From e42d88da0e5a1e6f6ce236a312cb991c6024b6e1 Mon Sep 17 00:00:00 2001 From: Jakob Botsch Nielsen Date: Tue, 5 May 2026 18:33:13 +0200 Subject: [PATCH 001/109] Add a Fuzzlyn triage skill (#127752) This skill triages Fuzzlyn weekend runs. It: - Downloads the artifacts and selects failures found by Fuzzlyn. Currently it focuses only on assertion failures. - Downloads the Core_Root that Fuzzlyn was testing. - Uses superpmi to find a context that reproduces the failure and mcs to extract that context. - Uses superpmi to create a jitdump of the failure. - Analyses the jitdump and JIT source to give its own input on what the issue may be. - Creates a zip with the repro.mc, jitdump.txt, and an issue.md file that can be used to open a github issue #127745 and #127747 are examples of what the issue.md file looks like once posted. The idea is to give enough detail that we can evaluate whether it sounds right or not, possibly come up with our own revisions, and then have CCA pick it up and actually fix the issue. --- .github/skills/fuzzlyn-triage/SKILL.md | 77 ++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 .github/skills/fuzzlyn-triage/SKILL.md diff --git a/.github/skills/fuzzlyn-triage/SKILL.md b/.github/skills/fuzzlyn-triage/SKILL.md new file mode 100644 index 00000000000000..a93d5863a7af14 --- /dev/null +++ b/.github/skills/fuzzlyn-triage/SKILL.md @@ -0,0 +1,77 @@ +--- +name: fuzzlyn-triage +description: Triage Fuzzlyn CI runs. +--- + +# Fuzzlyn triage + +#### 1 — Goal + +Initial investigation of Fuzzlyn found issues with assertions in CI runs. + +#### 2 — Required user inputs + +Ask the user for a link to a Fuzzlyn CI run if not provided. + +#### 3 — Investigation steps (must be completed in order) + +1. Download all the Issues artifacts for the CI run. +These artifacts are zipped files named "Issues_{platform}_Checked.zip". +For example, "Issues_windows_x64_Checked.zip". +This may take a long time, so download these in parallel. +Extract all the downloaded zip files into a single directory, and delete the .zip files once extracted. + +2. Look at the reduced examples that are available. +Focus on ones that have JIT assertion failures in them, and group by the specific assertion failure. +For each assertion failure pick a single example and create a directory named based on the number part of the seed. +Create an "example.cs" file in the directory with the content of the example. +For example, if the seed is 123456789, create a directory named "123456789" and an "example.cs" file in it with the content of the example. + +3. Look for the .mc files corresponding to the examples you have created. +Move the relevant .mc files under the appropriate example folders. + +4. Download the Helix payload for the host you are using to run these triage steps, from the Partition0 work item. +In most cases this will be the windows-x64 job; if you are running the triage steps on a different host, use that host's payload instead. +To download the payload, obtain the Job ID from the "Send job to Helix" step in the CI run. +Download the payload for Partition0 with `runfo get-helix-payload -j -w Partition0 -o `. +This should result in the host-appropriate corerun, superpmi, and mcs tools that you should use for the next steps. +Choose the payload based on the machine running triage, not on the platform where the examples reproduced. + +Now, for each example, do the following. Do NOT parallelize. Finish ALL steps for each example before you start on the next example. + +1. Use superpmi to replay the .mc files for that example until you find a context that reproduces the assertion failure. +To do that, for each example, run `superpmi.exe `. +The clrjit.dll used should be the one that corresponds to the target that reproduced the error. +For example, if the example reproduced on linux-x64, then use clrjit_unix_x64_x64.dll. +If the assertion failure reproduces it should give you the context index before the message, e.g. "#12345". +For the next steps use the numeric portion of that index, e.g. "12345" without the "#" symbol. + +2. Once you have the context index, use superpmi to replay that specific context with `superpmi.exe -c `. +Validate that this reproduces the assertion failure instantly. + +3. Use mcs.exe next to superpmi.exe to extract that single context to a repro.mc file with `mcs.exe -copy `. +Delete all the other .mc files for that example, and keep only the repro.mc file. + +4. Create a jitdump file. +To do that, run `superpmi.exe -jitoption JitDump=*` and pipe the output to a jitdump.txt file in the example's directory. + +5. Analyze the jitdump file and try to come up with the root cause of that assertion failure. +The JIT source code creating the jitdump is available at src/coreclr/jit/*. +Do NOT make any changes to the source code; only analyze the jitdump file and try to come up with a root cause. +Put your analysis into an analysis.md file in the example's directory. + +6. Create a details.zip file that includes the repro.mc and also the jitdump.txt file. + +7. Create an issue.md file that can be used to open a GitHub issue later. +In this issue.md file include the following: + - A header with the assertion failure message. + For example, if the assertion failure is "Assertion failed: x > 0", the header should be "# Assertion failed: x > 0". + - The reduced example from the .cs file. + ALWAYS keep the comment header. + - A section containing your analysis of the jitdump. + Wrap the analysis in a `
Analysis of jitdump ...
` block. + Make sure to add a note that the analysis is AI generated. + - A blurb "Attached details.zip file that includes the repro.mc and jitdump.txt files for this example." + - A "cc @dotnet/jit-contrib" at the end to make sure the JIT team sees the issue. + +8. Once you have done the above steps, proceed with the next example if there are still examples left. \ No newline at end of file From e6a90cc289dbafd2a6a48286c558ff014a978051 Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Tue, 5 May 2026 19:09:22 +0200 Subject: [PATCH 002/109] Fix illink TypeMap proxy retention. Fixes #127004. (#127005) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `TypeMapHandler.MarkTypeMapAttribute` calls `Annotations.MarkInstantiated` directly, which only records the type as instantiated without running the full processing pipeline. When `MarkRequirementsForInstantiatedTypes` is later called for the same type (e.g. because of a `new` expression), it sees the type is already marked as instantiated and returns early — skipping the calls to `TypeMapHandler.ProcessType` and `TypeMapHandler.ProcessInstantiated`, which are responsible for marking matching `TypeMap` and `TypeMapAssociation` entries respectively. This causes two bugs: 1. **`TypeMapAssociation` trimmed** (#127004): When a type appears as the target in both a `TypeMap` and a `TypeMapAssociation`, the `TypeMapAssociation` entry is incorrectly trimmed because `ProcessInstantiated` is never called. 2. **`TypeMap` trimmed** (#127504): When a type is both the proxy target of a `TypeMapAssociation` (arg\[1]) and the trimTarget of a `TypeMap` (arg\[2]), and the proxy association's source type is instantiated before the trim target, the `TypeMap` entry is incorrectly trimmed because `ProcessType` is never called. The fix changes `MarkTypeMapAttribute` to call `MarkRequirementsForInstantiatedTypes` instead of `Annotations.MarkInstantiated`. This ensures the full instantiation pipeline runs (including both `ProcessType` and `ProcessInstantiated`), so external `TypeMap` and proxy `TypeMapAssociation` entries are properly retained regardless of instantiation order. The method's visibility is widened from `protected` to `protected internal` to allow the call from `TypeMapHandler`. Test cases are added for both scenarios. Fixes https://github.com/dotnet/runtime/issues/127004. Fixes https://github.com/dotnet/runtime/issues/127504. --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../src/linker/Linker.Steps/MarkStep.cs | 2 +- .../src/linker/Linker/TypeMapHandler.cs | 2 +- .../Reflection/TypeMap.cs | 36 +++++++++++++++++++ 3 files changed, 38 insertions(+), 2 deletions(-) diff --git a/src/tools/illink/src/linker/Linker.Steps/MarkStep.cs b/src/tools/illink/src/linker/Linker.Steps/MarkStep.cs index 80b9722732649f..2f3bfc860f6d31 100644 --- a/src/tools/illink/src/linker/Linker.Steps/MarkStep.cs +++ b/src/tools/illink/src/linker/Linker.Steps/MarkStep.cs @@ -3504,7 +3504,7 @@ static bool TypeIsInlineArrayType(TypeDefinition type) return false; } - protected virtual void MarkRequirementsForInstantiatedTypes(TypeDefinition type) + protected internal virtual void MarkRequirementsForInstantiatedTypes(TypeDefinition type) { if (Annotations.IsInstantiated(type)) return; diff --git a/src/tools/illink/src/linker/Linker/TypeMapHandler.cs b/src/tools/illink/src/linker/Linker/TypeMapHandler.cs index dce5132369f3d3..2b1d2e4a55e8c4 100644 --- a/src/tools/illink/src/linker/Linker/TypeMapHandler.cs +++ b/src/tools/illink/src/linker/Linker/TypeMapHandler.cs @@ -109,7 +109,7 @@ void MarkTypeMapAttribute(CustomAttributeWithOrigin entry, DependencyInfo info) // Mark the target type as instantiated if (entry.TargetType is { } targetType && _context.Resolve(UnwrapToResolvableType(targetType)) is TypeDefinition targetTypeDef) - _context.Annotations.MarkInstantiated(targetTypeDef); + _markStep.MarkRequirementsForInstantiatedTypes(targetTypeDef); } public void ProcessType(TypeDefinition definition) diff --git a/src/tools/illink/test/Mono.Linker.Tests.Cases/Reflection/TypeMap.cs b/src/tools/illink/test/Mono.Linker.Tests.Cases/Reflection/TypeMap.cs index ce887a9d5e8458..368f10ef0df362 100644 --- a/src/tools/illink/test/Mono.Linker.Tests.Cases/Reflection/TypeMap.cs +++ b/src/tools/illink/test/Mono.Linker.Tests.Cases/Reflection/TypeMap.cs @@ -85,6 +85,19 @@ [assembly: TypeMapAssemblyTarget("library")] [assembly: TypeMapAssemblyTarget("library")] // Should be removed +// Verify that a type can be kept if it's used for both TypeMap and TypeMapAssociation +[assembly: TypeMap("BothInExternalAndProxy", typeof(BothInExternalAndProxy), typeof(BothInExternalAndProxy))] // Kept +[assembly: TypeMapAssociation(typeof(BothInExternalAndProxy), typeof(BothInExternalAndProxyTarget))] // Kept +[assembly: KeptAttributeAttribute(typeof(TypeMapAttribute), "BothInExternalAndProxy", typeof(BothInExternalAndProxy), typeof(BothInExternalAndProxy))] +[assembly: KeptAttributeAttribute(typeof(TypeMapAssociationAttribute), typeof(BothInExternalAndProxy), typeof(BothInExternalAndProxyTarget))] + +// Verify that a TypeMap entry with trimTarget=X is kept when X is also the proxy target of a TypeMapAssociation, +// even when the proxy association's source type is instantiated before the trim target type. +[assembly: TypeMap("ProxyTargetIsAlsoTrimTarget", typeof(ProxyTargetIsAlsoTrimTargetTarget), typeof(ProxyTargetIsAlsoTrimTarget))] // Kept +[assembly: TypeMapAssociation(typeof(ProxyTargetIsAlsoTrimTargetSource), typeof(ProxyTargetIsAlsoTrimTarget))] // Kept +[assembly: KeptAttributeAttribute(typeof(TypeMapAttribute), "ProxyTargetIsAlsoTrimTarget", typeof(ProxyTargetIsAlsoTrimTargetTarget), typeof(ProxyTargetIsAlsoTrimTarget))] +[assembly: KeptAttributeAttribute(typeof(TypeMapAssociationAttribute), typeof(ProxyTargetIsAlsoTrimTargetSource), typeof(ProxyTargetIsAlsoTrimTarget))] + namespace Mono.Linker.Tests.Cases.Reflection { [SetupLinkerAction("link", "System.Private.CoreLib")] // Needed to get the RemoveAttributeInstances in embedded xml @@ -234,6 +247,14 @@ static void ConstrainedStaticCall(T t) where T : IStaticInterface _ = new int(); _ = TypeMapping.GetOrCreateExternalTypeMapping(); _ = TypeMapping.GetOrCreateProxyTypeMapping(); + + // Use BothInExternalAndProxy in a way that preserves any corresponding typemap entries. + Console.WriteLine(new BothInExternalAndProxy()); + + // Source must be instantiated BEFORE the trim target, so that the proxy association + // is processed first via MarkTypeMapAttribute → MarkRequirementsForInstantiatedTypes. + _ = new ProxyTargetIsAlsoTrimTargetSource(); + Console.WriteLine(new ProxyTargetIsAlsoTrimTarget()); } [ExpectBodyModified] @@ -562,6 +583,12 @@ class UsedProxyTarget2; [Kept] class PreservedTargetType; + [Kept] + [KeptMember(".ctor()")] + class BothInExternalAndProxy; + [Kept] + class BothInExternalAndProxyTarget; + [Kept] class ArrayTypeTrimTargetTarget; @@ -572,4 +599,13 @@ class ArrayTypeTrimTargetClass; class ArrayTypeTrimTargetUnusedTarget; class ArrayTypeTrimTargetUnusedClass; + + [Kept] + [KeptMember(".ctor()")] + class ProxyTargetIsAlsoTrimTarget; + [Kept] + class ProxyTargetIsAlsoTrimTargetTarget; + [Kept] + [KeptMember(".ctor()")] + class ProxyTargetIsAlsoTrimTargetSource; } From 579e813245bd6ef3c575dc99fec5f6c2692b8a73 Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Tue, 5 May 2026 10:13:07 -0700 Subject: [PATCH 003/109] Disable server GC and background GC for CoreCLR WebAssembly, iOS, and tvOS builds (#127178) Applies size optimizations for CoreCLR WebAssembly, iOS, and tvOS builds by removing GC modes that are unavailable or unnecessary on those platforms. ### Size measurements (`corerun.wasm`) | Configuration | Raw (bytes) | Brotli (bytes) | |---|---|---| | Original baseline | 4,497,135 | 1,340,828 | | Disable server GC + background GC | **4,171,449** | **1,258,272** | | **Total savings** | **325,686 (7.2%)** | **82,556 (6.2%)** | --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: davidwrighton <10779849+davidwrighton@users.noreply.github.com> Co-authored-by: janvorli <10758568+janvorli@users.noreply.github.com> Co-authored-by: Pavel Savara Co-authored-by: Radek Doulik Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: David Wrighton Co-authored-by: jkotas <6668460+jkotas@users.noreply.github.com> --- docs/design/datacontracts/GC.md | 102 ++++++++++++++---- src/coreclr/clrdefinitions.cmake | 4 +- .../gc/datadescriptor/datadescriptor.h | 6 +- .../gc/datadescriptor/datadescriptor.inc | 12 ++- src/coreclr/gc/gcpriv.h | 2 + .../Contracts/GC/GCHeapWKS.cs | 20 ++-- .../Contracts/GC/GC_1.cs | 8 +- .../Contracts/GC/IGCHeap.cs | 8 +- .../Data/GC/GCHeapSVR.cs | 23 ++-- 9 files changed, 130 insertions(+), 55 deletions(-) diff --git a/docs/design/datacontracts/GC.md b/docs/design/datacontracts/GC.md index 50e3a954ba6f4e..bde7b40f264a3d 100644 --- a/docs/design/datacontracts/GC.md +++ b/docs/design/datacontracts/GC.md @@ -152,17 +152,17 @@ public readonly struct GCMemoryRegionData Data descriptors used: | Data Descriptor Name | Field | Source | Meaning | | --- | --- | --- | --- | -| `GCHeap` | MarkArray | GC | Pointer to the heap's MarkArray (in sever builds) | -| `GCHeap` | NextSweepObj | GC | Pointer to the heap's NextSweepObj (in sever builds) | -| `GCHeap` | BackgroundMinSavedAddr | GC | Heap's background saved lowest address (in sever builds) | -| `GCHeap` | BackgroundMaxSavedAddr | GC | Heap's background saved highest address (in sever builds) | +| `GCHeap` | MarkArray | GC | Pointer to the heap's MarkArray (only in server builds with background GC) | +| `GCHeap` | NextSweepObj | GC | Pointer to the heap's NextSweepObj (only in server builds with background GC) | +| `GCHeap` | BackgroundMinSavedAddr | GC | Heap's background saved lowest address (only in server builds with background GC) | +| `GCHeap` | BackgroundMaxSavedAddr | GC | Heap's background saved highest address (only in server builds with background GC) | | `GCHeap` | AllocAllocated | GC | Heap's highest address allocated by Alloc (in sever builds) | | `GCHeap` | EphemeralHeapSegment | GC | Pointer to the heap's ephemeral heap segment (in sever builds) | | `GCHeap` | CardTable | GC | Pointer to the heap's bookkeeping GC data structure (in sever builds) | | `GCHeap` | FinalizeQueue | GC | Pointer to the heap's CFinalize data structure (in sever builds) | | `GCHeap` | GenerationTable | GC | Pointer to the start of an array containing `"TotalGenerationCount"` `Generation` structures (in sever builds) | -| `GCHeap` | SavedSweepEphemeralSeg | GC | Pointer to the heap's saved sweep ephemeral segment (only in server builds with segment) | -| `GCHeap` | SavedSweepEphemeralStart | GC | Start of the heap's sweep ephemeral segment (only in server builds with segment) | +| `GCHeap` | SavedSweepEphemeralSeg | GC | Pointer to the heap's saved sweep ephemeral segment (only in server builds with segment and background GC) | +| `GCHeap` | SavedSweepEphemeralStart | GC | Start of the heap's sweep ephemeral segment (only in server builds with segment and background GC) | | `GCHeap` | OomData | GC | OOM related data in a struct (in sever builds) | | `GCHeap` | InternalRootArray | GC | Data array stored per heap (in sever builds) | | `GCHeap` | InternalRootArrayIndex | GC | Index into InternalRootArray (in sever builds) | @@ -229,17 +229,17 @@ Global variables used: | `CompactReasonsLength` | uint | GC | The number of elements in the `CompactReasons` array | | `ExpandMechanismsLength` | uint | GC | The number of elements in the `ExpandMechanisms` array | | `InterestingMechanismBitsLength` | uint | GC | The number of elements in the `InterestingMechanismBits` array | -| `GCHeapMarkArray` | TargetPointer | GC | Pointer to the static heap's MarkArray (in workstation builds) | -| `GCHeapNextSweepObj` | TargetPointer | GC | Pointer to the static heap's NextSweepObj (in workstation builds) | -| `GCHeapBackgroundMinSavedAddr` | TargetPointer | GC | Background saved lowest address (in workstation builds) | -| `GCHeapBackgroundMaxSavedAddr` | TargetPointer | GC | Background saved highest address (in workstation builds) | +| `GCHeapMarkArray` | TargetPointer | GC | Pointer to the static heap's MarkArray (in workstation builds with background GC) | +| `GCHeapNextSweepObj` | TargetPointer | GC | Pointer to the static heap's NextSweepObj (in workstation builds with background GC) | +| `GCHeapBackgroundMinSavedAddr` | TargetPointer | GC | Background saved lowest address (in workstation builds with background GC) | +| `GCHeapBackgroundMaxSavedAddr` | TargetPointer | GC | Background saved highest address (in workstation builds with background GC) | | `GCHeapAllocAllocated` | TargetPointer | GC | Highest address allocated by Alloc (in workstation builds) | | `GCHeapEphemeralHeapSegment` | TargetPointer | GC | Pointer to an ephemeral heap segment (in workstation builds) | | `GCHeapCardTable` | TargetPointer | GC | Pointer to the static heap's bookkeeping GC data structure (in workstation builds) | | `GCHeapFinalizeQueue` | TargetPointer | GC | Pointer to the static heap's CFinalize data structure (in workstation builds) | | `GCHeapGenerationTable` | TargetPointer | GC | Pointer to the start of an array containing `"TotalGenerationCount"` `Generation` structures (in workstation builds) | -| `GCHeapSavedSweepEphemeralSeg` | TargetPointer | GC | Pointer to the static heap's saved sweep ephemeral segment (in workstation builds with segment) | -| `GCHeapSavedSweepEphemeralStart` | TargetPointer | GC | Start of the static heap's sweep ephemeral segment (in workstation builds with segment) | +| `GCHeapSavedSweepEphemeralSeg` | TargetPointer | GC | Pointer to the static heap's saved sweep ephemeral segment (in workstation builds with segment and background GC) | +| `GCHeapSavedSweepEphemeralStart` | TargetPointer | GC | Start of the static heap's sweep ephemeral segment (in workstation builds with segment and background GC) | | `GCHeapOomData` | TargetPointer | GC | OOM related data in a struct (in workstation builds) | | `GCHeapInternalRootArray` | TargetPointer | GC | Data array stored per heap (in workstation builds) | | `GCHeapInternalRootArrayIndex` | TargetPointer | GC | Index into InternalRootArray (in workstation builds) | @@ -454,11 +454,39 @@ GCHeapData IGC.GetHeapData() GCHeapData data; - // Read fields directly from globals - data.MarkArray = target.ReadPointer(target.ReadGlobalPointer("GCHeapMarkArray")); - data.NextSweepObj = target.ReadPointer(target.ReadGlobalPointer("GCHeapNextSweepObj")); - data.BackgroundMinSavedAddr = target.ReadPointer(target.ReadGlobalPointer("GCHeapBackgroundMinSavedAddr")); - data.BackgroundMaxSavedAddr = target.ReadPointer(target.ReadGlobalPointer("GCHeapBackgroundMaxSavedAddr")); + // Read background GC globals - these are absent when background GC is disabled (e.g., on WebAssembly). + if (target.TryReadGlobalPointer("GCHeapMarkArray", out TargetPointer? markArrayPtr)) + { + data.MarkArray = target.ReadPointer(markArrayPtr.Value); + } + else + { + data.MarkArray = 0; + } + if (target.TryReadGlobalPointer("GCHeapNextSweepObj", out TargetPointer? nextSweepObjPtr)) + { + data.NextSweepObj = target.ReadPointer(nextSweepObjPtr.Value); + } + else + { + data.NextSweepObj = 0; + } + if (target.TryReadGlobalPointer("GCHeapBackgroundMinSavedAddr", out TargetPointer? bgMinPtr)) + { + data.BackgroundMinSavedAddr = target.ReadPointer(bgMinPtr.Value); + } + else + { + data.BackgroundMinSavedAddr = 0; + } + if (target.TryReadGlobalPointer("GCHeapBackgroundMaxSavedAddr", out TargetPointer? bgMaxPtr)) + { + data.BackgroundMaxSavedAddr = target.ReadPointer(bgMaxPtr.Value); + } + else + { + data.BackgroundMaxSavedAddr = 0; + } data.AllocAllocated = target.ReadPointer(target.ReadGlobalPointer("GCHeapAllocAllocated")); data.EphemeralHeapSegment = target.ReadPointer(target.ReadGlobalPointer("GCHeapEphemeralHeapSegment")); data.CardTable = target.ReadPointer(target.ReadGlobalPointer("GCHeapCardTable")); @@ -521,11 +549,41 @@ GCHeapData IGC.GetHeapData(TargetPointer heapAddress) GCHeapData data; - // Read fields directly from heap - data.MarkArray = target.ReadPointer(heapAddress + /* GCHeap::MarkArray offset */); - data.NextSweepObj = target.ReadPointer(heapAddress + /* GCHeap::NextSweepObj offset */); - data.BackgroundMinSavedAddr = target.ReadPointer(heapAddress + /* GCHeap::BackgroundMinSavedAddr offset */); - data.BackgroundMaxSavedAddr = target.ReadPointer(heapAddress + /* GCHeap::BackgroundMaxSavedAddr offset */); + // Read background GC heap fields - these fields are absent when background GC is disabled (e.g., on WebAssembly). + // Check whether the field exists in the type layout before reading; default to 0 if not present. + Target.TypeInfo gcHeapType = target.GetTypeInfo(DataType.GCHeap); + if (gcHeapType.Fields.ContainsKey("MarkArray")) + { + data.MarkArray = target.ReadPointer(heapAddress + /* GCHeap::MarkArray offset */); + } + else + { + data.MarkArray = 0; + } + if (gcHeapType.Fields.ContainsKey("NextSweepObj")) + { + data.NextSweepObj = target.ReadPointer(heapAddress + /* GCHeap::NextSweepObj offset */); + } + else + { + data.NextSweepObj = 0; + } + if (gcHeapType.Fields.ContainsKey("BackgroundMinSavedAddr")) + { + data.BackgroundMinSavedAddr = target.ReadPointer(heapAddress + /* GCHeap::BackgroundMinSavedAddr offset */); + } + else + { + data.BackgroundMinSavedAddr = 0; + } + if (gcHeapType.Fields.ContainsKey("BackgroundMaxSavedAddr")) + { + data.BackgroundMaxSavedAddr = target.ReadPointer(heapAddress + /* GCHeap::BackgroundMaxSavedAddr offset */); + } + else + { + data.BackgroundMaxSavedAddr = 0; + } data.AllocAllocated = target.ReadPointer(heapAddress + /* GCHeap::AllocAllocated offset */); data.EphemeralHeapSegment = target.ReadPointer(heapAddress + /* GCHeap::EphemeralHeapSegment offset */); data.CardTable = target.ReadPointer(heapAddress + /* GCHeap::CardTable offset */); diff --git a/src/coreclr/clrdefinitions.cmake b/src/coreclr/clrdefinitions.cmake index 0fd1a1f3d3e182..c1c3ce9c48e18e 100644 --- a/src/coreclr/clrdefinitions.cmake +++ b/src/coreclr/clrdefinitions.cmake @@ -174,10 +174,10 @@ endif (CLR_CMAKE_HOST_UNIX AND CLR_CMAKE_TARGET_UNIX) if (FEATURE_ENABLE_NO_ADDRESS_SPACE_RANDOMIZATION) add_definitions(-DFEATURE_ENABLE_NO_ADDRESS_SPACE_RANDOMIZATION) endif(FEATURE_ENABLE_NO_ADDRESS_SPACE_RANDOMIZATION) -if (NOT CLR_CMAKE_HOST_ANDROID) +if (NOT CLR_CMAKE_HOST_ANDROID AND NOT CLR_CMAKE_TARGET_ARCH_WASM AND NOT CLR_CMAKE_TARGET_IOS AND NOT CLR_CMAKE_TARGET_TVOS) set(FEATURE_SVR_GC 1) add_definitions(-DFEATURE_SVR_GC) -endif(NOT CLR_CMAKE_HOST_ANDROID) +endif(NOT CLR_CMAKE_HOST_ANDROID AND NOT CLR_CMAKE_TARGET_ARCH_WASM AND NOT CLR_CMAKE_TARGET_IOS AND NOT CLR_CMAKE_TARGET_TVOS) add_definitions(-DFEATURE_SYMDIFF) if (FEATURE_TIERED_COMPILATION) diff --git a/src/coreclr/gc/datadescriptor/datadescriptor.h b/src/coreclr/gc/datadescriptor/datadescriptor.h index d60a73e8e24a92..166d9ada0b9a5e 100644 --- a/src/coreclr/gc/datadescriptor/datadescriptor.h +++ b/src/coreclr/gc/datadescriptor/datadescriptor.h @@ -52,19 +52,21 @@ struct cdac_data GC_HEAP_FIELD(OomData, oom_info) /* For use in GCHeapDetails APIs */ +#ifdef BACKGROUND_GC GC_HEAP_FIELD(MarkArray, mark_array) GC_HEAP_FIELD(NextSweepObj, next_sweep_obj) GC_HEAP_FIELD(BackgroundMinSavedAddr, background_saved_lowest_address) GC_HEAP_FIELD(BackgroundMaxSavedAddr, background_saved_highest_address) +#endif // BACKGROUND_GC GC_HEAP_FIELD(AllocAllocated, alloc_allocated) GC_HEAP_FIELD(EphemeralHeapSegment, ephemeral_heap_segment) GC_HEAP_FIELD(CardTable, card_table) GC_HEAP_FIELD(FinalizeQueue, finalize_queue) GC_HEAP_FIELD(GenerationTable, generation_table) -#ifndef USE_REGIONS +#if !defined(USE_REGIONS) && defined(BACKGROUND_GC) GC_HEAP_FIELD(SavedSweepEphemeralSeg, saved_sweep_ephemeral_seg) GC_HEAP_FIELD(SavedSweepEphemeralStart, saved_sweep_ephemeral_start) -#endif // !USE_REGIONS +#endif // !USE_REGIONS && BACKGROUND_GC /* For use in GCHeapAnalyzeData APIs */ #ifdef HEAP_ANALYZE diff --git a/src/coreclr/gc/datadescriptor/datadescriptor.inc b/src/coreclr/gc/datadescriptor/datadescriptor.inc index 2937aa7627eb8e..53eccca843a79d 100644 --- a/src/coreclr/gc/datadescriptor/datadescriptor.inc +++ b/src/coreclr/gc/datadescriptor/datadescriptor.inc @@ -13,19 +13,21 @@ CDAC_TYPES_BEGIN() #ifdef SERVER_GC CDAC_TYPE_BEGIN(GCHeap) CDAC_TYPE_INDETERMINATE(GCHeap) +#ifdef BACKGROUND_GC CDAC_TYPE_FIELD(GCHeap, T_POINTER, MarkArray, cdac_data::MarkArray) CDAC_TYPE_FIELD(GCHeap, T_POINTER, NextSweepObj, cdac_data::NextSweepObj) CDAC_TYPE_FIELD(GCHeap, T_POINTER, BackgroundMinSavedAddr, cdac_data::BackgroundMinSavedAddr) CDAC_TYPE_FIELD(GCHeap, T_POINTER, BackgroundMaxSavedAddr, cdac_data::BackgroundMaxSavedAddr) +#endif // BACKGROUND_GC CDAC_TYPE_FIELD(GCHeap, T_POINTER, AllocAllocated, cdac_data::AllocAllocated) CDAC_TYPE_FIELD(GCHeap, T_POINTER, EphemeralHeapSegment, cdac_data::EphemeralHeapSegment) CDAC_TYPE_FIELD(GCHeap, T_POINTER, CardTable, cdac_data::CardTable) CDAC_TYPE_FIELD(GCHeap, T_POINTER, FinalizeQueue, cdac_data::FinalizeQueue) CDAC_TYPE_FIELD(GCHeap, T_POINTER, GenerationTable, cdac_data::GenerationTable) -#ifndef USE_REGIONS +#if !defined(USE_REGIONS) && defined(BACKGROUND_GC) CDAC_TYPE_FIELD(GCHeap, T_POINTER, SavedSweepEphemeralSeg, cdac_data::SavedSweepEphemeralSeg) CDAC_TYPE_FIELD(GCHeap, T_POINTER, SavedSweepEphemeralStart, cdac_data::SavedSweepEphemeralStart) -#endif // !USE_REGIONS +#endif // !USE_REGIONS && BACKGROUND_GC CDAC_TYPE_FIELD(GCHeap, TYPE(OomHistory), OomData, cdac_data::OomData) #ifdef HEAP_ANALYZE CDAC_TYPE_FIELD(GCHeap, T_POINTER, InternalRootArray, cdac_data::InternalRootArray) @@ -154,19 +156,21 @@ CDAC_GLOBAL(CountFreeRegionKinds, T_UINT32, (uint32_t)FREE_REGION_KINDS) #ifndef SERVER_GC +#ifdef BACKGROUND_GC CDAC_GLOBAL_POINTER(GCHeapMarkArray, cdac_data::MarkArray) CDAC_GLOBAL_POINTER(GCHeapNextSweepObj, cdac_data::NextSweepObj) CDAC_GLOBAL_POINTER(GCHeapBackgroundMinSavedAddr, cdac_data::BackgroundMinSavedAddr) CDAC_GLOBAL_POINTER(GCHeapBackgroundMaxSavedAddr, cdac_data::BackgroundMaxSavedAddr) +#endif // BACKGROUND_GC CDAC_GLOBAL_POINTER(GCHeapAllocAllocated, cdac_data::AllocAllocated) CDAC_GLOBAL_POINTER(GCHeapEphemeralHeapSegment, cdac_data::EphemeralHeapSegment) CDAC_GLOBAL_POINTER(GCHeapCardTable, cdac_data::CardTable) CDAC_GLOBAL_POINTER(GCHeapFinalizeQueue, cdac_data::FinalizeQueue) CDAC_GLOBAL_POINTER(GCHeapGenerationTable, cdac_data::GenerationTable) -#ifndef USE_REGIONS +#if !defined(USE_REGIONS) && defined(BACKGROUND_GC) CDAC_GLOBAL_POINTER(GCHeapSavedSweepEphemeralSeg, cdac_data::SavedSweepEphemeralSeg) CDAC_GLOBAL_POINTER(GCHeapSavedSweepEphemeralStart, cdac_data::SavedSweepEphemeralStart) -#endif // !USE_REGIONS +#endif // !USE_REGIONS && BACKGROUND_GC CDAC_GLOBAL_POINTER(GCHeapOomData, cdac_data::OomData) #ifdef HEAP_ANALYZE CDAC_GLOBAL_POINTER(GCHeapInternalRootArray, cdac_data::InternalRootArray) diff --git a/src/coreclr/gc/gcpriv.h b/src/coreclr/gc/gcpriv.h index 18b128049a2e8d..d520934fce408f 100644 --- a/src/coreclr/gc/gcpriv.h +++ b/src/coreclr/gc/gcpriv.h @@ -190,7 +190,9 @@ inline void FATAL_GC_ERROR() #define FEATURE_PREMORTEM_FINALIZATION #define GC_HISTORY +#ifndef TARGET_WASM #define BACKGROUND_GC //concurrent background GC (requires WRITE_WATCH) +#endif //!TARGET_WASM // We need the lower 3 bits in the MT to do our bookkeeping so doubly linked free list is only for 64-bit #if defined(BACKGROUND_GC) && defined(HOST_64BIT) diff --git a/src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/GC/GCHeapWKS.cs b/src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/GC/GCHeapWKS.cs index 99e9ee879cdd4a..355331f61cea28 100644 --- a/src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/GC/GCHeapWKS.cs +++ b/src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/GC/GCHeapWKS.cs @@ -7,10 +7,14 @@ internal sealed class GCHeapWKS : IGCHeap { public GCHeapWKS(Target target) { - MarkArray = target.ReadPointer(target.ReadGlobalPointer(Constants.Globals.GCHeapMarkArray)); - NextSweepObj = target.ReadPointer(target.ReadGlobalPointer(Constants.Globals.GCHeapNextSweepObj)); - BackgroundMinSavedAddr = target.ReadPointer(target.ReadGlobalPointer(Constants.Globals.GCHeapBackgroundMinSavedAddr)); - BackgroundMaxSavedAddr = target.ReadPointer(target.ReadGlobalPointer(Constants.Globals.GCHeapBackgroundMaxSavedAddr)); + if (target.TryReadGlobalPointer(Constants.Globals.GCHeapMarkArray, out TargetPointer? markArrayPtr)) + MarkArray = target.ReadPointer(markArrayPtr.Value); + if (target.TryReadGlobalPointer(Constants.Globals.GCHeapNextSweepObj, out TargetPointer? nextSweepObjPtr)) + NextSweepObj = target.ReadPointer(nextSweepObjPtr.Value); + if (target.TryReadGlobalPointer(Constants.Globals.GCHeapBackgroundMinSavedAddr, out TargetPointer? bgMinPtr)) + BackgroundMinSavedAddr = target.ReadPointer(bgMinPtr.Value); + if (target.TryReadGlobalPointer(Constants.Globals.GCHeapBackgroundMaxSavedAddr, out TargetPointer? bgMaxPtr)) + BackgroundMaxSavedAddr = target.ReadPointer(bgMaxPtr.Value); AllocAllocated = target.ReadPointer(target.ReadGlobalPointer(Constants.Globals.GCHeapAllocAllocated)); EphemeralHeapSegment = target.ReadPointer(target.ReadGlobalPointer(Constants.Globals.GCHeapEphemeralHeapSegment)); CardTable = target.ReadPointer(target.ReadGlobalPointer(Constants.Globals.GCHeapCardTable)); @@ -41,10 +45,10 @@ public GCHeapWKS(Target target) FreeRegions = freeRegionsPtr.Value; } - public TargetPointer MarkArray { get; } - public TargetPointer NextSweepObj { get; } - public TargetPointer BackgroundMinSavedAddr { get; } - public TargetPointer BackgroundMaxSavedAddr { get; } + public TargetPointer? MarkArray { get; } + public TargetPointer? NextSweepObj { get; } + public TargetPointer? BackgroundMinSavedAddr { get; } + public TargetPointer? BackgroundMaxSavedAddr { get; } public TargetPointer AllocAllocated { get; } public TargetPointer EphemeralHeapSegment { get; } public TargetPointer CardTable { get; } diff --git a/src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/GC/GC_1.cs b/src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/GC/GC_1.cs index 9fd8ced2e9ed2d..932a31af52e3e2 100644 --- a/src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/GC/GC_1.cs +++ b/src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/GC/GC_1.cs @@ -170,10 +170,10 @@ private GCHeapData GetGCHeapDataFromHeap(IGCHeap heap) return new GCHeapData() { - MarkArray = heap.MarkArray, - NextSweepObject = heap.NextSweepObj, - BackGroundSavedMinAddress = heap.BackgroundMinSavedAddr, - BackGroundSavedMaxAddress = heap.BackgroundMaxSavedAddr, + MarkArray = heap.MarkArray ?? TargetPointer.Null, + NextSweepObject = heap.NextSweepObj ?? TargetPointer.Null, + BackGroundSavedMinAddress = heap.BackgroundMinSavedAddr ?? TargetPointer.Null, + BackGroundSavedMaxAddress = heap.BackgroundMaxSavedAddr ?? TargetPointer.Null, AllocAllocated = heap.AllocAllocated, EphemeralHeapSegment = heap.EphemeralHeapSegment, CardTable = heap.CardTable, diff --git a/src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/GC/IGCHeap.cs b/src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/GC/IGCHeap.cs index f7e6dc1cc9ac77..4264e9611db325 100644 --- a/src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/GC/IGCHeap.cs +++ b/src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/GC/IGCHeap.cs @@ -5,10 +5,10 @@ namespace Microsoft.Diagnostics.DataContractReader.Contracts.GCHelpers; internal interface IGCHeap { - TargetPointer MarkArray { get; } - TargetPointer NextSweepObj { get; } - TargetPointer BackgroundMinSavedAddr { get; } - TargetPointer BackgroundMaxSavedAddr { get; } + TargetPointer? MarkArray { get; } + TargetPointer? NextSweepObj { get; } + TargetPointer? BackgroundMinSavedAddr { get; } + TargetPointer? BackgroundMaxSavedAddr { get; } TargetPointer AllocAllocated { get; } TargetPointer EphemeralHeapSegment { get; } TargetPointer CardTable { get; } diff --git a/src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Data/GC/GCHeapSVR.cs b/src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Data/GC/GCHeapSVR.cs index 7acf5d75459357..28eae9e9dbe83f 100644 --- a/src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Data/GC/GCHeapSVR.cs +++ b/src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Data/GC/GCHeapSVR.cs @@ -14,17 +14,22 @@ public GCHeapSVR(Target target, TargetPointer address) { Target.TypeInfo type = target.GetTypeInfo(DataType.GCHeap); - MarkArray = target.ReadPointerField(address, type, nameof(MarkArray)); - NextSweepObj = target.ReadPointerField(address, type, nameof(NextSweepObj)); - BackgroundMinSavedAddr = target.ReadPointerField(address, type, nameof(BackgroundMinSavedAddr)); - BackgroundMaxSavedAddr = target.ReadPointerField(address, type, nameof(BackgroundMaxSavedAddr)); + // Fields only exist in background GC builds + if (type.Fields.ContainsKey(nameof(MarkArray))) + MarkArray = target.ReadPointerField(address, type, nameof(MarkArray)); + if (type.Fields.ContainsKey(nameof(NextSweepObj))) + NextSweepObj = target.ReadPointerField(address, type, nameof(NextSweepObj)); + if (type.Fields.ContainsKey(nameof(BackgroundMinSavedAddr))) + BackgroundMinSavedAddr = target.ReadPointerField(address, type, nameof(BackgroundMinSavedAddr)); + if (type.Fields.ContainsKey(nameof(BackgroundMaxSavedAddr))) + BackgroundMaxSavedAddr = target.ReadPointerField(address, type, nameof(BackgroundMaxSavedAddr)); AllocAllocated = target.ReadPointerField(address, type, nameof(AllocAllocated)); EphemeralHeapSegment = target.ReadPointerField(address, type, nameof(EphemeralHeapSegment)); CardTable = target.ReadPointerField(address, type, nameof(CardTable)); FinalizeQueue = target.ReadPointerField(address, type, nameof(FinalizeQueue)); GenerationTable = address + (ulong)type.Fields[nameof(GenerationTable)].Offset; - // Fields only exist segment GC builds + // Fields only exist in segment GC builds with background GC if (type.Fields.ContainsKey(nameof(SavedSweepEphemeralSeg))) SavedSweepEphemeralSeg = target.ReadPointerField(address, type, nameof(SavedSweepEphemeralSeg)); if (type.Fields.ContainsKey(nameof(SavedSweepEphemeralStart))) @@ -49,10 +54,10 @@ public GCHeapSVR(Target target, TargetPointer address) FreeRegions = address + (ulong)type.Fields[nameof(FreeRegions)].Offset; } - public TargetPointer MarkArray { get; } - public TargetPointer NextSweepObj { get; } - public TargetPointer BackgroundMinSavedAddr { get; } - public TargetPointer BackgroundMaxSavedAddr { get; } + public TargetPointer? MarkArray { get; } + public TargetPointer? NextSweepObj { get; } + public TargetPointer? BackgroundMinSavedAddr { get; } + public TargetPointer? BackgroundMaxSavedAddr { get; } public TargetPointer AllocAllocated { get; } public TargetPointer EphemeralHeapSegment { get; } public TargetPointer CardTable { get; } From cb67209148787d94ee4b4c550a09a037dedd40f3 Mon Sep 17 00:00:00 2001 From: Aleksandr Dovydenkov Date: Tue, 5 May 2026 20:18:31 +0300 Subject: [PATCH 004/109] Fix memory leak of offset_to_bb_hash (#125967) The hash table is created and filled with values. Add `g_hash_table_destroy` to free memory. Compilation occurs with `cfg->verbose_level >= 2`. Disassembled code is written to standard output. The flow is as follows: - An empty table is created. - The table is filled with pairs of pointers: Key: `bb->native_offset // The offset of the generated code, used for fixups` Value: `bb->block_num + 1 // unique block number identification` - A hash table search is performed, followed by output of `bb_num` to a temporary file `ofd` in ascending order of `bb->native_offset`. A memory leak then occurs because the hash table is never destroyed. Signed-off-by: Aleksandr Dovydenkov Found by Linux Verification Center (linuxtesting.org) with SVACE. Signed-off-by: Aleksandr Dovydenkov --- src/mono/mono/mini/helpers.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/mono/mono/mini/helpers.c b/src/mono/mono/mini/helpers.c index e7d3dac0d6ce03..dd4c02c2d09489 100644 --- a/src/mono/mono/mini/helpers.c +++ b/src/mono/mono/mini/helpers.c @@ -182,6 +182,7 @@ MONO_DISABLE_WARNING(4127) /* conditional expression is constant */ if (cindex == 64) cindex = 0; } + g_hash_table_destroy(offset_to_bb_hash); fprintf (ofd, "\n"); fclose (ofd); From e42458bf1f276f49d6e3364458021a5f2d749531 Mon Sep 17 00:00:00 2001 From: Jan Jones Date: Tue, 5 May 2026 20:07:05 +0200 Subject: [PATCH 005/109] Remove [RequiresUnsafe] attribute usages (#127761) It won't be possible to be used in source with new compiler (https://github.com/dotnet/roslyn/pull/83295). Specifically, it will result in ``` error CS9379: Do not use 'RequiresUnsafeAttribute' in source; use the 'unsafe' modifier instead. ``` Related to https://github.com/dotnet/runtime/issues/125800 and https://github.com/dotnet/roslyn/issues/81207. --- .../Runtime/CompilerHelpers/ThrowHelpers.cs | 10 - .../ComActivator.PlatformNotSupported.cs | 3 - .../src/System/AppContext.CoreCLR.cs | 3 - .../src/System/ArgIterator.cs | 2 - .../src/System/Array.CoreCLR.cs | 8 - .../src/System/Buffer.CoreCLR.cs | 2 - .../src/System/Delegate.CoreCLR.cs | 3 - .../src/System/Environment.CoreCLR.cs | 5 - .../src/System/Exception.CoreCLR.cs | 3 - .../src/System/GC.CoreCLR.cs | 5 - .../src/System/IO/Stream.CoreCLR.cs | 1 - .../src/System/Math.CoreCLR.cs | 2 - .../src/System/MathF.CoreCLR.cs | 2 - .../System/Reflection/AssemblyName.CoreCLR.cs | 4 - .../Reflection/ConstructorInvoker.CoreCLR.cs | 1 - .../Reflection/Emit/DynamicILGenerator.cs | 4 - .../Reflection/Emit/RuntimeAssemblyBuilder.cs | 1 - .../Reflection/Emit/RuntimeTypeBuilder.cs | 1 - .../System/Reflection/InstanceCalliHelper.cs | 46 - .../src/System/Reflection/LoaderAllocator.cs | 1 - .../src/System/Reflection/MdImport.cs | 12 - .../Reflection/Metadata/AssemblyExtensions.cs | 2 - .../Reflection/Metadata/MetadataUpdater.cs | 1 - .../Reflection/MethodBaseInvoker.CoreCLR.cs | 2 - .../Reflection/MethodInvoker.CoreCLR.cs | 2 - .../src/System/Reflection/RuntimeAssembly.cs | 3 - .../Reflection/RuntimeCustomAttributeData.cs | 1 - .../Reflection/TypeNameResolver.CoreCLR.cs | 1 - .../CompilerServices/AsyncHelpers.CoreCLR.cs | 5 - .../Runtime/CompilerServices/CastHelpers.cs | 29 - .../CompilerServices/GenericsHelpers.cs | 2 - .../Runtime/CompilerServices/InitHelpers.cs | 4 - .../RuntimeHelpers.CoreCLR.cs | 20 - .../CompilerServices/StaticsHelpers.cs | 15 - .../ExceptionServices/InternalCalls.cs | 6 - .../InteropServices/ComWrappers.CoreCLR.cs | 5 - .../EnumeratorToEnumVariantMarshaler.cs | 1 - .../DynamicInterfaceCastableHelpers.cs | 2 - .../InteropServices/IDispatchHelpers.cs | 18 - .../Java/JavaMarshal.CoreCLR.cs | 7 - .../InteropServices/Marshal.CoreCLR.cs | 1 - .../InteropServices/NativeLibrary.CoreCLR.cs | 1 - .../Loader/AssemblyLoadContext.CoreCLR.cs | 5 - .../src/System/RuntimeHandles.cs | 47 - .../src/System/RuntimeType.BoxCache.cs | 2 - .../src/System/RuntimeType.CoreCLR.cs | 5 - ...meType.CreateUninitializedCache.CoreCLR.cs | 2 - .../src/System/StartupHookProvider.CoreCLR.cs | 1 - .../src/System/String.CoreCLR.cs | 2 - .../src/System/StubHelpers.cs | 24 - .../src/System/Text/StringBuilder.CoreCLR.cs | 2 - .../System/Threading/Interlocked.CoreCLR.cs | 2 - .../src/System/Threading/Thread.CoreCLR.cs | 4 - .../src/System/ValueType.cs | 3 - .../src/System/__ComObject.cs | 1 - .../src/System/ArgIterator.cs | 1 - .../System/Reflection/Emit/DynamicILInfo.cs | 3 - .../Reflection/Metadata/AssemblyExtensions.cs | 1 - .../Java/JavaMarshal.NativeAot.cs | 4 - .../ref/System.Diagnostics.Tracing.cs | 2 - .../ref/System.Numerics.Vectors.cs | 24 - .../InteropServices/ComponentActivator.cs | 1 - .../src/System/AppContext.cs | 1 - .../src/System/Buffer.cs | 2 - .../Text/Base64Helper/Base64DecoderHelper.cs | 17 - .../Text/Base64Helper/Base64EncoderHelper.cs | 21 - .../Buffers/Text/Base64Helper/Base64Helper.cs | 17 - .../Text/Base64Url/Base64UrlDecoder.cs | 12 - .../Text/Base64Url/Base64UrlEncoder.cs | 14 - .../src/System/Decimal.DecCalc.cs | 3 - .../Diagnostics/Tracing/ActivityTracker.cs | 3 - .../Diagnostics/Tracing/EventPipe.Internal.cs | 6 - .../Tracing/EventPipeEventProvider.cs | 4 - .../Tracing/EventPipeMetadataGenerator.cs | 7 - .../Diagnostics/Tracing/EventProvider.cs | 12 - .../System/Diagnostics/Tracing/EventSource.cs | 10 - ...untimeEventSource.Threading.NativeSinks.cs | 3 - .../Tracing/TraceLogging/DataCollector.cs | 3 - .../TraceLogging/TraceLoggingEventSource.cs | 6 - .../Tracing/TraceLogging/XplatEventLogger.cs | 1 - .../System/Globalization/CalendarData.Icu.cs | 2 - .../System/Globalization/CalendarData.Nls.cs | 2 - .../System/Globalization/CompareInfo.Icu.cs | 9 - .../System/Globalization/CompareInfo.Nls.cs | 4 - .../src/System/Globalization/CompareInfo.cs | 4 - .../System/Globalization/CultureData.Nls.cs | 4 - .../src/System/Globalization/TextInfo.Icu.cs | 1 - .../src/System/Globalization/TextInfo.Nls.cs | 1 - .../src/System/Globalization/TextInfo.cs | 1 - .../System.Private.CoreLib/src/System/Guid.cs | 1 - .../src/System/IO/Path.cs | 1 - .../src/System/IO/SharedMemoryManager.Unix.cs | 2 - .../src/System/IO/UnmanagedMemoryStream.cs | 4 - .../src/System/Number.Formatting.cs | 15 - .../Number.NumberToFloatingPointBits.cs | 3 - .../src/System/Numerics/Vector.cs | 6 - .../src/System/Numerics/Vector2.Extensions.cs | 3 - .../src/System/Numerics/Vector2.cs | 3 - .../src/System/Numerics/Vector3.Extensions.cs | 3 - .../src/System/Numerics/Vector3.cs | 3 - .../src/System/Numerics/Vector4.Extensions.cs | 3 - .../src/System/Numerics/Vector4.cs | 3 - .../src/System/Numerics/Vector_1.cs | 6 - .../src/System/ReadOnlySpan.cs | 1 - .../Runtime/CompilerServices/QCallHandles.cs | 1 - .../CompilerServices/RuntimeHelpers.cs | 1 - .../System/Runtime/CompilerServices/Unsafe.cs | 11 - .../src/System/Runtime/GCFrameRegistration.cs | 3 - .../ComAwareWeakReference.ComWrappers.cs | 1 - .../ComWrappers.PlatformNotSupported.cs | 2 - .../Runtime/InteropServices/ComWrappers.cs | 8 - .../InteropServices/GCHandleExtensions.cs | 2 - .../Java/JavaMarshal.Unsupported.cs | 4 - .../Runtime/InteropServices/Marshal.Unix.cs | 1 - .../Marshalling/AnsiStringMarshaller.cs | 4 - .../Marshalling/ArrayMarshaller.cs | 5 - .../Marshalling/BStrStringMarshaller.cs | 3 - .../Marshalling/PointerArrayMarshaller.cs | 5 - .../Marshalling/ReadOnlySpanMarshaller.cs | 4 - .../Marshalling/SpanMarshaller.cs | 5 - .../Marshalling/Utf16StringMarshaller.cs | 2 - .../Marshalling/Utf8StringMarshaller.cs | 4 - .../Runtime/InteropServices/MemoryMarshal.cs | 2 - .../InteropServices/NativeMemory.Unix.cs | 4 - .../InteropServices/NativeMemory.Windows.cs | 4 - .../Runtime/InteropServices/NativeMemory.cs | 3 - .../ObjectiveCMarshal.PlatformNotSupported.cs | 1 - .../ObjectiveC/ObjectiveCMarshal.cs | 1 - .../InteropServices/ReferenceTrackerHost.cs | 2 - .../InteropServices/TypeMapLazyDictionary.cs | 7 - .../Arm/AdvSimd.PlatformNotSupported.cs | 540 ----- .../System/Runtime/Intrinsics/Arm/AdvSimd.cs | 540 ----- .../Arm/Sve.PlatformNotSupported.cs | 482 ----- .../src/System/Runtime/Intrinsics/Arm/Sve.cs | 482 ----- .../Arm/Sve2.PlatformNotSupported.cs | 39 - .../src/System/Runtime/Intrinsics/Arm/Sve2.cs | 39 - .../Runtime/Intrinsics/ISimdVector_2.cs | 6 - .../Intrinsics/SimdVectorExtensions.cs | 3 - .../System/Runtime/Intrinsics/Vector128.cs | 6 - .../System/Runtime/Intrinsics/Vector128_1.cs | 6 - .../System/Runtime/Intrinsics/Vector256.cs | 6 - .../System/Runtime/Intrinsics/Vector256_1.cs | 6 - .../System/Runtime/Intrinsics/Vector512.cs | 6 - .../System/Runtime/Intrinsics/Vector512_1.cs | 6 - .../src/System/Runtime/Intrinsics/Vector64.cs | 6 - .../System/Runtime/Intrinsics/Vector64_1.cs | 6 - .../Wasm/PackedSimd.PlatformNotSupported.cs | 74 - .../Runtime/Intrinsics/Wasm/PackedSimd.cs | 74 - .../X86/Avx.PlatformNotSupported.cs | 71 - .../src/System/Runtime/Intrinsics/X86/Avx.cs | 71 - .../X86/Avx10v1.PlatformNotSupported.cs | 118 -- .../System/Runtime/Intrinsics/X86/Avx10v1.cs | 118 -- .../X86/Avx10v2.PlatformNotSupported.cs | 2 - .../System/Runtime/Intrinsics/X86/Avx10v2.cs | 2 - .../X86/Avx2.PlatformNotSupported.cs | 108 - .../src/System/Runtime/Intrinsics/X86/Avx2.cs | 108 - .../X86/Avx512BW.PlatformNotSupported.cs | 32 - .../System/Runtime/Intrinsics/X86/Avx512BW.cs | 32 - .../X86/Avx512DQ.PlatformNotSupported.cs | 6 - .../System/Runtime/Intrinsics/X86/Avx512DQ.cs | 6 - .../X86/Avx512F.PlatformNotSupported.cs | 172 -- .../System/Runtime/Intrinsics/X86/Avx512F.cs | 172 -- .../X86/Avx512Vbmi2.PlatformNotSupported.cs | 24 - .../Runtime/Intrinsics/X86/Avx512Vbmi2.cs | 24 - .../X86/Bmi2.PlatformNotSupported.cs | 2 - .../src/System/Runtime/Intrinsics/X86/Bmi2.cs | 2 - .../X86/Sse.PlatformNotSupported.cs | 15 - .../src/System/Runtime/Intrinsics/X86/Sse.cs | 15 - .../X86/Sse2.PlatformNotSupported.cs | 65 - .../src/System/Runtime/Intrinsics/X86/Sse2.cs | 65 - .../X86/Sse3.PlatformNotSupported.cs | 9 - .../src/System/Runtime/Intrinsics/X86/Sse3.cs | 9 - .../X86/Sse41.PlatformNotSupported.cs | 20 - .../System/Runtime/Intrinsics/X86/Sse41.cs | 20 - .../System/Runtime/Intrinsics/X86/X86Base.cs | 1 - .../Runtime/Loader/AssemblyLoadContext.cs | 7 - .../SearchValues/IndexOfAnyAsciiSearcher.cs | 2 - .../SearchValues/ProbabilisticMapState.cs | 1 - .../src/System/Security/SecureString.cs | 1 - .../System.Private.CoreLib/src/System/Span.cs | 1 - .../src/System/SpanHelpers.Byte.cs | 1 - .../src/System/SpanHelpers.ByteMemOps.cs | 2 - .../src/System/SpanHelpers.Char.cs | 1 - .../src/System/StartupHookProvider.cs | 2 - .../src/System/String.Manipulation.cs | 1 - .../src/System/String.cs | 14 - .../src/System/Text/ASCIIEncoding.cs | 12 - .../src/System/Text/Ascii.CaseConversion.cs | 2 - .../src/System/Text/Ascii.Utility.cs | 12 - .../src/System/Text/Decoder.cs | 3 - .../src/System/Text/DecoderFallback.cs | 3 - .../src/System/Text/DecoderNLS.cs | 3 - .../System/Text/DecoderReplacementFallback.cs | 1 - .../src/System/Text/Encoder.cs | 3 - .../src/System/Text/EncoderFallback.cs | 1 - .../src/System/Text/EncoderNLS.cs | 3 - .../src/System/Text/Encoding.Internal.cs | 16 - .../src/System/Text/Encoding.cs | 11 - .../src/System/Text/Latin1Encoding.cs | 11 - .../src/System/Text/Latin1Utility.cs | 8 - .../src/System/Text/StringBuilder.cs | 1 - .../src/System/Text/UTF32Encoding.cs | 8 - .../src/System/Text/UTF7Encoding.cs | 9 - .../src/System/Text/UTF8Encoding.cs | 12 - .../Text/Unicode/Utf16Utility.Validation.cs | 1 - .../Text/Unicode/Utf8Utility.Transcoding.cs | 2 - .../Text/Unicode/Utf8Utility.Validation.cs | 1 - .../src/System/Text/UnicodeEncoding.cs | 8 - .../src/System/Threading/AutoreleasePool.cs | 2 - .../Threading/IOCompletionCallbackHelper.cs | 1 - .../src/System/Threading/Lock.cs | 1 - .../src/System/Threading/NamedMutex.Unix.cs | 1 - .../src/System/Threading/Overlapped.cs | 6 - .../System/Threading/ThreadBlockingInfo.cs | 1 - .../System/Threading/ThreadPool.Browser.cs | 1 - .../src/System/Threading/ThreadPool.Unix.cs | 1 - .../src/System/Threading/ThreadPool.Wasi.cs | 1 - .../System/Threading/ThreadPool.Windows.cs | 1 - .../ThreadPoolBoundHandle.Portable.cs | 3 - .../ThreadPoolBoundHandleOverlapped.cs | 1 - .../Win32ThreadPoolNativeOverlapped.cs | 4 - .../ref/System.Reflection.Emit.Lightweight.cs | 3 - .../ref/System.Runtime.InteropServices.cs | 39 - .../Marshalling/StrategyBasedComWrappers.cs | 1 - .../ref/System.Runtime.Intrinsics.cs | 1803 ----------------- .../ref/System.Runtime.Loader.cs | 1 - .../System.Runtime/ref/System.Runtime.cs | 50 - .../ref/System.Text.Encoding.Extensions.cs | 20 - .../ref/System.Threading.Overlapped.cs | 2 - .../ref/System.Threading.ThreadPool.cs | 1 - .../src/System/ArgIterator.cs | 1 - .../System/Reflection/Emit/DynamicILInfo.cs | 3 - .../Reflection/Metadata/AssemblyExtensions.cs | 1 - 233 files changed, 6429 deletions(-) diff --git a/src/coreclr/System.Private.CoreLib/src/Internal/Runtime/CompilerHelpers/ThrowHelpers.cs b/src/coreclr/System.Private.CoreLib/src/Internal/Runtime/CompilerHelpers/ThrowHelpers.cs index 3a1c5d2980492b..377fba25b43a36 100644 --- a/src/coreclr/System.Private.CoreLib/src/Internal/Runtime/CompilerHelpers/ThrowHelpers.cs +++ b/src/coreclr/System.Private.CoreLib/src/Internal/Runtime/CompilerHelpers/ThrowHelpers.cs @@ -12,12 +12,10 @@ internal static unsafe partial class ThrowHelpers { [DoesNotReturn] [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "ExceptionNative_ThrowAmbiguousResolutionException")] - [RequiresUnsafe] private static partial void ThrowAmbiguousResolutionException(MethodTable* targetType, MethodTable* interfaceType, void* methodDesc); [DoesNotReturn] [DebuggerHidden] - [RequiresUnsafe] internal static void ThrowAmbiguousResolutionException( void* method, // MethodDesc* void* interfaceType, // MethodTable* @@ -28,12 +26,10 @@ internal static void ThrowAmbiguousResolutionException( [DoesNotReturn] [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "ExceptionNative_ThrowEntryPointNotFoundException")] - [RequiresUnsafe] private static partial void ThrowEntryPointNotFoundException(MethodTable* targetType, MethodTable* interfaceType, void* methodDesc); [DoesNotReturn] [DebuggerHidden] - [RequiresUnsafe] internal static void ThrowEntryPointNotFoundException( void* method, // MethodDesc* void* interfaceType, // MethodTable* @@ -44,13 +40,11 @@ internal static void ThrowEntryPointNotFoundException( [DoesNotReturn] [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "ExceptionNative_ThrowMethodAccessException")] - [RequiresUnsafe] private static partial void ThrowMethodAccessExceptionInternal(void* caller, void* callee); // implementation of CORINFO_HELP_METHOD_ACCESS_EXCEPTION [DoesNotReturn] [DebuggerHidden] - [RequiresUnsafe] internal static void ThrowMethodAccessException( void* caller, // MethodDesc* void* callee) // MethodDesc* @@ -60,13 +54,11 @@ internal static void ThrowMethodAccessException( [DoesNotReturn] [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "ExceptionNative_ThrowFieldAccessException")] - [RequiresUnsafe] private static partial void ThrowFieldAccessExceptionInternal(void* caller, void* callee); // implementation of CORINFO_HELP_FIELD_ACCESS_EXCEPTION [DoesNotReturn] [DebuggerHidden] - [RequiresUnsafe] internal static void ThrowFieldAccessException( void* caller, // MethodDesc* void* callee) // FieldDesc* @@ -76,13 +68,11 @@ internal static void ThrowFieldAccessException( [DoesNotReturn] [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "ExceptionNative_ThrowClassAccessException")] - [RequiresUnsafe] private static partial void ThrowClassAccessExceptionInternal(void* caller, void* callee); // implementation of CORINFO_HELP_CLASS_ACCESS_EXCEPTION [DoesNotReturn] [DebuggerHidden] - [RequiresUnsafe] internal static void ThrowClassAccessException( void* caller, // MethodDesc* void* callee) // Type handle diff --git a/src/coreclr/System.Private.CoreLib/src/Internal/Runtime/InteropServices/ComActivator.PlatformNotSupported.cs b/src/coreclr/System.Private.CoreLib/src/Internal/Runtime/InteropServices/ComActivator.PlatformNotSupported.cs index 89e048c86d712f..4f90dd004780fe 100644 --- a/src/coreclr/System.Private.CoreLib/src/Internal/Runtime/InteropServices/ComActivator.PlatformNotSupported.cs +++ b/src/coreclr/System.Private.CoreLib/src/Internal/Runtime/InteropServices/ComActivator.PlatformNotSupported.cs @@ -16,7 +16,6 @@ internal static class ComActivator /// /// Pointer to a instance [UnmanagedCallersOnly] - [RequiresUnsafe] private static unsafe int GetClassFactoryForTypeInternal(ComActivationContextInternal* pCxtInt) => throw new PlatformNotSupportedException(); @@ -25,7 +24,6 @@ private static unsafe int GetClassFactoryForTypeInternal(ComActivationContextInt /// /// Pointer to a instance [UnmanagedCallersOnly] - [RequiresUnsafe] private static unsafe int RegisterClassForTypeInternal(ComActivationContextInternal* pCxtInt) => throw new PlatformNotSupportedException(); @@ -34,7 +32,6 @@ private static unsafe int RegisterClassForTypeInternal(ComActivationContextInter /// /// Pointer to a instance [UnmanagedCallersOnly] - [RequiresUnsafe] private static unsafe int UnregisterClassForTypeInternal(ComActivationContextInternal* pCxtInt) => throw new PlatformNotSupportedException(); } diff --git a/src/coreclr/System.Private.CoreLib/src/System/AppContext.CoreCLR.cs b/src/coreclr/System.Private.CoreLib/src/System/AppContext.CoreCLR.cs index 75b8b42cf51f65..f76aa7daade17e 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/AppContext.CoreCLR.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/AppContext.CoreCLR.cs @@ -10,7 +10,6 @@ namespace System public static partial class AppContext { [UnmanagedCallersOnly] - [RequiresUnsafe] private static unsafe void OnProcessExit(Exception* pException) { try @@ -24,7 +23,6 @@ private static unsafe void OnProcessExit(Exception* pException) } [UnmanagedCallersOnly] - [RequiresUnsafe] private static unsafe void OnUnhandledException(object* pException, Exception* pOutException) { try @@ -38,7 +36,6 @@ private static unsafe void OnUnhandledException(object* pException, Exception* p } [UnmanagedCallersOnly] - [RequiresUnsafe] internal static unsafe void OnFirstChanceException(Exception* pException, Exception* pOutException) { try diff --git a/src/coreclr/System.Private.CoreLib/src/System/ArgIterator.cs b/src/coreclr/System.Private.CoreLib/src/System/ArgIterator.cs index 592cc1db674eca..5bc772cf117b8e 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/ArgIterator.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/ArgIterator.cs @@ -48,7 +48,6 @@ public ArgIterator(RuntimeArgumentHandle arglist) // This is much like the C va_start macro [CLSCompliant(false)] - [RequiresUnsafe] public ArgIterator(RuntimeArgumentHandle arglist, void* ptr) { IntPtr cookie = arglist.Value; @@ -163,7 +162,6 @@ public ArgIterator(RuntimeArgumentHandle arglist) } [CLSCompliant(false)] - [RequiresUnsafe] public unsafe ArgIterator(RuntimeArgumentHandle arglist, void* ptr) { throw new PlatformNotSupportedException(SR.PlatformNotSupported_ArgIterator); // https://github.com/dotnet/runtime/issues/7317 diff --git a/src/coreclr/System.Private.CoreLib/src/System/Array.CoreCLR.cs b/src/coreclr/System.Private.CoreLib/src/System/Array.CoreCLR.cs index c974894bf48314..e16d76377cd8f4 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/Array.CoreCLR.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/Array.CoreCLR.cs @@ -16,11 +16,9 @@ namespace System public abstract partial class Array : ICloneable, IList, IStructuralComparable, IStructuralEquatable { [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "Array_CreateInstance")] - [RequiresUnsafe] private static unsafe partial void InternalCreate(QCallTypeHandle type, int rank, int* pLengths, int* pLowerBounds, [MarshalAs(UnmanagedType.Bool)] bool fromArrayType, ObjectHandleOnStack retArray); - [RequiresUnsafe] private static unsafe Array InternalCreate(RuntimeType elementType, int rank, int* pLengths, int* pLowerBounds) { Array? retArray = null; @@ -29,7 +27,6 @@ private static unsafe Array InternalCreate(RuntimeType elementType, int rank, in return retArray!; } - [RequiresUnsafe] private static unsafe Array InternalCreateFromArrayType(RuntimeType arrayType, int rank, int* pLengths, int* pLowerBounds) { Array? retArray = null; @@ -39,14 +36,12 @@ private static unsafe Array InternalCreateFromArrayType(RuntimeType arrayType, i } [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "Array_Ctor")] - [RequiresUnsafe] private static unsafe partial void Ctor(MethodTable* pArrayMT, uint dwNumArgs, int* pArgList, ObjectHandleOnStack retArray); // implementation of CORINFO_HELP_NEW_MDARR and CORINFO_HELP_NEW_MDARR_RARE. [StackTraceHidden] [DebuggerStepThrough] [DebuggerHidden] - [RequiresUnsafe] internal static unsafe Array Ctor(MethodTable* pArrayMT, uint dwNumArgs, int* pArgList) { Array? arr = null; @@ -309,7 +304,6 @@ public int Rank [MethodImpl(MethodImplOptions.InternalCall)] internal extern CorElementType GetCorElementTypeOfElementType(); - [RequiresUnsafe] private unsafe MethodTable* ElementMethodTable => RuntimeHelpers.GetMethodTable(this)->GetArrayElementTypeHandle().AsMethodTable(); private unsafe bool IsValueOfElementType(object value) @@ -356,10 +350,8 @@ internal sealed unsafe partial class ArrayInitializeCache : RuntimeType.IGeneric internal readonly delegate* ConstructorEntrypoint; [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "Array_GetElementConstructorEntrypoint")] - [RequiresUnsafe] private static partial delegate* GetElementConstructorEntrypoint(QCallTypeHandle arrayType); - [RequiresUnsafe] private ArrayInitializeCache(delegate* constructorEntrypoint) { ConstructorEntrypoint = constructorEntrypoint; diff --git a/src/coreclr/System.Private.CoreLib/src/System/Buffer.CoreCLR.cs b/src/coreclr/System.Private.CoreLib/src/System/Buffer.CoreCLR.cs index 8764e418aaf5ae..c7a94a1ddbe23c 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/Buffer.CoreCLR.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/Buffer.CoreCLR.cs @@ -14,7 +14,6 @@ public partial class Buffer private static extern void BulkMoveWithWriteBarrierInternal(ref byte destination, ref byte source, nuint byteCount); // Used by ilmarshalers.cpp - [RequiresUnsafe] internal static unsafe void Memcpy(byte* dest, byte* src, int len) { Debug.Assert(len >= 0, "Negative length in memcpy!"); @@ -22,7 +21,6 @@ internal static unsafe void Memcpy(byte* dest, byte* src, int len) } // Used by ilmarshalers.cpp - [RequiresUnsafe] internal static unsafe void Memcpy(byte* pDest, int destIndex, byte[] src, int srcIndex, int len) { Debug.Assert((srcIndex >= 0) && (destIndex >= 0) && (len >= 0), "Index and length must be non-negative!"); diff --git a/src/coreclr/System.Private.CoreLib/src/System/Delegate.CoreCLR.cs b/src/coreclr/System.Private.CoreLib/src/System/Delegate.CoreCLR.cs index 8d822a08a6b42b..358dab7f43674d 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/Delegate.CoreCLR.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/Delegate.CoreCLR.cs @@ -483,11 +483,9 @@ private void DelegateConstruct(object target, IntPtr method) private static partial void Construct(ObjectHandleOnStack _this, ObjectHandleOnStack target, IntPtr method); [MethodImpl(MethodImplOptions.InternalCall)] - [RequiresUnsafe] private static extern unsafe void* GetMulticastInvoke(MethodTable* pMT); [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "Delegate_GetMulticastInvokeSlow")] - [RequiresUnsafe] private static unsafe partial void* GetMulticastInvokeSlow(MethodTable* pMT); internal unsafe IntPtr GetMulticastInvoke() @@ -505,7 +503,6 @@ internal unsafe IntPtr GetMulticastInvoke() } [MethodImpl(MethodImplOptions.InternalCall)] - [RequiresUnsafe] private static extern unsafe void* GetInvokeMethod(MethodTable* pMT); internal unsafe IntPtr GetInvokeMethod() diff --git a/src/coreclr/System.Private.CoreLib/src/System/Environment.CoreCLR.cs b/src/coreclr/System.Private.CoreLib/src/System/Environment.CoreCLR.cs index e182546b527753..71aff544f92c27 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/Environment.CoreCLR.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/Environment.CoreCLR.cs @@ -87,7 +87,6 @@ private static void FailFast(ref StackCrawlMark mark, string? message, Exception [DoesNotReturn] private static partial void FailFast(StackCrawlMarkHandle mark, string? message, ObjectHandleOnStack exception, string? errorMessage); - [RequiresUnsafe] private static unsafe string[] InitializeCommandLineArgs(char* exePath, int argc, char** argv) // invoked from VM { string[] commandLineArgs = new string[argc + 1]; @@ -105,7 +104,6 @@ private static unsafe string[] InitializeCommandLineArgs(char* exePath, int argc } [UnmanagedCallersOnly] - [RequiresUnsafe] private static unsafe void InitializeCommandLineArgs(char* exePath, int argc, char** argv, string[]* pResult, Exception* pException) { try @@ -122,7 +120,6 @@ private static unsafe void InitializeCommandLineArgs(char* exePath, int argc, ch internal static partial int GetProcessorCount(); [UnmanagedCallersOnly] - [RequiresUnsafe] private static unsafe void GetResourceString(char* pKey, string* pResult, Exception* pException) { try @@ -137,7 +134,6 @@ private static unsafe void GetResourceString(char* pKey, string* pResult, Except [UnmanagedCallersOnly] [StackTraceHidden] - [RequiresUnsafe] internal static unsafe void CallEntryPoint(IntPtr entryPoint, string[]* pArgument, int* pReturnValue, bool captureException, Exception* pException) { try @@ -175,7 +171,6 @@ internal static unsafe void CallEntryPoint(IntPtr entryPoint, string[]* pArgumen [UnmanagedCallersOnly] [StackTraceHidden] - [RequiresUnsafe] internal static unsafe int ExecuteInDefaultAppDomain(IntPtr entryPoint, char* pArgument, Exception* pException) { try diff --git a/src/coreclr/System.Private.CoreLib/src/System/Exception.CoreCLR.cs b/src/coreclr/System.Private.CoreLib/src/System/Exception.CoreCLR.cs index f71851e59c63aa..defddcdd5c488f 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/Exception.CoreCLR.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/Exception.CoreCLR.cs @@ -115,7 +115,6 @@ internal void InternalPreserveStackTrace() } [UnmanagedCallersOnly] - [RequiresUnsafe] private static unsafe void InternalPreserveStackTrace(Exception* pException, Exception* pOutException) { try @@ -272,7 +271,6 @@ private bool CanSetRemoteStackTrace() } [UnmanagedCallersOnly] - [RequiresUnsafe] internal static unsafe void CreateRuntimeWrappedException(object* pThrownObject, object* pResult, Exception* pException) { try @@ -286,7 +284,6 @@ internal static unsafe void CreateRuntimeWrappedException(object* pThrownObject, } [UnmanagedCallersOnly] - [RequiresUnsafe] internal static unsafe void CreateTypeInitializationException(char* pTypeName, Exception* pInnerException, object* pResult, Exception* pException) { try diff --git a/src/coreclr/System.Private.CoreLib/src/System/GC.CoreCLR.cs b/src/coreclr/System.Private.CoreLib/src/System/GC.CoreCLR.cs index 1e8c22fe0ae12a..e543a91087230c 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/GC.CoreCLR.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/GC.CoreCLR.cs @@ -309,11 +309,9 @@ public static int GetGeneration(WeakReference wo) public static int MaxGeneration => GetMaxGeneration(); [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "GCInterface_GetNextFinalizableObject")] - [RequiresUnsafe] private static unsafe partial void* GetNextFinalizeableObject(ObjectHandleOnStack target); [UnmanagedCallersOnly] - [RequiresUnsafe] private static unsafe uint RunFinalizers() { Thread currentThread = Thread.CurrentThread; @@ -764,7 +762,6 @@ static void Free(NoGCRegionCallbackFinalizerWorkItem* pWorkItem) } [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "GCInterface_EnableNoGCRegionCallback")] - [RequiresUnsafe] private static unsafe partial EnableNoGCRegionCallbackStatus _EnableNoGCRegionCallback(NoGCRegionCallbackFinalizerWorkItem* callback, long totalSize); internal static long GetGenerationBudget(int generation) @@ -877,7 +874,6 @@ internal struct GCConfigurationContext } [UnmanagedCallersOnly] - [RequiresUnsafe] private static unsafe void ConfigCallback(void* configurationContext, byte* name, byte* publicKey, GCConfigurationType type, long data) { // If the public key is null, it means that the corresponding configuration isn't publicly available @@ -939,7 +935,6 @@ internal enum GCConfigurationType } [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "GCInterface_EnumerateConfigurationValues")] - [RequiresUnsafe] internal static unsafe partial void _EnumerateConfigurationValues(void* configurationDictionary, delegate* unmanaged callback); internal enum RefreshMemoryStatus diff --git a/src/coreclr/System.Private.CoreLib/src/System/IO/Stream.CoreCLR.cs b/src/coreclr/System.Private.CoreLib/src/System/IO/Stream.CoreCLR.cs index b485bf5de46401..1a78a6cdf897c9 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/IO/Stream.CoreCLR.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/IO/Stream.CoreCLR.cs @@ -10,7 +10,6 @@ namespace System.IO public abstract unsafe partial class Stream { [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "Stream_HasOverriddenSlow")] - [RequiresUnsafe] [return: MarshalAs(UnmanagedType.Bool)] private static partial bool HasOverriddenSlow(MethodTable* pMT, [MarshalAs(UnmanagedType.Bool)] bool isRead); diff --git a/src/coreclr/System.Private.CoreLib/src/System/Math.CoreCLR.cs b/src/coreclr/System.Private.CoreLib/src/System/Math.CoreCLR.cs index 29e85816c4595e..502cb90ac74051 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/Math.CoreCLR.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/Math.CoreCLR.cs @@ -123,11 +123,9 @@ public static unsafe (double Sin, double Cos) SinCos(double x) public static extern double Tanh(double value); [MethodImpl(MethodImplOptions.InternalCall)] - [RequiresUnsafe] private static extern unsafe double ModF(double x, double* intptr); [MethodImpl(MethodImplOptions.InternalCall)] - [RequiresUnsafe] private static extern unsafe void SinCos(double x, double* sin, double* cos); } } diff --git a/src/coreclr/System.Private.CoreLib/src/System/MathF.CoreCLR.cs b/src/coreclr/System.Private.CoreLib/src/System/MathF.CoreCLR.cs index 6b9eb3cb128213..4960d7ca738e9c 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/MathF.CoreCLR.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/MathF.CoreCLR.cs @@ -120,11 +120,9 @@ public static unsafe (float Sin, float Cos) SinCos(float x) public static extern float Tanh(float x); [MethodImpl(MethodImplOptions.InternalCall)] - [RequiresUnsafe] private static extern unsafe float ModF(float x, float* intptr); [MethodImpl(MethodImplOptions.InternalCall)] - [RequiresUnsafe] private static extern unsafe void SinCos(float x, float* sin, float* cos); } } diff --git a/src/coreclr/System.Private.CoreLib/src/System/Reflection/AssemblyName.CoreCLR.cs b/src/coreclr/System.Private.CoreLib/src/System/Reflection/AssemblyName.CoreCLR.cs index ad32d438c5121f..ce281aa99db183 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/Reflection/AssemblyName.CoreCLR.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/Reflection/AssemblyName.CoreCLR.cs @@ -63,7 +63,6 @@ public void SetVersion(Version? version, ushort defaultValue) public sealed partial class AssemblyName { - [RequiresUnsafe] internal unsafe AssemblyName(NativeAssemblyNameParts* pParts) : this() { @@ -147,7 +146,6 @@ private static ProcessorArchitecture CalculateProcArch(PortableExecutableKinds p } [UnmanagedCallersOnly] - [RequiresUnsafe] private static unsafe void ParseAsAssemblySpec(char* pAssemblyName, void* pAssemblySpec, Exception* pException) { try @@ -179,7 +177,6 @@ private static unsafe void ParseAsAssemblySpec(char* pAssemblyName, void* pAssem } [UnmanagedCallersOnly] - [RequiresUnsafe] private static unsafe void CreateAssemblyName(AssemblyName* pResult, NativeAssemblyNameParts* pParts, Exception* pException) { try @@ -193,7 +190,6 @@ private static unsafe void CreateAssemblyName(AssemblyName* pResult, NativeAssem } [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyName_InitializeAssemblySpec")] - [RequiresUnsafe] private static unsafe partial void InitializeAssemblySpec(NativeAssemblyNameParts* pAssemblyNameParts, void* pAssemblySpec); } } diff --git a/src/coreclr/System.Private.CoreLib/src/System/Reflection/ConstructorInvoker.CoreCLR.cs b/src/coreclr/System.Private.CoreLib/src/System/Reflection/ConstructorInvoker.CoreCLR.cs index a5027d6a8da32a..aa351553b79966 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/Reflection/ConstructorInvoker.CoreCLR.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/Reflection/ConstructorInvoker.CoreCLR.cs @@ -15,7 +15,6 @@ internal unsafe ConstructorInvoker(RuntimeConstructorInfo constructor) : this(co _invokeFunc_RefArgs = InterpretedInvoke; } - [RequiresUnsafe] private unsafe object? InterpretedInvoke(object? obj, IntPtr* args) { return RuntimeMethodHandle.InvokeMethod(obj, (void**)args, _signature!, isConstructor: obj is null); diff --git a/src/coreclr/System.Private.CoreLib/src/System/Reflection/Emit/DynamicILGenerator.cs b/src/coreclr/System.Private.CoreLib/src/System/Reflection/Emit/DynamicILGenerator.cs index fed49fef5cea4f..dc11617d89ed09 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/Reflection/Emit/DynamicILGenerator.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/Reflection/Emit/DynamicILGenerator.cs @@ -757,7 +757,6 @@ internal override byte[] GetLocalsSignature() return m_exceptionHeader; } - [RequiresUnsafe] internal override unsafe void GetEHInfo(int excNumber, void* exc) { Debug.Assert(m_exceptions != null); @@ -906,7 +905,6 @@ public void SetCode(byte[]? code, int maxStackSize) } [CLSCompliant(false)] - [RequiresUnsafe] public unsafe void SetCode(byte* code, int codeSize, int maxStackSize) { ArgumentOutOfRangeException.ThrowIfNegative(codeSize); @@ -923,7 +921,6 @@ public void SetExceptions(byte[]? exceptions) } [CLSCompliant(false)] - [RequiresUnsafe] public unsafe void SetExceptions(byte* exceptions, int exceptionsSize) { ArgumentOutOfRangeException.ThrowIfNegative(exceptionsSize); @@ -940,7 +937,6 @@ public void SetLocalSignature(byte[]? localSignature) } [CLSCompliant(false)] - [RequiresUnsafe] public unsafe void SetLocalSignature(byte* localSignature, int signatureSize) { ArgumentOutOfRangeException.ThrowIfNegative(signatureSize); diff --git a/src/coreclr/System.Private.CoreLib/src/System/Reflection/Emit/RuntimeAssemblyBuilder.cs b/src/coreclr/System.Private.CoreLib/src/System/Reflection/Emit/RuntimeAssemblyBuilder.cs index ee44898231d7e9..474e2c68292709 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/Reflection/Emit/RuntimeAssemblyBuilder.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/Reflection/Emit/RuntimeAssemblyBuilder.cs @@ -113,7 +113,6 @@ internal RuntimeAssemblyBuilder(AssemblyName name, #region DefineDynamicAssembly [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "AppDomain_CreateDynamicAssembly")] - [RequiresUnsafe] private static unsafe partial void CreateDynamicAssembly(ObjectHandleOnStack assemblyLoadContext, NativeAssemblyNameParts* pAssemblyName, AssemblyHashAlgorithm hashAlgId, diff --git a/src/coreclr/System.Private.CoreLib/src/System/Reflection/Emit/RuntimeTypeBuilder.cs b/src/coreclr/System.Private.CoreLib/src/System/Reflection/Emit/RuntimeTypeBuilder.cs index 9405e17878f3d2..58fe7960ab3c6d 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/Reflection/Emit/RuntimeTypeBuilder.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/Reflection/Emit/RuntimeTypeBuilder.cs @@ -126,7 +126,6 @@ internal static partial int SetParamInfo(QCallModule module, int tkMethod, int i internal static partial void SetClassLayout(QCallModule module, int tk, PackingSize iPackingSize, int iTypeSize); [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "TypeBuilder_SetConstantValue")] - [RequiresUnsafe] private static unsafe partial void SetConstantValue(QCallModule module, int tk, int corType, void* pValue); [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "TypeBuilder_SetPInvokeData", StringMarshalling = StringMarshalling.Utf16)] diff --git a/src/coreclr/System.Private.CoreLib/src/System/Reflection/InstanceCalliHelper.cs b/src/coreclr/System.Private.CoreLib/src/System/Reflection/InstanceCalliHelper.cs index fe8e3a234d0e53..08758cdf75d59f 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/Reflection/InstanceCalliHelper.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/Reflection/InstanceCalliHelper.cs @@ -16,197 +16,151 @@ internal static unsafe class InstanceCalliHelper // Zero parameter methods such as property getters: [Intrinsic] - [RequiresUnsafe] internal static bool Call(delegate* fn, object o) => fn(o); [Intrinsic] - [RequiresUnsafe] internal static byte Call(delegate* fn, object o) => fn(o); [Intrinsic] - [RequiresUnsafe] internal static char Call(delegate* fn, object o) => fn(o); [Intrinsic] - [RequiresUnsafe] internal static DateTime Call(delegate* fn, object o) => fn(o); [Intrinsic] - [RequiresUnsafe] internal static DateTimeOffset Call(delegate* fn, object o) => fn(o); [Intrinsic] - [RequiresUnsafe] internal static decimal Call(delegate* fn, object o) => fn(o); [Intrinsic] - [RequiresUnsafe] internal static double Call(delegate* fn, object o) => fn(o); [Intrinsic] - [RequiresUnsafe] internal static float Call(delegate* fn, object o) => fn(o); [Intrinsic] - [RequiresUnsafe] internal static Guid Call(delegate* fn, object o) => fn(o); [Intrinsic] - [RequiresUnsafe] internal static short Call(delegate* fn, object o) => fn(o); [Intrinsic] - [RequiresUnsafe] internal static int Call(delegate* fn, object o) => fn(o); [Intrinsic] - [RequiresUnsafe] internal static long Call(delegate* fn, object o) => fn(o); [Intrinsic] - [RequiresUnsafe] internal static nint Call(delegate* fn, object o) => fn(o); [Intrinsic] - [RequiresUnsafe] internal static nuint Call(delegate* fn, object o) => fn(o); [Intrinsic] - [RequiresUnsafe] internal static object? Call(delegate* fn, object o) => fn(o); [Intrinsic] - [RequiresUnsafe] internal static sbyte Call(delegate* fn, object o) => fn(o); [Intrinsic] - [RequiresUnsafe] internal static ushort Call(delegate* fn, object o) => fn(o); [Intrinsic] - [RequiresUnsafe] internal static uint Call(delegate* fn, object o) => fn(o); [Intrinsic] - [RequiresUnsafe] internal static ulong Call(delegate* fn, object o) => fn(o); [Intrinsic] - [RequiresUnsafe] internal static void Call(delegate* fn, object o) => fn(o); // One parameter methods with no return such as property setters: [Intrinsic] - [RequiresUnsafe] internal static void Call(delegate* fn, object o, bool arg1) => fn(o, arg1); [Intrinsic] - [RequiresUnsafe] internal static void Call(delegate* fn, object o, byte arg1) => fn(o, arg1); [Intrinsic] - [RequiresUnsafe] internal static void Call(delegate* fn, object o, char arg1) => fn(o, arg1); [Intrinsic] - [RequiresUnsafe] internal static void Call(delegate* fn, object o, DateTime arg1) => fn(o, arg1); [Intrinsic] - [RequiresUnsafe] internal static void Call(delegate* fn, object o, DateTimeOffset arg1) => fn(o, arg1); [Intrinsic] - [RequiresUnsafe] internal static void Call(delegate* fn, object o, decimal arg1) => fn(o, arg1); [Intrinsic] - [RequiresUnsafe] internal static void Call(delegate* fn, object o, double arg1) => fn(o, arg1); [Intrinsic] - [RequiresUnsafe] internal static void Call(delegate* fn, object o, float arg1) => fn(o, arg1); [Intrinsic] - [RequiresUnsafe] internal static void Call(delegate* fn, object o, Guid arg1) => fn(o, arg1); [Intrinsic] - [RequiresUnsafe] internal static void Call(delegate* fn, object o, short arg1) => fn(o, arg1); [Intrinsic] - [RequiresUnsafe] internal static void Call(delegate* fn, object o, int arg1) => fn(o, arg1); [Intrinsic] - [RequiresUnsafe] internal static void Call(delegate* fn, object o, long arg1) => fn(o, arg1); [Intrinsic] - [RequiresUnsafe] internal static void Call(delegate* fn, object o, nint arg1) => fn(o, arg1); [Intrinsic] - [RequiresUnsafe] internal static void Call(delegate* fn, object o, nuint arg1) => fn(o, arg1); [Intrinsic] - [RequiresUnsafe] internal static void Call(delegate* fn, object o, object? arg1) => fn(o, arg1); [Intrinsic] - [RequiresUnsafe] internal static void Call(delegate* fn, object o, sbyte arg1) => fn(o, arg1); [Intrinsic] - [RequiresUnsafe] internal static void Call(delegate* fn, object o, ushort arg1) => fn(o, arg1); [Intrinsic] - [RequiresUnsafe] internal static void Call(delegate* fn, object o, uint arg1) => fn(o, arg1); [Intrinsic] - [RequiresUnsafe] internal static void Call(delegate* fn, object o, ulong arg1) => fn(o, arg1); // Other methods: [Intrinsic] - [RequiresUnsafe] internal static void Call(delegate* fn, object o, object? arg1, object? arg2) => fn(o, arg1, arg2); [Intrinsic] - [RequiresUnsafe] internal static void Call(delegate* fn, object o, object? arg1, object? arg2, object? arg3) => fn(o, arg1, arg2, arg3); [Intrinsic] - [RequiresUnsafe] internal static void Call(delegate* fn, object o, object? arg1, object? arg2, object? arg3, object? arg4) => fn(o, arg1, arg2, arg3, arg4); [Intrinsic] - [RequiresUnsafe] internal static void Call(delegate* fn, object o, object? arg1, object? arg2, object? arg3, object? arg4, object? arg5) => fn(o, arg1, arg2, arg3, arg4, arg5); [Intrinsic] - [RequiresUnsafe] internal static void Call(delegate* fn, object o, object? arg1, object? arg2, object? arg3, object? arg4, object? arg5, object? arg6) => fn(o, arg1, arg2, arg3, arg4, arg5, arg6); [Intrinsic] - [RequiresUnsafe] internal static void Call(delegate*?, void> fn, object o, IEnumerable? arg1) => fn(o, arg1); [Intrinsic] - [RequiresUnsafe] internal static void Call(delegate*?, IEnumerable?, void> fn, object o, IEnumerable? arg1, IEnumerable? arg2) => fn(o, arg1, arg2); } diff --git a/src/coreclr/System.Private.CoreLib/src/System/Reflection/LoaderAllocator.cs b/src/coreclr/System.Private.CoreLib/src/System/Reflection/LoaderAllocator.cs index febdd92b7426aa..0a377941f053a2 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/Reflection/LoaderAllocator.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/Reflection/LoaderAllocator.cs @@ -56,7 +56,6 @@ private LoaderAllocator() } [UnmanagedCallersOnly] - [RequiresUnsafe] private static unsafe void Create(object* pResult, Exception* pException) { try diff --git a/src/coreclr/System.Private.CoreLib/src/System/Reflection/MdImport.cs b/src/coreclr/System.Private.CoreLib/src/System/Reflection/MdImport.cs index 368e5d8cbe2063..885a3305a4e292 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/Reflection/MdImport.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/Reflection/MdImport.cs @@ -229,7 +229,6 @@ private bool Equals(MetadataImport import) #region Static Members [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "MetadataImport_GetMarshalAs")] - [RequiresUnsafe] [return: MarshalAs(UnmanagedType.Bool)] private static unsafe partial bool GetMarshalAs( IntPtr pNativeType, @@ -335,7 +334,6 @@ internal MetadataImport(RuntimeModule module) #endregion [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "MetadataImport_Enum")] - [RequiresUnsafe] private static unsafe partial void Enum(IntPtr scope, int type, int parent, ref int length, int* shortResult, ObjectHandleOnStack longResult); public unsafe void Enum(MetadataTokenType type, int parent, out MetadataEnumResult result) @@ -379,7 +377,6 @@ public void EnumEvents(int mdTypeDef, out MetadataEnumResult result) Enum(MetadataTokenType.Event, mdTypeDef, out result); } - [RequiresUnsafe] private static unsafe string? ConvertMetadataStringPermitInvalidContent(char* stringMetadataEncoding, int length) { Debug.Assert(stringMetadataEncoding != null); @@ -390,7 +387,6 @@ public void EnumEvents(int mdTypeDef, out MetadataEnumResult result) #region FCalls [MethodImpl(MethodImplOptions.InternalCall)] - [RequiresUnsafe] private static extern unsafe int GetDefaultValue( IntPtr scope, int mdToken, @@ -415,7 +411,6 @@ private static extern unsafe int GetDefaultValue( } [MethodImpl(MethodImplOptions.InternalCall)] - [RequiresUnsafe] private static extern unsafe int GetUserString(IntPtr scope, int mdToken, out char* stringMetadataEncoding, out int length); public unsafe string? GetUserString(int mdToken) @@ -428,7 +423,6 @@ private static extern unsafe int GetDefaultValue( } [MethodImpl(MethodImplOptions.InternalCall)] - [RequiresUnsafe] private static extern unsafe int GetName(IntPtr scope, int mdToken, out byte* name); public unsafe MdUtf8String GetName(int mdToken) @@ -438,7 +432,6 @@ public unsafe MdUtf8String GetName(int mdToken) } [MethodImpl(MethodImplOptions.InternalCall)] - [RequiresUnsafe] private static extern unsafe int GetNamespace(IntPtr scope, int mdToken, out byte* namesp); public unsafe MdUtf8String GetNamespace(int mdToken) @@ -448,10 +441,8 @@ public unsafe MdUtf8String GetNamespace(int mdToken) } [MethodImpl(MethodImplOptions.InternalCall)] - [RequiresUnsafe] private static extern unsafe int GetEventProps(IntPtr scope, int mdToken, out void* name, out int eventAttributes); - [RequiresUnsafe] public unsafe void GetEventProps(int mdToken, out void* name, out EventAttributes eventAttributes) { ThrowBadImageExceptionForHR(GetEventProps(m_metadataImport2, mdToken, out name, out int eventAttributesRaw)); @@ -468,10 +459,8 @@ public void GetFieldDefProps(int mdToken, out FieldAttributes fieldAttributes) } [MethodImpl(MethodImplOptions.InternalCall)] - [RequiresUnsafe] private static extern unsafe int GetPropertyProps(IntPtr scope, int mdToken, out void* name, out int propertyAttributes, out ConstArray signature); - [RequiresUnsafe] public unsafe void GetPropertyProps(int mdToken, out void* name, out PropertyAttributes propertyAttributes, out ConstArray signature) { ThrowBadImageExceptionForHR(GetPropertyProps(m_metadataImport2, mdToken, out name, out int propertyAttributesRaw, out signature)); @@ -614,7 +603,6 @@ public ConstArray GetFieldMarshal(int fieldToken) } [MethodImpl(MethodImplOptions.InternalCall)] - [RequiresUnsafe] private static extern unsafe int GetPInvokeMap(IntPtr scope, int token, out int attributes, diff --git a/src/coreclr/System.Private.CoreLib/src/System/Reflection/Metadata/AssemblyExtensions.cs b/src/coreclr/System.Private.CoreLib/src/System/Reflection/Metadata/AssemblyExtensions.cs index 5d06bcfcf89177..cf47e46a60fcb6 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/Reflection/Metadata/AssemblyExtensions.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/Reflection/Metadata/AssemblyExtensions.cs @@ -10,7 +10,6 @@ namespace System.Reflection.Metadata public static partial class AssemblyExtensions { [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_InternalTryGetRawMetadata")] - [RequiresUnsafe] [return: MarshalAs(UnmanagedType.Bool)] private static unsafe partial bool InternalTryGetRawMetadata(QCallAssembly assembly, ref byte* blob, ref int length); @@ -30,7 +29,6 @@ public static partial class AssemblyExtensions /// The caller is responsible for keeping the assembly object alive while accessing the metadata blob. /// [CLSCompliant(false)] // out byte* blob - [RequiresUnsafe] public static unsafe bool TryGetRawMetadata(this Assembly assembly, out byte* blob, out int length) { ArgumentNullException.ThrowIfNull(assembly); diff --git a/src/coreclr/System.Private.CoreLib/src/System/Reflection/Metadata/MetadataUpdater.cs b/src/coreclr/System.Private.CoreLib/src/System/Reflection/Metadata/MetadataUpdater.cs index 6dc9ced64de36e..f0b6774ac45503 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/Reflection/Metadata/MetadataUpdater.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/Reflection/Metadata/MetadataUpdater.cs @@ -11,7 +11,6 @@ namespace System.Reflection.Metadata public static partial class MetadataUpdater { [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_ApplyUpdate")] - [RequiresUnsafe] private static unsafe partial void ApplyUpdate(QCallAssembly assembly, byte* metadataDelta, int metadataDeltaLength, byte* ilDelta, int ilDeltaLength, byte* pdbDelta, int pdbDeltaLength); [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_IsApplyUpdateSupported")] diff --git a/src/coreclr/System.Private.CoreLib/src/System/Reflection/MethodBaseInvoker.CoreCLR.cs b/src/coreclr/System.Private.CoreLib/src/System/Reflection/MethodBaseInvoker.CoreCLR.cs index 48babc3ebc4a8e..cec67b5e37c193 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/Reflection/MethodBaseInvoker.CoreCLR.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/Reflection/MethodBaseInvoker.CoreCLR.cs @@ -30,11 +30,9 @@ internal unsafe MethodBaseInvoker(DynamicMethod method, Signature signature) : t _invokeFunc_RefArgs = InterpretedInvoke_Method; } - [RequiresUnsafe] private unsafe object? InterpretedInvoke_Constructor(object? obj, IntPtr* args) => RuntimeMethodHandle.InvokeMethod(obj, (void**)args, _signature!, isConstructor: obj is null); - [RequiresUnsafe] private unsafe object? InterpretedInvoke_Method(object? obj, IntPtr* args) => RuntimeMethodHandle.InvokeMethod(obj, (void**)args, _signature!, isConstructor: false); } diff --git a/src/coreclr/System.Private.CoreLib/src/System/Reflection/MethodInvoker.CoreCLR.cs b/src/coreclr/System.Private.CoreLib/src/System/Reflection/MethodInvoker.CoreCLR.cs index ed74df63ac261b..e9dcc90fc1b1f7 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/Reflection/MethodInvoker.CoreCLR.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/Reflection/MethodInvoker.CoreCLR.cs @@ -31,11 +31,9 @@ private unsafe MethodInvoker(RuntimeConstructorInfo constructor) : this(construc _invocationFlags = constructor.ComputeAndUpdateInvocationFlags(); } - [RequiresUnsafe] private unsafe object? InterpretedInvoke_Method(object? obj, IntPtr* args) => RuntimeMethodHandle.InvokeMethod(obj, (void**)args, _signature!, isConstructor: false); - [RequiresUnsafe] private unsafe object? InterpretedInvoke_Constructor(object? obj, IntPtr* args) => RuntimeMethodHandle.InvokeMethod(obj, (void**)args, _signature!, isConstructor: obj is null); } diff --git a/src/coreclr/System.Private.CoreLib/src/System/Reflection/RuntimeAssembly.cs b/src/coreclr/System.Private.CoreLib/src/System/Reflection/RuntimeAssembly.cs index 211da3c50b79c5..48ebce7eb9e4cc 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/Reflection/RuntimeAssembly.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/Reflection/RuntimeAssembly.cs @@ -41,7 +41,6 @@ private sealed class ManifestResourceStream : UnmanagedMemoryStream // ensures the RuntimeAssembly is kept alive for as long as the stream lives private readonly RuntimeAssembly _manifestAssembly; - [RequiresUnsafe] internal unsafe ManifestResourceStream(RuntimeAssembly manifestAssembly, byte* pointer, long length, long capacity, FileAccess access) : base(pointer, length, capacity, access) { _manifestAssembly = manifestAssembly; @@ -268,7 +267,6 @@ public override bool IsCollectible // GetResource will return a pointer to the resources in memory. [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_GetResource", StringMarshalling = StringMarshalling.Utf16)] - [RequiresUnsafe] private static unsafe partial byte* GetResource(QCallAssembly assembly, string resourceName, out uint length); @@ -397,7 +395,6 @@ internal static unsafe RuntimeAssembly InternalLoad(AssemblyName assemblyName, } [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_InternalLoad")] - [RequiresUnsafe] private static unsafe partial void InternalLoad(NativeAssemblyNameParts* pAssemblyNameParts, ObjectHandleOnStack requestingAssembly, StackCrawlMarkHandle stackMark, diff --git a/src/coreclr/System.Private.CoreLib/src/System/Reflection/RuntimeCustomAttributeData.cs b/src/coreclr/System.Private.CoreLib/src/System/Reflection/RuntimeCustomAttributeData.cs index b0a37eb1997d05..06492be84dfd6b 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/Reflection/RuntimeCustomAttributeData.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/Reflection/RuntimeCustomAttributeData.cs @@ -1835,7 +1835,6 @@ internal static object[] CreateAttributeArrayHelper(RuntimeType caType, int elem [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "CustomAttribute_ParseAttributeUsageAttribute")] [SuppressGCTransition] - [RequiresUnsafe] private static partial int ParseAttributeUsageAttribute( IntPtr pData, int cData, diff --git a/src/coreclr/System.Private.CoreLib/src/System/Reflection/TypeNameResolver.CoreCLR.cs b/src/coreclr/System.Private.CoreLib/src/System/Reflection/TypeNameResolver.CoreCLR.cs index 02d99767439b05..fb79062fe8f54b 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/Reflection/TypeNameResolver.CoreCLR.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/Reflection/TypeNameResolver.CoreCLR.cs @@ -131,7 +131,6 @@ internal static RuntimeType GetTypeReferencedByCustomAttribute(string typeName, } [UnmanagedCallersOnly] - [RequiresUnsafe] private static unsafe void GetTypeHelper(char* pTypeName, RuntimeAssembly* pRequestingAssembly, bool throwOnError, bool requireAssemblyQualifiedName, IntPtr unsafeAccessorMethod, RuntimeType* pResult, Exception* pException) { try diff --git a/src/coreclr/System.Private.CoreLib/src/System/Runtime/CompilerServices/AsyncHelpers.CoreCLR.cs b/src/coreclr/System.Private.CoreLib/src/System/Runtime/CompilerServices/AsyncHelpers.CoreCLR.cs index 3b6c123504e869..bb068f1290c0f8 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/Runtime/CompilerServices/AsyncHelpers.CoreCLR.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/Runtime/CompilerServices/AsyncHelpers.CoreCLR.cs @@ -289,15 +289,12 @@ public void Pop() #if !NATIVEAOT [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "AsyncHelpers_AddContinuationToExInternal")] - [RequiresUnsafe] private static unsafe partial void AddContinuationToExInternal(void* diagnosticIP, ObjectHandleOnStack ex); - [RequiresUnsafe] internal static unsafe void AddContinuationToExInternal(void* diagnosticIP, Exception e) => AddContinuationToExInternal(diagnosticIP, ObjectHandleOnStack.Create(ref e)); #endif - [RequiresUnsafe] private static unsafe Continuation AllocContinuation(Continuation prevContinuation, MethodTable* contMT) { #if NATIVEAOT @@ -310,7 +307,6 @@ private static unsafe Continuation AllocContinuation(Continuation prevContinuati } #if !NATIVEAOT - [RequiresUnsafe] private static unsafe Continuation AllocContinuationMethod(Continuation prevContinuation, MethodTable* contMT, int keepAliveOffset, MethodDesc* method) { LoaderAllocator loaderAllocator = RuntimeMethodHandle.GetLoaderAllocator(new RuntimeMethodHandleInternal((IntPtr)method)); @@ -320,7 +316,6 @@ private static unsafe Continuation AllocContinuationMethod(Continuation prevCont return newContinuation; } - [RequiresUnsafe] private static unsafe Continuation AllocContinuationClass(Continuation prevContinuation, MethodTable* contMT, int keepAliveOffset, MethodTable* methodTable) { IntPtr loaderAllocatorHandle = methodTable->GetLoaderAllocatorHandle(); diff --git a/src/coreclr/System.Private.CoreLib/src/System/Runtime/CompilerServices/CastHelpers.cs b/src/coreclr/System.Private.CoreLib/src/System/Runtime/CompilerServices/CastHelpers.cs index cdcd1891cd3cb8..3723dccb9b3211 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/Runtime/CompilerServices/CastHelpers.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/Runtime/CompilerServices/CastHelpers.cs @@ -15,11 +15,9 @@ internal static unsafe partial class CastHelpers internal static int[]? s_table; [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "ThrowInvalidCastException")] - [RequiresUnsafe] private static partial void ThrowInvalidCastExceptionInternal(void* fromTypeHnd, void* toTypeHnd); [DoesNotReturn] - [RequiresUnsafe] internal static void ThrowInvalidCastException(void* fromTypeHnd, void* toTypeHnd) { ThrowInvalidCastExceptionInternal(fromTypeHnd, toTypeHnd); @@ -27,7 +25,6 @@ internal static void ThrowInvalidCastException(void* fromTypeHnd, void* toTypeHn } [DoesNotReturn] - [RequiresUnsafe] internal static void ThrowInvalidCastException(object fromType, void* toTypeHnd) { ThrowInvalidCastExceptionInternal(RuntimeHelpers.GetMethodTable(fromType), toTypeHnd); @@ -36,12 +33,10 @@ internal static void ThrowInvalidCastException(object fromType, void* toTypeHnd) } [LibraryImport(RuntimeHelpers.QCall)] - [RequiresUnsafe] [return: MarshalAs(UnmanagedType.Bool)] private static partial bool IsInstanceOf_NoCacheLookup(void *toTypeHnd, [MarshalAs(UnmanagedType.Bool)] bool throwCastException, ObjectHandleOnStack obj); [MethodImpl(MethodImplOptions.NoInlining)] - [RequiresUnsafe] private static object? IsInstanceOfAny_NoCacheLookup(void* toTypeHnd, object obj) { if (IsInstanceOf_NoCacheLookup(toTypeHnd, false, ObjectHandleOnStack.Create(ref obj))) @@ -52,7 +47,6 @@ internal static void ThrowInvalidCastException(object fromType, void* toTypeHnd) } [MethodImpl(MethodImplOptions.NoInlining)] - [RequiresUnsafe] private static object ChkCastAny_NoCacheLookup(void* toTypeHnd, object obj) { IsInstanceOf_NoCacheLookup(toTypeHnd, true, ObjectHandleOnStack.Create(ref obj)); @@ -63,7 +57,6 @@ private static object ChkCastAny_NoCacheLookup(void* toTypeHnd, object obj) // Unlike the IsInstanceOfInterface and IsInstanceOfClass functions, // this test must deal with all kinds of type tests [DebuggerHidden] - [RequiresUnsafe] internal static object? IsInstanceOfAny(void* toTypeHnd, object? obj) { if (obj != null) @@ -95,7 +88,6 @@ private static object ChkCastAny_NoCacheLookup(void* toTypeHnd, object obj) } [DebuggerHidden] - [RequiresUnsafe] private static object? IsInstanceOfInterface(void* toTypeHnd, object? obj) { const int unrollSize = 4; @@ -165,7 +157,6 @@ private static object ChkCastAny_NoCacheLookup(void* toTypeHnd, object obj) } [DebuggerHidden] - [RequiresUnsafe] private static object? IsInstanceOfClass(void* toTypeHnd, object? obj) { if (obj == null || RuntimeHelpers.GetMethodTable(obj) == toTypeHnd) @@ -217,7 +208,6 @@ private static object ChkCastAny_NoCacheLookup(void* toTypeHnd, object obj) [DebuggerHidden] [MethodImpl(MethodImplOptions.NoInlining)] - [RequiresUnsafe] private static object? IsInstance_Helper(void* toTypeHnd, object obj) { CastResult result = CastCache.TryGet(s_table!, (nuint)RuntimeHelpers.GetMethodTable(obj), (nuint)toTypeHnd); @@ -238,7 +228,6 @@ private static object ChkCastAny_NoCacheLookup(void* toTypeHnd, object obj) // Unlike the ChkCastInterface and ChkCastClass functions, // this test must deal with all kinds of type tests [DebuggerHidden] - [RequiresUnsafe] internal static object? ChkCastAny(void* toTypeHnd, object? obj) { CastResult result; @@ -268,7 +257,6 @@ private static object ChkCastAny_NoCacheLookup(void* toTypeHnd, object obj) [DebuggerHidden] [MethodImpl(MethodImplOptions.NoInlining)] - [RequiresUnsafe] private static object? ChkCast_Helper(void* toTypeHnd, object obj) { CastResult result = CastCache.TryGet(s_table!, (nuint)RuntimeHelpers.GetMethodTable(obj), (nuint)toTypeHnd); @@ -282,7 +270,6 @@ private static object ChkCastAny_NoCacheLookup(void* toTypeHnd, object obj) } [DebuggerHidden] - [RequiresUnsafe] private static object? ChkCastInterface(void* toTypeHnd, object? obj) { const int unrollSize = 4; @@ -349,7 +336,6 @@ private static object ChkCastAny_NoCacheLookup(void* toTypeHnd, object obj) } [DebuggerHidden] - [RequiresUnsafe] private static object? ChkCastClass(void* toTypeHnd, object? obj) { if (obj == null || RuntimeHelpers.GetMethodTable(obj) == toTypeHnd) @@ -363,7 +349,6 @@ private static object ChkCastAny_NoCacheLookup(void* toTypeHnd, object obj) // Optimized helper for classes. Assumes that the trivial cases // has been taken care of by the inlined check [DebuggerHidden] - [RequiresUnsafe] private static object? ChkCastClassSpecial(void* toTypeHnd, object obj) { MethodTable* mt = RuntimeHelpers.GetMethodTable(obj); @@ -410,7 +395,6 @@ private static object ChkCastAny_NoCacheLookup(void* toTypeHnd, object obj) } [DebuggerHidden] - [RequiresUnsafe] private static ref byte Unbox(MethodTable* toTypeHnd, object obj) { // This will throw NullReferenceException if obj is null. @@ -433,7 +417,6 @@ private static void ThrowArrayMismatchException() } [DebuggerHidden] - [RequiresUnsafe] private static ref object? LdelemaRef(object?[] array, nint index, void* type) { // This will throw NullReferenceException if array is null. @@ -484,7 +467,6 @@ private static void StelemRef(object?[] array, nint index, object? obj) [DebuggerHidden] [MethodImpl(MethodImplOptions.NoInlining)] - [RequiresUnsafe] private static void StelemRef_Helper(ref object? element, void* elementType, object obj) { CastResult result = CastCache.TryGet(s_table!, (nuint)RuntimeHelpers.GetMethodTable(obj), (nuint)elementType); @@ -498,7 +480,6 @@ private static void StelemRef_Helper(ref object? element, void* elementType, obj } [DebuggerHidden] - [RequiresUnsafe] private static void StelemRef_Helper_NoCacheLookup(ref object? element, void* elementType, object obj) { Debug.Assert(obj != null); @@ -531,7 +512,6 @@ private static void ArrayTypeCheck(object obj, Array array) [DebuggerHidden] [MethodImpl(MethodImplOptions.NoInlining)] - [RequiresUnsafe] private static void ArrayTypeCheck_Helper(object obj, void* elementType) { Debug.Assert(obj != null); @@ -544,7 +524,6 @@ private static void ArrayTypeCheck_Helper(object obj, void* elementType) // Helpers for boxing [DebuggerHidden] - [RequiresUnsafe] internal static object? Box_Nullable(MethodTable* srcMT, ref byte nullableData) { Debug.Assert(srcMT->IsNullable); @@ -561,7 +540,6 @@ private static void ArrayTypeCheck_Helper(object obj, void* elementType) } [DebuggerHidden] - [RequiresUnsafe] internal static object Box(MethodTable* typeMT, ref byte unboxedData) { Debug.Assert(typeMT != null); @@ -605,7 +583,6 @@ private static bool AreTypesEquivalent(MethodTable* pMTa, MethodTable* pMTb) [DebuggerHidden] [MethodImpl(MethodImplOptions.AggressiveInlining)] - [RequiresUnsafe] internal static bool IsNullableForType(MethodTable* typeMT, MethodTable* boxedMT) { if (!typeMT->IsNullable) @@ -634,7 +611,6 @@ internal static bool IsNullableForType(MethodTable* typeMT, MethodTable* boxedMT [DebuggerHidden] [MethodImpl(MethodImplOptions.NoInlining)] - [RequiresUnsafe] private static void Unbox_Nullable_NotIsNullableForType(ref byte destPtr, MethodTable* typeMT, object obj) { // Also allow true nullables to be unboxed normally. @@ -647,7 +623,6 @@ private static void Unbox_Nullable_NotIsNullableForType(ref byte destPtr, Method } [DebuggerHidden] - [RequiresUnsafe] internal static void Unbox_Nullable(ref byte destPtr, MethodTable* typeMT, object? obj) { if (obj == null) @@ -682,7 +657,6 @@ internal static void Unbox_Nullable(ref byte destPtr, MethodTable* typeMT, objec } [DebuggerHidden] - [RequiresUnsafe] internal static object? ReboxFromNullable(MethodTable* srcMT, object src) { ref byte nullableData = ref src.GetRawData(); @@ -691,7 +665,6 @@ internal static void Unbox_Nullable(ref byte destPtr, MethodTable* typeMT, objec [DebuggerHidden] [MethodImpl(MethodImplOptions.NoInlining)] - [RequiresUnsafe] private static ref byte Unbox_Helper(MethodTable* pMT1, object obj) { // must be a value type @@ -713,7 +686,6 @@ private static ref byte Unbox_Helper(MethodTable* pMT1, object obj) [DebuggerHidden] [MethodImpl(MethodImplOptions.NoInlining)] - [RequiresUnsafe] private static void Unbox_TypeTest_Helper(MethodTable *pMT1, MethodTable *pMT2) { if ((!pMT1->IsPrimitive || !pMT2->IsPrimitive || @@ -728,7 +700,6 @@ private static void Unbox_TypeTest_Helper(MethodTable *pMT1, MethodTable *pMT2) } [DebuggerHidden] - [RequiresUnsafe] private static void Unbox_TypeTest(MethodTable *pMT1, MethodTable *pMT2) { if (pMT1 == pMT2) diff --git a/src/coreclr/System.Private.CoreLib/src/System/Runtime/CompilerServices/GenericsHelpers.cs b/src/coreclr/System.Private.CoreLib/src/System/Runtime/CompilerServices/GenericsHelpers.cs index 196cd56be5130f..da1a4dec2bf57c 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/Runtime/CompilerServices/GenericsHelpers.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/Runtime/CompilerServices/GenericsHelpers.cs @@ -29,7 +29,6 @@ public static IntPtr Method(IntPtr methodHnd, IntPtr signature) } [DebuggerHidden] - [RequiresUnsafe] public static IntPtr MethodWithSlotAndModule(IntPtr methodHnd, GenericHandleArgs * pArgs) { return GenericHandleWorker(methodHnd, IntPtr.Zero, pArgs->signature, pArgs->dictionaryIndexAndSlot, pArgs->module); @@ -42,7 +41,6 @@ public static IntPtr Class(IntPtr classHnd, IntPtr signature) } [DebuggerHidden] - [RequiresUnsafe] public static IntPtr ClassWithSlotAndModule(IntPtr classHnd, GenericHandleArgs * pArgs) { return GenericHandleWorker(IntPtr.Zero, classHnd, pArgs->signature, pArgs->dictionaryIndexAndSlot, pArgs->module); diff --git a/src/coreclr/System.Private.CoreLib/src/System/Runtime/CompilerServices/InitHelpers.cs b/src/coreclr/System.Private.CoreLib/src/System/Runtime/CompilerServices/InitHelpers.cs index f320ba057f0065..bf2794b5c5ed99 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/Runtime/CompilerServices/InitHelpers.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/Runtime/CompilerServices/InitHelpers.cs @@ -12,19 +12,16 @@ namespace System.Runtime.CompilerServices internal static unsafe partial class InitHelpers { [LibraryImport(RuntimeHelpers.QCall)] - [RequiresUnsafe] private static partial void InitClassHelper(MethodTable* mt); [DebuggerHidden] [MethodImpl(MethodImplOptions.NoInlining)] - [RequiresUnsafe] internal static void InitClassSlow(MethodTable* mt) { InitClassHelper(mt); } [DebuggerHidden] - [RequiresUnsafe] private static void InitClass(MethodTable* mt) { if (mt->AuxiliaryData->IsClassInited) @@ -34,7 +31,6 @@ private static void InitClass(MethodTable* mt) } [DebuggerHidden] - [RequiresUnsafe] private static void InitInstantiatedClass(MethodTable* mt, MethodDesc* methodDesc) { MethodTable *pTemplateMT = methodDesc->MethodTable; diff --git a/src/coreclr/System.Private.CoreLib/src/System/Runtime/CompilerServices/RuntimeHelpers.CoreCLR.cs b/src/coreclr/System.Private.CoreLib/src/System/Runtime/CompilerServices/RuntimeHelpers.CoreCLR.cs index 7d30dc1b187a82..935ae133272fe7 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/Runtime/CompilerServices/RuntimeHelpers.CoreCLR.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/Runtime/CompilerServices/RuntimeHelpers.CoreCLR.cs @@ -198,7 +198,6 @@ public static void RunModuleConstructor(ModuleHandle module) internal static partial void CompileMethod(RuntimeMethodHandleInternal method); [LibraryImport(QCall, EntryPoint = "ReflectionInvocation_PrepareMethod")] - [RequiresUnsafe] private static unsafe partial void PrepareMethod(RuntimeMethodHandleInternal method, IntPtr* pInstantiation, int cInstantiation); public static void PrepareMethod(RuntimeMethodHandle method) => PrepareMethod(method, null); @@ -449,7 +448,6 @@ internal static unsafe bool ObjectHasComponentSize(object obj) /// A reference to the data to box. /// A boxed instance of the value at . /// This method includes proper handling for nullable value types as well. - [RequiresUnsafe] internal static unsafe object? Box(MethodTable* methodTable, ref byte data) => methodTable->IsNullable ? CastHelpers.Box_Nullable(methodTable, ref data) : CastHelpers.Box(methodTable, ref data); @@ -465,11 +463,9 @@ internal static unsafe bool ObjectHasComponentSize(object obj) // GC.KeepAlive(o); // [Intrinsic] - [RequiresUnsafe] internal static unsafe MethodTable* GetMethodTable(object obj) => GetMethodTable(obj); [LibraryImport(QCall, EntryPoint = "MethodTable_AreTypesEquivalent")] - [RequiresUnsafe] [return: MarshalAs(UnmanagedType.Bool)] internal static unsafe partial bool AreTypesEquivalent(MethodTable* pMTa, MethodTable* pMTb); @@ -524,11 +520,9 @@ public static IntPtr AllocateTypeAssociatedMemory(Type type, int size, int align private static partial IntPtr AllocateTypeAssociatedMemoryAligned(QCallTypeHandle type, uint size, uint alignment); [MethodImpl(MethodImplOptions.InternalCall)] - [RequiresUnsafe] private static extern unsafe TailCallArgBuffer* GetTailCallArgBuffer(); [LibraryImport(QCall, EntryPoint = "TailCallHelp_AllocTailCallArgBufferInternal")] - [RequiresUnsafe] private static unsafe partial TailCallArgBuffer* AllocTailCallArgBufferInternal(int size); private const int TAILCALLARGBUFFER_ACTIVE = 0; @@ -536,7 +530,6 @@ public static IntPtr AllocateTypeAssociatedMemory(Type type, int size, int align private const int TAILCALLARGBUFFER_INACTIVE = 2; [MethodImpl(MethodImplOptions.AggressiveInlining)] // To allow unrolling of Span.Clear - [RequiresUnsafe] private static unsafe TailCallArgBuffer* AllocTailCallArgBuffer(int size, IntPtr gcDesc) { TailCallArgBuffer* buffer = GetTailCallArgBuffer(); @@ -566,11 +559,9 @@ public static IntPtr AllocateTypeAssociatedMemory(Type type, int size, int align } [MethodImpl(MethodImplOptions.InternalCall)] - [RequiresUnsafe] private static extern unsafe TailCallTls* GetTailCallInfo(IntPtr retAddrSlot, IntPtr* retAddr); [StackTraceHidden] - [RequiresUnsafe] private static unsafe void DispatchTailCalls( IntPtr callersRetAddrSlot, delegate* callTarget, @@ -653,7 +644,6 @@ public static int SizeOf(RuntimeTypeHandle type) } [UnmanagedCallersOnly] - [RequiresUnsafe] internal static unsafe void CallToString(object* pObj, string* pResult, Exception* pException) { try @@ -725,10 +715,8 @@ internal unsafe struct MethodDesc [MethodImpl(MethodImplOptions.AggressiveInlining)] [DebuggerHidden] [DebuggerStepThrough] - [RequiresUnsafe] private MethodDescChunk* GetMethodDescChunk() => (MethodDescChunk*)(((byte*)Unsafe.AsPointer(ref this)) - (sizeof(MethodDescChunk) + ChunkIndex * sizeof(IntPtr))); - [RequiresUnsafe] public MethodTable* MethodTable => GetMethodDescChunk()->MethodTable; } @@ -920,7 +908,6 @@ internal unsafe struct MethodTable public bool IsCollectible => (Flags & enum_flag_Collectible) != 0; - [RequiresUnsafe] internal static bool AreSameType(MethodTable* mt1, MethodTable* mt2) => mt1 == mt2; public bool HasDefaultConstructor => (Flags & (enum_flag_HasComponentSize | enum_flag_HasDefaultCtor)) == enum_flag_HasDefaultCtor; @@ -1024,11 +1011,9 @@ public TypeHandle GetArrayElementTypeHandle() /// Get the MethodTable in the type hierarchy of this MethodTable that has the same TypeDef/Module as parent. /// [MethodImpl(MethodImplOptions.InternalCall)] - [RequiresUnsafe] public extern MethodTable* GetMethodTableMatchingParentClass(MethodTable* parent); [MethodImpl(MethodImplOptions.InternalCall)] - [RequiresUnsafe] public extern MethodTable* InstantiationArg0(); [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -1212,7 +1197,6 @@ internal readonly unsafe partial struct TypeHandle private readonly void* m_asTAddr; [MethodImpl(MethodImplOptions.AggressiveInlining)] - [RequiresUnsafe] public TypeHandle(void* tAddr) { m_asTAddr = tAddr; @@ -1238,7 +1222,6 @@ public bool IsTypeDesc /// /// This is only safe to call if returned . [MethodImpl(MethodImplOptions.AggressiveInlining)] - [RequiresUnsafe] public MethodTable* AsMethodTable() { Debug.Assert(!IsTypeDesc); @@ -1251,7 +1234,6 @@ public bool IsTypeDesc /// /// This is only safe to call if returned . [MethodImpl(MethodImplOptions.AggressiveInlining)] - [RequiresUnsafe] public TypeDesc* AsTypeDesc() { Debug.Assert(IsTypeDesc); @@ -1324,12 +1306,10 @@ private static bool CanCastToWorker(TypeHandle srcTH, TypeHandle destTH, bool nu } [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "TypeHandle_CanCastTo_NoCacheLookup")] - [RequiresUnsafe] private static partial Interop.BOOL CanCastTo_NoCacheLookup(void* fromTypeHnd, void* toTypeHnd); [SuppressGCTransition] [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "TypeHandle_GetCorElementType")] - [RequiresUnsafe] private static partial int GetCorElementType(void* typeHnd); } diff --git a/src/coreclr/System.Private.CoreLib/src/System/Runtime/CompilerServices/StaticsHelpers.cs b/src/coreclr/System.Private.CoreLib/src/System/Runtime/CompilerServices/StaticsHelpers.cs index eedcb4476a7df7..1504418b3b4321 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/Runtime/CompilerServices/StaticsHelpers.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/Runtime/CompilerServices/StaticsHelpers.cs @@ -15,7 +15,6 @@ internal static unsafe partial class StaticsHelpers private static partial void GetThreadStaticsByIndex(ByteRefOnStack result, int index, [MarshalAs(UnmanagedType.Bool)] bool gcStatics); [LibraryImport(RuntimeHelpers.QCall)] - [RequiresUnsafe] private static partial void GetThreadStaticsByMethodTable(ByteRefOnStack result, MethodTable* pMT, [MarshalAs(UnmanagedType.Bool)] bool gcStatics); [Intrinsic] @@ -23,7 +22,6 @@ internal static unsafe partial class StaticsHelpers [DebuggerHidden] [MethodImpl(MethodImplOptions.NoInlining)] - [RequiresUnsafe] private static ref byte GetNonGCStaticBaseSlow(MethodTable* mt) { InitHelpers.InitClassSlow(mt); @@ -31,7 +29,6 @@ private static ref byte GetNonGCStaticBaseSlow(MethodTable* mt) } [DebuggerHidden] - [RequiresUnsafe] private static ref byte GetNonGCStaticBase(MethodTable* mt) { ref byte nonGCStaticBase = ref VolatileReadAsByref(ref mt->AuxiliaryData->GetDynamicStaticsInfo()._pNonGCStatics); @@ -43,7 +40,6 @@ private static ref byte GetNonGCStaticBase(MethodTable* mt) } [DebuggerHidden] - [RequiresUnsafe] private static ref byte GetDynamicNonGCStaticBase(DynamicStaticsInfo* dynamicStaticsInfo) { ref byte nonGCStaticBase = ref VolatileReadAsByref(ref dynamicStaticsInfo->_pNonGCStatics); @@ -56,7 +52,6 @@ private static ref byte GetDynamicNonGCStaticBase(DynamicStaticsInfo* dynamicSta [DebuggerHidden] [MethodImpl(MethodImplOptions.NoInlining)] - [RequiresUnsafe] private static ref byte GetGCStaticBaseSlow(MethodTable* mt) { InitHelpers.InitClassSlow(mt); @@ -64,7 +59,6 @@ private static ref byte GetGCStaticBaseSlow(MethodTable* mt) } [DebuggerHidden] - [RequiresUnsafe] private static ref byte GetGCStaticBase(MethodTable* mt) { ref byte gcStaticBase = ref VolatileReadAsByref(ref mt->AuxiliaryData->GetDynamicStaticsInfo()._pGCStatics); @@ -76,7 +70,6 @@ private static ref byte GetGCStaticBase(MethodTable* mt) } [DebuggerHidden] - [RequiresUnsafe] private static ref byte GetDynamicGCStaticBase(DynamicStaticsInfo* dynamicStaticsInfo) { ref byte gcStaticBase = ref VolatileReadAsByref(ref dynamicStaticsInfo->_pGCStatics); @@ -162,7 +155,6 @@ private static ref byte GetGCThreadStaticsByIndexSlow(int index) [DebuggerHidden] [MethodImpl(MethodImplOptions.NoInlining)] - [RequiresUnsafe] private static ref byte GetNonGCThreadStaticBaseSlow(MethodTable* mt) { ByteRef result = default; @@ -172,7 +164,6 @@ private static ref byte GetNonGCThreadStaticBaseSlow(MethodTable* mt) [DebuggerHidden] [MethodImpl(MethodImplOptions.NoInlining)] - [RequiresUnsafe] private static ref byte GetGCThreadStaticBaseSlow(MethodTable* mt) { ByteRef result = default; @@ -228,7 +219,6 @@ private static ref byte GetThreadLocalStaticBaseByIndex(int index, bool gcStatic } [DebuggerHidden] - [RequiresUnsafe] private static ref byte GetNonGCThreadStaticBase(MethodTable* mt) { int index = mt->AuxiliaryData->GetThreadStaticsInfo()._nonGCTlsIndex; @@ -239,7 +229,6 @@ private static ref byte GetNonGCThreadStaticBase(MethodTable* mt) } [DebuggerHidden] - [RequiresUnsafe] private static ref byte GetGCThreadStaticBase(MethodTable* mt) { int index = mt->AuxiliaryData->GetThreadStaticsInfo()._gcTlsIndex; @@ -250,7 +239,6 @@ private static ref byte GetGCThreadStaticBase(MethodTable* mt) } [DebuggerHidden] - [RequiresUnsafe] private static ref byte GetDynamicNonGCThreadStaticBase(ThreadStaticsInfo* threadStaticsInfo) { int index = threadStaticsInfo->_nonGCTlsIndex; @@ -261,7 +249,6 @@ private static ref byte GetDynamicNonGCThreadStaticBase(ThreadStaticsInfo* threa } [DebuggerHidden] - [RequiresUnsafe] private static ref byte GetDynamicGCThreadStaticBase(ThreadStaticsInfo* threadStaticsInfo) { int index = threadStaticsInfo->_gcTlsIndex; @@ -292,14 +279,12 @@ private struct StaticFieldAddressArgs } [DebuggerHidden] - [RequiresUnsafe] private static unsafe ref byte StaticFieldAddress_Dynamic(StaticFieldAddressArgs* pArgs) { return ref Unsafe.Add(ref pArgs->staticBaseHelper(pArgs->arg0), pArgs->offset); } [DebuggerHidden] - [RequiresUnsafe] private static unsafe ref byte StaticFieldAddressUnbox_Dynamic(StaticFieldAddressArgs* pArgs) { object boxedObject = Unsafe.As(ref Unsafe.Add(ref pArgs->staticBaseHelper(pArgs->arg0), pArgs->offset)); diff --git a/src/coreclr/System.Private.CoreLib/src/System/Runtime/ExceptionServices/InternalCalls.cs b/src/coreclr/System.Private.CoreLib/src/System/Runtime/ExceptionServices/InternalCalls.cs index c862fc7d6505ef..927deea6d0babb 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/Runtime/ExceptionServices/InternalCalls.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/Runtime/ExceptionServices/InternalCalls.cs @@ -16,38 +16,32 @@ internal static partial class InternalCalls { [StackTraceHidden] [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "SfiInit")] - [RequiresUnsafe] [return: MarshalAs(UnmanagedType.U1)] internal static unsafe partial bool RhpSfiInit(ref StackFrameIterator pThis, void* pStackwalkCtx, [MarshalAs(UnmanagedType.U1)] bool instructionFault, bool* fIsExceptionIntercepted); [StackTraceHidden] [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "SfiNext")] - [RequiresUnsafe] [return: MarshalAs(UnmanagedType.U1)] internal static unsafe partial bool RhpSfiNext(ref StackFrameIterator pThis, uint* uExCollideClauseIdx, bool* fUnwoundReversePInvoke, bool* fIsExceptionIntercepted); [StackTraceHidden] [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "CallFilterFunclet")] - [RequiresUnsafe] [return: MarshalAs(UnmanagedType.U1)] internal static unsafe partial bool RhpCallFilterFunclet( ObjectHandleOnStack exceptionObj, byte* pFilterIP, void* pvRegDisplay); [StackTraceHidden] [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "AppendExceptionStackFrame")] - [RequiresUnsafe] internal static unsafe partial void RhpAppendExceptionStackFrame(ObjectHandleOnStack exceptionObj, IntPtr ip, UIntPtr sp, int flags, EH.ExInfo* exInfo); [StackTraceHidden] [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "EHEnumInitFromStackFrameIterator")] [SuppressGCTransition] - [RequiresUnsafe] [return: MarshalAs(UnmanagedType.U1)] internal static unsafe partial bool RhpEHEnumInitFromStackFrameIterator(ref StackFrameIterator pFrameIter, out EH.MethodRegionInfo pMethodRegionInfo, void* pEHEnum); [StackTraceHidden] [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "EHEnumNext")] - [RequiresUnsafe] [return: MarshalAs(UnmanagedType.U1)] internal static unsafe partial bool RhpEHEnumNext(void* pEHEnum, void* pEHClause); } diff --git a/src/coreclr/System.Private.CoreLib/src/System/Runtime/InteropServices/ComWrappers.CoreCLR.cs b/src/coreclr/System.Private.CoreLib/src/System/Runtime/InteropServices/ComWrappers.CoreCLR.cs index 9fb2717ff094cf..23dea958040b58 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/Runtime/InteropServices/ComWrappers.CoreCLR.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/Runtime/InteropServices/ComWrappers.CoreCLR.cs @@ -27,7 +27,6 @@ public static void GetIUnknownImpl(out IntPtr fpQueryInterface, out IntPtr fpAdd [SuppressGCTransition] private static partial void GetIUnknownImplInternal(out IntPtr fpQueryInterface, out IntPtr fpAddRef, out IntPtr fpRelease); - [RequiresUnsafe] internal static unsafe void GetUntrackedIUnknownImpl(out delegate* unmanaged[MemberFunction] fpAddRef, out delegate* unmanaged[MemberFunction] fpRelease) { fpAddRef = fpRelease = GetUntrackedAddRefRelease(); @@ -35,7 +34,6 @@ internal static unsafe void GetUntrackedIUnknownImpl(out delegate* unmanaged[Mem [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "ComWrappers_GetUntrackedAddRefRelease")] [SuppressGCTransition] - [RequiresUnsafe] private static unsafe partial delegate* unmanaged[MemberFunction] GetUntrackedAddRefRelease(); internal static IntPtr DefaultIUnknownVftblPtr { get; } = CreateDefaultIUnknownVftbl(); @@ -69,7 +67,6 @@ internal static int CallICustomQueryInterface(ManagedObjectWrapperHolder holder, } [UnmanagedCallersOnly] - [RequiresUnsafe] private static unsafe int CallICustomQueryInterface(ManagedObjectWrapperHolder* pHolder, Guid* pIid, IntPtr* ppObject, Exception* pException) { try @@ -103,7 +100,6 @@ internal static IntPtr GetOrCreateComInterfaceForObjectWithGlobalMarshallingInst } [UnmanagedCallersOnly] - [RequiresUnsafe] private static unsafe void GetOrCreateComInterfaceForObjectWithGlobalMarshallingInstance(object* pObj, IntPtr* pResult, Exception* pException) { try @@ -136,7 +132,6 @@ private static unsafe void GetOrCreateComInterfaceForObjectWithGlobalMarshalling } [UnmanagedCallersOnly] - [RequiresUnsafe] private static unsafe void GetOrCreateObjectForComInstanceWithGlobalMarshallingInstance(IntPtr comObject, int flags, object* pResult, Exception* pException) { try diff --git a/src/coreclr/System.Private.CoreLib/src/System/Runtime/InteropServices/CustomMarshalers/EnumeratorToEnumVariantMarshaler.cs b/src/coreclr/System.Private.CoreLib/src/System/Runtime/InteropServices/CustomMarshalers/EnumeratorToEnumVariantMarshaler.cs index dfef80658e0b61..c008f6d4cbbf4c 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/Runtime/InteropServices/CustomMarshalers/EnumeratorToEnumVariantMarshaler.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/Runtime/InteropServices/CustomMarshalers/EnumeratorToEnumVariantMarshaler.cs @@ -49,7 +49,6 @@ public IntPtr MarshalManagedToNative(object ManagedObj) } [System.Runtime.InteropServices.UnmanagedCallersOnly] - [RequiresUnsafe] private static unsafe void InternalMarshalNativeToManaged(IntPtr pNativeData, object* pResult, Exception* pException) { try diff --git a/src/coreclr/System.Private.CoreLib/src/System/Runtime/InteropServices/DynamicInterfaceCastableHelpers.cs b/src/coreclr/System.Private.CoreLib/src/System/Runtime/InteropServices/DynamicInterfaceCastableHelpers.cs index 613767c1c6c9b5..973fb88d8f815f 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/Runtime/InteropServices/DynamicInterfaceCastableHelpers.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/Runtime/InteropServices/DynamicInterfaceCastableHelpers.cs @@ -24,7 +24,6 @@ internal static bool IsInterfaceImplemented(IDynamicInterfaceCastable castable, } [UnmanagedCallersOnly] - [RequiresUnsafe] private static unsafe void IsInterfaceImplemented(IDynamicInterfaceCastable* pCastable, RuntimeType* pInterfaceType, bool throwIfNotImplemented, bool* pResult, Exception* pException) { try @@ -58,7 +57,6 @@ private static unsafe void IsInterfaceImplemented(IDynamicInterfaceCastable* pCa } [UnmanagedCallersOnly] - [RequiresUnsafe] private static unsafe void GetInterfaceImplementation(IDynamicInterfaceCastable* pCastable, RuntimeType* pInterfaceType, RuntimeType* pResult, Exception* pException) { try diff --git a/src/coreclr/System.Private.CoreLib/src/System/Runtime/InteropServices/IDispatchHelpers.cs b/src/coreclr/System.Private.CoreLib/src/System/Runtime/InteropServices/IDispatchHelpers.cs index 713996d43f9d94..bcdb9484e8b6e2 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/Runtime/InteropServices/IDispatchHelpers.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/Runtime/InteropServices/IDispatchHelpers.cs @@ -13,7 +13,6 @@ internal static class IDispatchHelpers private const int DispatchExPropertyCanWrite = 2; [UnmanagedCallersOnly] - [RequiresUnsafe] private static unsafe int GetDispatchExPropertyFlags(PropertyInfo* pMemberInfo, Exception* pException) { try @@ -40,7 +39,6 @@ private static unsafe int GetDispatchExPropertyFlags(PropertyInfo* pMemberInfo, } [UnmanagedCallersOnly] - [RequiresUnsafe] private static unsafe void GetDispatchParameterInfoName(ParameterInfo* pParameterInfo, string* pResult, Exception* pException) { try @@ -54,7 +52,6 @@ private static unsafe void GetDispatchParameterInfoName(ParameterInfo* pParamete } [UnmanagedCallersOnly] - [RequiresUnsafe] private static unsafe void GetDispatchMemberInfoName(MemberInfo* pMemberInfo, string* pResult, Exception* pException) { try @@ -68,7 +65,6 @@ private static unsafe void GetDispatchMemberInfoName(MemberInfo* pMemberInfo, st } [UnmanagedCallersOnly] - [RequiresUnsafe] private static unsafe int GetDispatchMemberInfoType(MemberInfo* pMemberInfo, Exception* pException) { try @@ -83,7 +79,6 @@ private static unsafe int GetDispatchMemberInfoType(MemberInfo* pMemberInfo, Exc } [UnmanagedCallersOnly] - [RequiresUnsafe] private static unsafe void HasDispatchCustomAttribute(MemberInfo* pMemberInfo, Type* pAttributeType, bool* pResult, Exception* pException) { try @@ -97,7 +92,6 @@ private static unsafe void HasDispatchCustomAttribute(MemberInfo* pMemberInfo, T } [UnmanagedCallersOnly] - [RequiresUnsafe] private static unsafe void GetDispatchMemberParameters(MemberInfo* pMemberInfo, ParameterInfo[]* pResult, Exception* pException) { try @@ -118,7 +112,6 @@ private static unsafe void GetDispatchMemberParameters(MemberInfo* pMemberInfo, } [UnmanagedCallersOnly] - [RequiresUnsafe] private static unsafe void GetDispatchPropertyTokenAndModule(PropertyInfo* pPropertyInfo, int* pToken, RuntimeModule* pModule, Exception* pException) { try @@ -133,7 +126,6 @@ private static unsafe void GetDispatchPropertyTokenAndModule(PropertyInfo* pProp } [UnmanagedCallersOnly] - [RequiresUnsafe] private static unsafe void GetDispatchPropertyAccessor(PropertyInfo* pPropertyInfo, bool getter, bool nonPublic, IntPtr* pResult, Exception* pException) { try @@ -148,7 +140,6 @@ private static unsafe void GetDispatchPropertyAccessor(PropertyInfo* pPropertyIn } [UnmanagedCallersOnly] - [RequiresUnsafe] private static unsafe void GetDispatchFieldValue(FieldInfo* pFieldInfo, object* pTarget, object* pResult, Exception* pException) { try @@ -162,7 +153,6 @@ private static unsafe void GetDispatchFieldValue(FieldInfo* pFieldInfo, object* } [UnmanagedCallersOnly] - [RequiresUnsafe] private static unsafe void SetDispatchFieldValue(FieldInfo* pFieldInfo, object* pTarget, object* pValue, int invokeAttr, Binder* pBinder, Globalization.CultureInfo* pCulture, Exception* pException) { try @@ -181,7 +171,6 @@ private static unsafe void SetDispatchFieldValue(FieldInfo* pFieldInfo, object* } [UnmanagedCallersOnly] - [RequiresUnsafe] private static unsafe void GetDispatchPropertyValue(PropertyInfo* pPropertyInfo, object* pTarget, int invokeAttr, Binder* pBinder, object[]* pIndexArgs, Globalization.CultureInfo* pCulture, object* pResult, Exception* pException) { try @@ -200,7 +189,6 @@ private static unsafe void GetDispatchPropertyValue(PropertyInfo* pPropertyInfo, } [UnmanagedCallersOnly] - [RequiresUnsafe] private static unsafe void SetDispatchPropertyValue(PropertyInfo* pPropertyInfo, object* pTarget, object* pValue, int invokeAttr, Binder* pBinder, object[]* pIndexArgs, Globalization.CultureInfo* pCulture, Exception* pException) { try @@ -220,7 +208,6 @@ private static unsafe void SetDispatchPropertyValue(PropertyInfo* pPropertyInfo, } [UnmanagedCallersOnly] - [RequiresUnsafe] private static unsafe void InvokeDispatchMethodInfo(MethodInfo* pMemberInfo, object* pTarget, int invokeAttr, Binder* pBinder, object[]* pArgs, Globalization.CultureInfo* pCulture, object* pResult, Exception* pException) { try @@ -240,7 +227,6 @@ private static unsafe void InvokeDispatchMethodInfo(MethodInfo* pMemberInfo, obj [RequiresUnreferencedCode("The member might be removed")] [UnmanagedCallersOnly] - [RequiresUnsafe] private static unsafe void InvokeDispatchReflectMember(IReflect* pReflectionObject, string* pName, int invokeAttr, Binder* pBinder, object* pTarget, object[]* pArgs, ParameterModifier[]* pModifiers, Globalization.CultureInfo* pCulture, string[]* pNamedParams, object* pResult, Exception* pException) { try @@ -263,7 +249,6 @@ private static unsafe void InvokeDispatchReflectMember(IReflect* pReflectionObje [RequiresUnreferencedCode("The member might be removed")] [UnmanagedCallersOnly] - [RequiresUnsafe] private static unsafe void GetDispatchProperties(IReflect* pReflectionObject, int bindingFlags, PropertyInfo[]* pResult, Exception* pException) { try @@ -278,7 +263,6 @@ private static unsafe void GetDispatchProperties(IReflect* pReflectionObject, in [RequiresUnreferencedCode("The member might be removed")] [UnmanagedCallersOnly] - [RequiresUnsafe] private static unsafe void GetDispatchFields(IReflect* pReflectionObject, int bindingFlags, FieldInfo[]* pResult, Exception* pException) { try @@ -293,7 +277,6 @@ private static unsafe void GetDispatchFields(IReflect* pReflectionObject, int bi [RequiresUnreferencedCode("The member might be removed")] [UnmanagedCallersOnly] - [RequiresUnsafe] private static unsafe void GetDispatchMethods(IReflect* pReflectionObject, int bindingFlags, MethodInfo[]* pResult, Exception* pException) { try @@ -307,7 +290,6 @@ private static unsafe void GetDispatchMethods(IReflect* pReflectionObject, int b } [UnmanagedCallersOnly] - [RequiresUnsafe] private static unsafe void GetDispatchInnerException(Exception* pExceptionObject, Exception* pResult, Exception* pException) { try diff --git a/src/coreclr/System.Private.CoreLib/src/System/Runtime/InteropServices/Java/JavaMarshal.CoreCLR.cs b/src/coreclr/System.Private.CoreLib/src/System/Runtime/InteropServices/Java/JavaMarshal.CoreCLR.cs index 8d590990e797e2..51f0f5a3ddc669 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/Runtime/InteropServices/Java/JavaMarshal.CoreCLR.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/Runtime/InteropServices/Java/JavaMarshal.CoreCLR.cs @@ -38,7 +38,6 @@ public static partial class JavaMarshal /// runtime code when cross-reference marking is required. /// Additionally, this callback must be implemented in unmanaged code. /// - [RequiresUnsafe] public static unsafe void Initialize(delegate* unmanaged markCrossReferences) { ArgumentNullException.ThrowIfNull(markCrossReferences); @@ -63,7 +62,6 @@ public static unsafe void Initialize(delegate* unmanagedA that represents the allocated reference-tracking handle. /// is null. /// The runtime or platform does not support Java cross-reference marshalling. - [RequiresUnsafe] public static unsafe GCHandle CreateReferenceTrackingHandle(object obj, void* context) { ArgumentNullException.ThrowIfNull(obj); @@ -84,7 +82,6 @@ public static unsafe GCHandle CreateReferenceTrackingHandle(object obj, void* co /// The returned pointer is the exact value that was originally provided as /// the context parameter when the handle was created. /// - [RequiresUnsafe] public static unsafe void* GetContext(GCHandle obj) { IntPtr handle = GCHandle.ToIntPtr(obj); @@ -106,7 +103,6 @@ public static unsafe GCHandle CreateReferenceTrackingHandle(object obj, void* co /// A pointer to the structure containing cross-reference information produced during marking. /// A span of values that were determined to be unreachable from the native side. /// The runtime or platform does not support Java cross-reference marshalling. - [RequiresUnsafe] public static unsafe void FinishCrossReferenceProcessing( MarkCrossReferencesArgs* crossReferences, ReadOnlySpan unreachableObjectHandles) @@ -125,16 +121,13 @@ public static unsafe void FinishCrossReferenceProcessing( private static partial bool InitializeInternal(IntPtr callback); [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "JavaMarshal_CreateReferenceTrackingHandle")] - [RequiresUnsafe] private static unsafe partial IntPtr CreateReferenceTrackingHandleInternal(ObjectHandleOnStack obj, void* context); [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "JavaMarshal_FinishCrossReferenceProcessing")] - [RequiresUnsafe] private static unsafe partial void FinishCrossReferenceProcessing(MarkCrossReferencesArgs* crossReferences, nuint length, void* unreachableObjectHandles); [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "JavaMarshal_GetContext")] [SuppressGCTransition] - [RequiresUnsafe] [return: MarshalAs(UnmanagedType.Bool)] private static unsafe partial bool GetContextInternal(IntPtr handle, out void* context); } diff --git a/src/coreclr/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshal.CoreCLR.cs b/src/coreclr/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshal.CoreCLR.cs index ffa20878cba85e..7b0389c0aa0c3e 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshal.CoreCLR.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshal.CoreCLR.cs @@ -1058,7 +1058,6 @@ internal static IntPtr GetFunctionPointerForDelegateInternal(Delegate d) #if DEBUG // Used for testing in Checked or Debug [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "MarshalNative_GetIsInCooperativeGCModeFunctionPointer")] - [RequiresUnsafe] internal static unsafe partial delegate* unmanaged GetIsInCooperativeGCModeFunctionPointer(); #endif } diff --git a/src/coreclr/System.Private.CoreLib/src/System/Runtime/InteropServices/NativeLibrary.CoreCLR.cs b/src/coreclr/System.Private.CoreLib/src/System/Runtime/InteropServices/NativeLibrary.CoreCLR.cs index ee7c61c672120a..1c19a684f6d130 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/Runtime/InteropServices/NativeLibrary.CoreCLR.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/Runtime/InteropServices/NativeLibrary.CoreCLR.cs @@ -27,7 +27,6 @@ internal static partial IntPtr LoadByName(string libraryName, QCallAssembly call [MarshalAs(UnmanagedType.Bool)] bool throwOnError); [UnmanagedCallersOnly] - [RequiresUnsafe] private static unsafe IntPtr LoadLibraryCallbackStub(char* pLibraryName, Assembly* pAssembly, bool hasDllImportSearchPathFlags, uint dllImportSearchPathFlags, Exception* pException) { try diff --git a/src/coreclr/System.Private.CoreLib/src/System/Runtime/Loader/AssemblyLoadContext.CoreCLR.cs b/src/coreclr/System.Private.CoreLib/src/System/Runtime/Loader/AssemblyLoadContext.CoreCLR.cs index 867f42389cbd4b..bff02ea6bac5c5 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/Runtime/Loader/AssemblyLoadContext.CoreCLR.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/Runtime/Loader/AssemblyLoadContext.CoreCLR.cs @@ -111,7 +111,6 @@ internal Assembly LoadFromInMemoryModule(IntPtr moduleHandle) // This method is invoked by the VM when using the host-provided assembly load context // implementation. [UnmanagedCallersOnly] - [RequiresUnsafe] private static unsafe IntPtr ResolveUnmanagedDll(char* pUnmanagedDllName, IntPtr gchAssemblyLoadContext, Exception* pException) { try @@ -129,7 +128,6 @@ private static unsafe IntPtr ResolveUnmanagedDll(char* pUnmanagedDllName, IntPtr // This method is invoked by the VM to resolve a native library using the ResolvingUnmanagedDll event // after trying all other means of resolution. [UnmanagedCallersOnly] - [RequiresUnsafe] private static unsafe IntPtr ResolveUnmanagedDllUsingEvent(char* pUnmanagedDllName, Assembly* pAssembly, IntPtr gchAssemblyLoadContext, Exception* pException) { try @@ -203,7 +201,6 @@ public void StartProfileOptimization(string? profile) /// Called by the runtime to start an assembly load activity for tracing /// [UnmanagedCallersOnly] - [RequiresUnsafe] private static unsafe void StartAssemblyLoad(Guid* activityId, Guid* relatedActivityId, Exception* pException) { try @@ -224,7 +221,6 @@ private static unsafe void StartAssemblyLoad(Guid* activityId, Guid* relatedActi /// Called by the runtime to stop an assembly load activity for tracing /// [UnmanagedCallersOnly] - [RequiresUnsafe] private static unsafe void StopAssemblyLoad(Guid* activityId, Exception* pException) { try @@ -242,7 +238,6 @@ private static unsafe void StopAssemblyLoad(Guid* activityId, Exception* pExcept /// Called by the runtime to make sure the default ALC is initialized /// [UnmanagedCallersOnly] - [RequiresUnsafe] private static unsafe void InitializeDefaultContext(Exception* pException) { try diff --git a/src/coreclr/System.Private.CoreLib/src/System/RuntimeHandles.cs b/src/coreclr/System.Private.CoreLib/src/System/RuntimeHandles.cs index 7e9d558c00dd57..baee8db37dd8a0 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/RuntimeHandles.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/RuntimeHandles.cs @@ -67,7 +67,6 @@ internal static unsafe RuntimeType GetRuntimeTypeFromHandle(IntPtr handle) } [MethodImpl(MethodImplOptions.AggressiveInlining)] - [RequiresUnsafe] internal static unsafe RuntimeType GetRuntimeType(MethodTable* pMT) { return pMT->AuxiliaryData->ExposedClassObject ?? GetRuntimeTypeFromHandleSlow((IntPtr)pMT); @@ -276,14 +275,12 @@ internal static object CreateInstanceForAnotherGenericParameter( } [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeTypeHandle_CreateInstanceForAnotherGenericParameter")] - [RequiresUnsafe] private static partial void CreateInstanceForAnotherGenericParameter( QCallTypeHandle baseType, IntPtr* pTypeHandles, int cTypeHandles, ObjectHandleOnStack instantiatedObject); - [RequiresUnsafe] internal static unsafe object InternalAlloc(MethodTable* pMT) { object? result = null; @@ -300,12 +297,10 @@ internal static object InternalAlloc(RuntimeType type) } [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeTypeHandle_InternalAlloc")] - [RequiresUnsafe] private static unsafe partial void InternalAlloc(MethodTable* pMT, ObjectHandleOnStack result); [MethodImpl(MethodImplOptions.AggressiveInlining)] - [RequiresUnsafe] internal static object InternalAllocNoChecks(MethodTable* pMT) { return InternalAllocNoChecks_FastPath(pMT) ?? InternalAllocNoChecksWorker(pMT); @@ -320,11 +315,9 @@ static object InternalAllocNoChecksWorker(MethodTable* pMT) } [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeTypeHandle_InternalAllocNoChecks")] - [RequiresUnsafe] private static unsafe partial void InternalAllocNoChecks(MethodTable* pMT, ObjectHandleOnStack result); [MethodImpl(MethodImplOptions.InternalCall)] - [RequiresUnsafe] private static extern object? InternalAllocNoChecks_FastPath(MethodTable* pMT); /// @@ -332,7 +325,6 @@ static object InternalAllocNoChecksWorker(MethodTable* pMT) /// semantics. This method will ensure the type object is fully initialized within /// the VM, but it will not call any static ctors on the type. /// - [RequiresUnsafe] internal static void GetActivationInfo( RuntimeType rt, out delegate* pfnAllocator, @@ -362,7 +354,6 @@ internal static void GetActivationInfo( } [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeTypeHandle_GetActivationInfo")] - [RequiresUnsafe] private static partial void GetActivationInfo( ObjectHandleOnStack pRuntimeType, delegate** ppfnAllocator, @@ -467,7 +458,6 @@ public ModuleHandle GetModuleHandle() internal static extern int GetToken(RuntimeType type); [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeTypeHandle_GetMethodAt")] - [RequiresUnsafe] private static unsafe partial IntPtr GetMethodAt(MethodTable* pMT, int slot); internal static RuntimeMethodHandleInternal GetMethodAt(RuntimeType type, int slot) @@ -546,7 +536,6 @@ internal static IntroducedMethodEnumerator GetIntroducedMethods(RuntimeType type private static extern void GetNextIntroducedMethod(ref RuntimeMethodHandleInternal method); [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeTypeHandle_GetFields")] - [RequiresUnsafe] private static partial Interop.BOOL GetFields(MethodTable* pMT, Span data, ref int usedCount); internal static bool GetFields(RuntimeType type, Span buffer, out int count) @@ -568,7 +557,6 @@ internal static bool GetFields(RuntimeType type, Span buffer, out int co } [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeTypeHandle_GetInterfaces")] - [RequiresUnsafe] private static unsafe partial void GetInterfaces(MethodTable* pMT, ObjectHandleOnStack result); internal static Type[] GetInterfaces(RuntimeType type) @@ -671,7 +659,6 @@ internal string ConstructName(TypeNameFormatFlags formatFlags) } [MethodImpl(MethodImplOptions.InternalCall)] - [RequiresUnsafe] private static extern unsafe void* GetUtf8NameInternal(MethodTable* pMT); // Since the returned string is a pointer into metadata, the caller should @@ -766,7 +753,6 @@ internal RuntimeType[] GetInstantiationInternal() } [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeTypeHandle_Instantiate")] - [RequiresUnsafe] private static partial void Instantiate(QCallTypeHandle handle, IntPtr* pInst, int numGenericArgs, ObjectHandleOnStack type); internal RuntimeType Instantiate(RuntimeType inst) @@ -828,7 +814,6 @@ internal RuntimeType MakeByRef() } [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeTypeHandle_MakeFunctionPointer")] - [RequiresUnsafe] private static partial void MakeFunctionPointer(nint* retAndParamTypes, int numArgs, [MarshalAs(UnmanagedType.Bool)] bool isUnmanaged, ObjectHandleOnStack type); internal RuntimeType MakeFunctionPointer(Type[] parameterTypes, bool isUnmanaged) @@ -1124,7 +1109,6 @@ internal static string ConstructInstantiation(IRuntimeMethodInfo method, TypeNam } [MethodImpl(MethodImplOptions.InternalCall)] - [RequiresUnsafe] private static extern unsafe MethodTable* GetMethodTable(RuntimeMethodHandleInternal method); internal static unsafe RuntimeType GetDeclaringType(RuntimeMethodHandleInternal method) @@ -1176,7 +1160,6 @@ internal static string GetName(IRuntimeMethodInfo method) } [MethodImpl(MethodImplOptions.InternalCall)] - [RequiresUnsafe] private static extern void* GetUtf8NameInternal(RuntimeMethodHandleInternal method); // Since the returned string is a pointer into metadata, the caller should @@ -1195,12 +1178,10 @@ internal static MdUtf8String GetUtf8Name(RuntimeMethodHandleInternal method) [DebuggerStepThrough] [DebuggerHidden] [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeMethodHandle_InvokeMethod")] - [RequiresUnsafe] private static partial void InvokeMethod(ObjectHandleOnStack target, void** arguments, ObjectHandleOnStack sig, Interop.BOOL isConstructor, ObjectHandleOnStack result); [DebuggerStepThrough] [DebuggerHidden] - [RequiresUnsafe] internal static object? InvokeMethod(object? target, void** arguments, Signature sig, bool isConstructor) { object? result = null; @@ -1541,7 +1522,6 @@ internal static string GetName(IRuntimeFieldInfo field) } [MethodImpl(MethodImplOptions.InternalCall)] - [RequiresUnsafe] private static extern void* GetUtf8NameInternal(RuntimeFieldHandleInternal field); // Since the returned string is a pointer into metadata, the caller should @@ -1561,7 +1541,6 @@ internal static MdUtf8String GetUtf8Name(RuntimeFieldHandleInternal field) internal static extern FieldAttributes GetAttributes(RuntimeFieldHandleInternal field); [MethodImpl(MethodImplOptions.InternalCall)] - [RequiresUnsafe] private static extern MethodTable* GetApproxDeclaringMethodTable(RuntimeFieldHandleInternal field); internal static RuntimeType GetApproxDeclaringType(RuntimeFieldHandleInternal field) @@ -1590,7 +1569,6 @@ internal static RuntimeType GetApproxDeclaringType(IRuntimeFieldInfo field) internal static extern IntPtr GetStaticFieldAddress(RtFieldInfo field); [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeFieldHandle_GetRVAFieldInfo")] - [RequiresUnsafe] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool GetRVAFieldInfo(RuntimeFieldHandleInternal field, out void* address, out uint size); @@ -1646,7 +1624,6 @@ private static partial void GetValue( } [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeFieldHandle_GetValueDirect")] - [RequiresUnsafe] private static partial void GetValueDirect( IntPtr fieldDesc, void* pTypedRef, @@ -1688,7 +1665,6 @@ internal static void SetValue(RtFieldInfo field, object? obj, object? value, Run } [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeFieldHandle_SetValueDirect")] - [RequiresUnsafe] private static partial void SetValueDirect( IntPtr fieldDesc, void* pTypedRef, @@ -1708,7 +1684,6 @@ internal static void SetValueDirect(RtFieldInfo field, RuntimeType fieldType, Ty } [MethodImpl(MethodImplOptions.InternalCall)] - [RequiresUnsafe] private static extern unsafe RuntimeFieldHandleInternal GetStaticFieldForGenericType(RuntimeFieldHandleInternal field, MethodTable* pMT); internal static RuntimeFieldHandleInternal GetStaticFieldForGenericType(RuntimeFieldHandleInternal field, RuntimeType declaringType) @@ -1743,14 +1718,12 @@ public void GetObjectData(SerializationInfo info, StreamingContext context) } [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeFieldHandle_GetEnCFieldAddr")] - [RequiresUnsafe] private static partial void* GetEnCFieldAddr(ObjectHandleOnStack tgt, void* pFD); // implementation of CORINFO_HELP_GETFIELDADDR [StackTraceHidden] [DebuggerStepThrough] [DebuggerHidden] - [RequiresUnsafe] internal static unsafe void* GetFieldAddr(object tgt, void* pFD) { void* addr = GetEnCFieldAddr(ObjectHandleOnStack.Create(ref tgt), pFD); @@ -1763,7 +1736,6 @@ public void GetObjectData(SerializationInfo info, StreamingContext context) [StackTraceHidden] [DebuggerStepThrough] [DebuggerHidden] - [RequiresUnsafe] internal static unsafe void* GetStaticFieldAddr(void* pFD) { object? nullTarget = null; @@ -1910,7 +1882,6 @@ public RuntimeTypeHandle ResolveTypeHandle(int typeToken, RuntimeTypeHandle[]? t } [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "ModuleHandle_ResolveType")] - [RequiresUnsafe] private static partial void ResolveType(QCallModule module, int typeToken, IntPtr* typeInstArgs, @@ -1963,7 +1934,6 @@ internal static RuntimeMethodHandleInternal ResolveMethodHandleInternal(RuntimeM } [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "ModuleHandle_ResolveMethod")] - [RequiresUnsafe] private static partial RuntimeMethodHandleInternal ResolveMethod(QCallModule module, int methodToken, IntPtr* typeInstArgs, @@ -2018,7 +1988,6 @@ public RuntimeFieldHandle ResolveFieldHandle(int fieldToken, RuntimeTypeHandle[] } [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "ModuleHandle_ResolveField")] - [RequiresUnsafe] private static partial void ResolveField(QCallModule module, int fieldToken, IntPtr* typeInstArgs, @@ -2038,7 +2007,6 @@ internal static RuntimeType GetModuleType(RuntimeModule module) } [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "ModuleHandle_GetPEKind")] - [RequiresUnsafe] private static partial void GetPEKind(QCallModule handle, int* peKind, int* machine); // making this internal, used by Module.GetPEKind @@ -2082,7 +2050,6 @@ internal sealed unsafe partial class Signature #endregion [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "Signature_Init")] - [RequiresUnsafe] private static partial void Init( ObjectHandleOnStack _this, void* pCorSig, int cCorSig, @@ -2090,7 +2057,6 @@ private static partial void Init( RuntimeMethodHandleInternal methodHandle); [MemberNotNull(nameof(_returnTypeORfieldType))] - [RequiresUnsafe] private void Init( void* pCorSig, int cCorSig, RuntimeFieldHandleInternal fieldHandle, @@ -2136,7 +2102,6 @@ public Signature(IRuntimeFieldInfo fieldHandle, RuntimeType declaringType) GC.KeepAlive(fieldHandle); } - [RequiresUnsafe] public Signature(void* pCorSig, int cCorSig, RuntimeType declaringType) { _declaringType = declaringType; @@ -2158,7 +2123,6 @@ internal RuntimeType[] Arguments internal RuntimeType FieldType => _returnTypeORfieldType; [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "Signature_AreEqual")] - [RequiresUnsafe] private static partial Interop.BOOL AreEqual( void* sig1, int csig1, QCallTypeHandle type1, void* sig2, int csig2, QCallTypeHandle type2); @@ -2171,7 +2135,6 @@ internal static bool AreEqual(Signature sig1, Signature sig2) } [MethodImpl(MethodImplOptions.InternalCall)] - [RequiresUnsafe] private static extern unsafe int GetParameterOffsetInternal(void* sig, int csig, int parameterIndex); internal int GetParameterOffset(int parameterIndex) @@ -2184,7 +2147,6 @@ internal int GetParameterOffset(int parameterIndex) } [MethodImpl(MethodImplOptions.InternalCall)] - [RequiresUnsafe] private static extern unsafe int GetTypeParameterOffsetInternal(void* sig, int csig, int offset, int index); internal int GetTypeParameterOffset(int offset, int index) @@ -2203,7 +2165,6 @@ internal int GetTypeParameterOffset(int offset, int index) } [MethodImpl(MethodImplOptions.InternalCall)] - [RequiresUnsafe] private static extern unsafe int GetCallingConventionFromFunctionPointerAtOffsetInternal(void* sig, int csig, int offset); internal SignatureCallingConvention GetCallingConventionFromFunctionPointerAtOffset(int offset) @@ -2261,7 +2222,6 @@ internal struct CORINFO_EH_CLAUSE internal abstract RuntimeType? GetJitContext(out int securityControlFlags); internal abstract byte[] GetCodeInfo(out int stackSize, out int initLocals, out int EHCount); internal abstract byte[] GetLocalsSignature(); - [RequiresUnsafe] internal abstract unsafe void GetEHInfo(int EHNumber, void* exception); internal abstract byte[]? GetRawEHInfo(); // token resolution @@ -2272,7 +2232,6 @@ internal struct CORINFO_EH_CLAUSE internal abstract MethodInfo GetDynamicMethod(); [UnmanagedCallersOnly] - [RequiresUnsafe] internal static unsafe void GetJitContext(Resolver* pResolver, int* pSecurityControlFlags, RuntimeType* ppResult, Exception* pException) { try @@ -2286,7 +2245,6 @@ internal static unsafe void GetJitContext(Resolver* pResolver, int* pSecurityCon } [UnmanagedCallersOnly] - [RequiresUnsafe] internal static unsafe void GetCodeInfo(Resolver* pResolver, int* pStackSize, int* pInitLocals, int* pEHCount, byte[]* ppResult, Exception* pException) { try @@ -2300,7 +2258,6 @@ internal static unsafe void GetCodeInfo(Resolver* pResolver, int* pStackSize, in } [UnmanagedCallersOnly] - [RequiresUnsafe] internal static unsafe void GetLocalsSignature(Resolver* pResolver, byte[]* ppResult, Exception* pException) { try @@ -2314,7 +2271,6 @@ internal static unsafe void GetLocalsSignature(Resolver* pResolver, byte[]* ppRe } [UnmanagedCallersOnly] - [RequiresUnsafe] internal static unsafe void GetStringLiteral(Resolver* pResolver, int token, string* ppResult, Exception* pException) { try @@ -2328,7 +2284,6 @@ internal static unsafe void GetStringLiteral(Resolver* pResolver, int token, str } [UnmanagedCallersOnly] - [RequiresUnsafe] internal static unsafe void ResolveToken(Resolver* pResolver, int token, IntPtr* pTypeHandle, IntPtr* pMethodHandle, IntPtr* pFieldHandle, Exception* pException) { try @@ -2342,7 +2297,6 @@ internal static unsafe void ResolveToken(Resolver* pResolver, int token, IntPtr* } [UnmanagedCallersOnly] - [RequiresUnsafe] internal static unsafe void ResolveSignature(Resolver* pResolver, int token, int fromMethod, byte[]* ppResult, Exception* pException) { try @@ -2356,7 +2310,6 @@ internal static unsafe void ResolveSignature(Resolver* pResolver, int token, int } [UnmanagedCallersOnly] - [RequiresUnsafe] internal static unsafe void GetEHInfo(Resolver* pResolver, int EHNumber, byte[]* ppRawEHInfo, void* parsedEHInfo, Exception* pException) { try diff --git a/src/coreclr/System.Private.CoreLib/src/System/RuntimeType.BoxCache.cs b/src/coreclr/System.Private.CoreLib/src/System/RuntimeType.BoxCache.cs index 169d26a76cde88..ca46521ec21c78 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/RuntimeType.BoxCache.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/RuntimeType.BoxCache.cs @@ -105,7 +105,6 @@ private BoxCache(RuntimeType rt) /// Given a RuntimeType, returns information about how to box instances /// of it via calli semantics. /// - [RequiresUnsafe] private static void GetBoxInfo( RuntimeType rt, out delegate* pfnAllocator, @@ -132,7 +131,6 @@ private static void GetBoxInfo( } [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "ReflectionInvocation_GetBoxInfo")] - [RequiresUnsafe] private static partial void GetBoxInfo( QCallTypeHandle type, delegate** ppfnAllocator, diff --git a/src/coreclr/System.Private.CoreLib/src/System/RuntimeType.CoreCLR.cs b/src/coreclr/System.Private.CoreLib/src/System/RuntimeType.CoreCLR.cs index 088587f84ed69d..a50bed7f6bcafc 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/RuntimeType.CoreCLR.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/RuntimeType.CoreCLR.cs @@ -150,7 +150,6 @@ private readonly struct Filter private readonly MdUtf8String m_name; private readonly MemberListType m_listType; - [RequiresUnsafe] public unsafe Filter(byte* pUtf8Name, int cUtf8Name, MemberListType listType) { m_name = new MdUtf8String(pUtf8Name, cUtf8Name); @@ -3416,7 +3415,6 @@ public override unsafe Guid GUID } [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "ReflectionInvocation_GetGuid")] - [RequiresUnsafe] private static unsafe partial void GetGuid(MethodTable* pMT, Guid* result); #if FEATURE_COMINTEROP @@ -4369,14 +4367,12 @@ private enum DispatchWrapperType : int internal readonly unsafe partial struct MdUtf8String { [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "MdUtf8String_EqualsCaseInsensitive")] - [RequiresUnsafe] [return: MarshalAs(UnmanagedType.Bool)] private static partial bool EqualsCaseInsensitive(void* szLhs, void* szRhs, int cSz); private readonly byte* m_pStringHeap; // This is the raw UTF8 string. private readonly int m_StringHeapByteLength; - [RequiresUnsafe] internal MdUtf8String(void* pStringHeap) { byte* pStringBytes = (byte*)pStringHeap; @@ -4392,7 +4388,6 @@ internal MdUtf8String(void* pStringHeap) m_pStringHeap = pStringBytes; } - [RequiresUnsafe] internal MdUtf8String(byte* pUtf8String, int cUtf8String) { m_pStringHeap = pUtf8String; diff --git a/src/coreclr/System.Private.CoreLib/src/System/RuntimeType.CreateUninitializedCache.CoreCLR.cs b/src/coreclr/System.Private.CoreLib/src/System/RuntimeType.CreateUninitializedCache.CoreCLR.cs index a370eafa5330b5..0612afd03825c0 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/RuntimeType.CreateUninitializedCache.CoreCLR.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/RuntimeType.CreateUninitializedCache.CoreCLR.cs @@ -57,7 +57,6 @@ internal object CreateUninitializedObject(RuntimeType rt) /// Given a RuntimeType, returns information about how to create uninitialized instances /// of it via calli semantics. /// - [RequiresUnsafe] private static void GetCreateUninitializedInfo( RuntimeType rt, out delegate* pfnAllocator, @@ -77,7 +76,6 @@ private static void GetCreateUninitializedInfo( } [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "ReflectionSerialization_GetCreateUninitializedObjectInfo")] - [RequiresUnsafe] private static partial void GetCreateUninitializedInfo( QCallTypeHandle type, delegate** ppfnAllocator, diff --git a/src/coreclr/System.Private.CoreLib/src/System/StartupHookProvider.CoreCLR.cs b/src/coreclr/System.Private.CoreLib/src/System/StartupHookProvider.CoreCLR.cs index 3cefd78c0e88f8..c265f91064a843 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/StartupHookProvider.CoreCLR.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/StartupHookProvider.CoreCLR.cs @@ -14,7 +14,6 @@ namespace System internal static partial class StartupHookProvider { [UnmanagedCallersOnly] - [RequiresUnsafe] private static unsafe void ManagedStartup(char* pDiagnosticStartupHooks, Exception* pException) { try diff --git a/src/coreclr/System.Private.CoreLib/src/System/String.CoreCLR.cs b/src/coreclr/System.Private.CoreLib/src/System/String.CoreCLR.cs index 002d59ec44e406..82beec6388b7c6 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/String.CoreCLR.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/String.CoreCLR.cs @@ -12,7 +12,6 @@ namespace System public partial class String { [MethodImpl(MethodImplOptions.InternalCall)] - [RequiresUnsafe] internal static extern unsafe string FastAllocateString(MethodTable *pMT, nint length); [DebuggerHidden] @@ -51,7 +50,6 @@ internal static unsafe void InternalCopy(string src, IntPtr dest, int len) } } - [RequiresUnsafe] internal unsafe int GetBytesFromEncoding(byte* pbNativeBuffer, int cbNativeBuffer, Encoding encoding) { // encoding == Encoding.UTF8 diff --git a/src/coreclr/System.Private.CoreLib/src/System/StubHelpers.cs b/src/coreclr/System.Private.CoreLib/src/System/StubHelpers.cs index ae34c9ab034225..3d5f7da15005ef 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/StubHelpers.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/StubHelpers.cs @@ -322,7 +322,6 @@ internal static unsafe IntPtr ConvertToNative(string? strManaged, IntPtr pNative } [UnmanagedCallersOnly] - [RequiresUnsafe] private static unsafe IntPtr ConvertToNative(string* pStr, Exception* pException) { try @@ -732,7 +731,6 @@ internal static void ClearNative(IntPtr pMarshalState, in object pManagedHome, I internal static unsafe partial class MngdRefCustomMarshaler { [UnmanagedCallersOnly] - [RequiresUnsafe] internal static void ConvertContentsToNative(ICustomMarshaler* pMarshaler, object* pManagedHome, IntPtr* pNativeHome, Exception* pException) { try @@ -745,7 +743,6 @@ internal static void ConvertContentsToNative(ICustomMarshaler* pMarshaler, objec } } - [RequiresUnsafe] internal static void ConvertContentsToNative(ICustomMarshaler marshaler, in object pManagedHome, IntPtr* pNativeHome) { // COMPAT: We never pass null to MarshalManagedToNative. @@ -759,7 +756,6 @@ internal static void ConvertContentsToNative(ICustomMarshaler marshaler, in obje } [UnmanagedCallersOnly] - [RequiresUnsafe] internal static void ConvertContentsToManaged(ICustomMarshaler* pMarshaler, object* pManagedHome, IntPtr* pNativeHome, Exception* pException) { try @@ -772,7 +768,6 @@ internal static void ConvertContentsToManaged(ICustomMarshaler* pMarshaler, obje } } - [RequiresUnsafe] internal static void ConvertContentsToManaged(ICustomMarshaler marshaler, ref object? pManagedHome, IntPtr* pNativeHome) { // COMPAT: We never pass null to MarshalNativeToManaged. @@ -786,7 +781,6 @@ internal static void ConvertContentsToManaged(ICustomMarshaler marshaler, ref ob } [UnmanagedCallersOnly] - [RequiresUnsafe] internal static void ClearNative(ICustomMarshaler* pMarshaler, object* pManagedHome, IntPtr* pNativeHome, Exception* pException) { try @@ -799,7 +793,6 @@ internal static void ClearNative(ICustomMarshaler* pMarshaler, object* pManagedH } } - [RequiresUnsafe] internal static void ClearNative(ICustomMarshaler marshaler, ref object _, IntPtr* pNativeHome) { // COMPAT: We never pass null to CleanUpNativeData. @@ -819,7 +812,6 @@ internal static void ClearNative(ICustomMarshaler marshaler, ref object _, IntPt } [UnmanagedCallersOnly] - [RequiresUnsafe] internal static void ClearManaged(ICustomMarshaler* pMarshaler, object* pManagedHome, IntPtr* pNativeHome, Exception* pException) { try @@ -832,7 +824,6 @@ internal static void ClearManaged(ICustomMarshaler* pMarshaler, object* pManaged } } - [RequiresUnsafe] internal static void ClearManaged(ICustomMarshaler marshaler, in object pManagedHome, IntPtr* _) { // COMPAT: We never pass null to CleanUpManagedData. @@ -846,7 +837,6 @@ internal static void ClearManaged(ICustomMarshaler marshaler, in object pManaged [UnmanagedCallersOnly] [UnconditionalSuppressMessage("Trimming", "IL2075", Justification = "Custom marshaler GetInstance method is preserved by ILLink (see MarkCustomMarshalerGetInstance).")] - [RequiresUnsafe] internal static void GetCustomMarshalerInstance(void* pMT, byte* pCookie, int cCookieBytes, object* pResult, Exception* pException) { try @@ -2257,7 +2247,6 @@ internal static void SetPendingExceptionObject(Exception? exception) [SupportedOSPlatform("windows")] [UnmanagedCallersOnly] - [RequiresUnsafe] private static unsafe void GetIEnumeratorToEnumVariantMarshaler(object* pResult, Exception* pException) { try @@ -2272,7 +2261,6 @@ private static unsafe void GetIEnumeratorToEnumVariantMarshaler(object* pResult, [SupportedOSPlatform("windows")] [UnmanagedCallersOnly] - [RequiresUnsafe] private static unsafe int CallICustomQueryInterface(ICustomQueryInterface* pObject, Guid* pIid, IntPtr* ppObject, Exception* pException) { try @@ -2288,7 +2276,6 @@ private static unsafe int CallICustomQueryInterface(ICustomQueryInterface* pObje [SupportedOSPlatform("windows")] [UnmanagedCallersOnly] - [RequiresUnsafe] private static unsafe void InvokeConnectionPointProviderMethod( object* pProvider, delegate* providerMethodEntryPoint, @@ -2385,11 +2372,9 @@ static IntPtr GetCOMIPFromRCWWorker(object objSrc, IntPtr pCPCMD, out IntPtr ppT // Profiler helpers //------------------------------------------------------- [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "StubHelpers_ProfilerBeginTransitionCallback")] - [RequiresUnsafe] internal static unsafe partial void* ProfilerBeginTransitionCallback(void* pTargetMD); [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "StubHelpers_ProfilerEndTransitionCallback")] - [RequiresUnsafe] internal static unsafe partial void ProfilerEndTransitionCallback(void* pTargetMD); #endif // PROFILING_SUPPORTED @@ -2412,7 +2397,6 @@ internal static void CheckStringLength(uint length) [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "StubHelpers_CreateLayoutClassMarshalStubs")] internal static unsafe partial void CreateLayoutClassMarshalStubs(QCallTypeHandle th, out delegate* pConvertToUnmanaged, out delegate* pConvertToManaged, out delegate* pFree); - [RequiresUnsafe] internal static unsafe void LayoutTypeConvertToUnmanaged(object obj, byte* pNative, ref CleanupWorkListElement? pCleanupWorkList) { RuntimeType type = (RuntimeType)obj.GetType(); @@ -2422,7 +2406,6 @@ internal static unsafe void LayoutTypeConvertToUnmanaged(object obj, byte* pNati } [UnmanagedCallersOnly] - [RequiresUnsafe] internal static unsafe void LayoutTypeConvertToUnmanaged(object* obj, byte* pNative, Exception* pException) { try @@ -2435,7 +2418,6 @@ internal static unsafe void LayoutTypeConvertToUnmanaged(object* obj, byte* pNat } } - [RequiresUnsafe] internal static unsafe void LayoutTypeConvertToManaged(object obj, byte* pNative) { RuntimeType type = (RuntimeType)obj.GetType(); @@ -2445,7 +2427,6 @@ internal static unsafe void LayoutTypeConvertToManaged(object obj, byte* pNative } [UnmanagedCallersOnly] - [RequiresUnsafe] internal static unsafe void LayoutTypeConvertToManaged(object* obj, byte* pNative, Exception* pException) { try @@ -2567,7 +2548,6 @@ internal static void MulticastDebuggerTraceHelper(object o, int count) internal static class CultureInfoMarshaler { [UnmanagedCallersOnly] - [RequiresUnsafe] internal static unsafe void GetCurrentCulture(bool bUICulture, object* pResult, Exception* pException) { try @@ -2583,7 +2563,6 @@ internal static unsafe void GetCurrentCulture(bool bUICulture, object* pResult, } [UnmanagedCallersOnly] - [RequiresUnsafe] internal static unsafe void SetCurrentCulture(bool bUICulture, Globalization.CultureInfo* pValue, Exception* pException) { try @@ -2600,7 +2579,6 @@ internal static unsafe void SetCurrentCulture(bool bUICulture, Globalization.Cul } [UnmanagedCallersOnly] - [RequiresUnsafe] internal static unsafe void CreateCultureInfo(int culture, object* pResult, Exception* pException) { try @@ -2646,7 +2624,6 @@ internal static int ConvertToNative(object? managedColor) } [UnmanagedCallersOnly] - [RequiresUnsafe] internal static unsafe void ConvertToManaged(int oleColor, object* pResult, Exception* pException) { try @@ -2660,7 +2637,6 @@ internal static unsafe void ConvertToManaged(int oleColor, object* pResult, Exce } [UnmanagedCallersOnly] - [RequiresUnsafe] internal static unsafe void ConvertToNative(object* pSrcObj, int* pResult, Exception* pException) { try diff --git a/src/coreclr/System.Private.CoreLib/src/System/Text/StringBuilder.CoreCLR.cs b/src/coreclr/System.Private.CoreLib/src/System/Text/StringBuilder.CoreCLR.cs index e0a7ff46f3e22f..1f35b4d6d2607c 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/Text/StringBuilder.CoreCLR.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/Text/StringBuilder.CoreCLR.cs @@ -25,7 +25,6 @@ private int GetReplaceBufferCapacity(int requiredCapacity) return newCapacity; } - [RequiresUnsafe] internal unsafe void ReplaceBufferInternal(char* newBuffer, int newLength) { ArgumentOutOfRangeException.ThrowIfGreaterThan(newLength, m_MaxCapacity, "capacity"); @@ -56,7 +55,6 @@ internal void ReplaceBufferUtf8Internal(ReadOnlySpan source) m_ChunkOffset = 0; } - [RequiresUnsafe] internal unsafe void ReplaceBufferAnsiInternal(sbyte* newBuffer, int newLength) { ArgumentOutOfRangeException.ThrowIfGreaterThan(newLength, m_MaxCapacity, "capacity"); diff --git a/src/coreclr/System.Private.CoreLib/src/System/Threading/Interlocked.CoreCLR.cs b/src/coreclr/System.Private.CoreLib/src/System/Threading/Interlocked.CoreCLR.cs index 1596d9dbc462df..5fb05077081bbb 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/Threading/Interlocked.CoreCLR.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/Threading/Interlocked.CoreCLR.cs @@ -135,7 +135,6 @@ public static int CompareExchange(ref int location1, int value, int comparand) // return type of the method. // The important part is avoiding `ref *location` that is reported as byref to the GC. [Intrinsic] - [RequiresUnsafe] internal static unsafe int CompareExchange(int* location1, int value, int comparand) { #if TARGET_X86 || TARGET_AMD64 || TARGET_ARM64 || TARGET_RISCV64 @@ -147,7 +146,6 @@ internal static unsafe int CompareExchange(int* location1, int value, int compar } [MethodImpl(MethodImplOptions.InternalCall)] - [RequiresUnsafe] private static extern unsafe int CompareExchange32Pointer(int* location1, int value, int comparand); /// Compares two 64-bit signed integers for equality and, if they are equal, replaces the first value. diff --git a/src/coreclr/System.Private.CoreLib/src/System/Threading/Thread.CoreCLR.cs b/src/coreclr/System.Private.CoreLib/src/System/Threading/Thread.CoreCLR.cs index f739f8421ba238..02e206061fc99d 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/Threading/Thread.CoreCLR.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/Threading/Thread.CoreCLR.cs @@ -109,11 +109,9 @@ private unsafe void StartCore() } [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "ThreadNative_Start")] - [RequiresUnsafe] private static unsafe partial Interop.BOOL StartInternal(ThreadHandle t, int stackSize, int priority, Interop.BOOL isThreadPool, char* pThreadName, ObjectHandleOnStack exception); [UnmanagedCallersOnly] - [RequiresUnsafe] private static unsafe void StartCallback(Thread* pThread) { StartHelper? startHelper = pThread->_startHelper; @@ -587,7 +585,6 @@ private void OnThreadExited() } [UnmanagedCallersOnly] - [RequiresUnsafe] private static unsafe void OnThreadExited(Thread* pThread, Exception* pException) { try @@ -601,7 +598,6 @@ private static unsafe void OnThreadExited(Thread* pThread, Exception* pException } [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "ThreadNative_ReentrantWaitAny")] - [RequiresUnsafe] internal static unsafe partial int ReentrantWaitAny([MarshalAs(UnmanagedType.Bool)] bool alertable, int timeout, int count, IntPtr* handles); internal static void CheckForPendingInterrupt() diff --git a/src/coreclr/System.Private.CoreLib/src/System/ValueType.cs b/src/coreclr/System.Private.CoreLib/src/System/ValueType.cs index 7f7a3ce067e047..f4c3acb31adf88 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/ValueType.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/ValueType.cs @@ -70,7 +70,6 @@ ref RuntimeHelpers.GetRawData(obj), // Return true if the valuetype does not contain pointer, is tightly packed, // does not have floating point number field and does not override Equals method. - [RequiresUnsafe] private static unsafe bool CanCompareBitsOrUseFastGetHashCode(MethodTable* pMT) { MethodTableAuxiliaryData* pAuxData = pMT->AuxiliaryData; @@ -84,7 +83,6 @@ private static unsafe bool CanCompareBitsOrUseFastGetHashCode(MethodTable* pMT) } [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "MethodTable_CanCompareBitsOrUseFastGetHashCode")] - [RequiresUnsafe] [return: MarshalAs(UnmanagedType.Bool)] private static unsafe partial bool CanCompareBitsOrUseFastGetHashCodeHelper(MethodTable* pMT); @@ -164,7 +162,6 @@ private enum ValueTypeHashCodeStrategy } [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "ValueType_GetHashCodeStrategy")] - [RequiresUnsafe] private static unsafe partial ValueTypeHashCodeStrategy GetHashCodeStrategy( MethodTable* pMT, ObjectHandleOnStack objHandle, out uint fieldOffset, out uint fieldSize, out MethodTable* fieldMT); diff --git a/src/coreclr/System.Private.CoreLib/src/System/__ComObject.cs b/src/coreclr/System.Private.CoreLib/src/System/__ComObject.cs index 9d5279cfa5e2f6..464ebfaff83268 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/__ComObject.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/__ComObject.cs @@ -110,7 +110,6 @@ internal void ReleaseAllData() } [UnmanagedCallersOnly] - [RequiresUnsafe] private static unsafe void ReleaseAllData(__ComObject* pComObject, Exception* pException) { try diff --git a/src/coreclr/nativeaot/System.Private.CoreLib/src/System/ArgIterator.cs b/src/coreclr/nativeaot/System.Private.CoreLib/src/System/ArgIterator.cs index 9874a0246793c6..14ef0fa953cf8c 100644 --- a/src/coreclr/nativeaot/System.Private.CoreLib/src/System/ArgIterator.cs +++ b/src/coreclr/nativeaot/System.Private.CoreLib/src/System/ArgIterator.cs @@ -15,7 +15,6 @@ public ArgIterator(RuntimeArgumentHandle arglist) } [CLSCompliant(false)] - [RequiresUnsafe] public unsafe ArgIterator(RuntimeArgumentHandle arglist, void* ptr) { throw new PlatformNotSupportedException(SR.PlatformNotSupported_ArgIterator); diff --git a/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Reflection/Emit/DynamicILInfo.cs b/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Reflection/Emit/DynamicILInfo.cs index 966f279e5d3969..abbbda62e618ff 100644 --- a/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Reflection/Emit/DynamicILInfo.cs +++ b/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Reflection/Emit/DynamicILInfo.cs @@ -17,19 +17,16 @@ internal DynamicILInfo() public void SetCode(byte[] code, int maxStackSize) { } [CLSCompliant(false)] - [RequiresUnsafe] public unsafe void SetCode(byte* code, int codeSize, int maxStackSize) { } public void SetExceptions(byte[] exceptions) { } [CLSCompliant(false)] - [RequiresUnsafe] public unsafe void SetExceptions(byte* exceptions, int exceptionsSize) { } public void SetLocalSignature(byte[] localSignature) { } [CLSCompliant(false)] - [RequiresUnsafe] public unsafe void SetLocalSignature(byte* localSignature, int signatureSize) { } public int GetTokenFor(RuntimeMethodHandle method) diff --git a/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Reflection/Metadata/AssemblyExtensions.cs b/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Reflection/Metadata/AssemblyExtensions.cs index 54a91b68efe7dc..62f816b3cdd78f 100644 --- a/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Reflection/Metadata/AssemblyExtensions.cs +++ b/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Reflection/Metadata/AssemblyExtensions.cs @@ -17,7 +17,6 @@ public static class AssemblyExtensions // associated, is alive. The caller is responsible for keeping the assembly object alive while accessing the // metadata blob. [CLSCompliant(false)] // out byte* blob - [RequiresUnsafe] public static unsafe bool TryGetRawMetadata(this Assembly assembly, out byte* blob, out int length) { ArgumentNullException.ThrowIfNull(assembly); diff --git a/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Runtime/InteropServices/Java/JavaMarshal.NativeAot.cs b/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Runtime/InteropServices/Java/JavaMarshal.NativeAot.cs index 350f47448a5032..c9c29591e1679e 100644 --- a/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Runtime/InteropServices/Java/JavaMarshal.NativeAot.cs +++ b/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Runtime/InteropServices/Java/JavaMarshal.NativeAot.cs @@ -38,7 +38,6 @@ public static partial class JavaMarshal /// runtime code when cross-reference marking is required. /// Additionally, this callback must be implemented in unmanaged code. /// - [RequiresUnsafe] public static unsafe void Initialize(delegate* unmanaged markCrossReferences) { ArgumentNullException.ThrowIfNull(markCrossReferences); @@ -63,7 +62,6 @@ public static unsafe void Initialize(delegate* unmanagedA that represents the allocated reference-tracking handle. /// is null. /// The runtime or platform does not support Java cross-reference marshalling. - [RequiresUnsafe] public static unsafe GCHandle CreateReferenceTrackingHandle(object obj, void* context) { ArgumentNullException.ThrowIfNull(obj); @@ -82,7 +80,6 @@ public static unsafe GCHandle CreateReferenceTrackingHandle(object obj, void* co /// The returned pointer is the exact value that was originally provided as /// the context parameter when the handle was created. /// - [RequiresUnsafe] public static unsafe void* GetContext(GCHandle obj) { IntPtr handle = GCHandle.ToIntPtr(obj); @@ -103,7 +100,6 @@ public static unsafe GCHandle CreateReferenceTrackingHandle(object obj, void* co /// A pointer to the structure containing cross-reference information produced during marking. /// A span of values that were determined to be unreachable from the native side. /// The runtime or platform does not support Java cross-reference marshalling. - [RequiresUnsafe] public static unsafe void FinishCrossReferenceProcessing( MarkCrossReferencesArgs* crossReferences, ReadOnlySpan unreachableObjectHandles) diff --git a/src/libraries/System.Diagnostics.Tracing/ref/System.Diagnostics.Tracing.cs b/src/libraries/System.Diagnostics.Tracing/ref/System.Diagnostics.Tracing.cs index 364c4110c942cb..5f7e0b9e3cc26f 100644 --- a/src/libraries/System.Diagnostics.Tracing/ref/System.Diagnostics.Tracing.cs +++ b/src/libraries/System.Diagnostics.Tracing/ref/System.Diagnostics.Tracing.cs @@ -204,13 +204,11 @@ protected void WriteEvent(int eventId, string? arg1, string? arg2) { } protected void WriteEvent(int eventId, string? arg1, string? arg2, string? arg3) { } [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("EventSource will serialize the whole object graph. Trimmer will not safely handle this case because properties may be trimmed. This can be suppressed if the object is a primitive type")] [System.CLSCompliantAttribute(false)] - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] protected unsafe void WriteEventCore(int eventId, int eventDataCount, System.Diagnostics.Tracing.EventSource.EventData* data) { } [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("EventSource will serialize the whole object graph. Trimmer will not safely handle this case because properties may be trimmed. This can be suppressed if the object is a primitive type")] protected void WriteEventWithRelatedActivityId(int eventId, System.Guid relatedActivityId, params object?[] args) { } [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("EventSource will serialize the whole object graph. Trimmer will not safely handle this case because properties may be trimmed. This can be suppressed if the object is a primitive type")] [System.CLSCompliantAttribute(false)] - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] protected unsafe void WriteEventWithRelatedActivityIdCore(int eventId, System.Guid* relatedActivityId, int eventDataCount, System.Diagnostics.Tracing.EventSource.EventData* data) { } [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("EventSource will serialize the whole object graph. Trimmer will not safely handle this case because properties may be trimmed. This can be suppressed if the object is a primitive type")] public void Write<[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicProperties)] T>(string? eventName, System.Diagnostics.Tracing.EventSourceOptions options, T data) { } diff --git a/src/libraries/System.Numerics.Vectors/ref/System.Numerics.Vectors.cs b/src/libraries/System.Numerics.Vectors/ref/System.Numerics.Vectors.cs index 630ba00644a847..350862a4af099a 100644 --- a/src/libraries/System.Numerics.Vectors/ref/System.Numerics.Vectors.cs +++ b/src/libraries/System.Numerics.Vectors/ref/System.Numerics.Vectors.cs @@ -390,13 +390,10 @@ public static partial class Vector public static System.Numerics.Vector LessThanOrEqual(System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } public static System.Numerics.Vector LessThan(System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } [System.CLSCompliantAttribute(false)] - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector Load(T* source) { throw null; } [System.CLSCompliantAttribute(false)] - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector LoadAligned(T* source) { throw null; } [System.CLSCompliantAttribute(false)] - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector LoadAlignedNonTemporal(T* source) { throw null; } public static System.Numerics.Vector LoadUnsafe(ref readonly T source) { throw null; } [System.CLSCompliantAttribute(false)] @@ -494,40 +491,28 @@ public static partial class Vector public static (System.Numerics.Vector Sin, System.Numerics.Vector Cos) SinCos(System.Numerics.Vector vector) { throw null; } public static System.Numerics.Vector SquareRoot(System.Numerics.Vector value) { throw null; } [System.CLSCompliantAttribute(false)] - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Store(this System.Numerics.Vector source, T* destination) { throw null; } [System.CLSCompliantAttribute(false)] - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Store(this System.Numerics.Vector2 source, float* destination) { throw null; } [System.CLSCompliantAttribute(false)] - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Store(this System.Numerics.Vector3 source, float* destination) { throw null; } [System.CLSCompliantAttribute(false)] - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Store(this System.Numerics.Vector4 source, float* destination) { throw null; } [System.CLSCompliantAttribute(false)] - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreAligned(this System.Numerics.Vector source, T* destination) { throw null; } [System.CLSCompliantAttribute(false)] - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreAligned(this System.Numerics.Vector2 source, float* destination) { throw null; } [System.CLSCompliantAttribute(false)] - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreAligned(this System.Numerics.Vector3 source, float* destination) { throw null; } [System.CLSCompliantAttribute(false)] - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreAligned(this System.Numerics.Vector4 source, float* destination) { throw null; } [System.CLSCompliantAttribute(false)] - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreAlignedNonTemporal(this System.Numerics.Vector source, T* destination) { throw null; } [System.CLSCompliantAttribute(false)] - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreAlignedNonTemporal(this System.Numerics.Vector2 source, float* destination) { throw null; } [System.CLSCompliantAttribute(false)] - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreAlignedNonTemporal(this System.Numerics.Vector3 source, float* destination) { throw null; } [System.CLSCompliantAttribute(false)] - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreAlignedNonTemporal(this System.Numerics.Vector4 source, float* destination) { throw null; } public static void StoreUnsafe(this System.Numerics.Vector source, ref T destination) { throw null; } public static void StoreUnsafe(this System.Numerics.Vector2 source, ref float destination) { throw null; } @@ -703,13 +688,10 @@ public readonly void CopyTo(System.Span destination) { } public static bool LessThanOrEqualAll(System.Numerics.Vector2 left, System.Numerics.Vector2 right) { throw null; } public static bool LessThanOrEqualAny(System.Numerics.Vector2 left, System.Numerics.Vector2 right) { throw null; } [CLSCompliant(false)] - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector2 Load(float* source) { throw null; } [CLSCompliant(false)] - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector2 LoadAligned(float* source) { throw null; } [CLSCompliant(false)] - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector2 LoadAlignedNonTemporal(float* source) { throw null; } public static System.Numerics.Vector2 LoadUnsafe(ref readonly float source) { throw null; } [CLSCompliant(false)] @@ -874,13 +856,10 @@ public readonly void CopyTo(System.Span destination) { } public static bool LessThanOrEqualAll(System.Numerics.Vector3 left, System.Numerics.Vector3 right) { throw null; } public static bool LessThanOrEqualAny(System.Numerics.Vector3 left, System.Numerics.Vector3 right) { throw null; } [CLSCompliant(false)] - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector3 Load(float* source) { throw null; } [CLSCompliant(false)] - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector3 LoadAligned(float* source) { throw null; } [CLSCompliant(false)] - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector3 LoadAlignedNonTemporal(float* source) { throw null; } public static System.Numerics.Vector3 LoadUnsafe(ref readonly float source) { throw null; } [CLSCompliant(false)] @@ -1049,13 +1028,10 @@ public readonly void CopyTo(System.Span destination) { } public static System.Numerics.Vector4 Log(System.Numerics.Vector4 vector) { throw null; } public static System.Numerics.Vector4 Log2(System.Numerics.Vector4 vector) { throw null; } [CLSCompliant(false)] - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector4 Load(float* source) { throw null; } [CLSCompliant(false)] - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector4 LoadAligned(float* source) { throw null; } [CLSCompliant(false)] - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector4 LoadAlignedNonTemporal(float* source) { throw null; } public static System.Numerics.Vector4 LoadUnsafe(ref readonly float source) { throw null; } [CLSCompliant(false)] diff --git a/src/libraries/System.Private.CoreLib/src/Internal/Runtime/InteropServices/ComponentActivator.cs b/src/libraries/System.Private.CoreLib/src/Internal/Runtime/InteropServices/ComponentActivator.cs index c3c448407b6ff0..7ee23e01a469db 100644 --- a/src/libraries/System.Private.CoreLib/src/Internal/Runtime/InteropServices/ComponentActivator.cs +++ b/src/libraries/System.Private.CoreLib/src/Internal/Runtime/InteropServices/ComponentActivator.cs @@ -178,7 +178,6 @@ private static void LoadAssemblyImpl(string assemblyPath) [UnsupportedOSPlatform("maccatalyst")] [UnsupportedOSPlatform("tvos")] [UnmanagedCallersOnly] - [RequiresUnsafe] public static unsafe int LoadAssemblyBytes(byte* assembly, nint assemblyByteLength, byte* symbols, nint symbolsByteLength, IntPtr loadContext, IntPtr reserved) { if (!IsSupported) diff --git a/src/libraries/System.Private.CoreLib/src/System/AppContext.cs b/src/libraries/System.Private.CoreLib/src/System/AppContext.cs index 2e92c5def7c7c1..b857dca79198e5 100644 --- a/src/libraries/System.Private.CoreLib/src/System/AppContext.cs +++ b/src/libraries/System.Private.CoreLib/src/System/AppContext.cs @@ -197,7 +197,6 @@ internal static unsafe void Setup(char** pNames, uint* pNameLengths, char** pVal } #elif !NATIVEAOT [UnmanagedCallersOnly] - [RequiresUnsafe] internal static unsafe void Setup(char** pNames, char** pValues, int count, Exception* pException) { try diff --git a/src/libraries/System.Private.CoreLib/src/System/Buffer.cs b/src/libraries/System.Private.CoreLib/src/System/Buffer.cs index 1276d5eef852e9..81f34896e4cdb8 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Buffer.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Buffer.cs @@ -101,7 +101,6 @@ public static void SetByte(Array array, int index, byte value) // Please do not edit unless intentional. [MethodImpl(MethodImplOptions.AggressiveInlining)] [CLSCompliant(false)] - [RequiresUnsafe] public static unsafe void MemoryCopy(void* source, void* destination, long destinationSizeInBytes, long sourceBytesToCopy) { if (sourceBytesToCopy > destinationSizeInBytes) @@ -116,7 +115,6 @@ public static unsafe void MemoryCopy(void* source, void* destination, long desti // Please do not edit unless intentional. [MethodImpl(MethodImplOptions.AggressiveInlining)] [CLSCompliant(false)] - [RequiresUnsafe] public static unsafe void MemoryCopy(void* source, void* destination, ulong destinationSizeInBytes, ulong sourceBytesToCopy) { if (sourceBytesToCopy > destinationSizeInBytes) diff --git a/src/libraries/System.Private.CoreLib/src/System/Buffers/Text/Base64Helper/Base64DecoderHelper.cs b/src/libraries/System.Private.CoreLib/src/System/Buffers/Text/Base64Helper/Base64DecoderHelper.cs index 0f35e0087ff381..a6752ea0c93d09 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Buffers/Text/Base64Helper/Base64DecoderHelper.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Buffers/Text/Base64Helper/Base64DecoderHelper.cs @@ -794,7 +794,6 @@ private static OperationStatus DecodeWithWhiteSpaceFromUtf8InPlace(TBase64Decoder decoder, ref T* srcBytes, ref byte* destBytes, T* srcEnd, int sourceLength, int destLength, T* srcStart, byte* destStart) where TBase64Decoder : IBase64Decoder where T : unmanaged @@ -862,7 +861,6 @@ private static unsafe void Avx512Decode(TBase64Decoder decode [MethodImpl(MethodImplOptions.AggressiveInlining)] [CompExactlyDependsOn(typeof(Avx2))] - [RequiresUnsafe] private static unsafe void Avx2Decode(TBase64Decoder decoder, ref T* srcBytes, ref byte* destBytes, T* srcEnd, int sourceLength, int destLength, T* srcStart, byte* destStart) where TBase64Decoder : IBase64Decoder where T : unmanaged @@ -984,7 +982,6 @@ internal static Vector128 SimdShuffle(Vector128 left, Vector128(TBase64Decoder decoder, ref T* srcBytes, ref byte* destBytes, T* srcEnd, int sourceLength, int destLength, T* srcStart, byte* destStart) where TBase64Decoder : IBase64Decoder where T : unmanaged @@ -1126,7 +1123,6 @@ private static unsafe void AdvSimdDecode(TBase64Decoder decod [MethodImpl(MethodImplOptions.AggressiveInlining)] [CompExactlyDependsOn(typeof(AdvSimd.Arm64))] [CompExactlyDependsOn(typeof(Ssse3))] - [RequiresUnsafe] private static unsafe void Vector128Decode(TBase64Decoder decoder, ref T* srcBytes, ref byte* destBytes, T* srcEnd, int sourceLength, int destLength, T* srcStart, byte* destStart) where TBase64Decoder : IBase64Decoder where T : unmanaged @@ -1306,7 +1302,6 @@ private static unsafe void Vector128Decode(TBase64Decoder dec #endif [MethodImpl(MethodImplOptions.AggressiveInlining)] - [RequiresUnsafe] private static unsafe void WriteThreeLowOrderBytes(byte* destination, int value) { destination[0] = (byte)(value >> 16); @@ -1484,7 +1479,6 @@ public bool TryDecode256Core( } [MethodImpl(MethodImplOptions.AggressiveInlining)] - [RequiresUnsafe] public unsafe bool TryLoadVector512(byte* src, byte* srcStart, int sourceLength, out Vector512 str) { AssertRead>(src, srcStart, sourceLength); @@ -1494,7 +1488,6 @@ public unsafe bool TryLoadVector512(byte* src, byte* srcStart, int sourceLength, [MethodImpl(MethodImplOptions.AggressiveInlining)] [CompExactlyDependsOn(typeof(Avx2))] - [RequiresUnsafe] public unsafe bool TryLoadAvxVector256(byte* src, byte* srcStart, int sourceLength, out Vector256 str) { AssertRead>(src, srcStart, sourceLength); @@ -1503,7 +1496,6 @@ public unsafe bool TryLoadAvxVector256(byte* src, byte* srcStart, int sourceLeng } [MethodImpl(MethodImplOptions.AggressiveInlining)] - [RequiresUnsafe] public unsafe bool TryLoadVector128(byte* src, byte* srcStart, int sourceLength, out Vector128 str) { AssertRead>(src, srcStart, sourceLength); @@ -1513,7 +1505,6 @@ public unsafe bool TryLoadVector128(byte* src, byte* srcStart, int sourceLength, [MethodImpl(MethodImplOptions.AggressiveInlining)] [CompExactlyDependsOn(typeof(AdvSimd.Arm64))] - [RequiresUnsafe] public unsafe bool TryLoadArmVector128x4(byte* src, byte* srcStart, int sourceLength, out Vector128 str1, out Vector128 str2, out Vector128 str3, out Vector128 str4) { @@ -1525,7 +1516,6 @@ public unsafe bool TryLoadArmVector128x4(byte* src, byte* srcStart, int sourceLe #endif // NET [MethodImpl(MethodImplOptions.AggressiveInlining)] - [RequiresUnsafe] public unsafe int DecodeFourElements(byte* source, ref sbyte decodingMap) { // The 'source' span expected to have at least 4 elements, and the 'decodingMap' consists 256 sbytes @@ -1551,7 +1541,6 @@ public unsafe int DecodeFourElements(byte* source, ref sbyte decodingMap) } [MethodImpl(MethodImplOptions.AggressiveInlining)] - [RequiresUnsafe] public unsafe int DecodeRemaining(byte* srcEnd, ref sbyte decodingMap, long remaining, out uint t2, out uint t3) { uint t0; @@ -1659,7 +1648,6 @@ public bool TryDecode256Core(Vector256 str, Vector256 hiNibbles, V default(Base64DecoderByte).TryDecode256Core(str, hiNibbles, maskSlashOrUnderscore, lutLow, lutHigh, lutShift, shiftForUnderscore, out result); [MethodImpl(MethodImplOptions.AggressiveInlining)] - [RequiresUnsafe] public unsafe bool TryLoadVector512(ushort* src, ushort* srcStart, int sourceLength, out Vector512 str) { AssertRead>(src, srcStart, sourceLength); @@ -1677,7 +1665,6 @@ public unsafe bool TryLoadVector512(ushort* src, ushort* srcStart, int sourceLen [MethodImpl(MethodImplOptions.AggressiveInlining)] [CompExactlyDependsOn(typeof(Avx2))] - [RequiresUnsafe] public unsafe bool TryLoadAvxVector256(ushort* src, ushort* srcStart, int sourceLength, out Vector256 str) { AssertRead>(src, srcStart, sourceLength); @@ -1695,7 +1682,6 @@ public unsafe bool TryLoadAvxVector256(ushort* src, ushort* srcStart, int source } [MethodImpl(MethodImplOptions.AggressiveInlining)] - [RequiresUnsafe] public unsafe bool TryLoadVector128(ushort* src, ushort* srcStart, int sourceLength, out Vector128 str) { AssertRead>(src, srcStart, sourceLength); @@ -1713,7 +1699,6 @@ public unsafe bool TryLoadVector128(ushort* src, ushort* srcStart, int sourceLen [MethodImpl(MethodImplOptions.AggressiveInlining)] [CompExactlyDependsOn(typeof(AdvSimd.Arm64))] - [RequiresUnsafe] public unsafe bool TryLoadArmVector128x4(ushort* src, ushort* srcStart, int sourceLength, out Vector128 str1, out Vector128 str2, out Vector128 str3, out Vector128 str4) { @@ -1737,7 +1722,6 @@ public unsafe bool TryLoadArmVector128x4(ushort* src, ushort* srcStart, int sour #endif // NET [MethodImpl(MethodImplOptions.AggressiveInlining)] - [RequiresUnsafe] public unsafe int DecodeFourElements(ushort* source, ref sbyte decodingMap) { // The 'source' span expected to have at least 4 elements, and the 'decodingMap' consists 256 sbytes @@ -1768,7 +1752,6 @@ public unsafe int DecodeFourElements(ushort* source, ref sbyte decodingMap) } [MethodImpl(MethodImplOptions.AggressiveInlining)] - [RequiresUnsafe] public unsafe int DecodeRemaining(ushort* srcEnd, ref sbyte decodingMap, long remaining, out uint t2, out uint t3) { uint t0; diff --git a/src/libraries/System.Private.CoreLib/src/System/Buffers/Text/Base64Helper/Base64EncoderHelper.cs b/src/libraries/System.Private.CoreLib/src/System/Buffers/Text/Base64Helper/Base64EncoderHelper.cs index b4757d8d2f058e..bcf720202be6e2 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Buffers/Text/Base64Helper/Base64EncoderHelper.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Buffers/Text/Base64Helper/Base64EncoderHelper.cs @@ -135,7 +135,6 @@ internal static unsafe OperationStatus EncodeTo(TBase64Encode [MethodImpl(MethodImplOptions.AggressiveInlining)] [CompExactlyDependsOn(typeof(Avx512BW))] [CompExactlyDependsOn(typeof(Avx512Vbmi))] - [RequiresUnsafe] private static unsafe void Avx512Encode(TBase64Encoder encoder, ref byte* srcBytes, ref T* destBytes, byte* srcEnd, int sourceLength, int destLength, byte* srcStart, T* destStart) where TBase64Encoder : IBase64Encoder where T : unmanaged @@ -210,7 +209,6 @@ private static unsafe void Avx512Encode(TBase64Encoder encode [MethodImpl(MethodImplOptions.AggressiveInlining)] [CompExactlyDependsOn(typeof(Avx2))] - [RequiresUnsafe] private static unsafe void Avx2Encode(TBase64Encoder encoder, ref byte* srcBytes, ref T* destBytes, byte* srcEnd, int sourceLength, int destLength, byte* srcStart, T* destStart) where TBase64Encoder : IBase64Encoder where T : unmanaged @@ -383,7 +381,6 @@ private static unsafe void Avx2Encode(TBase64Encoder encoder, [MethodImpl(MethodImplOptions.AggressiveInlining)] [CompExactlyDependsOn(typeof(AdvSimd.Arm64))] - [RequiresUnsafe] private static unsafe void AdvSimdEncode(TBase64Encoder encoder, ref byte* srcBytes, ref T* destBytes, byte* srcEnd, int sourceLength, int destLength, byte* srcStart, T* destStart) where TBase64Encoder : IBase64Encoder where T : unmanaged @@ -444,7 +441,6 @@ private static unsafe void AdvSimdEncode(TBase64Encoder encod [MethodImpl(MethodImplOptions.AggressiveInlining)] [CompExactlyDependsOn(typeof(Ssse3))] [CompExactlyDependsOn(typeof(AdvSimd.Arm64))] - [RequiresUnsafe] private static unsafe void Vector128Encode(TBase64Encoder encoder, ref byte* srcBytes, ref T* destBytes, byte* srcEnd, int sourceLength, int destLength, byte* srcStart, T* destStart) where TBase64Encoder : IBase64Encoder where T : unmanaged @@ -634,7 +630,6 @@ internal static unsafe OperationStatus EncodeToUtf8InPlace(TBase } [MethodImpl(MethodImplOptions.AggressiveInlining)] - [RequiresUnsafe] private static unsafe uint Encode(byte* threeBytes, ref byte encodingMap) { uint t0 = threeBytes[0]; @@ -665,7 +660,6 @@ private static uint ConstructResult(uint i0, uint i1, uint i2, uint i3) } [MethodImpl(MethodImplOptions.AggressiveInlining)] - [RequiresUnsafe] public static unsafe void EncodeOneOptionallyPadTwo(byte* oneByte, ushort* dest, ref byte encodingMap) { uint t0 = oneByte[0]; @@ -690,7 +684,6 @@ public static unsafe void EncodeOneOptionallyPadTwo(byte* oneByte, ushort* dest, } [MethodImpl(MethodImplOptions.AggressiveInlining)] - [RequiresUnsafe] public static unsafe void EncodeTwoOptionallyPadOne(byte* twoBytes, ushort* dest, ref byte encodingMap) { uint t0 = twoBytes[0]; @@ -737,7 +730,6 @@ public int GetMaxSrcLength(int srcLength, int destLength) => public int GetMaxEncodedLength(int srcLength) => Base64.GetMaxEncodedToUtf8Length(srcLength); [MethodImpl(MethodImplOptions.AggressiveInlining)] - [RequiresUnsafe] public unsafe void EncodeOneOptionallyPadTwo(byte* oneByte, byte* dest, ref byte encodingMap) { uint t0 = oneByte[0]; @@ -752,7 +744,6 @@ public unsafe void EncodeOneOptionallyPadTwo(byte* oneByte, byte* dest, ref byte } [MethodImpl(MethodImplOptions.AggressiveInlining)] - [RequiresUnsafe] public unsafe void EncodeTwoOptionallyPadOne(byte* twoBytes, byte* dest, ref byte encodingMap) { uint t0 = twoBytes[0]; @@ -770,7 +761,6 @@ public unsafe void EncodeTwoOptionallyPadOne(byte* twoBytes, byte* dest, ref byt #if NET [MethodImpl(MethodImplOptions.AggressiveInlining)] - [RequiresUnsafe] public unsafe void StoreVector512ToDestination(byte* dest, byte* destStart, int destLength, Vector512 str) { AssertWrite>(dest, destStart, destLength); @@ -779,7 +769,6 @@ public unsafe void StoreVector512ToDestination(byte* dest, byte* destStart, int [MethodImpl(MethodImplOptions.AggressiveInlining)] [CompExactlyDependsOn(typeof(Avx2))] - [RequiresUnsafe] public unsafe void StoreVector256ToDestination(byte* dest, byte* destStart, int destLength, Vector256 str) { AssertWrite>(dest, destStart, destLength); @@ -787,7 +776,6 @@ public unsafe void StoreVector256ToDestination(byte* dest, byte* destStart, int } [MethodImpl(MethodImplOptions.AggressiveInlining)] - [RequiresUnsafe] public unsafe void StoreVector128ToDestination(byte* dest, byte* destStart, int destLength, Vector128 str) { AssertWrite>(dest, destStart, destLength); @@ -796,7 +784,6 @@ public unsafe void StoreVector128ToDestination(byte* dest, byte* destStart, int [MethodImpl(MethodImplOptions.AggressiveInlining)] [CompExactlyDependsOn(typeof(AdvSimd.Arm64))] - [RequiresUnsafe] public unsafe void StoreArmVector128x4ToDestination(byte* dest, byte* destStart, int destLength, Vector128 res1, Vector128 res2, Vector128 res3, Vector128 res4) { @@ -806,7 +793,6 @@ public unsafe void StoreArmVector128x4ToDestination(byte* dest, byte* destStart, #endif // NET [MethodImpl(MethodImplOptions.AggressiveInlining)] - [RequiresUnsafe] public unsafe void EncodeThreeAndWrite(byte* threeBytes, byte* destination, ref byte encodingMap) { uint result = Encode(threeBytes, ref encodingMap); @@ -838,7 +824,6 @@ public int GetMaxSrcLength(int srcLength, int destLength) => public int GetMaxEncodedLength(int _) => 0; // not used for char encoding [MethodImpl(MethodImplOptions.AggressiveInlining)] - [RequiresUnsafe] public unsafe void EncodeOneOptionallyPadTwo(byte* oneByte, ushort* dest, ref byte encodingMap) { Base64Helper.EncodeOneOptionallyPadTwo(oneByte, dest, ref encodingMap); @@ -847,7 +832,6 @@ public unsafe void EncodeOneOptionallyPadTwo(byte* oneByte, ushort* dest, ref by } [MethodImpl(MethodImplOptions.AggressiveInlining)] - [RequiresUnsafe] public unsafe void EncodeTwoOptionallyPadOne(byte* twoBytes, ushort* dest, ref byte encodingMap) { Base64Helper.EncodeTwoOptionallyPadOne(twoBytes, dest, ref encodingMap); @@ -856,7 +840,6 @@ public unsafe void EncodeTwoOptionallyPadOne(byte* twoBytes, ushort* dest, ref b #if NET [MethodImpl(MethodImplOptions.AggressiveInlining)] - [RequiresUnsafe] public unsafe void StoreVector512ToDestination(ushort* dest, ushort* destStart, int destLength, Vector512 str) { AssertWrite>(dest, destStart, destLength); @@ -866,7 +849,6 @@ public unsafe void StoreVector512ToDestination(ushort* dest, ushort* destStart, } [MethodImpl(MethodImplOptions.AggressiveInlining)] - [RequiresUnsafe] public unsafe void StoreVector256ToDestination(ushort* dest, ushort* destStart, int destLength, Vector256 str) { AssertWrite>(dest, destStart, destLength); @@ -876,7 +858,6 @@ public unsafe void StoreVector256ToDestination(ushort* dest, ushort* destStart, } [MethodImpl(MethodImplOptions.AggressiveInlining)] - [RequiresUnsafe] public unsafe void StoreVector128ToDestination(ushort* dest, ushort* destStart, int destLength, Vector128 str) { AssertWrite>(dest, destStart, destLength); @@ -887,7 +868,6 @@ public unsafe void StoreVector128ToDestination(ushort* dest, ushort* destStart, [MethodImpl(MethodImplOptions.AggressiveInlining)] [CompExactlyDependsOn(typeof(AdvSimd.Arm64))] - [RequiresUnsafe] public unsafe void StoreArmVector128x4ToDestination(ushort* dest, ushort* destStart, int destLength, Vector128 res1, Vector128 res2, Vector128 res3, Vector128 res4) { @@ -902,7 +882,6 @@ public unsafe void StoreArmVector128x4ToDestination(ushort* dest, ushort* destSt #endif // NET [MethodImpl(MethodImplOptions.AggressiveInlining)] - [RequiresUnsafe] public unsafe void EncodeThreeAndWrite(byte* threeBytes, ushort* destination, ref byte encodingMap) { uint t0 = threeBytes[0]; diff --git a/src/libraries/System.Private.CoreLib/src/System/Buffers/Text/Base64Helper/Base64Helper.cs b/src/libraries/System.Private.CoreLib/src/System/Buffers/Text/Base64Helper/Base64Helper.cs index a652aff01ab35b..28429d9382b81e 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Buffers/Text/Base64Helper/Base64Helper.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Buffers/Text/Base64Helper/Base64Helper.cs @@ -13,7 +13,6 @@ namespace System.Buffers.Text internal static partial class Base64Helper { [Conditional("DEBUG")] - [RequiresUnsafe] internal static unsafe void AssertRead(byte* src, byte* srcStart, int srcLength) { int vectorElements = Unsafe.SizeOf(); @@ -28,7 +27,6 @@ internal static unsafe void AssertRead(byte* src, byte* srcStart, int s } [Conditional("DEBUG")] - [RequiresUnsafe] internal static unsafe void AssertWrite(byte* dest, byte* destStart, int destLength) { int vectorElements = Unsafe.SizeOf(); @@ -43,7 +41,6 @@ internal static unsafe void AssertWrite(byte* dest, byte* destStart, in } [Conditional("DEBUG")] - [RequiresUnsafe] internal static unsafe void AssertRead(ushort* src, ushort* srcStart, int srcLength) { int vectorElements = Unsafe.SizeOf(); @@ -58,7 +55,6 @@ internal static unsafe void AssertRead(ushort* src, ushort* srcStart, i } [Conditional("DEBUG")] - [RequiresUnsafe] internal static unsafe void AssertWrite(ushort* dest, ushort* destStart, int destLength) { int vectorElements = Unsafe.SizeOf(); @@ -182,22 +178,15 @@ internal interface IBase64Encoder where T : unmanaged int GetMaxSrcLength(int srcLength, int destLength); int GetMaxEncodedLength(int srcLength); uint GetInPlaceDestinationLength(int encodedLength, int leftOver); - [RequiresUnsafe] unsafe void EncodeOneOptionallyPadTwo(byte* oneByte, T* dest, ref byte encodingMap); - [RequiresUnsafe] unsafe void EncodeTwoOptionallyPadOne(byte* oneByte, T* dest, ref byte encodingMap); - [RequiresUnsafe] unsafe void EncodeThreeAndWrite(byte* threeBytes, T* destination, ref byte encodingMap); int IncrementPadTwo { get; } int IncrementPadOne { get; } #if NET - [RequiresUnsafe] unsafe void StoreVector512ToDestination(T* dest, T* destStart, int destLength, Vector512 str); - [RequiresUnsafe] unsafe void StoreVector256ToDestination(T* dest, T* destStart, int destLength, Vector256 str); - [RequiresUnsafe] unsafe void StoreVector128ToDestination(T* dest, T* destStart, int destLength, Vector128 str); - [RequiresUnsafe] unsafe void StoreArmVector128x4ToDestination(T* dest, T* destStart, int destLength, Vector128 res1, Vector128 res2, Vector128 res3, Vector128 res4); #endif // NET @@ -241,19 +230,13 @@ bool TryDecode256Core( Vector256 lutShift, Vector256 shiftForUnderscore, out Vector256 result); - [RequiresUnsafe] unsafe bool TryLoadVector512(T* src, T* srcStart, int sourceLength, out Vector512 str); - [RequiresUnsafe] unsafe bool TryLoadAvxVector256(T* src, T* srcStart, int sourceLength, out Vector256 str); - [RequiresUnsafe] unsafe bool TryLoadVector128(T* src, T* srcStart, int sourceLength, out Vector128 str); - [RequiresUnsafe] unsafe bool TryLoadArmVector128x4(T* src, T* srcStart, int sourceLength, out Vector128 str1, out Vector128 str2, out Vector128 str3, out Vector128 str4); #endif // NET - [RequiresUnsafe] unsafe int DecodeFourElements(T* source, ref sbyte decodingMap); - [RequiresUnsafe] unsafe int DecodeRemaining(T* srcEnd, ref sbyte decodingMap, long remaining, out uint t2, out uint t3); int IndexOfAnyExceptWhiteSpace(ReadOnlySpan span); OperationStatus DecodeWithWhiteSpaceBlockwiseWrapper(TTBase64Decoder decoder, ReadOnlySpan source, diff --git a/src/libraries/System.Private.CoreLib/src/System/Buffers/Text/Base64Url/Base64UrlDecoder.cs b/src/libraries/System.Private.CoreLib/src/System/Buffers/Text/Base64Url/Base64UrlDecoder.cs index f2083119c4a22c..ddf56b3dd341f4 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Buffers/Text/Base64Url/Base64UrlDecoder.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Buffers/Text/Base64Url/Base64UrlDecoder.cs @@ -445,36 +445,30 @@ public bool TryDecode256Core( } [MethodImpl(MethodImplOptions.AggressiveInlining)] - [RequiresUnsafe] public unsafe bool TryLoadVector512(byte* src, byte* srcStart, int sourceLength, out Vector512 str) => default(Base64DecoderByte).TryLoadVector512(src, srcStart, sourceLength, out str); [MethodImpl(MethodImplOptions.AggressiveInlining)] [CompExactlyDependsOn(typeof(Avx2))] - [RequiresUnsafe] public unsafe bool TryLoadAvxVector256(byte* src, byte* srcStart, int sourceLength, out Vector256 str) => default(Base64DecoderByte).TryLoadAvxVector256(src, srcStart, sourceLength, out str); [MethodImpl(MethodImplOptions.AggressiveInlining)] - [RequiresUnsafe] public unsafe bool TryLoadVector128(byte* src, byte* srcStart, int sourceLength, out Vector128 str) => default(Base64DecoderByte).TryLoadVector128(src, srcStart, sourceLength, out str); [MethodImpl(MethodImplOptions.AggressiveInlining)] [CompExactlyDependsOn(typeof(AdvSimd.Arm64))] - [RequiresUnsafe] public unsafe bool TryLoadArmVector128x4(byte* src, byte* srcStart, int sourceLength, out Vector128 str1, out Vector128 str2, out Vector128 str3, out Vector128 str4) => default(Base64DecoderByte).TryLoadArmVector128x4(src, srcStart, sourceLength, out str1, out str2, out str3, out str4); #endif // NET [MethodImpl(MethodImplOptions.AggressiveInlining)] - [RequiresUnsafe] public unsafe int DecodeFourElements(byte* source, ref sbyte decodingMap) => default(Base64DecoderByte).DecodeFourElements(source, ref decodingMap); [MethodImpl(MethodImplOptions.AggressiveInlining)] - [RequiresUnsafe] public unsafe int DecodeRemaining(byte* srcEnd, ref sbyte decodingMap, long remaining, out uint t2, out uint t3) => default(Base64DecoderByte).DecodeRemaining(srcEnd, ref decodingMap, remaining, out t2, out t3); @@ -536,36 +530,30 @@ public bool TryDecode256Core(Vector256 str, Vector256 hiNibbles, V default(Base64UrlDecoderByte).TryDecode256Core(str, hiNibbles, maskSlashOrUnderscore, lutLow, lutHigh, lutShift, shiftForUnderscore, out result); [MethodImpl(MethodImplOptions.AggressiveInlining)] - [RequiresUnsafe] public unsafe bool TryLoadVector512(ushort* src, ushort* srcStart, int sourceLength, out Vector512 str) => default(Base64DecoderChar).TryLoadVector512(src, srcStart, sourceLength, out str); [MethodImpl(MethodImplOptions.AggressiveInlining)] [CompExactlyDependsOn(typeof(Avx2))] - [RequiresUnsafe] public unsafe bool TryLoadAvxVector256(ushort* src, ushort* srcStart, int sourceLength, out Vector256 str) => default(Base64DecoderChar).TryLoadAvxVector256(src, srcStart, sourceLength, out str); [MethodImpl(MethodImplOptions.AggressiveInlining)] - [RequiresUnsafe] public unsafe bool TryLoadVector128(ushort* src, ushort* srcStart, int sourceLength, out Vector128 str) => default(Base64DecoderChar).TryLoadVector128(src, srcStart, sourceLength, out str); [MethodImpl(MethodImplOptions.AggressiveInlining)] [CompExactlyDependsOn(typeof(AdvSimd.Arm64))] - [RequiresUnsafe] public unsafe bool TryLoadArmVector128x4(ushort* src, ushort* srcStart, int sourceLength, out Vector128 str1, out Vector128 str2, out Vector128 str3, out Vector128 str4) => default(Base64DecoderChar).TryLoadArmVector128x4(src, srcStart, sourceLength, out str1, out str2, out str3, out str4); #endif // NET [MethodImpl(MethodImplOptions.AggressiveInlining)] - [RequiresUnsafe] public unsafe int DecodeFourElements(ushort* source, ref sbyte decodingMap) => default(Base64DecoderChar).DecodeFourElements(source, ref decodingMap); [MethodImpl(MethodImplOptions.AggressiveInlining)] - [RequiresUnsafe] public unsafe int DecodeRemaining(ushort* srcEnd, ref sbyte decodingMap, long remaining, out uint t2, out uint t3) => default(Base64DecoderChar).DecodeRemaining(srcEnd, ref decodingMap, remaining, out t2, out t3); diff --git a/src/libraries/System.Private.CoreLib/src/System/Buffers/Text/Base64Url/Base64UrlEncoder.cs b/src/libraries/System.Private.CoreLib/src/System/Buffers/Text/Base64Url/Base64UrlEncoder.cs index 7a945367cbe73b..8f5e047613bf05 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Buffers/Text/Base64Url/Base64UrlEncoder.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Buffers/Text/Base64Url/Base64UrlEncoder.cs @@ -244,7 +244,6 @@ public uint GetInPlaceDestinationLength(int encodedLength, int leftOver) => public int GetMaxEncodedLength(int srcLength) => GetEncodedLength(srcLength); [MethodImpl(MethodImplOptions.AggressiveInlining)] - [RequiresUnsafe] public unsafe void EncodeOneOptionallyPadTwo(byte* oneByte, byte* dest, ref byte encodingMap) { uint t0 = oneByte[0]; @@ -269,7 +268,6 @@ public unsafe void EncodeOneOptionallyPadTwo(byte* oneByte, byte* dest, ref byte } [MethodImpl(MethodImplOptions.AggressiveInlining)] - [RequiresUnsafe] public unsafe void EncodeTwoOptionallyPadOne(byte* twoBytes, byte* dest, ref byte encodingMap) { uint t0 = twoBytes[0]; @@ -288,31 +286,26 @@ public unsafe void EncodeTwoOptionallyPadOne(byte* twoBytes, byte* dest, ref byt #if NET [MethodImpl(MethodImplOptions.AggressiveInlining)] - [RequiresUnsafe] public unsafe void StoreVector512ToDestination(byte* dest, byte* destStart, int destLength, Vector512 str) => default(Base64EncoderByte).StoreVector512ToDestination(dest, destStart, destLength, str); [MethodImpl(MethodImplOptions.AggressiveInlining)] [CompExactlyDependsOn(typeof(Avx2))] - [RequiresUnsafe] public unsafe void StoreVector256ToDestination(byte* dest, byte* destStart, int destLength, Vector256 str) => default(Base64EncoderByte).StoreVector256ToDestination(dest, destStart, destLength, str); [MethodImpl(MethodImplOptions.AggressiveInlining)] - [RequiresUnsafe] public unsafe void StoreVector128ToDestination(byte* dest, byte* destStart, int destLength, Vector128 str) => default(Base64EncoderByte).StoreVector128ToDestination(dest, destStart, destLength, str); [MethodImpl(MethodImplOptions.AggressiveInlining)] [CompExactlyDependsOn(typeof(AdvSimd.Arm64))] - [RequiresUnsafe] public unsafe void StoreArmVector128x4ToDestination(byte* dest, byte* destStart, int destLength, Vector128 res1, Vector128 res2, Vector128 res3, Vector128 res4) => default(Base64EncoderByte).StoreArmVector128x4ToDestination(dest, destStart, destLength, res1, res2, res3, res4); #endif // NET [MethodImpl(MethodImplOptions.AggressiveInlining)] - [RequiresUnsafe] public unsafe void EncodeThreeAndWrite(byte* threeBytes, byte* destination, ref byte encodingMap) => default(Base64EncoderByte).EncodeThreeAndWrite(threeBytes, destination, ref encodingMap); } @@ -341,41 +334,34 @@ public int GetMaxSrcLength(int srcLength, int destLength) => public int GetMaxEncodedLength(int _) => 0; // not used for char encoding [MethodImpl(MethodImplOptions.AggressiveInlining)] - [RequiresUnsafe] public unsafe void EncodeOneOptionallyPadTwo(byte* oneByte, ushort* dest, ref byte encodingMap) => Base64Helper.EncodeOneOptionallyPadTwo(oneByte, dest, ref encodingMap); [MethodImpl(MethodImplOptions.AggressiveInlining)] - [RequiresUnsafe] public unsafe void EncodeTwoOptionallyPadOne(byte* twoBytes, ushort* dest, ref byte encodingMap) => Base64Helper.EncodeTwoOptionallyPadOne(twoBytes, dest, ref encodingMap); #if NET [MethodImpl(MethodImplOptions.AggressiveInlining)] - [RequiresUnsafe] public unsafe void StoreVector512ToDestination(ushort* dest, ushort* destStart, int destLength, Vector512 str) => default(Base64EncoderChar).StoreVector512ToDestination(dest, destStart, destLength, str); [MethodImpl(MethodImplOptions.AggressiveInlining)] - [RequiresUnsafe] public unsafe void StoreVector256ToDestination(ushort* dest, ushort* destStart, int destLength, Vector256 str) => default(Base64EncoderChar).StoreVector256ToDestination(dest, destStart, destLength, str); [MethodImpl(MethodImplOptions.AggressiveInlining)] - [RequiresUnsafe] public unsafe void StoreVector128ToDestination(ushort* dest, ushort* destStart, int destLength, Vector128 str) => default(Base64EncoderChar).StoreVector128ToDestination(dest, destStart, destLength, str); [MethodImpl(MethodImplOptions.AggressiveInlining)] [CompExactlyDependsOn(typeof(AdvSimd.Arm64))] - [RequiresUnsafe] public unsafe void StoreArmVector128x4ToDestination(ushort* dest, ushort* destStart, int destLength, Vector128 res1, Vector128 res2, Vector128 res3, Vector128 res4) => default(Base64EncoderChar).StoreArmVector128x4ToDestination(dest, destStart, destLength, res1, res2, res3, res4); #endif // NET [MethodImpl(MethodImplOptions.AggressiveInlining)] - [RequiresUnsafe] public unsafe void EncodeThreeAndWrite(byte* threeBytes, ushort* destination, ref byte encodingMap) => default(Base64EncoderChar).EncodeThreeAndWrite(threeBytes, destination, ref encodingMap); } diff --git a/src/libraries/System.Private.CoreLib/src/System/Decimal.DecCalc.cs b/src/libraries/System.Private.CoreLib/src/System/Decimal.DecCalc.cs index cb56695b309fc5..ca312b17cec6ed 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Decimal.DecCalc.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Decimal.DecCalc.cs @@ -362,7 +362,6 @@ private static void Unscale(ref uint low, ref ulong high64, ref int scale) /// 64-bit divisor /// Returns quotient. Remainder overwrites lower 64-bits of dividend. [MethodImpl(MethodImplOptions.AggressiveInlining)] - [RequiresUnsafe] private static unsafe ulong Div128By64(Buf16* bufNum, ulong den) { Debug.Assert(den > bufNum->High64); @@ -606,7 +605,6 @@ private static void IncreaseScale64(ref Buf12 bufNum, uint power) /// Index of last non-zero value in bufRes /// Scale factor for this value, range 0 - 2 * DEC_SCALE_MAX /// Returns new scale factor. bufRes updated in place, always 3 uints. - [RequiresUnsafe] private static unsafe int ScaleResult(Buf24* bufRes, uint hiRes, int scale) { Debug.Assert(hiRes < Buf24.Length); @@ -768,7 +766,6 @@ private static unsafe int ScaleResult(Buf24* bufRes, uint hiRes, int scale) } [MethodImpl(MethodImplOptions.AggressiveInlining)] - [RequiresUnsafe] private static unsafe uint DivByConst(uint* result, uint hiRes, out uint quotient, out uint remainder, uint power) { uint high = result[hiRes]; diff --git a/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/ActivityTracker.cs b/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/ActivityTracker.cs index 31b3d254a56d1e..e12e68fd8b813f 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/ActivityTracker.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/ActivityTracker.cs @@ -378,7 +378,6 @@ private unsafe void CreateActivityPathGuid(out Guid idRet, out int activityPathG /// sufficient space for this ID. By doing this, we preserve the fact that this activity /// is a child (of unknown depth) from that ancestor. /// - [RequiresUnsafe] private unsafe void CreateOverflowGuid(Guid* outPtr) { // Search backwards for an ancestor that has sufficient space to put the ID. @@ -427,7 +426,6 @@ private enum NumberListCodes : byte /// is the maximum number of bytes that fit in a GUID) if the path did not fit. /// If 'overflow' is true, then the number is encoded as an 'overflow number (which has a /// special (longer prefix) that indicates that this ID is allocated differently - [RequiresUnsafe] private static unsafe int AddIdToGuid(Guid* outPtr, int whereToAddId, uint id, bool overflow = false) { byte* ptr = (byte*)outPtr; @@ -503,7 +501,6 @@ private static unsafe int AddIdToGuid(Guid* outPtr, int whereToAddId, uint id, b /// Thus if it is non-zero it adds to the current byte, otherwise it advances and writes /// the new byte (in the high bits) of the next byte. /// - [RequiresUnsafe] private static unsafe void WriteNibble(ref byte* ptr, byte* endPtr, uint value) { Debug.Assert(value < 16); diff --git a/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/EventPipe.Internal.cs b/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/EventPipe.Internal.cs index 70fba068cf0fa2..dfa67fe2c2c392 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/EventPipe.Internal.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/EventPipe.Internal.cs @@ -15,7 +15,6 @@ internal static partial class EventPipeInternal // These PInvokes are used by the configuration APIs to interact with EventPipe. // [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "EventPipeInternal_Enable")] - [RequiresUnsafe] private static unsafe partial ulong Enable( char* outputFile, EventPipeSerializationFormat format, @@ -30,13 +29,11 @@ private static unsafe partial ulong Enable( // These PInvokes are used by EventSource to interact with the EventPipe. // [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "EventPipeInternal_CreateProvider", StringMarshalling = StringMarshalling.Utf16)] - [RequiresUnsafe] internal static unsafe partial IntPtr CreateProvider(string providerName, delegate* unmanaged callbackFunc, void* callbackContext); [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "EventPipeInternal_DefineEvent")] - [RequiresUnsafe] internal static unsafe partial IntPtr DefineEvent(IntPtr provHandle, uint eventID, long keywords, uint eventVersion, uint level, void *pMetadata, uint metadataLength); [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "EventPipeInternal_GetProvider", StringMarshalling = StringMarshalling.Utf16)] @@ -49,19 +46,16 @@ internal static unsafe partial IntPtr CreateProvider(string providerName, internal static partial int EventActivityIdControl(uint controlCode, ref Guid activityId); [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "EventPipeInternal_WriteEventData")] - [RequiresUnsafe] internal static unsafe partial void WriteEventData(IntPtr eventHandle, EventProvider.EventData* pEventData, uint dataCount, Guid* activityId, Guid* relatedActivityId); // // These PInvokes are used as part of the EventPipeEventDispatcher. // [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "EventPipeInternal_GetSessionInfo")] - [RequiresUnsafe] [return: MarshalAs(UnmanagedType.Bool)] internal static unsafe partial bool GetSessionInfo(ulong sessionID, EventPipeSessionInfo* pSessionInfo); [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "EventPipeInternal_GetNextEvent")] - [RequiresUnsafe] [return: MarshalAs(UnmanagedType.Bool)] internal static unsafe partial bool GetNextEvent(ulong sessionID, EventPipeEventInstanceData* pInstance); diff --git a/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/EventPipeEventProvider.cs b/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/EventPipeEventProvider.cs index c43a38239ec225..2e49aba519abbc 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/EventPipeEventProvider.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/EventPipeEventProvider.cs @@ -18,7 +18,6 @@ internal EventPipeEventProvider(EventProvider eventProvider) _eventProvider = new WeakReference(eventProvider); } - [RequiresUnsafe] protected override unsafe void HandleEnableNotification( EventProvider target, byte* additionalData, @@ -61,7 +60,6 @@ protected override unsafe void HandleEnableNotification( } [UnmanagedCallersOnly] - [RequiresUnsafe] private static unsafe void Callback(byte* sourceId, int isEnabled, byte level, long matchAnyKeywords, long matchAllKeywords, Interop.Advapi32.EVENT_FILTER_DESCRIPTOR* filterData, void* callbackContext) { @@ -102,7 +100,6 @@ internal override void Unregister() } // Write an event. - [RequiresUnsafe] internal override unsafe EventProvider.WriteEventErrorCode EventWriteTransfer( in EventDescriptor eventDescriptor, IntPtr eventHandle, @@ -141,7 +138,6 @@ internal override int ActivityIdControl(Interop.Advapi32.ActivityControl control } // Define an EventPipeEvent handle. - [RequiresUnsafe] internal override unsafe IntPtr DefineEventHandle(uint eventID, string eventName, long keywords, uint eventVersion, uint level, byte* pMetadata, uint metadataLength) { diff --git a/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/EventPipeMetadataGenerator.cs b/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/EventPipeMetadataGenerator.cs index b549cb14974ea4..6d564e82ba51ac 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/EventPipeMetadataGenerator.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/EventPipeMetadataGenerator.cs @@ -221,7 +221,6 @@ private EventPipeMetadataGenerator() { } // Copy src to buffer and modify the offset. // Note: We know the buffer size ahead of time to make sure no buffer overflow. - [RequiresUnsafe] internal static unsafe void WriteToBuffer(byte* buffer, uint bufferLength, ref uint offset, byte* src, uint srcLength) { Debug.Assert(bufferLength >= (offset + srcLength)); @@ -232,7 +231,6 @@ internal static unsafe void WriteToBuffer(byte* buffer, uint bufferLength, ref u offset += srcLength; } - [RequiresUnsafe] internal static unsafe void WriteToBuffer(byte* buffer, uint bufferLength, ref uint offset, T value) where T : unmanaged { Debug.Assert(bufferLength >= (offset + sizeof(T))); @@ -254,7 +252,6 @@ internal void SetInfo(string name, Type type, TraceLoggingTypeInfo? typeInfo = n TypeInfo = typeInfo; } - [RequiresUnsafe] internal unsafe bool GenerateMetadata(byte* pMetadataBlob, ref uint offset, uint blobSize) { TypeCode typeCode = GetTypeCodeExtended(ParameterType); @@ -310,7 +307,6 @@ internal unsafe bool GenerateMetadata(byte* pMetadataBlob, ref uint offset, uint return true; } - [RequiresUnsafe] private static unsafe bool GenerateMetadataForProperty(PropertyAnalysis property, byte* pMetadataBlob, ref uint offset, uint blobSize) { Debug.Assert(property != null); @@ -378,7 +374,6 @@ private static unsafe bool GenerateMetadataForProperty(PropertyAnalysis property return true; } - [RequiresUnsafe] internal unsafe bool GenerateMetadataV2(byte* pMetadataBlob, ref uint offset, uint blobSize) { if (TypeInfo == null) @@ -386,7 +381,6 @@ internal unsafe bool GenerateMetadataV2(byte* pMetadataBlob, ref uint offset, ui return GenerateMetadataForNamedTypeV2(ParameterName, TypeInfo, pMetadataBlob, ref offset, blobSize); } - [RequiresUnsafe] private static unsafe bool GenerateMetadataForNamedTypeV2(string name, TraceLoggingTypeInfo typeInfo, byte* pMetadataBlob, ref uint offset, uint blobSize) { Debug.Assert(pMetadataBlob != null); @@ -407,7 +401,6 @@ private static unsafe bool GenerateMetadataForNamedTypeV2(string name, TraceLogg return GenerateMetadataForTypeV2(typeInfo, pMetadataBlob, ref offset, blobSize); } - [RequiresUnsafe] private static unsafe bool GenerateMetadataForTypeV2(TraceLoggingTypeInfo? typeInfo, byte* pMetadataBlob, ref uint offset, uint blobSize) { Debug.Assert(typeInfo != null); diff --git a/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/EventProvider.cs b/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/EventProvider.cs index a5b1c3aa88e5be..8851c7ff5c6c96 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/EventProvider.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/EventProvider.cs @@ -237,7 +237,6 @@ private static void SetLastError(WriteEventErrorCode error) s_returnCode = error; } - [RequiresUnsafe] private static unsafe object? EncodeObject(ref object? data, ref EventData* dataDescriptor, ref byte* dataBuffer, ref uint totalEventSize) /*++ @@ -463,7 +462,6 @@ to fill the passed in ETW data descriptor. /// /// Payload for the ETW event. /// - [RequiresUnsafe] internal unsafe bool WriteEvent(ref EventDescriptor eventDescriptor, IntPtr eventHandle, Guid* activityID, Guid* childActivityID, object?[] eventPayload) { WriteEventErrorCode status = WriteEventErrorCode.NoError; @@ -674,7 +672,6 @@ internal unsafe bool WriteEvent(ref EventDescriptor eventDescriptor, IntPtr even /// /// pointer do the event data /// - [RequiresUnsafe] protected internal unsafe bool WriteEvent(ref EventDescriptor eventDescriptor, IntPtr eventHandle, Guid* activityID, Guid* childActivityID, int dataCount, IntPtr data) { if (childActivityID != null) @@ -696,7 +693,6 @@ protected internal unsafe bool WriteEvent(ref EventDescriptor eventDescriptor, I return true; } - [RequiresUnsafe] internal unsafe bool WriteEventRaw( ref EventDescriptor eventDescriptor, IntPtr eventHandle, @@ -769,7 +765,6 @@ internal override void Disable() _liveSessions = null; } - [RequiresUnsafe] protected override unsafe void HandleEnableNotification( EventProvider target, byte *additionalData, @@ -870,7 +865,6 @@ internal override void Unregister() } // Write an event. - [RequiresUnsafe] internal override unsafe EventProvider.WriteEventErrorCode EventWriteTransfer( in EventDescriptor eventDescriptor, IntPtr eventHandle, @@ -904,7 +898,6 @@ internal override int ActivityIdControl(Interop.Advapi32.ActivityControl Control } // Define an EventPipeEvent handle. - [RequiresUnsafe] internal override unsafe IntPtr DefineEventHandle(uint eventID, string eventName, long keywords, uint eventVersion, uint level, byte* pMetadata, uint metadataLength) { @@ -1153,7 +1146,6 @@ internal EventKeywords MatchAllKeyword set => _allKeywordMask = unchecked((long)value); } - [RequiresUnsafe] protected virtual unsafe void HandleEnableNotification( EventProvider target, byte *additionalData, @@ -1234,7 +1226,6 @@ internal virtual void Unregister() { } - [RequiresUnsafe] internal virtual unsafe EventProvider.WriteEventErrorCode EventWriteTransfer( in EventDescriptor eventDescriptor, IntPtr eventHandle, @@ -1252,14 +1243,12 @@ internal virtual int ActivityIdControl(Interop.Advapi32.ActivityControl ControlC } // Define an EventPipeEvent handle. - [RequiresUnsafe] internal virtual unsafe IntPtr DefineEventHandle(uint eventID, string eventName, long keywords, uint eventVersion, uint level, byte* pMetadata, uint metadataLength) { return IntPtr.Zero; } - [RequiresUnsafe] protected unsafe void ProviderCallback( EventProvider target, byte *additionalData, @@ -1341,7 +1330,6 @@ private static int FindNull(byte[] buffer, int idx) return args; } - [RequiresUnsafe] protected unsafe bool MarshalFilterData(Interop.Advapi32.EVENT_FILTER_DESCRIPTOR* filterData, out ControllerCommand command, out byte[]? data) { Debug.Assert(filterData != null); diff --git a/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/EventSource.cs b/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/EventSource.cs index feabfae3e18835..bbd1061c0e6509 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/EventSource.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/EventSource.cs @@ -1272,7 +1272,6 @@ internal int Reserved /// Pinned tracelogging-compatible metadata blob. /// The size of the metadata blob. /// Value for reserved: 2 for per-provider metadata, 1 for per-event metadata - [RequiresUnsafe] internal unsafe void SetMetadata(byte* pointer, int size, int reserved) { this.m_Ptr = (ulong)pointer; @@ -1321,7 +1320,6 @@ internal unsafe void SetMetadata(byte* pointer, int size, int reserved) "requires unreferenced code, but EnsureDescriptorsInitialized does not access this member and is safe to call.")] [RequiresUnreferencedCode(EventSourceRequiresUnreferenceMessage)] [CLSCompliant(false)] - [RequiresUnsafe] protected unsafe void WriteEventCore(int eventId, int eventDataCount, EventData* data) { WriteEventWithRelatedActivityIdCore(eventId, null, eventDataCount, data); @@ -1357,7 +1355,6 @@ protected unsafe void WriteEventCore(int eventId, int eventDataCount, EventData* "requires unreferenced code, but EnsureDescriptorsInitialized does not access this member and is safe to call.")] [RequiresUnreferencedCode(EventSourceRequiresUnreferenceMessage)] [CLSCompliant(false)] - [RequiresUnsafe] protected unsafe void WriteEventWithRelatedActivityIdCore(int eventId, Guid* relatedActivityId, int eventDataCount, EventData* data) { if (IsEnabled()) @@ -1573,7 +1570,6 @@ protected virtual void Dispose(bool disposing) #region private - [RequiresUnsafe] private unsafe void WriteEventRaw( string? eventName, ref EventDescriptor eventDescriptor, @@ -1791,7 +1787,6 @@ private static Guid GenerateGuidFromName(string name) return new Guid(bytes.Slice(0, 16)); } - [RequiresUnsafe] private static unsafe void DecodeObjects(object?[] decodedObjects, Type[] parameterTypes, EventData* data) { for (int i = 0; i < decodedObjects.Length; i++, data++) @@ -1960,7 +1955,6 @@ private static unsafe void DecodeObjects(object?[] decodedObjects, Type[] parame } [Conditional("DEBUG")] - [RequiresUnsafe] private static unsafe void AssertValidString(EventData* data) { Debug.Assert(data->Size >= 0 && data->Size % 2 == 0, "String size should be even"); @@ -1991,7 +1985,6 @@ private static unsafe void AssertValidString(EventData* data) Justification = "EnsureDescriptorsInitialized's use of GetType preserves this method which " + "requires unreferenced code, but EnsureDescriptorsInitialized does not access this member and is safe to call.")] [RequiresUnreferencedCode(EventSourceRequiresUnreferenceMessage)] - [RequiresUnsafe] private unsafe void WriteEventVarargs(int eventId, Guid* childActivityID, object?[] args) { if (IsEnabled()) @@ -2155,7 +2148,6 @@ private void LogEventArgsMismatches(int eventId, object?[] args) } } - [RequiresUnsafe] private unsafe void WriteToAllListeners(EventWrittenEventArgs eventCallbackArgs, int eventDataCount, EventData* data) { Debug.Assert(m_eventData != null); @@ -3926,7 +3918,6 @@ internal static void InitializeDefaultEventSources() #if CORECLR [UnmanagedCallersOnly] - [RequiresUnsafe] private static unsafe void InitializeDefaultEventSources(Exception* pException) { try @@ -4330,7 +4321,6 @@ internal EventWrittenEventArgs(EventSource eventSource, int eventId) TimeStamp = DateTime.UtcNow; } - [RequiresUnsafe] internal unsafe EventWrittenEventArgs(EventSource eventSource, int eventId, Guid* pActivityID, Guid* pChildActivityID) : this(eventSource, eventId) { diff --git a/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/NativeRuntimeEventSource.Threading.NativeSinks.cs b/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/NativeRuntimeEventSource.Threading.NativeSinks.cs index 2e03275ddbf86a..1fc333603fdd0a 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/NativeRuntimeEventSource.Threading.NativeSinks.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/NativeRuntimeEventSource.Threading.NativeSinks.cs @@ -224,7 +224,6 @@ private void ThreadPoolIOEnqueue( [NonEvent] [MethodImpl(MethodImplOptions.NoInlining)] - [RequiresUnsafe] public unsafe void ThreadPoolIOEnqueue(NativeOverlapped* nativeOverlapped) { if (IsEnabled(EventLevel.Verbose, Keywords.ThreadingKeyword | Keywords.ThreadTransferKeyword)) @@ -266,7 +265,6 @@ private void ThreadPoolIODequeue( [NonEvent] [MethodImpl(MethodImplOptions.NoInlining)] - [RequiresUnsafe] public unsafe void ThreadPoolIODequeue(NativeOverlapped* nativeOverlapped) { if (IsEnabled(EventLevel.Verbose, Keywords.ThreadingKeyword | Keywords.ThreadTransferKeyword)) @@ -306,7 +304,6 @@ public void ThreadPoolWorkingThreadCount(uint Count, ushort ClrInstanceID = Defa [NonEvent] [MethodImpl(MethodImplOptions.NoInlining)] - [RequiresUnsafe] public unsafe void ThreadPoolIOPack(NativeOverlapped* nativeOverlapped) { if (IsEnabled(EventLevel.Verbose, Keywords.ThreadingKeyword)) diff --git a/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/TraceLogging/DataCollector.cs b/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/TraceLogging/DataCollector.cs index e41ea97b986014..ab1207d431178a 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/TraceLogging/DataCollector.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/TraceLogging/DataCollector.cs @@ -34,7 +34,6 @@ internal unsafe struct DataCollector private int bufferNesting; // We may merge many fields int a single blob. If we are doing this we increment this. private bool writingScalars; - [RequiresUnsafe] internal void Enable( byte* scratch, int scratchSize, @@ -66,14 +65,12 @@ internal void Disable() /// A pointer to the next unused data descriptor, or datasEnd if they were /// all used. (Descriptors may be unused if a string or array was null.) /// - [RequiresUnsafe] internal EventSource.EventData* Finish() { this.ScalarsEnd(); return this.datas; } - [RequiresUnsafe] internal void AddScalar(void* value, int size) { var pb = (byte*)value; diff --git a/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/TraceLogging/TraceLoggingEventSource.cs b/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/TraceLogging/TraceLoggingEventSource.cs index 9ef95f7ddff82e..e18a27209475cf 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/TraceLogging/TraceLoggingEventSource.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/TraceLogging/TraceLoggingEventSource.cs @@ -325,7 +325,6 @@ public unsafe void Write(string? eventName, EventSourceOptions options) /// the values must match the number and types of the fields described by the /// eventTypes parameter. /// - [RequiresUnsafe] private unsafe void WriteMultiMerge( string? eventName, ref EventSourceOptions options, @@ -386,7 +385,6 @@ private unsafe void WriteMultiMerge( /// the values must match the number and types of the fields described by the /// eventTypes parameter. /// - [RequiresUnsafe] private unsafe void WriteMultiMergeInner( string? eventName, ref EventSourceOptions options, @@ -506,7 +504,6 @@ private unsafe void WriteMultiMergeInner( /// The number and types of the values must match the number and types of the /// fields described by the eventTypes parameter. /// - [RequiresUnsafe] internal unsafe void WriteMultiMerge( string? eventName, ref EventSourceOptions options, @@ -577,7 +574,6 @@ internal unsafe void WriteMultiMerge( } } - [RequiresUnsafe] private unsafe void WriteImpl( string? eventName, ref EventSourceOptions options, @@ -699,7 +695,6 @@ private unsafe void WriteImpl( } } - [RequiresUnsafe] private unsafe void WriteToAllListeners(string? eventName, ref EventDescriptor eventDescriptor, EventTags tags, Guid* pActivityId, Guid* pChildActivityId, EventPayload? payload) { // Self described events do not have an id attached. We mark it internally with -1. @@ -722,7 +717,6 @@ private unsafe void WriteToAllListeners(string? eventName, ref EventDescriptor e } [NonEvent] - [RequiresUnsafe] private static unsafe void WriteCleanup(GCHandle* pPins, int cPins) { DataCollector.ThreadInstance.Disable(); diff --git a/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/TraceLogging/XplatEventLogger.cs b/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/TraceLogging/XplatEventLogger.cs index 049650dd662fc5..0e3d11876a7056 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/TraceLogging/XplatEventLogger.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/TraceLogging/XplatEventLogger.cs @@ -22,7 +22,6 @@ public XplatEventLogger() { } private static unsafe string GetClrConfig(string configName) => new string(EventSource_GetClrConfig(configName)); [LibraryImport(RuntimeHelpers.QCall, StringMarshalling = StringMarshalling.Utf16)] - [RequiresUnsafe] private static unsafe partial char* EventSource_GetClrConfig(string configName); private static bool initializedPersistentListener; diff --git a/src/libraries/System.Private.CoreLib/src/System/Globalization/CalendarData.Icu.cs b/src/libraries/System.Private.CoreLib/src/System/Globalization/CalendarData.Icu.cs index 399cc58b0b80c2..ebb8b2749afd19 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Globalization/CalendarData.Icu.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Globalization/CalendarData.Icu.cs @@ -427,7 +427,6 @@ internal static unsafe bool EnumCalendarInfo(string localeName, CalendarId calen return result; } - [RequiresUnsafe] private static unsafe bool EnumCalendarInfo(string localeName, CalendarId calendarId, CalendarDataType dataType, IcuEnumCalendarsData* callbackContext) { #if TARGET_MACCATALYST || TARGET_IOS || TARGET_TVOS @@ -439,7 +438,6 @@ private static unsafe bool EnumCalendarInfo(string localeName, CalendarId calend } [UnmanagedCallersOnly] - [RequiresUnsafe] private static unsafe void EnumCalendarInfoCallback(char* calendarStringPtr, IntPtr context) { try diff --git a/src/libraries/System.Private.CoreLib/src/System/Globalization/CalendarData.Nls.cs b/src/libraries/System.Private.CoreLib/src/System/Globalization/CalendarData.Nls.cs index bdfd44bd906792..758b2743853ba1 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Globalization/CalendarData.Nls.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Globalization/CalendarData.Nls.cs @@ -60,7 +60,6 @@ private struct EnumData // EnumCalendarInfoExEx callback itself. [UnmanagedCallersOnly] - [RequiresUnsafe] private static unsafe Interop.BOOL EnumCalendarInfoCallback(char* lpCalendarInfoString, uint calendar, IntPtr pReserved, void* lParam) { EnumData* context = (EnumData*)lParam; @@ -93,7 +92,6 @@ public struct NlsEnumCalendarsData } [UnmanagedCallersOnly] - [RequiresUnsafe] private static unsafe Interop.BOOL EnumCalendarsCallback(char* lpCalendarInfoString, uint calendar, IntPtr reserved, void* lParam) { NlsEnumCalendarsData* context = (NlsEnumCalendarsData*)lParam; diff --git a/src/libraries/System.Private.CoreLib/src/System/Globalization/CompareInfo.Icu.cs b/src/libraries/System.Private.CoreLib/src/System/Globalization/CompareInfo.Icu.cs index 46a89b4b1c2a88..a8bb129e68e896 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Globalization/CompareInfo.Icu.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Globalization/CompareInfo.Icu.cs @@ -64,7 +64,6 @@ private unsafe int IcuCompareString(ReadOnlySpan string1, ReadOnlySpan source, ReadOnlySpan target, CompareOptions options, int* matchLengthPtr, bool fromBeginning) { Debug.Assert(!GlobalizationMode.Invariant); @@ -102,7 +101,6 @@ private unsafe int IcuIndexOfCore(ReadOnlySpan source, ReadOnlySpan /// as the JIT wouldn't be able to optimize the ignoreCase path away. /// /// - [RequiresUnsafe] private unsafe int IndexOfOrdinalIgnoreCaseHelper(ReadOnlySpan source, ReadOnlySpan target, CompareOptions options, int* matchLengthPtr, bool fromBeginning) { Debug.Assert(!GlobalizationMode.Invariant); @@ -218,7 +216,6 @@ private unsafe int IndexOfOrdinalIgnoreCaseHelper(ReadOnlySpan source, Rea } } - [RequiresUnsafe] private unsafe int IndexOfOrdinalHelper(ReadOnlySpan source, ReadOnlySpan target, CompareOptions options, int* matchLengthPtr, bool fromBeginning) { Debug.Assert(!GlobalizationMode.Invariant); @@ -314,7 +311,6 @@ private unsafe int IndexOfOrdinalHelper(ReadOnlySpan source, ReadOnlySpan< } // this method sets '*matchLengthPtr' (if not nullptr) only on success - [RequiresUnsafe] private unsafe bool IcuStartsWith(ReadOnlySpan source, ReadOnlySpan prefix, CompareOptions options, int* matchLengthPtr) { Debug.Assert(!GlobalizationMode.Invariant); @@ -344,7 +340,6 @@ private unsafe bool IcuStartsWith(ReadOnlySpan source, ReadOnlySpan } } - [RequiresUnsafe] private unsafe bool StartsWithOrdinalIgnoreCaseHelper(ReadOnlySpan source, ReadOnlySpan prefix, CompareOptions options, int* matchLengthPtr) { Debug.Assert(!GlobalizationMode.Invariant); @@ -427,7 +422,6 @@ private unsafe bool StartsWithOrdinalIgnoreCaseHelper(ReadOnlySpan source, } } - [RequiresUnsafe] private unsafe bool StartsWithOrdinalHelper(ReadOnlySpan source, ReadOnlySpan prefix, CompareOptions options, int* matchLengthPtr) { Debug.Assert(!GlobalizationMode.Invariant); @@ -501,7 +495,6 @@ private unsafe bool StartsWithOrdinalHelper(ReadOnlySpan source, ReadOnlyS } // this method sets '*matchLengthPtr' (if not nullptr) only on success - [RequiresUnsafe] private unsafe bool IcuEndsWith(ReadOnlySpan source, ReadOnlySpan suffix, CompareOptions options, int* matchLengthPtr) { Debug.Assert(!GlobalizationMode.Invariant); @@ -531,7 +524,6 @@ private unsafe bool IcuEndsWith(ReadOnlySpan source, ReadOnlySpan su } } - [RequiresUnsafe] private unsafe bool EndsWithOrdinalIgnoreCaseHelper(ReadOnlySpan source, ReadOnlySpan suffix, CompareOptions options, int* matchLengthPtr) { Debug.Assert(!GlobalizationMode.Invariant); @@ -615,7 +607,6 @@ private unsafe bool EndsWithOrdinalIgnoreCaseHelper(ReadOnlySpan source, R } } - [RequiresUnsafe] private unsafe bool EndsWithOrdinalHelper(ReadOnlySpan source, ReadOnlySpan suffix, CompareOptions options, int* matchLengthPtr) { Debug.Assert(!GlobalizationMode.Invariant); diff --git a/src/libraries/System.Private.CoreLib/src/System/Globalization/CompareInfo.Nls.cs b/src/libraries/System.Private.CoreLib/src/System/Globalization/CompareInfo.Nls.cs index a4a2449aa51bbf..23b84657e4d066 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Globalization/CompareInfo.Nls.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Globalization/CompareInfo.Nls.cs @@ -243,7 +243,6 @@ private unsafe int NlsCompareString(ReadOnlySpan string1, ReadOnlySpan lpStringSource, @@ -295,7 +294,6 @@ private unsafe int FindString( } } - [RequiresUnsafe] private unsafe int NlsIndexOfCore(ReadOnlySpan source, ReadOnlySpan target, CompareOptions options, int* matchLengthPtr, bool fromBeginning) { Debug.Assert(!GlobalizationMode.Invariant); @@ -307,7 +305,6 @@ private unsafe int NlsIndexOfCore(ReadOnlySpan source, ReadOnlySpan return FindString(positionFlag | (uint)GetNativeCompareFlags(options), source, target, matchLengthPtr); } - [RequiresUnsafe] private unsafe bool NlsStartsWith(ReadOnlySpan source, ReadOnlySpan prefix, CompareOptions options, int* matchLengthPtr) { Debug.Assert(!GlobalizationMode.Invariant); @@ -329,7 +326,6 @@ private unsafe bool NlsStartsWith(ReadOnlySpan source, ReadOnlySpan return false; } - [RequiresUnsafe] private unsafe bool NlsEndsWith(ReadOnlySpan source, ReadOnlySpan suffix, CompareOptions options, int* matchLengthPtr) { Debug.Assert(!GlobalizationMode.Invariant); diff --git a/src/libraries/System.Private.CoreLib/src/System/Globalization/CompareInfo.cs b/src/libraries/System.Private.CoreLib/src/System/Globalization/CompareInfo.cs index bf628417f98e20..25301679bad7e4 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Globalization/CompareInfo.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Globalization/CompareInfo.cs @@ -627,7 +627,6 @@ public unsafe bool IsPrefix(ReadOnlySpan source, ReadOnlySpan prefix return matched; } - [RequiresUnsafe] private unsafe bool StartsWithCore(ReadOnlySpan source, ReadOnlySpan prefix, CompareOptions options, int* matchLengthPtr) => GlobalizationMode.UseNls ? NlsStartsWith(source, prefix, options, matchLengthPtr) : @@ -776,7 +775,6 @@ public bool IsSuffix(string source, string suffix) return IsSuffix(source, suffix, CompareOptions.None); } - [RequiresUnsafe] private unsafe bool EndsWithCore(ReadOnlySpan source, ReadOnlySpan suffix, CompareOptions options, int* matchLengthPtr) => GlobalizationMode.UseNls ? NlsEndsWith(source, suffix, options, matchLengthPtr) : @@ -1045,7 +1043,6 @@ public int IndexOf(ReadOnlySpan source, Rune value, CompareOptions options /// Caller needs to ensure is non-null and points /// to a valid address. This method will validate . /// - [RequiresUnsafe] private unsafe int IndexOf(ReadOnlySpan source, ReadOnlySpan value, int* matchLengthPtr, CompareOptions options, bool fromBeginning) { Debug.Assert(matchLengthPtr != null); @@ -1111,7 +1108,6 @@ private unsafe int IndexOf(ReadOnlySpan source, ReadOnlySpan value, return retVal; } - [RequiresUnsafe] private unsafe int IndexOfCore(ReadOnlySpan source, ReadOnlySpan target, CompareOptions options, int* matchLengthPtr, bool fromBeginning) => GlobalizationMode.UseNls ? NlsIndexOfCore(source, target, options, matchLengthPtr, fromBeginning) : diff --git a/src/libraries/System.Private.CoreLib/src/System/Globalization/CultureData.Nls.cs b/src/libraries/System.Private.CoreLib/src/System/Globalization/CultureData.Nls.cs index d2ea6b8ec02f30..cb178278d9889a 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Globalization/CultureData.Nls.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Globalization/CultureData.Nls.cs @@ -37,7 +37,6 @@ internal static unsafe int GetLocaleInfoExInt(string localeName, uint field) return value; } - [RequiresUnsafe] internal static unsafe int GetLocaleInfoEx(string lpLocaleName, uint lcType, char* lpLCData, int cchData) { Debug.Assert(!GlobalizationMode.Invariant); @@ -346,7 +345,6 @@ private struct EnumLocaleData // EnumSystemLocaleEx callback. [UnmanagedCallersOnly] - [RequiresUnsafe] private static unsafe Interop.BOOL EnumSystemLocalesProc(char* lpLocaleString, uint flags, void* contextHandle) { EnumLocaleData* context = (EnumLocaleData*)contextHandle; @@ -370,7 +368,6 @@ private static unsafe Interop.BOOL EnumSystemLocalesProc(char* lpLocaleString, u // EnumSystemLocaleEx callback. [UnmanagedCallersOnly] - [RequiresUnsafe] private static unsafe Interop.BOOL EnumAllSystemLocalesProc(char* lpLocaleString, uint flags, void* contextHandle) { try @@ -392,7 +389,6 @@ private struct EnumData // EnumTimeFormatsEx callback itself. [UnmanagedCallersOnly] - [RequiresUnsafe] private static unsafe Interop.BOOL EnumTimeCallback(char* lpTimeFormatString, void* lParam) { try diff --git a/src/libraries/System.Private.CoreLib/src/System/Globalization/TextInfo.Icu.cs b/src/libraries/System.Private.CoreLib/src/System/Globalization/TextInfo.Icu.cs index 05b66058881060..0e04fb4dd1e9dd 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Globalization/TextInfo.Icu.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Globalization/TextInfo.Icu.cs @@ -17,7 +17,6 @@ private static bool NeedsTurkishCasing(string localeName) return CultureInfo.GetCultureInfo(localeName).CompareInfo.Compare("\u0131", "I", CompareOptions.IgnoreCase) == 0; } - [RequiresUnsafe] internal unsafe void IcuChangeCase(char* src, int srcLen, char* dstBuffer, int dstBufferCapacity, bool bToUpper) { Debug.Assert(!GlobalizationMode.Invariant); diff --git a/src/libraries/System.Private.CoreLib/src/System/Globalization/TextInfo.Nls.cs b/src/libraries/System.Private.CoreLib/src/System/Globalization/TextInfo.Nls.cs index 819b9b147de207..6160aa61a21085 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Globalization/TextInfo.Nls.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Globalization/TextInfo.Nls.cs @@ -8,7 +8,6 @@ namespace System.Globalization { public partial class TextInfo { - [RequiresUnsafe] private unsafe void NlsChangeCase(char* pSource, int pSourceLen, char* pResult, int pResultLen, bool toUpper) { Debug.Assert(!GlobalizationMode.Invariant); diff --git a/src/libraries/System.Private.CoreLib/src/System/Globalization/TextInfo.cs b/src/libraries/System.Private.CoreLib/src/System/Globalization/TextInfo.cs index a650aa97c774be..9d0fd2a3e8b905 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Globalization/TextInfo.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Globalization/TextInfo.cs @@ -768,7 +768,6 @@ private int AddTitlecaseLetter(ref StringBuilder result, ref string input, int i return inputIndex; } - [RequiresUnsafe] private unsafe void ChangeCaseCore(char* src, int srcLen, char* dstBuffer, int dstBufferCapacity, bool bToUpper) { if (GlobalizationMode.UseNls) diff --git a/src/libraries/System.Private.CoreLib/src/System/Guid.cs b/src/libraries/System.Private.CoreLib/src/System/Guid.cs index b488f144fdab09..60b6b289991ca3 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Guid.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Guid.cs @@ -1183,7 +1183,6 @@ public int CompareTo(Guid value) public static bool operator !=(Guid a, Guid b) => !EqualsCore(a, b); [MethodImpl(MethodImplOptions.AggressiveInlining)] - [RequiresUnsafe] private static unsafe int HexsToChars(TChar* guidChars, int a, int b) where TChar : unmanaged, IUtfChar { guidChars[0] = TChar.CastFrom(HexConverter.ToCharLower(a >> 4)); diff --git a/src/libraries/System.Private.CoreLib/src/System/IO/Path.cs b/src/libraries/System.Private.CoreLib/src/System/IO/Path.cs index 5859b5535d28eb..ce1ae318088bed 100644 --- a/src/libraries/System.Private.CoreLib/src/System/IO/Path.cs +++ b/src/libraries/System.Private.CoreLib/src/System/IO/Path.cs @@ -791,7 +791,6 @@ private struct JoinInternalState // used to avoid rooting ValueTuple`7 private static ReadOnlySpan Base32Char => "abcdefghijklmnopqrstuvwxyz012345"u8; - [RequiresUnsafe] internal static unsafe void Populate83FileNameFromRandomBytes(byte* bytes, int byteCount, Span chars) { // This method requires bytes of length 8 and chars of length 12. diff --git a/src/libraries/System.Private.CoreLib/src/System/IO/SharedMemoryManager.Unix.cs b/src/libraries/System.Private.CoreLib/src/System/IO/SharedMemoryManager.Unix.cs index bd8a97d35ee0c9..42b21388bcddba 100644 --- a/src/libraries/System.Private.CoreLib/src/System/IO/SharedMemoryManager.Unix.cs +++ b/src/libraries/System.Private.CoreLib/src/System/IO/SharedMemoryManager.Unix.cs @@ -128,7 +128,6 @@ internal sealed unsafe class SharedMemoryProcessDataHeader (void*)addr; } diff --git a/src/libraries/System.Private.CoreLib/src/System/IO/UnmanagedMemoryStream.cs b/src/libraries/System.Private.CoreLib/src/System/IO/UnmanagedMemoryStream.cs index 7d5f57dbd930dd..8695bb91b3ea27 100644 --- a/src/libraries/System.Private.CoreLib/src/System/IO/UnmanagedMemoryStream.cs +++ b/src/libraries/System.Private.CoreLib/src/System/IO/UnmanagedMemoryStream.cs @@ -131,7 +131,6 @@ protected void Initialize(SafeBuffer buffer, long offset, long length, FileAcces /// Creates a stream over a byte*. /// [CLSCompliant(false)] - [RequiresUnsafe] public unsafe UnmanagedMemoryStream(byte* pointer, long length) { Initialize(pointer, length, length, FileAccess.Read); @@ -141,7 +140,6 @@ public unsafe UnmanagedMemoryStream(byte* pointer, long length) /// Creates a stream over a byte*. /// [CLSCompliant(false)] - [RequiresUnsafe] public unsafe UnmanagedMemoryStream(byte* pointer, long length, long capacity, FileAccess access) { Initialize(pointer, length, capacity, access); @@ -151,7 +149,6 @@ public unsafe UnmanagedMemoryStream(byte* pointer, long length, long capacity, F /// Subclasses must call this method (or the other overload) to properly initialize all instance fields. /// [CLSCompliant(false)] - [RequiresUnsafe] protected unsafe void Initialize(byte* pointer, long length, long capacity, FileAccess access) { ArgumentNullException.ThrowIfNull(pointer); @@ -297,7 +294,6 @@ public override long Position /// Pointer to memory at the current Position in the stream. /// [CLSCompliant(false)] - [RequiresUnsafe] public unsafe byte* PositionPointer { get diff --git a/src/libraries/System.Private.CoreLib/src/System/Number.Formatting.cs b/src/libraries/System.Private.CoreLib/src/System/Number.Formatting.cs index 1b98008083b26a..141b946d8af147 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Number.Formatting.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Number.Formatting.cs @@ -1733,7 +1733,6 @@ internal static unsafe bool TryInt32ToHexStr(int value, char hexBase, int } [MethodImpl(MethodImplOptions.AggressiveInlining)] - [RequiresUnsafe] private static unsafe TChar* Int32ToHexChars(TChar* buffer, uint value, int hexBase, int digits) where TChar : unmanaged, IUtfChar { Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); @@ -1790,7 +1789,6 @@ private static unsafe bool TryUInt32ToBinaryStr(uint value, int digits, S } [MethodImpl(MethodImplOptions.AggressiveInlining)] - [RequiresUnsafe] private static unsafe TChar* UInt32ToBinaryChars(TChar* buffer, uint value, int digits) where TChar : unmanaged, IUtfChar { Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); @@ -1828,7 +1826,6 @@ private static unsafe void UInt32ToNumber(uint value, ref NumberBuffer number) } [MethodImpl(MethodImplOptions.AggressiveInlining)] - [RequiresUnsafe] internal static unsafe void WriteTwoDigits(uint value, TChar* ptr) where TChar : unmanaged, IUtfChar { Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); @@ -1845,7 +1842,6 @@ ref Unsafe.Add(ref GetTwoDigitsBytesRef(typeof(TChar) == typeof(char)), (uint)si /// This method performs best when the starting index is a constant literal. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - [RequiresUnsafe] internal static unsafe void WriteFourDigits(uint value, TChar* ptr) where TChar : unmanaged, IUtfChar { Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); @@ -1867,7 +1863,6 @@ ref Unsafe.Add(ref charsArray, (uint)sizeof(TChar) * 2 * remainder), } [MethodImpl(MethodImplOptions.AggressiveInlining)] - [RequiresUnsafe] internal static unsafe void WriteDigits(uint value, TChar* ptr, int count) where TChar : unmanaged, IUtfChar { TChar* cur; @@ -1884,7 +1879,6 @@ internal static unsafe void WriteDigits(uint value, TChar* ptr, int count } [MethodImpl(MethodImplOptions.AggressiveInlining)] - [RequiresUnsafe] internal static unsafe TChar* UInt32ToDecChars(TChar* bufferEnd, uint value) where TChar : unmanaged, IUtfChar { Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); @@ -1914,7 +1908,6 @@ internal static unsafe void WriteDigits(uint value, TChar* ptr, int count } [MethodImpl(MethodImplOptions.AggressiveInlining)] - [RequiresUnsafe] internal static unsafe TChar* UInt32ToDecChars(TChar* bufferEnd, uint value, int digits) where TChar : unmanaged, IUtfChar { Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); @@ -2174,7 +2167,6 @@ internal static unsafe bool TryInt64ToHexStr(long value, char hexBase, in #if TARGET_64BIT [MethodImpl(MethodImplOptions.AggressiveInlining)] - [RequiresUnsafe] #endif private static unsafe TChar* Int64ToHexChars(TChar* buffer, ulong value, int hexBase, int digits) where TChar : unmanaged, IUtfChar { @@ -2247,7 +2239,6 @@ private static unsafe bool TryUInt64ToBinaryStr(ulong value, int digits, #if TARGET_64BIT [MethodImpl(MethodImplOptions.AggressiveInlining)] - [RequiresUnsafe] #endif private static unsafe TChar* UInt64ToBinaryChars(TChar* buffer, ulong value, int digits) where TChar : unmanaged, IUtfChar { @@ -2309,7 +2300,6 @@ private static uint Int64DivMod1E9(ref ulong value) #if TARGET_64BIT [MethodImpl(MethodImplOptions.AggressiveInlining)] - [RequiresUnsafe] #endif internal static unsafe TChar* UInt64ToDecChars(TChar* bufferEnd, ulong value) where TChar : unmanaged, IUtfChar { @@ -2349,7 +2339,6 @@ private static uint Int64DivMod1E9(ref ulong value) #if TARGET_64BIT [MethodImpl(MethodImplOptions.AggressiveInlining)] - [RequiresUnsafe] #endif internal static unsafe TChar* UInt64ToDecChars(TChar* bufferEnd, ulong value, int digits) where TChar : unmanaged, IUtfChar { @@ -2611,7 +2600,6 @@ private static unsafe bool TryInt128ToHexStr(Int128 value, char hexBase, } [MethodImpl(MethodImplOptions.AggressiveInlining)] - [RequiresUnsafe] private static unsafe TChar* Int128ToHexChars(TChar* buffer, UInt128 value, int hexBase, int digits) where TChar : unmanaged, IUtfChar { ulong lower = value.Lower; @@ -2675,7 +2663,6 @@ private static unsafe bool TryUInt128ToBinaryStr(Int128 value, int digits } [MethodImpl(MethodImplOptions.AggressiveInlining)] - [RequiresUnsafe] private static unsafe TChar* UInt128ToBinaryChars(TChar* buffer, UInt128 value, int digits) where TChar : unmanaged, IUtfChar { ulong lower = value.Lower; @@ -2724,7 +2711,6 @@ private static ulong Int128DivMod1E19(ref UInt128 value) } [MethodImpl(MethodImplOptions.AggressiveInlining)] - [RequiresUnsafe] internal static unsafe TChar* UInt128ToDecChars(TChar* bufferEnd, UInt128 value) where TChar : unmanaged, IUtfChar { Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); @@ -2737,7 +2723,6 @@ private static ulong Int128DivMod1E19(ref UInt128 value) } [MethodImpl(MethodImplOptions.AggressiveInlining)] - [RequiresUnsafe] internal static unsafe TChar* UInt128ToDecChars(TChar* bufferEnd, UInt128 value, int digits) where TChar : unmanaged, IUtfChar { Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); diff --git a/src/libraries/System.Private.CoreLib/src/System/Number.NumberToFloatingPointBits.cs b/src/libraries/System.Private.CoreLib/src/System/Number.NumberToFloatingPointBits.cs index f852449fb22abe..5bcc75e4dabf62 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Number.NumberToFloatingPointBits.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Number.NumberToFloatingPointBits.cs @@ -891,7 +891,6 @@ private static ulong ConvertBigIntegerToFloatingPointBits(ref BigInteger } // get 32-bit integer from at most 9 digits - [RequiresUnsafe] private static uint DigitsToUInt32(byte* p, int count) { Debug.Assert((1 <= count) && (count <= 9)); @@ -916,7 +915,6 @@ private static uint DigitsToUInt32(byte* p, int count) } // get 64-bit integer from at most 19 digits - [RequiresUnsafe] private static ulong DigitsToUInt64(byte* p, int count) { Debug.Assert((1 <= count) && (count <= 19)); @@ -945,7 +943,6 @@ private static ulong DigitsToUInt64(byte* p, int count) /// https://lemire.me/blog/2022/01/21/swar-explained-parsing-eight-digits/ /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - [RequiresUnsafe] internal static uint ParseEightDigitsUnrolled(byte* chars) { // let's take the following value (byte*) 12345678 and read it unaligned : diff --git a/src/libraries/System.Private.CoreLib/src/System/Numerics/Vector.cs b/src/libraries/System.Private.CoreLib/src/System/Numerics/Vector.cs index bb14e36a8be3d5..ae25ce85d2431b 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Numerics/Vector.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Numerics/Vector.cs @@ -1942,7 +1942,6 @@ public static bool LessThanOrEqualAny(Vector left, Vector right) /// The type of () is not supported. [Intrinsic] [CLSCompliant(false)] - [RequiresUnsafe] public static unsafe Vector Load(T* source) => LoadUnsafe(ref *source); /// Loads a vector from the given aligned source. @@ -1953,7 +1952,6 @@ public static bool LessThanOrEqualAny(Vector left, Vector right) [Intrinsic] [CLSCompliant(false)] [MethodImpl(MethodImplOptions.AggressiveInlining)] - [RequiresUnsafe] public static unsafe Vector LoadAligned(T* source) { ThrowHelper.ThrowForUnsupportedNumericsVectorBaseType(); @@ -1974,7 +1972,6 @@ public static unsafe Vector LoadAligned(T* source) /// The type of () is not supported. [Intrinsic] [CLSCompliant(false)] - [RequiresUnsafe] public static unsafe Vector LoadAlignedNonTemporal(T* source) => LoadAligned(source); /// Loads a vector from the given source. @@ -2991,7 +2988,6 @@ public static Vector SquareRoot(Vector value) /// The type of () is not supported. [Intrinsic] [CLSCompliant(false)] - [RequiresUnsafe] public static unsafe void Store(this Vector source, T* destination) => source.StoreUnsafe(ref *destination); /// Stores a vector at the given aligned destination. @@ -3002,7 +2998,6 @@ public static Vector SquareRoot(Vector value) [Intrinsic] [CLSCompliant(false)] [MethodImpl(MethodImplOptions.AggressiveInlining)] - [RequiresUnsafe] public static unsafe void StoreAligned(this Vector source, T* destination) { ThrowHelper.ThrowForUnsupportedNumericsVectorBaseType(); @@ -3023,7 +3018,6 @@ public static unsafe void StoreAligned(this Vector source, T* destination) /// The type of () is not supported. [Intrinsic] [CLSCompliant(false)] - [RequiresUnsafe] public static unsafe void StoreAlignedNonTemporal(this Vector source, T* destination) => source.StoreAligned(destination); /// Stores a vector at the given destination. diff --git a/src/libraries/System.Private.CoreLib/src/System/Numerics/Vector2.Extensions.cs b/src/libraries/System.Private.CoreLib/src/System/Numerics/Vector2.Extensions.cs index 0ed6452af84630..cfa96a849756e8 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Numerics/Vector2.Extensions.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Numerics/Vector2.Extensions.cs @@ -50,7 +50,6 @@ public static float GetElement(this Vector2 vector, int index) /// The vector that will be stored. /// The destination at which will be stored. [CLSCompliant(false)] - [RequiresUnsafe] public static void Store(this Vector2 source, float* destination) => source.StoreUnsafe(ref *destination); /// Stores a vector at the given 8-byte aligned destination. @@ -59,7 +58,6 @@ public static float GetElement(this Vector2 vector, int index) /// is not 8-byte aligned. [CLSCompliant(false)] [MethodImpl(MethodImplOptions.AggressiveInlining)] - [RequiresUnsafe] public static void StoreAligned(this Vector2 source, float* destination) { if (((nuint)destination % (uint)(Vector2.Alignment)) != 0) @@ -76,7 +74,6 @@ public static void StoreAligned(this Vector2 source, float* destination) /// is not 8-byte aligned. /// This method may bypass the cache on certain platforms. [CLSCompliant(false)] - [RequiresUnsafe] public static void StoreAlignedNonTemporal(this Vector2 source, float* destination) => source.StoreAligned(destination); /// Stores a vector at the given destination. diff --git a/src/libraries/System.Private.CoreLib/src/System/Numerics/Vector2.cs b/src/libraries/System.Private.CoreLib/src/System/Numerics/Vector2.cs index 94d2f0eb113548..62d7e9e3490310 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Numerics/Vector2.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Numerics/Vector2.cs @@ -675,14 +675,12 @@ public static float Cross(Vector2 value1, Vector2 value2) /// [Intrinsic] [CLSCompliant(false)] - [RequiresUnsafe] public static unsafe Vector2 Load(float* source) => LoadUnsafe(in *source); /// [Intrinsic] [CLSCompliant(false)] [MethodImpl(MethodImplOptions.AggressiveInlining)] - [RequiresUnsafe] public static unsafe Vector2 LoadAligned(float* source) { if (((nuint)(source) % Alignment) != 0) @@ -696,7 +694,6 @@ public static unsafe Vector2 LoadAligned(float* source) /// [Intrinsic] [CLSCompliant(false)] - [RequiresUnsafe] public static unsafe Vector2 LoadAlignedNonTemporal(float* source) => LoadAligned(source); /// diff --git a/src/libraries/System.Private.CoreLib/src/System/Numerics/Vector3.Extensions.cs b/src/libraries/System.Private.CoreLib/src/System/Numerics/Vector3.Extensions.cs index 16686ca631c655..3df8497f470c38 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Numerics/Vector3.Extensions.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Numerics/Vector3.Extensions.cs @@ -45,7 +45,6 @@ public static float GetElement(this Vector3 vector, int index) /// The vector that will be stored. /// The destination at which will be stored. [CLSCompliant(false)] - [RequiresUnsafe] public static void Store(this Vector3 source, float* destination) => source.StoreUnsafe(ref *destination); /// Stores a vector at the given 8-byte aligned destination. @@ -54,7 +53,6 @@ public static float GetElement(this Vector3 vector, int index) /// is not 8-byte aligned. [CLSCompliant(false)] [MethodImpl(MethodImplOptions.AggressiveInlining)] - [RequiresUnsafe] public static void StoreAligned(this Vector3 source, float* destination) { if (((nuint)destination % (uint)(Vector3.Alignment)) != 0) @@ -71,7 +69,6 @@ public static void StoreAligned(this Vector3 source, float* destination) /// is not 8-byte aligned. /// This method may bypass the cache on certain platforms. [CLSCompliant(false)] - [RequiresUnsafe] public static void StoreAlignedNonTemporal(this Vector3 source, float* destination) => source.StoreAligned(destination); /// Stores a vector at the given destination. diff --git a/src/libraries/System.Private.CoreLib/src/System/Numerics/Vector3.cs b/src/libraries/System.Private.CoreLib/src/System/Numerics/Vector3.cs index 42e01de9993548..9bc2b354f1399c 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Numerics/Vector3.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Numerics/Vector3.cs @@ -705,14 +705,12 @@ public static Vector3 Cross(Vector3 vector1, Vector3 vector2) /// [Intrinsic] [CLSCompliant(false)] - [RequiresUnsafe] public static unsafe Vector3 Load(float* source) => LoadUnsafe(in *source); /// [Intrinsic] [CLSCompliant(false)] [MethodImpl(MethodImplOptions.AggressiveInlining)] - [RequiresUnsafe] public static unsafe Vector3 LoadAligned(float* source) { if (((nuint)(source) % Alignment) != 0) @@ -726,7 +724,6 @@ public static unsafe Vector3 LoadAligned(float* source) /// [Intrinsic] [CLSCompliant(false)] - [RequiresUnsafe] public static unsafe Vector3 LoadAlignedNonTemporal(float* source) => LoadAligned(source); /// diff --git a/src/libraries/System.Private.CoreLib/src/System/Numerics/Vector4.Extensions.cs b/src/libraries/System.Private.CoreLib/src/System/Numerics/Vector4.Extensions.cs index 93015433b5e40d..ef008a43b04f6d 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Numerics/Vector4.Extensions.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Numerics/Vector4.Extensions.cs @@ -43,7 +43,6 @@ public static unsafe partial class Vector /// The vector that will be stored. /// The destination at which will be stored. [CLSCompliant(false)] - [RequiresUnsafe] public static void Store(this Vector4 source, float* destination) => source.AsVector128().Store(destination); /// Stores a vector at the given 16-byte aligned destination. @@ -52,7 +51,6 @@ public static unsafe partial class Vector /// is not 16-byte aligned. [CLSCompliant(false)] [MethodImpl(MethodImplOptions.AggressiveInlining)] - [RequiresUnsafe] public static void StoreAligned(this Vector4 source, float* destination) => source.AsVector128().StoreAligned(destination); /// Stores a vector at the given 16-byte aligned destination. @@ -61,7 +59,6 @@ public static unsafe partial class Vector /// is not 16-byte aligned. /// This method may bypass the cache on certain platforms. [CLSCompliant(false)] - [RequiresUnsafe] public static void StoreAlignedNonTemporal(this Vector4 source, float* destination) => source.AsVector128().StoreAlignedNonTemporal(destination); /// Stores a vector at the given destination. diff --git a/src/libraries/System.Private.CoreLib/src/System/Numerics/Vector4.cs b/src/libraries/System.Private.CoreLib/src/System/Numerics/Vector4.cs index 09fd54ff8abc8e..4608e9a7d48e7b 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Numerics/Vector4.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Numerics/Vector4.cs @@ -770,21 +770,18 @@ public static Vector4 Cross(Vector4 vector1, Vector4 vector2) [Intrinsic] [CLSCompliant(false)] [MethodImpl(MethodImplOptions.AggressiveInlining)] - [RequiresUnsafe] public static unsafe Vector4 Load(float* source) => Vector128.Load(source).AsVector4(); /// [Intrinsic] [CLSCompliant(false)] [MethodImpl(MethodImplOptions.AggressiveInlining)] - [RequiresUnsafe] public static unsafe Vector4 LoadAligned(float* source) => Vector128.LoadAligned(source).AsVector4(); /// [Intrinsic] [CLSCompliant(false)] [MethodImpl(MethodImplOptions.AggressiveInlining)] - [RequiresUnsafe] public static unsafe Vector4 LoadAlignedNonTemporal(float* source) => Vector128.LoadAlignedNonTemporal(source).AsVector4(); /// diff --git a/src/libraries/System.Private.CoreLib/src/System/Numerics/Vector_1.cs b/src/libraries/System.Private.CoreLib/src/System/Numerics/Vector_1.cs index 0dd762c866e312..f1838df4caedae 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Numerics/Vector_1.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Numerics/Vector_1.cs @@ -1073,17 +1073,14 @@ static bool ISimdVector, T>.IsHardwareAccelerated /// [Intrinsic] - [RequiresUnsafe] static Vector ISimdVector, T>.Load(T* source) => Vector.Load(source); /// [Intrinsic] - [RequiresUnsafe] static Vector ISimdVector, T>.LoadAligned(T* source) => Vector.LoadAligned(source); /// [Intrinsic] - [RequiresUnsafe] static Vector ISimdVector, T>.LoadAlignedNonTemporal(T* source) => Vector.LoadAlignedNonTemporal(source); /// @@ -1184,17 +1181,14 @@ static bool ISimdVector, T>.IsHardwareAccelerated /// [Intrinsic] - [RequiresUnsafe] static void ISimdVector, T>.Store(Vector source, T* destination) => source.Store(destination); /// [Intrinsic] - [RequiresUnsafe] static void ISimdVector, T>.StoreAligned(Vector source, T* destination) => source.StoreAligned(destination); /// [Intrinsic] - [RequiresUnsafe] static void ISimdVector, T>.StoreAlignedNonTemporal(Vector source, T* destination) => source.StoreAlignedNonTemporal(destination); /// diff --git a/src/libraries/System.Private.CoreLib/src/System/ReadOnlySpan.cs b/src/libraries/System.Private.CoreLib/src/System/ReadOnlySpan.cs index 4f5109f6fba647..18e6088c2bf14d 100644 --- a/src/libraries/System.Private.CoreLib/src/System/ReadOnlySpan.cs +++ b/src/libraries/System.Private.CoreLib/src/System/ReadOnlySpan.cs @@ -101,7 +101,6 @@ public ReadOnlySpan(T[]? array, int start, int length) /// [CLSCompliant(false)] [MethodImpl(MethodImplOptions.AggressiveInlining)] - [RequiresUnsafe] public unsafe ReadOnlySpan(void* pointer, int length) { if (RuntimeHelpers.IsReferenceOrContainsReferences()) diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/QCallHandles.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/QCallHandles.cs index b4b4ff1105f62a..6e3c3e32c12837 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/QCallHandles.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/QCallHandles.cs @@ -24,7 +24,6 @@ internal unsafe ref struct ObjectHandleOnStack { private object* _ptr; - [RequiresUnsafe] private ObjectHandleOnStack(object* pObject) { _ptr = pObject; diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/RuntimeHelpers.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/RuntimeHelpers.cs index bb51c339b119db..f9f228e6aea688 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/RuntimeHelpers.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/RuntimeHelpers.cs @@ -187,7 +187,6 @@ public static ReadOnlySpan CreateSpan(RuntimeFieldHandle fldHandle) internal static void WriteBarrier(ref object? dst, object? obj) => dst = obj; [Intrinsic] - [RequiresUnsafe] internal static unsafe void SetNextCallGenericContext(void* value) => throw new UnreachableException(); // Unconditionally expanded intrinsic [Intrinsic] diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/Unsafe.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/Unsafe.cs index 5effb8beaeabe5..154cd64a421e88 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/Unsafe.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/Unsafe.cs @@ -281,7 +281,6 @@ public static TTo BitCast(TFrom source) [NonVersionable] [CLSCompliant(false)] [MethodImpl(MethodImplOptions.AggressiveInlining)] - [RequiresUnsafe] public static void Copy(void* destination, ref readonly T source) where T : allows ref struct { @@ -302,7 +301,6 @@ public static void Copy(void* destination, ref readonly T source) [NonVersionable] [CLSCompliant(false)] [MethodImpl(MethodImplOptions.AggressiveInlining)] - [RequiresUnsafe] public static void Copy(ref T destination, void* source) where T : allows ref struct { @@ -323,7 +321,6 @@ public static void Copy(ref T destination, void* source) [NonVersionable] [CLSCompliant(false)] [MethodImpl(MethodImplOptions.AggressiveInlining)] - [RequiresUnsafe] public static void CopyBlock(void* destination, void* source, uint byteCount) { throw new PlatformNotSupportedException(); @@ -362,7 +359,6 @@ public static void CopyBlock(ref byte destination, ref readonly byte source, uin [NonVersionable] [CLSCompliant(false)] [MethodImpl(MethodImplOptions.AggressiveInlining)] - [RequiresUnsafe] public static void CopyBlockUnaligned(void* destination, void* source, uint byteCount) { throw new PlatformNotSupportedException(); @@ -483,7 +479,6 @@ public static bool IsAddressLessThanOrEqualTo([AllowNull] ref readonly T left [NonVersionable] [CLSCompliant(false)] [MethodImpl(MethodImplOptions.AggressiveInlining)] - [RequiresUnsafe] public static void InitBlock(void* startAddress, byte value, uint byteCount) { throw new PlatformNotSupportedException(); @@ -523,7 +518,6 @@ public static void InitBlock(ref byte startAddress, byte value, uint byteCount) [NonVersionable] [CLSCompliant(false)] [MethodImpl(MethodImplOptions.AggressiveInlining)] - [RequiresUnsafe] public static void InitBlockUnaligned(void* startAddress, byte value, uint byteCount) { throw new PlatformNotSupportedException(); @@ -572,7 +566,6 @@ public static void InitBlockUnaligned(ref byte startAddress, byte value, uint by [NonVersionable] [CLSCompliant(false)] [MethodImpl(MethodImplOptions.AggressiveInlining)] - [RequiresUnsafe] public static T ReadUnaligned(void* source) where T : allows ref struct { @@ -624,7 +617,6 @@ public static T ReadUnaligned(scoped ref readonly byte source) [NonVersionable] [CLSCompliant(false)] [MethodImpl(MethodImplOptions.AggressiveInlining)] - [RequiresUnsafe] public static void WriteUnaligned(void* destination, T value) where T : allows ref struct { @@ -697,7 +689,6 @@ public static ref T AddByteOffset(ref T source, nint byteOffset) [NonVersionable] [CLSCompliant(false)] [MethodImpl(MethodImplOptions.AggressiveInlining)] - [RequiresUnsafe] public static T Read(void* source) where T : allows ref struct { @@ -711,7 +702,6 @@ public static T Read(void* source) [NonVersionable] [CLSCompliant(false)] [MethodImpl(MethodImplOptions.AggressiveInlining)] - [RequiresUnsafe] public static void Write(void* destination, T value) where T : allows ref struct { @@ -725,7 +715,6 @@ public static void Write(void* destination, T value) [NonVersionable] [CLSCompliant(false)] [MethodImpl(MethodImplOptions.AggressiveInlining)] - [RequiresUnsafe] public static ref T AsRef(void* source) where T : allows ref struct { diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/GCFrameRegistration.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/GCFrameRegistration.cs index d29c1797d977aa..ac511a860e1528 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/GCFrameRegistration.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/GCFrameRegistration.cs @@ -19,7 +19,6 @@ internal unsafe struct GCFrameRegistration private nuint _osStackLocation; #endif - [RequiresUnsafe] public GCFrameRegistration(void** allocation, uint elemCount, bool areByRefs = true) { _reserved1 = 0; @@ -34,11 +33,9 @@ public GCFrameRegistration(void** allocation, uint elemCount, bool areByRefs = t #if CORECLR [MethodImpl(MethodImplOptions.InternalCall)] - [RequiresUnsafe] internal static extern void RegisterForGCReporting(GCFrameRegistration* pRegistration); [MethodImpl(MethodImplOptions.InternalCall)] - [RequiresUnsafe] internal static extern void UnregisterForGCReporting(GCFrameRegistration* pRegistration); #endif } diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/ComAwareWeakReference.ComWrappers.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/ComAwareWeakReference.ComWrappers.cs index 86400b6d8c7a9b..036ebcb9d50eeb 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/ComAwareWeakReference.ComWrappers.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/ComAwareWeakReference.ComWrappers.cs @@ -17,7 +17,6 @@ internal sealed partial class ComAwareWeakReference private static unsafe delegate* s_possiblyComObjectCallback; private static unsafe delegate* s_objectToComWeakRefCallback; - [RequiresUnsafe] internal static unsafe void InitializeCallbacks( delegate* comWeakRefToObject, delegate* possiblyComObject, diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/ComWrappers.PlatformNotSupported.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/ComWrappers.PlatformNotSupported.cs index 470f84d71ed945..deab6a551c69a5 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/ComWrappers.PlatformNotSupported.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/ComWrappers.PlatformNotSupported.cs @@ -21,7 +21,6 @@ public struct ComInterfaceEntry public IntPtr Vtable; } - [RequiresUnsafe] protected abstract unsafe ComInterfaceEntry* ComputeVtables(object obj, CreateComInterfaceFlags flags, out int count); protected abstract object? CreateObject(IntPtr externalComObject, CreateObjectFlags flags); @@ -49,7 +48,6 @@ public struct ComInterfaceDispatch { public IntPtr Vtable; - [RequiresUnsafe] public static unsafe T GetInstance(ComInterfaceDispatch* dispatchPtr) where T : class { throw new PlatformNotSupportedException(); diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/ComWrappers.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/ComWrappers.cs index e91e7f755607d1..aff669dd7acacc 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/ComWrappers.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/ComWrappers.cs @@ -129,14 +129,12 @@ public partial struct ComInterfaceDispatch /// Desired type. /// Pointer supplied to Vtable function entry. /// Instance of type associated with dispatched function call. - [RequiresUnsafe] public static unsafe T GetInstance(ComInterfaceDispatch* dispatchPtr) where T : class { ManagedObjectWrapper* comInstance = ToManagedObjectWrapper(dispatchPtr); return Unsafe.As(comInstance->Holder!.WrappedObject); } - [RequiresUnsafe] internal static unsafe ManagedObjectWrapper* ToManagedObjectWrapper(ComInterfaceDispatch* dispatchPtr) { InternalComInterfaceDispatch* dispatch = (InternalComInterfaceDispatch*)unchecked((nuint)dispatchPtr & (nuint)InternalComInterfaceDispatch.DispatchAlignmentMask); @@ -488,7 +486,6 @@ static ManagedObjectWrapperHolder() private readonly ManagedObjectWrapper* _wrapper; - [RequiresUnsafe] public ManagedObjectWrapperHolder(ManagedObjectWrapper* wrapper, object wrappedObject) { _wrapper = wrapper; @@ -505,7 +502,6 @@ public ManagedObjectWrapperHolder(ManagedObjectWrapper* wrapper, object wrappedO public bool IsActivated => _wrapper->Flags.HasFlag(CreateComInterfaceFlagsEx.IsComActivated); - [RequiresUnsafe] internal ManagedObjectWrapper* Wrapper => _wrapper; } @@ -513,7 +509,6 @@ internal sealed unsafe class ManagedObjectWrapperReleaser { private ManagedObjectWrapper* _wrapper; - [RequiresUnsafe] public ManagedObjectWrapperReleaser(ManagedObjectWrapper* wrapper) { _wrapper = wrapper; @@ -831,7 +826,6 @@ private static nuint AlignUp(nuint value, nuint alignment) return (nuint)((value + alignMask) & ~alignMask); } - [RequiresUnsafe] private unsafe ManagedObjectWrapper* CreateManagedObjectWrapper(object instance, CreateComInterfaceFlags flags) { ComInterfaceEntry* userDefined = ComputeVtables(instance, flags, out int userDefinedCount); @@ -991,7 +985,6 @@ public object GetOrRegisterObjectForComInstance(IntPtr externalComObject, Create return obj; } - [RequiresUnsafe] private static unsafe ComInterfaceDispatch* TryGetComInterfaceDispatch(IntPtr comObject) { // If the first Vtable entry is part of a ManagedObjectWrapper impl, @@ -1513,7 +1506,6 @@ public static void RegisterForMarshalling(ComWrappers instance) /// If the interface entries cannot be created and a negative or null and a non-zero are returned, /// the call to will throw a . /// - [RequiresUnsafe] protected abstract unsafe ComInterfaceEntry* ComputeVtables(object obj, CreateComInterfaceFlags flags, out int count); /// diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/GCHandleExtensions.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/GCHandleExtensions.cs index bdabc22c989bdf..e1bb978c3974eb 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/GCHandleExtensions.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/GCHandleExtensions.cs @@ -25,7 +25,6 @@ public static class GCHandleExtensions /// If the handle is not initialized or already disposed. /// The element type of the pinned array. [CLSCompliant(false)] - [RequiresUnsafe] public static unsafe T* GetAddressOfArrayData( #nullable disable // Nullable oblivious because no covariance between PinnedGCHandle and PinnedGCHandle this PinnedGCHandle handle) @@ -49,7 +48,6 @@ public static class GCHandleExtensions /// /// If the handle is not initialized or already disposed. [CLSCompliant(false)] - [RequiresUnsafe] public static unsafe char* GetAddressOfStringData( #nullable disable // Nullable oblivious because no covariance between PinnedGCHandle and PinnedGCHandle this PinnedGCHandle handle) diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/Java/JavaMarshal.Unsupported.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/Java/JavaMarshal.Unsupported.cs index 3f3131d5774eb0..351c0a2b6aee10 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/Java/JavaMarshal.Unsupported.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/Java/JavaMarshal.Unsupported.cs @@ -38,7 +38,6 @@ public static partial class JavaMarshal /// runtime code when cross-reference marking is required. /// Additionally, this callback must be implemented in unmanaged code. /// - [RequiresUnsafe] public static unsafe void Initialize(delegate* unmanaged markCrossReferences) { throw new PlatformNotSupportedException(); @@ -58,7 +57,6 @@ public static unsafe void Initialize(delegate* unmanagedA that represents the allocated reference-tracking handle. /// is null. /// The runtime or platform does not support Java cross-reference marshalling. - [RequiresUnsafe] public static unsafe GCHandle CreateReferenceTrackingHandle(object obj, void* context) { throw new PlatformNotSupportedException(); @@ -76,7 +74,6 @@ public static unsafe GCHandle CreateReferenceTrackingHandle(object obj, void* co /// The returned pointer is the exact value that was originally provided as /// the context parameter when the handle was created. /// - [RequiresUnsafe] public static unsafe void* GetContext(GCHandle obj) { throw new PlatformNotSupportedException(); @@ -91,7 +88,6 @@ public static unsafe GCHandle CreateReferenceTrackingHandle(object obj, void* co /// A pointer to the structure containing cross-reference information produced during marking. /// A span of values that were determined to be unreachable from the native side. /// The runtime or platform does not support Java cross-reference marshalling. - [RequiresUnsafe] public static unsafe void FinishCrossReferenceProcessing( MarkCrossReferencesArgs* crossReferences, ReadOnlySpan unreachableObjectHandles) diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshal.Unix.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshal.Unix.cs index 6abfe8d8c6219a..40331b4975da31 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshal.Unix.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshal.Unix.cs @@ -33,7 +33,6 @@ public static IntPtr StringToCoTaskMemAuto(string? s) private static bool IsNullOrWin32Atom(IntPtr ptr) => ptr == IntPtr.Zero; - [RequiresUnsafe] internal static unsafe int StringToAnsiString(string s, byte* buffer, int bufferLength, bool bestFit = false, bool throwOnUnmappableChar = false) { Debug.Assert(bufferLength >= (s.Length + 1) * SystemMaxDBCSCharSize, "Insufficient buffer length passed to StringToAnsiString"); diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshalling/AnsiStringMarshaller.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshalling/AnsiStringMarshaller.cs index 41251a956924be..deaf95eeb0934e 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshalling/AnsiStringMarshaller.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshalling/AnsiStringMarshaller.cs @@ -19,7 +19,6 @@ public static unsafe class AnsiStringMarshaller /// /// The managed string to convert. /// An unmanaged string. - [RequiresUnsafe] public static byte* ConvertToUnmanaged(string? managed) { if (managed is null) @@ -38,7 +37,6 @@ public static unsafe class AnsiStringMarshaller /// /// The unmanaged string to convert. /// A managed string. - [RequiresUnsafe] public static string? ConvertToManaged(byte* unmanaged) => Marshal.PtrToStringAnsi((IntPtr)unmanaged); @@ -46,7 +44,6 @@ public static unsafe class AnsiStringMarshaller /// Frees the memory for the unmanaged string. /// /// The memory allocated for the unmanaged string. - [RequiresUnsafe] public static void Free(byte* unmanaged) => Marshal.FreeCoTaskMem((IntPtr)unmanaged); @@ -101,7 +98,6 @@ public void FromManaged(string? managed, Span buffer) /// Converts the current managed string to an unmanaged string. /// /// The converted unmanaged string. - [RequiresUnsafe] public byte* ToUnmanaged() => _unmanagedValue; /// diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshalling/ArrayMarshaller.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshalling/ArrayMarshaller.cs index 2d7731c1220232..8ff0b597474e18 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshalling/ArrayMarshaller.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshalling/ArrayMarshaller.cs @@ -29,7 +29,6 @@ public static unsafe class ArrayMarshaller /// The managed array. /// The unmanaged element count. /// The unmanaged pointer to the allocated memory. - [RequiresUnsafe] public static TUnmanagedElement* AllocateContainerForUnmanagedElements(T[]? managed, out int numElements) { if (managed is null) @@ -59,7 +58,6 @@ public static ReadOnlySpan GetManagedValuesSource(T[]? managed) /// The unmanaged allocation. /// The unmanaged element count. /// The of unmanaged elements. - [RequiresUnsafe] public static Span GetUnmanagedValuesDestination(TUnmanagedElement* unmanaged, int numElements) { if (unmanaged is null) @@ -96,7 +94,6 @@ public static Span GetManagedValuesDestination(T[]? managed) /// The unmanaged array. /// The unmanaged element count. /// The containing the unmanaged elements to marshal. - [RequiresUnsafe] public static ReadOnlySpan GetUnmanagedValuesSource(TUnmanagedElement* unmanagedValue, int numElements) { if (unmanagedValue is null) @@ -109,7 +106,6 @@ public static ReadOnlySpan GetUnmanagedValuesSource(TUnmanage /// Frees memory for the unmanaged array. /// /// The unmanaged array. - [RequiresUnsafe] public static void Free(TUnmanagedElement* unmanaged) => Marshal.FreeCoTaskMem((IntPtr)unmanaged); @@ -188,7 +184,6 @@ public void FromManaged(T[]? array, Span buffer) /// Returns the unmanaged value representing the array. /// /// A pointer to the beginning of the unmanaged value. - [RequiresUnsafe] public TUnmanagedElement* ToUnmanaged() { // Unsafe.AsPointer is safe since buffer must be pinned diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshalling/BStrStringMarshaller.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshalling/BStrStringMarshaller.cs index c636d1d8164e80..75847be7fb92a0 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshalling/BStrStringMarshaller.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshalling/BStrStringMarshaller.cs @@ -29,7 +29,6 @@ public static unsafe class BStrStringMarshaller /// /// An unmanaged string to convert. /// The converted managed string. - [RequiresUnsafe] public static string? ConvertToManaged(ushort* unmanaged) { if (unmanaged is null) @@ -42,7 +41,6 @@ public static unsafe class BStrStringMarshaller /// Frees the memory for the unmanaged string. /// /// The memory allocated for the unmanaged string. - [RequiresUnsafe] public static void Free(ushort* unmanaged) => Marshal.FreeBSTR((IntPtr)unmanaged); @@ -108,7 +106,6 @@ public void FromManaged(string? managed, Span buffer) /// Converts the current managed string to an unmanaged string. /// /// The converted unmanaged string. - [RequiresUnsafe] public ushort* ToUnmanaged() => _ptrToFirstChar; /// diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshalling/PointerArrayMarshaller.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshalling/PointerArrayMarshaller.cs index 585648b78a1693..c50d3b02e808f2 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshalling/PointerArrayMarshaller.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshalling/PointerArrayMarshaller.cs @@ -59,7 +59,6 @@ public static ReadOnlySpan GetManagedValuesSource(T*[]? managed) /// The unmanaged allocation to get a destination for. /// The unmanaged element count. /// The of unmanaged elements. - [RequiresUnsafe] public static Span GetUnmanagedValuesDestination(TUnmanagedElement* unmanaged, int numElements) { if (unmanaged is null) @@ -74,7 +73,6 @@ public static Span GetUnmanagedValuesDestination(TUnmanagedEl /// The unmanaged array. /// The unmanaged element count. /// The managed array. - [RequiresUnsafe] public static T*[]? AllocateContainerForManagedElements(TUnmanagedElement* unmanaged, int numElements) { if (unmanaged is null) @@ -97,7 +95,6 @@ public static Span GetManagedValuesDestination(T*[]? managed) /// The unmanaged array to get a source for. /// The unmanaged element count. /// The containing the unmanaged elements to marshal. - [RequiresUnsafe] public static ReadOnlySpan GetUnmanagedValuesSource(TUnmanagedElement* unmanagedValue, int numElements) { if (unmanagedValue is null) @@ -110,7 +107,6 @@ public static ReadOnlySpan GetUnmanagedValuesSource(TUnmanage /// Frees memory for the unmanaged array. /// /// The unmanaged array. - [RequiresUnsafe] public static void Free(TUnmanagedElement* unmanaged) => Marshal.FreeCoTaskMem((IntPtr)unmanaged); @@ -189,7 +185,6 @@ public void FromManaged(T*[]? array, Span buffer) /// Returns the unmanaged value representing the array. /// /// A pointer to the beginning of the unmanaged value. - [RequiresUnsafe] public TUnmanagedElement* ToUnmanaged() { // Unsafe.AsPointer is safe since buffer must be pinned diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshalling/ReadOnlySpanMarshaller.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshalling/ReadOnlySpanMarshaller.cs index 68b8f006982c01..b1da9a3c4c008c 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshalling/ReadOnlySpanMarshaller.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshalling/ReadOnlySpanMarshaller.cs @@ -38,7 +38,6 @@ public static class UnmanagedToManagedOut /// The managed span. /// The number of elements in the span. /// A pointer to the block of memory for the unmanaged elements. - [RequiresUnsafe] public static TUnmanagedElement* AllocateContainerForUnmanagedElements(ReadOnlySpan managed, out int numElements) { // Emulate the pinning behavior: @@ -70,7 +69,6 @@ public static ReadOnlySpan GetManagedValuesSource(ReadOnlySpan managed) /// The pointer to the block of memory for the unmanaged elements. /// The number of elements that will be copied into the memory block. /// A span over the unmanaged memory that can contain the specified number of elements. - [RequiresUnsafe] public static Span GetUnmanagedValuesDestination(TUnmanagedElement* unmanaged, int numElements) { if (unmanaged == null) @@ -151,7 +149,6 @@ public void FromManaged(ReadOnlySpan managed, Span buffer) /// /// Returns the unmanaged value representing the array. /// - [RequiresUnsafe] public TUnmanagedElement* ToUnmanaged() { // Unsafe.AsPointer is safe since buffer must be pinned @@ -189,7 +186,6 @@ public struct ManagedToUnmanagedOut /// Initializes the marshaller. /// /// A pointer to the array to be unmarshalled from native to managed. - [RequiresUnsafe] public void FromUnmanaged(TUnmanagedElement* unmanaged) { _unmanagedArray = unmanaged; diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshalling/SpanMarshaller.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshalling/SpanMarshaller.cs index 45c0f01969ed5c..906af3bb667ebf 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshalling/SpanMarshaller.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshalling/SpanMarshaller.cs @@ -63,7 +63,6 @@ public static ReadOnlySpan GetManagedValuesSource(Span managed) /// The pointer to the block of memory for the unmanaged elements. /// The number of elements that will be copied into the memory block. /// A span over the unmanaged memory that can contain the specified number of elements. - [RequiresUnsafe] public static Span GetUnmanagedValuesDestination(TUnmanagedElement* unmanaged, int numElements) { if (unmanaged == null) @@ -78,7 +77,6 @@ public static Span GetUnmanagedValuesDestination(TUnmanagedEl /// The unmanaged value. /// The number of elements in the unmanaged collection. /// A span over enough memory to contain elements. - [RequiresUnsafe] public static Span AllocateContainerForManagedElements(TUnmanagedElement* unmanaged, int numElements) { if (unmanaged is null) @@ -101,7 +99,6 @@ public static Span GetManagedValuesDestination(Span managed) /// The unmanaged value. /// The number of elements in the unmanaged collection. /// A span over the native collection elements. - [RequiresUnsafe] public static ReadOnlySpan GetUnmanagedValuesSource(TUnmanagedElement* unmanaged, int numElements) { if (unmanaged == null) @@ -114,7 +111,6 @@ public static ReadOnlySpan GetUnmanagedValuesSource(TUnmanage /// Frees the allocated unmanaged memory. /// /// A pointer to the allocated unmanaged memory. - [RequiresUnsafe] public static void Free(TUnmanagedElement* unmanaged) => Marshal.FreeCoTaskMem((IntPtr)unmanaged); @@ -185,7 +181,6 @@ public void FromManaged(Span managed, Span buffer) /// /// Returns the unmanaged value representing the array. /// - [RequiresUnsafe] public TUnmanagedElement* ToUnmanaged() { // Unsafe.AsPointer is safe since buffer must be pinned diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshalling/Utf16StringMarshaller.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshalling/Utf16StringMarshaller.cs index d33e3ee11ed261..033f32d0f82634 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshalling/Utf16StringMarshaller.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshalling/Utf16StringMarshaller.cs @@ -26,7 +26,6 @@ public static unsafe class Utf16StringMarshaller /// /// The unmanaged string to convert. /// A managed string. - [RequiresUnsafe] public static string? ConvertToManaged(ushort* unmanaged) => Marshal.PtrToStringUni((IntPtr)unmanaged); @@ -34,7 +33,6 @@ public static unsafe class Utf16StringMarshaller /// Frees the memory for the unmanaged string. /// /// The memory allocated for the unmanaged string. - [RequiresUnsafe] public static void Free(ushort* unmanaged) => Marshal.FreeCoTaskMem((IntPtr)unmanaged); diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshalling/Utf8StringMarshaller.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshalling/Utf8StringMarshaller.cs index 842d9140f5a6a8..2dd8ec175505d3 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshalling/Utf8StringMarshaller.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshalling/Utf8StringMarshaller.cs @@ -20,7 +20,6 @@ public static unsafe class Utf8StringMarshaller /// /// The managed string to convert. /// An unmanaged string. - [RequiresUnsafe] public static byte* ConvertToUnmanaged(string? managed) { if (managed is null) @@ -40,7 +39,6 @@ public static unsafe class Utf8StringMarshaller /// /// The unmanaged string to convert. /// A managed string. - [RequiresUnsafe] public static string? ConvertToManaged(byte* unmanaged) => Marshal.PtrToStringUTF8((IntPtr)unmanaged); @@ -48,7 +46,6 @@ public static unsafe class Utf8StringMarshaller /// Free the memory for a specified unmanaged string. /// /// The memory allocated for the unmanaged string. - [RequiresUnsafe] public static void Free(byte* unmanaged) => Marshal.FreeCoTaskMem((IntPtr)unmanaged); @@ -106,7 +103,6 @@ public void FromManaged(string? managed, Span buffer) /// Converts the current managed string to an unmanaged string. /// /// An unmanaged string. - [RequiresUnsafe] public byte* ToUnmanaged() => _unmanagedValue; /// diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/MemoryMarshal.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/MemoryMarshal.cs index 4735e00409cf3f..18d3f34ef13fd7 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/MemoryMarshal.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/MemoryMarshal.cs @@ -251,7 +251,6 @@ public static ReadOnlySpan CreateReadOnlySpan(scoped ref readonly T refere /// The returned span does not include the null terminator. /// The string is longer than . [CLSCompliant(false)] - [RequiresUnsafe] public static unsafe ReadOnlySpan CreateReadOnlySpanFromNullTerminated(char* value) => value != null ? new ReadOnlySpan(value, string.wcslen(value)) : default; @@ -262,7 +261,6 @@ public static unsafe ReadOnlySpan CreateReadOnlySpanFromNullTerminated(cha /// The returned span does not include the null terminator, nor does it validate the well-formedness of the UTF-8 data. /// The string is longer than . [CLSCompliant(false)] - [RequiresUnsafe] public static unsafe ReadOnlySpan CreateReadOnlySpanFromNullTerminated(byte* value) => value != null ? new ReadOnlySpan(value, string.strlen(value)) : default; diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/NativeMemory.Unix.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/NativeMemory.Unix.cs index 14cd2eadb49045..b77dbf1a30d36d 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/NativeMemory.Unix.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/NativeMemory.Unix.cs @@ -61,7 +61,6 @@ public static unsafe partial class NativeMemory /// This method is a thin wrapper over the C free API or a platform dependent aligned free API such as _aligned_free on Win32. /// [CLSCompliant(false)] - [RequiresUnsafe] public static void AlignedFree(void* ptr) { if (ptr != null) @@ -84,7 +83,6 @@ public static void AlignedFree(void* ptr) /// This method is not compatible with or , instead or should be called. /// [CLSCompliant(false)] - [RequiresUnsafe] public static void* AlignedRealloc(void* ptr, nuint byteCount, nuint alignment) { if (!BitOperations.IsPow2(alignment)) @@ -178,7 +176,6 @@ public static void AlignedFree(void* ptr) /// This method is a thin wrapper over the C free API. /// [CLSCompliant(false)] - [RequiresUnsafe] public static void Free(void* ptr) { if (ptr != null) @@ -198,7 +195,6 @@ public static void Free(void* ptr) /// This method is a thin wrapper over the C realloc API. /// [CLSCompliant(false)] - [RequiresUnsafe] public static void* Realloc(void* ptr, nuint byteCount) { // The C standard does not define what happens when size == 0, we want an "empty" allocation diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/NativeMemory.Windows.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/NativeMemory.Windows.cs index 0a3fdbe0dca727..456a4616bf0655 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/NativeMemory.Windows.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/NativeMemory.Windows.cs @@ -48,7 +48,6 @@ public static unsafe partial class NativeMemory /// This method is a thin wrapper over the C free API or a platform dependent aligned free API such as _aligned_free on Win32. /// [CLSCompliant(false)] - [RequiresUnsafe] public static void AlignedFree(void* ptr) { if (ptr != null) @@ -71,7 +70,6 @@ public static void AlignedFree(void* ptr) /// This method is not compatible with or , instead or should be called. /// [CLSCompliant(false)] - [RequiresUnsafe] public static void* AlignedRealloc(void* ptr, nuint byteCount, nuint alignment) { if (!BitOperations.IsPow2(alignment)) @@ -143,7 +141,6 @@ public static void AlignedFree(void* ptr) /// This method is a thin wrapper over the C free API. /// [CLSCompliant(false)] - [RequiresUnsafe] public static void Free(void* ptr) { if (ptr != null) @@ -163,7 +160,6 @@ public static void Free(void* ptr) /// This method is a thin wrapper over the C realloc API. /// [CLSCompliant(false)] - [RequiresUnsafe] public static void* Realloc(void* ptr, nuint byteCount) { // The Windows implementation treats size == 0 as Free, we want an "empty" allocation diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/NativeMemory.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/NativeMemory.cs index 7008f9286e2473..d5ddb155c39849 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/NativeMemory.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/NativeMemory.cs @@ -47,7 +47,6 @@ public static unsafe partial class NativeMemory /// The behavior when is and is greater than 0 is undefined. /// [CLSCompliant(false)] - [RequiresUnsafe] public static void Clear(void* ptr, nuint byteCount) { SpanHelpers.ClearWithoutReferences(ref *(byte*)ptr, byteCount); @@ -61,7 +60,6 @@ public static void Clear(void* ptr, nuint byteCount) /// A pointer to the destination memory block where the data is to be copied. /// The size, in bytes, to be copied from the source location to the destination. [CLSCompliant(false)] - [RequiresUnsafe] public static void Copy(void* source, void* destination, nuint byteCount) { SpanHelpers.Memmove(ref *(byte*)destination, ref *(byte*)source, byteCount); @@ -75,7 +73,6 @@ public static void Copy(void* source, void* destination, nuint byteCount) /// The number of bytes to be set to . /// The value to be set. [CLSCompliant(false)] - [RequiresUnsafe] public static void Fill(void* ptr, nuint byteCount, byte value) { SpanHelpers.Fill(ref *(byte*)ptr, byteCount, value); diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/ObjectiveC/ObjectiveCMarshal.PlatformNotSupported.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/ObjectiveC/ObjectiveCMarshal.PlatformNotSupported.cs index c1418ec26c1a7a..133b2e7fe887eb 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/ObjectiveC/ObjectiveCMarshal.PlatformNotSupported.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/ObjectiveC/ObjectiveCMarshal.PlatformNotSupported.cs @@ -56,7 +56,6 @@ public static class ObjectiveCMarshal /// The should return 0 for not reference or 1 for /// referenced. Any other value has undefined behavior. /// - [RequiresUnsafe] public static unsafe void Initialize( delegate* unmanaged beginEndCallback, delegate* unmanaged isReferencedCallback, diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/ObjectiveC/ObjectiveCMarshal.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/ObjectiveC/ObjectiveCMarshal.cs index 0ed0d11aeeafbf..812de71191cc93 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/ObjectiveC/ObjectiveCMarshal.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/ObjectiveC/ObjectiveCMarshal.cs @@ -58,7 +58,6 @@ public static partial class ObjectiveCMarshal /// The should return 0 for not reference or 1 for /// referenced. Any other value has undefined behavior. /// - [RequiresUnsafe] public static unsafe void Initialize( delegate* unmanaged beginEndCallback, delegate* unmanaged isReferencedCallback, diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/ReferenceTrackerHost.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/ReferenceTrackerHost.cs index dbdb8d9fd9546f..a2e6f9c42d50c1 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/ReferenceTrackerHost.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/ReferenceTrackerHost.cs @@ -75,7 +75,6 @@ internal static int IReferenceTrackerHost_NotifyEndOfReferenceTrackingOnThread(I #pragma warning disable IDE0060, CS3016 [UnmanagedCallersOnly(CallConvs = [typeof(CallConvMemberFunction)])] - [RequiresUnsafe] internal static unsafe int IReferenceTrackerHost_GetTrackerTarget(IntPtr pThis, IntPtr punk, IntPtr* ppNewReference) #pragma warning restore IDE0060, CS3016 { @@ -135,7 +134,6 @@ internal static int IReferenceTrackerHost_RemoveMemoryPressure(IntPtr pThis, lon #pragma warning disable CS3016 [UnmanagedCallersOnly(CallConvs = [typeof(CallConvMemberFunction)])] - [RequiresUnsafe] internal static unsafe int IReferenceTrackerHost_QueryInterface(IntPtr pThis, Guid* guid, IntPtr* ppObject) #pragma warning restore CS3016 { diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/TypeMapLazyDictionary.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/TypeMapLazyDictionary.cs index 12200ec9521fa8..9452e58d18e175 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/TypeMapLazyDictionary.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/TypeMapLazyDictionary.cs @@ -79,7 +79,6 @@ public unsafe struct ProcessAttributesCallbackArg } [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "TypeMapLazyDictionary_ProcessAttributes")] - [RequiresUnsafe] private static unsafe partial void ProcessAttributes( QCallAssembly assembly, QCallTypeHandle groupType, @@ -134,7 +133,6 @@ private static void ConvertUtf8ToUtf16(ReadOnlySpan utf8TypeName, out Utf1 } [UnmanagedCallersOnly] - [RequiresUnsafe] private static unsafe Interop.BOOL NewPrecachedExternalTypeMap(CallbackContext* context) { Debug.Assert(context != null); @@ -153,7 +151,6 @@ private static unsafe Interop.BOOL NewPrecachedExternalTypeMap(CallbackContext* } [UnmanagedCallersOnly] - [RequiresUnsafe] private static unsafe Interop.BOOL NewPrecachedProxyTypeMap(CallbackContext* context) { Debug.Assert(context != null); @@ -172,7 +169,6 @@ private static unsafe Interop.BOOL NewPrecachedProxyTypeMap(CallbackContext* con } [UnmanagedCallersOnly] - [RequiresUnsafe] private static unsafe Interop.BOOL NewExternalTypeEntry(CallbackContext* context, ProcessAttributesCallbackArg* arg) { Debug.Assert(context != null); @@ -200,7 +196,6 @@ private static unsafe Interop.BOOL NewExternalTypeEntry(CallbackContext* context } [UnmanagedCallersOnly] - [RequiresUnsafe] private static unsafe Interop.BOOL NewProxyTypeEntry(CallbackContext* context, ProcessAttributesCallbackArg* arg) { Debug.Assert(context != null); @@ -239,7 +234,6 @@ private static unsafe Interop.BOOL NewProxyTypeEntry(CallbackContext* context, P return Interop.BOOL.TRUE; // Continue processing. } - [RequiresUnsafe] private static unsafe CallbackContext CreateMaps( RuntimeType groupType, delegate* unmanaged newExternalTypeEntry, @@ -363,7 +357,6 @@ public bool TryGetValue(TKey key, [MaybeNullWhen(false)] out Type value) private unsafe struct TypeNameUtf8 { - [RequiresUnsafe] public required void* Utf8TypeName { get; init; } public required int Utf8TypeNameLen { get; init; } } diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Arm/AdvSimd.PlatformNotSupported.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Arm/AdvSimd.PlatformNotSupported.cs index 31499f7211a606..cbe9b9a00cc3a5 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Arm/AdvSimd.PlatformNotSupported.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Arm/AdvSimd.PlatformNotSupported.cs @@ -1550,688 +1550,519 @@ internal Arm64() { } public static Vector128 InsertSelectedScalar(Vector128 result, [ConstantExpected(Max = (byte)(1))] byte resultIndex, Vector128 value, [ConstantExpected(Max = (byte)(1))] byte valueIndex) { throw new PlatformNotSupportedException(); } /// A64: LD2 { Vn.16B, Vn+1.16B }[Vm], [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) LoadAndInsertScalar((Vector128, Vector128) values, [ConstantExpected(Max = (byte)(15))] byte index, byte* address) { throw new PlatformNotSupportedException(); } /// A64: LD2 { Vn.16B, Vn+1.16B }[Vm], [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) LoadAndInsertScalar((Vector128, Vector128) values, [ConstantExpected(Max = (byte)(15))] byte index, sbyte* address) { throw new PlatformNotSupportedException(); } /// A64: LD2 { Vn.8H, Vn+1.8H }[Vm], [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) LoadAndInsertScalar((Vector128, Vector128) values, [ConstantExpected(Max = (byte)(7))] byte index, short* address) { throw new PlatformNotSupportedException(); } /// A64: LD2 { Vn.8H, Vn+1.8H }[Vm], [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) LoadAndInsertScalar((Vector128, Vector128) values, [ConstantExpected(Max = (byte)(7))] byte index, ushort* address) { throw new PlatformNotSupportedException(); } /// A64: LD2 { Vn.4S, Vn+1.4S }[Vm], [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) LoadAndInsertScalar((Vector128, Vector128) values, [ConstantExpected(Max = (byte)(3))] byte index, int* address) { throw new PlatformNotSupportedException(); } /// A64: LD2 { Vn.4S, Vn+1.4S }[Vm], [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) LoadAndInsertScalar((Vector128, Vector128) values, [ConstantExpected(Max = (byte)(3))] byte index, uint* address) { throw new PlatformNotSupportedException(); } /// A64: LD2 { Vn.2D, Vn+1.2D }[Vm], [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) LoadAndInsertScalar((Vector128, Vector128) values, [ConstantExpected(Max = (byte)(1))] byte index, long* address) { throw new PlatformNotSupportedException(); } /// A64: LD2 { Vn.2D, Vn+1.2D }[Vm], [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) LoadAndInsertScalar((Vector128, Vector128) values, [ConstantExpected(Max = (byte)(1))] byte index, ulong* address) { throw new PlatformNotSupportedException(); } /// A64: LD2 { Vn.4S, Vn+1.4S }[Vm], [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) LoadAndInsertScalar((Vector128, Vector128) values, [ConstantExpected(Max = (byte)(3))] byte index, float* address) { throw new PlatformNotSupportedException(); } /// A64: LD2 { Vn.2D, Vn+1.2D }[Vm], [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) LoadAndInsertScalar((Vector128, Vector128) values, [ConstantExpected(Max = (byte)(1))] byte index, double* address) { throw new PlatformNotSupportedException(); } /// A64: LD3 { Vn.16B, Vn+1.16B, Vn+2.16B }[Vm], [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) LoadAndInsertScalar((Vector128, Vector128, Vector128) values, [ConstantExpected(Max = (byte)(15))] byte index, byte* address) { throw new PlatformNotSupportedException(); } /// A64: LD3 { Vn.16B, Vn+1.16B, Vn+2.16B }[Vm], [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) LoadAndInsertScalar((Vector128, Vector128, Vector128) values, [ConstantExpected(Max = (byte)(15))] byte index, sbyte* address) { throw new PlatformNotSupportedException(); } /// A64: LD3 { Vn.8H, Vn+1.8H, Vn+2.8H }[Vm], [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) LoadAndInsertScalar((Vector128, Vector128, Vector128) values, [ConstantExpected(Max = (byte)(7))] byte index, short* address) { throw new PlatformNotSupportedException(); } /// A64: LD3 { Vn.8H, Vn+1.8H, Vn+2.8H }[Vm], [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) LoadAndInsertScalar((Vector128, Vector128, Vector128) values, [ConstantExpected(Max = (byte)(7))] byte index, ushort* address) { throw new PlatformNotSupportedException(); } /// A64: LD3 { Vn.4S, Vn+1.4S, Vn+2.4S }[Vm], [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) LoadAndInsertScalar((Vector128, Vector128, Vector128) values, [ConstantExpected(Max = (byte)(3))] byte index, int* address) { throw new PlatformNotSupportedException(); } /// A64: LD3 { Vn.4S, Vn+1.4S, Vn+2.4S }[Vm], [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) LoadAndInsertScalar((Vector128, Vector128, Vector128) values, [ConstantExpected(Max = (byte)(3))] byte index, uint* address) { throw new PlatformNotSupportedException(); } /// A64: LD3 { Vn.2D, Vn+1.2D, Vn+2.2D }[Vm], [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) LoadAndInsertScalar((Vector128, Vector128, Vector128) values, [ConstantExpected(Max = (byte)(1))] byte index, long* address) { throw new PlatformNotSupportedException(); } /// A64: LD3 { Vn.2D, Vn+1.2D, Vn+2.2D }[Vm], [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) LoadAndInsertScalar((Vector128, Vector128, Vector128) values, [ConstantExpected(Max = (byte)(1))] byte index, ulong* address) { throw new PlatformNotSupportedException(); } /// A64: LD3 { Vn.4S, Vn+1.4S, Vn+2.4S }[Vm], [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) LoadAndInsertScalar((Vector128, Vector128, Vector128) values, [ConstantExpected(Max = (byte)(3))] byte index, float* address) { throw new PlatformNotSupportedException(); } /// A64: LD3 { Vn.2D, Vn+1.2D, Vn+2.2D }[Vm], [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) LoadAndInsertScalar((Vector128, Vector128, Vector128) values, [ConstantExpected(Max = (byte)(1))] byte index, double* address) { throw new PlatformNotSupportedException(); } /// A64: LD4 { Vn.16B, Vn+1.16B, Vn+2.16B, Vn+3.16B }[Vm], [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) LoadAndInsertScalar((Vector128, Vector128, Vector128, Vector128) values, [ConstantExpected(Max = (byte)(15))] byte index, byte* address) { throw new PlatformNotSupportedException(); } /// A64: LD4 { Vn.16B, Vn+1.16B, Vn+2.16B, Vn+3.16B }[Vm], [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) LoadAndInsertScalar((Vector128, Vector128, Vector128, Vector128) values, [ConstantExpected(Max = (byte)(15))] byte index, sbyte* address) { throw new PlatformNotSupportedException(); } /// A64: LD4 { Vn.8H, Vn+1.8H, Vn+2.8H, Vn+3.8H }[Vm], [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) LoadAndInsertScalar((Vector128, Vector128, Vector128, Vector128) values, [ConstantExpected(Max = (byte)(7))] byte index, short* address) { throw new PlatformNotSupportedException(); } /// A64: LD4 { Vn.8H, Vn+1.8H, Vn+2.8H, Vn+3.8H }[Vm], [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) LoadAndInsertScalar((Vector128, Vector128, Vector128, Vector128) values, [ConstantExpected(Max = (byte)(7))] byte index, ushort* address) { throw new PlatformNotSupportedException(); } /// A64: LD4 { Vn.4S, Vn+1.4S, Vn+2.4S, Vn+3.4S }[Vm], [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) LoadAndInsertScalar((Vector128, Vector128, Vector128, Vector128) values, [ConstantExpected(Max = (byte)(3))] byte index, int* address) { throw new PlatformNotSupportedException(); } /// A64: LD4 { Vn.4S, Vn+1.4S, Vn+2.4S, Vn+3.4S }[Vm], [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) LoadAndInsertScalar((Vector128, Vector128, Vector128, Vector128) values, [ConstantExpected(Max = (byte)(3))] byte index, uint* address) { throw new PlatformNotSupportedException(); } /// A64: LD4 { Vn.2D, Vn+1.2D, Vn+2.2D, Vn+3.2D }[Vm], [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) LoadAndInsertScalar((Vector128, Vector128, Vector128, Vector128) values, [ConstantExpected(Max = (byte)(1))] byte index, long* address) { throw new PlatformNotSupportedException(); } /// A64: LD4 { Vn.2D, Vn+1.2D, Vn+2.2D, Vn+3.2D }[Vm], [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) LoadAndInsertScalar((Vector128, Vector128, Vector128, Vector128) values, [ConstantExpected(Max = (byte)(1))] byte index, ulong* address) { throw new PlatformNotSupportedException(); } /// A64: LD4 { Vn.4S, Vn+1.4S, Vn+2.4S, Vn+3.4S }[Vm], [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) LoadAndInsertScalar((Vector128, Vector128, Vector128, Vector128) values, [ConstantExpected(Max = (byte)(3))] byte index, float* address) { throw new PlatformNotSupportedException(); } /// A64: LD4 { Vn.2D, Vn+1.2D, Vn+2.2D, Vn+3.2D }[Vm], [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) LoadAndInsertScalar((Vector128, Vector128, Vector128, Vector128) values, [ConstantExpected(Max = (byte)(1))] byte index, double* address) { throw new PlatformNotSupportedException(); } /// /// float64x2_t vld1q_dup_f64 (float64_t const * ptr) /// A64: LD1R { Vt.2D }, [Xn] /// - [RequiresUnsafe] public static unsafe Vector128 LoadAndReplicateToVector128(double* address) { throw new PlatformNotSupportedException(); } /// /// int64x2_t vld1q_dup_s64 (int64_t const * ptr) /// A64: LD1R { Vt.2D }, [Xn] /// - [RequiresUnsafe] public static unsafe Vector128 LoadAndReplicateToVector128(long* address) { throw new PlatformNotSupportedException(); } /// /// uint64x2_t vld1q_dup_u64 (uint64_t const * ptr) /// A64: LD1R { Vt.2D }, [Xn] /// - [RequiresUnsafe] public static unsafe Vector128 LoadAndReplicateToVector128(ulong* address) { throw new PlatformNotSupportedException(); } /// A64: LD2R { Vn.16B, Vn+1.16B }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) LoadAndReplicateToVector128x2(byte* address) { throw new PlatformNotSupportedException(); } /// A64: LD2R { Vn.16B, Vn+1.16B }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) LoadAndReplicateToVector128x2(sbyte* address) { throw new PlatformNotSupportedException(); } /// A64: LD2R { Vn.8H, Vn+1.8H }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) LoadAndReplicateToVector128x2(short* address) { throw new PlatformNotSupportedException(); } /// A64: LD2R { Vn.8H, Vn+1.8H }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) LoadAndReplicateToVector128x2(ushort* address) { throw new PlatformNotSupportedException(); } /// A64: LD2R { Vn.4S, Vn+1.4S }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) LoadAndReplicateToVector128x2(int* address) { throw new PlatformNotSupportedException(); } /// A64: LD2R { Vn.4S, Vn+1.4S }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) LoadAndReplicateToVector128x2(uint* address) { throw new PlatformNotSupportedException(); } /// A64: LD2R { Vn.2D, Vn+1.2D }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) LoadAndReplicateToVector128x2(long* address) { throw new PlatformNotSupportedException(); } /// A64: LD2R { Vn.2D, Vn+1.2D }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) LoadAndReplicateToVector128x2(ulong* address) { throw new PlatformNotSupportedException(); } /// A64: LD2R { Vn.4S, Vn+1.4S }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) LoadAndReplicateToVector128x2(float* address) { throw new PlatformNotSupportedException(); } /// A64: LD2R { Vn.2D, Vn+1.2D }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) LoadAndReplicateToVector128x2(double* address) { throw new PlatformNotSupportedException(); } /// A64: LD3R { Vn.16B, Vn+1.16B, Vn+2.16B }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) LoadAndReplicateToVector128x3(byte* address) { throw new PlatformNotSupportedException(); } /// A64: LD3R { Vn.16B, Vn+1.16B, Vn+2.16B }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) LoadAndReplicateToVector128x3(sbyte* address) { throw new PlatformNotSupportedException(); } /// A64: LD3R { Vn.8H, Vn+1.8H, Vn+2.8H }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) LoadAndReplicateToVector128x3(short* address) { throw new PlatformNotSupportedException(); } /// A64: LD3R { Vn.8H, Vn+1.8H, Vn+2.8H }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) LoadAndReplicateToVector128x3(ushort* address) { throw new PlatformNotSupportedException(); } /// A64: LD3R { Vn.4S, Vn+1.4S, Vn+2.4S }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) LoadAndReplicateToVector128x3(int* address) { throw new PlatformNotSupportedException(); } /// A64: LD3R { Vn.4S, Vn+1.4S, Vn+2.4S }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) LoadAndReplicateToVector128x3(uint* address) { throw new PlatformNotSupportedException(); } /// A64: LD3R { Vn.2D, Vn+1.2D, Vn+2.2D }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) LoadAndReplicateToVector128x3(long* address) { throw new PlatformNotSupportedException(); } /// A64: LD3R { Vn.2D, Vn+1.2D, Vn+2.2D }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) LoadAndReplicateToVector128x3(ulong* address) { throw new PlatformNotSupportedException(); } /// A64: LD3R { Vn.4S, Vn+1.4S, Vn+2.4S }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) LoadAndReplicateToVector128x3(float* address) { throw new PlatformNotSupportedException(); } /// A64: LD3R { Vn.2D, Vn+1.2D, Vn+2.2D }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) LoadAndReplicateToVector128x3(double* address) { throw new PlatformNotSupportedException(); } /// A64: LD4R { Vn.16B, Vn+1.16B, Vn+2.16B, Vn+3.16B }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) LoadAndReplicateToVector128x4(byte* address) { throw new PlatformNotSupportedException(); } /// A64: LD4R { Vn.16B, Vn+1.16B, Vn+2.16B, Vn+3.16B }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) LoadAndReplicateToVector128x4(sbyte* address) { throw new PlatformNotSupportedException(); } /// A64: LD4R { Vn.8H, Vn+1.8H, Vn+2.8H, Vn+3.8H }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) LoadAndReplicateToVector128x4(short* address) { throw new PlatformNotSupportedException(); } /// A64: LD4R { Vn.8H, Vn+1.8H, Vn+2.8H, Vn+3.8H }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) LoadAndReplicateToVector128x4(ushort* address) { throw new PlatformNotSupportedException(); } /// A64: LD4R { Vn.4S, Vn+1.4S, Vn+2.4S, Vn+3.4S }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) LoadAndReplicateToVector128x4(int* address) { throw new PlatformNotSupportedException(); } /// A64: LD4R { Vn.4S, Vn+1.4S, Vn+2.4S, Vn+3.4S }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) LoadAndReplicateToVector128x4(uint* address) { throw new PlatformNotSupportedException(); } /// A64: LD4R { Vn.2D, Vn+1.2D, Vn+2.2D, Vn+3.2D }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) LoadAndReplicateToVector128x4(long* address) { throw new PlatformNotSupportedException(); } /// A64: LD4R { Vn.2D, Vn+1.2D, Vn+2.2D, Vn+3.2D }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) LoadAndReplicateToVector128x4(ulong* address) { throw new PlatformNotSupportedException(); } /// A64: LD4R { Vn.4S, Vn+1.4S, Vn+2.4S, Vn+3.4S }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) LoadAndReplicateToVector128x4(float* address) { throw new PlatformNotSupportedException(); } /// A64: LD4R { Vn.2D, Vn+1.2D, Vn+2.2D, Vn+3.2D }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) LoadAndReplicateToVector128x4(double* address) { throw new PlatformNotSupportedException(); } /// A64: LDP Dt1, Dt2, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) LoadPairVector64(byte* address) { throw new PlatformNotSupportedException(); } /// A64: LDP Dt1, Dt2, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) LoadPairVector64(double* address) { throw new PlatformNotSupportedException(); } /// A64: LDP Dt1, Dt2, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) LoadPairVector64(short* address) { throw new PlatformNotSupportedException(); } /// A64: LDP Dt1, Dt2, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) LoadPairVector64(int* address) { throw new PlatformNotSupportedException(); } /// A64: LDP Dt1, Dt2, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) LoadPairVector64(long* address) { throw new PlatformNotSupportedException(); } /// A64: LDP Dt1, Dt2, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) LoadPairVector64(sbyte* address) { throw new PlatformNotSupportedException(); } /// A64: LDP Dt1, Dt2, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) LoadPairVector64(float* address) { throw new PlatformNotSupportedException(); } /// A64: LDP Dt1, Dt2, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) LoadPairVector64(ushort* address) { throw new PlatformNotSupportedException(); } /// A64: LDP Dt1, Dt2, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) LoadPairVector64(uint* address) { throw new PlatformNotSupportedException(); } /// A64: LDP Dt1, Dt2, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) LoadPairVector64(ulong* address) { throw new PlatformNotSupportedException(); } /// A64: LDP St1, St2, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) LoadPairScalarVector64(int* address) { throw new PlatformNotSupportedException(); } /// A64: LDP St1, St2, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) LoadPairScalarVector64(float* address) { throw new PlatformNotSupportedException(); } /// A64: LDP St1, St2, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) LoadPairScalarVector64(uint* address) { throw new PlatformNotSupportedException(); } /// A64: LDP Qt1, Qt2, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) LoadPairVector128(byte* address) { throw new PlatformNotSupportedException(); } /// A64: LDP Qt1, Qt2, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) LoadPairVector128(double* address) { throw new PlatformNotSupportedException(); } /// A64: LDP Qt1, Qt2, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) LoadPairVector128(short* address) { throw new PlatformNotSupportedException(); } /// A64: LDP Qt1, Qt2, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) LoadPairVector128(int* address) { throw new PlatformNotSupportedException(); } /// A64: LDP Qt1, Qt2, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) LoadPairVector128(long* address) { throw new PlatformNotSupportedException(); } /// A64: LDP Qt1, Qt2, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) LoadPairVector128(sbyte* address) { throw new PlatformNotSupportedException(); } /// A64: LDP Qt1, Qt2, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) LoadPairVector128(float* address) { throw new PlatformNotSupportedException(); } /// A64: LDP Qt1, Qt2, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) LoadPairVector128(ushort* address) { throw new PlatformNotSupportedException(); } /// A64: LDP Qt1, Qt2, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) LoadPairVector128(uint* address) { throw new PlatformNotSupportedException(); } /// A64: LDP Qt1, Qt2, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) LoadPairVector128(ulong* address) { throw new PlatformNotSupportedException(); } /// A64: LDNP Dt1, Dt2, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) LoadPairVector64NonTemporal(byte* address) { throw new PlatformNotSupportedException(); } /// A64: LDNP Dt1, Dt2, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) LoadPairVector64NonTemporal(double* address) { throw new PlatformNotSupportedException(); } /// A64: LDNP Dt1, Dt2, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) LoadPairVector64NonTemporal(short* address) { throw new PlatformNotSupportedException(); } /// A64: LDNP Dt1, Dt2, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) LoadPairVector64NonTemporal(int* address) { throw new PlatformNotSupportedException(); } /// A64: LDNP Dt1, Dt2, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) LoadPairVector64NonTemporal(long* address) { throw new PlatformNotSupportedException(); } /// A64: LDNP Dt1, Dt2, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) LoadPairVector64NonTemporal(sbyte* address) { throw new PlatformNotSupportedException(); } /// A64: LDNP Dt1, Dt2, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) LoadPairVector64NonTemporal(float* address) { throw new PlatformNotSupportedException(); } /// A64: LDNP Dt1, Dt2, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) LoadPairVector64NonTemporal(ushort* address) { throw new PlatformNotSupportedException(); } /// A64: LDNP Dt1, Dt2, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) LoadPairVector64NonTemporal(uint* address) { throw new PlatformNotSupportedException(); } /// A64: LDNP Dt1, Dt2, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) LoadPairVector64NonTemporal(ulong* address) { throw new PlatformNotSupportedException(); } /// A64: LDNP St1, St2, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) LoadPairScalarVector64NonTemporal(int* address) { throw new PlatformNotSupportedException(); } /// A64: LDNP St1, St2, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) LoadPairScalarVector64NonTemporal(float* address) { throw new PlatformNotSupportedException(); } /// A64: LDNP St1, St2, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) LoadPairScalarVector64NonTemporal(uint* address) { throw new PlatformNotSupportedException(); } /// A64: LDNP Qt1, Qt2, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) LoadPairVector128NonTemporal(byte* address) { throw new PlatformNotSupportedException(); } /// A64: LDNP Qt1, Qt2, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) LoadPairVector128NonTemporal(double* address) { throw new PlatformNotSupportedException(); } /// A64: LDNP Qt1, Qt2, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) LoadPairVector128NonTemporal(short* address) { throw new PlatformNotSupportedException(); } /// A64: LDNP Qt1, Qt2, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) LoadPairVector128NonTemporal(int* address) { throw new PlatformNotSupportedException(); } /// A64: LDNP Qt1, Qt2, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) LoadPairVector128NonTemporal(long* address) { throw new PlatformNotSupportedException(); } /// A64: LDNP Qt1, Qt2, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) LoadPairVector128NonTemporal(sbyte* address) { throw new PlatformNotSupportedException(); } /// A64: LDNP Qt1, Qt2, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) LoadPairVector128NonTemporal(float* address) { throw new PlatformNotSupportedException(); } /// A64: LDNP Qt1, Qt2, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) LoadPairVector128NonTemporal(ushort* address) { throw new PlatformNotSupportedException(); } /// A64: LDNP Qt1, Qt2, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) LoadPairVector128NonTemporal(uint* address) { throw new PlatformNotSupportedException(); } /// A64: LDNP Qt1, Qt2, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) LoadPairVector128NonTemporal(ulong* address) { throw new PlatformNotSupportedException(); } /// A64: LD2 { Vn.16B, Vn+1.16B }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) Load2xVector128AndUnzip(byte* address) { throw new PlatformNotSupportedException(); } /// A64: LD2 { Vn.16B, Vn+1.16B }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) Load2xVector128AndUnzip(sbyte* address) { throw new PlatformNotSupportedException(); } /// A64: LD2 { Vn.8H, Vn+1.8H }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) Load2xVector128AndUnzip(short* address) { throw new PlatformNotSupportedException(); } /// A64: LD2 { Vn.8H, Vn+1.8H }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) Load2xVector128AndUnzip(ushort* address) { throw new PlatformNotSupportedException(); } /// A64: LD2 { Vn.4S, Vn+1.4S }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) Load2xVector128AndUnzip(int* address) { throw new PlatformNotSupportedException(); } /// A64: LD2 { Vn.4S, Vn+1.4S }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) Load2xVector128AndUnzip(uint* address) { throw new PlatformNotSupportedException(); } /// A64: LD2 { Vn.2D, Vn+1.2D }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) Load2xVector128AndUnzip(long* address) { throw new PlatformNotSupportedException(); } /// A64: LD2 { Vn.2D, Vn+1.2D }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) Load2xVector128AndUnzip(ulong* address) { throw new PlatformNotSupportedException(); } /// A64: LD2 { Vn.4S, Vn+1.4S }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) Load2xVector128AndUnzip(float* address) { throw new PlatformNotSupportedException(); } /// A64: LD2 { Vn.2D, Vn+1.2D }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) Load2xVector128AndUnzip(double* address) { throw new PlatformNotSupportedException(); } /// A64: LD3 { Vn.16B, Vn+1.16B, Vn+2.16B }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) Load3xVector128AndUnzip(byte* address) { throw new PlatformNotSupportedException(); } /// A64: LD3 { Vn.16B, Vn+1.16B, Vn+2.16B }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) Load3xVector128AndUnzip(sbyte* address) { throw new PlatformNotSupportedException(); } /// A64: LD3 { Vn.8H, Vn+1.8H, Vn+2.8H }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) Load3xVector128AndUnzip(short* address) { throw new PlatformNotSupportedException(); } /// A64: LD3 { Vn.8H, Vn+1.8H, Vn+2.8H }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) Load3xVector128AndUnzip(ushort* address) { throw new PlatformNotSupportedException(); } /// A64: LD3 { Vn.4S, Vn+1.4S, Vn+2.4S }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) Load3xVector128AndUnzip(int* address) { throw new PlatformNotSupportedException(); } /// A64: LD3 { Vn.4S, Vn+1.4S, Vn+2.4S }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) Load3xVector128AndUnzip(uint* address) { throw new PlatformNotSupportedException(); } /// A64: LD3 { Vn.2D, Vn+1.2D, Vn+2.2D }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) Load3xVector128AndUnzip(long* address) { throw new PlatformNotSupportedException(); } /// A64: LD3 { Vn.2D, Vn+1.2D, Vn+2.2D }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) Load3xVector128AndUnzip(ulong* address) { throw new PlatformNotSupportedException(); } /// A64: LD3 { Vn.4S, Vn+1.4S, Vn+2.4S }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) Load3xVector128AndUnzip(float* address) { throw new PlatformNotSupportedException(); } /// A64: LD3 { Vn.2D, Vn+1.2D, Vn+2.2D }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) Load3xVector128AndUnzip(double* address) { throw new PlatformNotSupportedException(); } /// A64: LD4 { Vn.16B, Vn+1.16B, Vn+2.16B, Vn+3.16B }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) Load4xVector128AndUnzip(byte* address) { throw new PlatformNotSupportedException(); } /// A64: LD4 { Vn.16B, Vn+1.16B, Vn+2.16B, Vn+3.16B }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) Load4xVector128AndUnzip(sbyte* address) { throw new PlatformNotSupportedException(); } /// A64: LD4 { Vn.8H, Vn+1.8H, Vn+2.8H, Vn+3.8H }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) Load4xVector128AndUnzip(short* address) { throw new PlatformNotSupportedException(); } /// A64: LD4 { Vn.8H, Vn+1.8H, Vn+2.8H, Vn+3.8H }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) Load4xVector128AndUnzip(ushort* address) { throw new PlatformNotSupportedException(); } /// A64: LD4 { Vn.4S, Vn+1.4S, Vn+2.4S, Vn+3.4S }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) Load4xVector128AndUnzip(int* address) { throw new PlatformNotSupportedException(); } /// A64: LD4 { Vn.4S, Vn+1.4S, Vn+2.4S, Vn+3.4S }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) Load4xVector128AndUnzip(uint* address) { throw new PlatformNotSupportedException(); } /// A64: LD4 { Vn.2D, Vn+1.2D, Vn+2.2D, Vn+3.2D }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) Load4xVector128AndUnzip(long* address) { throw new PlatformNotSupportedException(); } /// A64: LD4 { Vn.2D, Vn+1.2D, Vn+2.2D, Vn+3.2D }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) Load4xVector128AndUnzip(ulong* address) { throw new PlatformNotSupportedException(); } /// A64: LD4 { Vn.4S, Vn+1.4S, Vn+2.4S, Vn+3.4S }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) Load4xVector128AndUnzip(float* address) { throw new PlatformNotSupportedException(); } /// A64: LD4 { Vn.2D, Vn+1.2D, Vn+2.2D, Vn+3.2D }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) Load4xVector128AndUnzip(double* address) { throw new PlatformNotSupportedException(); } /// A64: LD1 { Vn.16B, Vn+1.16B }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) Load2xVector128(byte* address) { throw new PlatformNotSupportedException(); } /// A64: LD1 { Vn.16B, Vn+1.16B }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) Load2xVector128(sbyte* address) { throw new PlatformNotSupportedException(); } /// A64: LD1 { Vn.8H, Vn+1.8H }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) Load2xVector128(short* address) { throw new PlatformNotSupportedException(); } /// A64: LD1 { Vn.8H, Vn+1.8H }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) Load2xVector128(ushort* address) { throw new PlatformNotSupportedException(); } /// A64: LD1 { Vn.4S, Vn+1.4S }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) Load2xVector128(int* address) { throw new PlatformNotSupportedException(); } /// A64: LD1 { Vn.4S, Vn+1.4S }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) Load2xVector128(uint* address) { throw new PlatformNotSupportedException(); } /// A64: LD1 { Vn.2D, Vn+1.2D }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) Load2xVector128(long* address) { throw new PlatformNotSupportedException(); } /// A64: LD1 { Vn.2D, Vn+1.2D }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) Load2xVector128(ulong* address) { throw new PlatformNotSupportedException(); } /// A64: LD1 { Vn.4S, Vn+1.4S }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) Load2xVector128(float* address) { throw new PlatformNotSupportedException(); } /// A64: LD1 { Vn.2D, Vn+1.2D }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) Load2xVector128(double* address) { throw new PlatformNotSupportedException(); } /// A64: LD1 { Vn.16B, Vn+1.16B, Vn+2.16B }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) Load3xVector128(byte* address) { throw new PlatformNotSupportedException(); } /// A64: LD1 { Vn.16B, Vn+1.16B, Vn+2.16B }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) Load3xVector128(sbyte* address) { throw new PlatformNotSupportedException(); } /// A64: LD1 { Vn.8H, Vn+1.8H, Vn+2.8H }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) Load3xVector128(short* address) { throw new PlatformNotSupportedException(); } /// A64: LD1 { Vn.8H, Vn+1.8H, Vn+2.8H }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) Load3xVector128(ushort* address) { throw new PlatformNotSupportedException(); } /// A64: LD1 { Vn.4S, Vn+1.4S, Vn+2.4S }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) Load3xVector128(int* address) { throw new PlatformNotSupportedException(); } /// A64: LD1 { Vn.4S, Vn+1.4S, Vn+2.4S }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) Load3xVector128(uint* address) { throw new PlatformNotSupportedException(); } /// A64: LD1 { Vn.2D, Vn+1.2D, Vn+2.2D }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) Load3xVector128(long* address) { throw new PlatformNotSupportedException(); } /// A64: LD1 { Vn.2D, Vn+1.2D, Vn+2.2D }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) Load3xVector128(ulong* address) { throw new PlatformNotSupportedException(); } /// A64: LD1 { Vn.4S, Vn+1.4S, Vn+2.4S }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) Load3xVector128(float* address) { throw new PlatformNotSupportedException(); } /// A64: LD1 { Vn.2D, Vn+1.2D, Vn+2.2D }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) Load3xVector128(double* address) { throw new PlatformNotSupportedException(); } /// A64: LD1 { Vn.16B, Vn+1.16B, Vn+2.16B, Vn+3.16B }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) Load4xVector128(byte* address) { throw new PlatformNotSupportedException(); } /// A64: LD1 { Vn.16B, Vn+1.16B, Vn+2.16B, Vn+3.16B }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) Load4xVector128(sbyte* address) { throw new PlatformNotSupportedException(); } /// A64: LD1 { Vn.8H, Vn+1.8H, Vn+2.8H, Vn+3.8H }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) Load4xVector128(short* address) { throw new PlatformNotSupportedException(); } /// A64: LD1 { Vn.8H, Vn+1.8H, Vn+2.8H, Vn+3.8H }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) Load4xVector128(ushort* address) { throw new PlatformNotSupportedException(); } /// A64: LD1 { Vn.4S, Vn+1.4S, Vn+2.4S, Vn+3.4S }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) Load4xVector128(int* address) { throw new PlatformNotSupportedException(); } /// A64: LD1 { Vn.4S, Vn+1.4S, Vn+2.4S, Vn+3.4S }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) Load4xVector128(uint* address) { throw new PlatformNotSupportedException(); } /// A64: LD1 { Vn.2D, Vn+1.2D, Vn+2.2D, Vn+3.2D }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) Load4xVector128(long* address) { throw new PlatformNotSupportedException(); } /// A64: LD1 { Vn.2D, Vn+1.2D, Vn+2.2D, Vn+3.2D}, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) Load4xVector128(ulong* address) { throw new PlatformNotSupportedException(); } /// A64: LD1 { Vn.4S, Vn+1.4S, Vn+2.4S, Vn+3.4S }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) Load4xVector128(float* address) { throw new PlatformNotSupportedException(); } /// A64: LD1 { Vn.2D, Vn+1.2D, Vn+2.2D, Vn+3.2D }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) Load4xVector128(double* address) { throw new PlatformNotSupportedException(); } /// @@ -3386,610 +3217,474 @@ internal Arm64() { } public static Vector128 Sqrt(Vector128 value) { throw new PlatformNotSupportedException(); } /// A64: STP Dt1, Dt2, [Xn] - [RequiresUnsafe] public static unsafe void StorePair(byte* address, Vector64 value1, Vector64 value2) { throw new PlatformNotSupportedException(); } /// A64: STP Dt1, Dt2, [Xn] - [RequiresUnsafe] public static unsafe void StorePair(double* address, Vector64 value1, Vector64 value2) { throw new PlatformNotSupportedException(); } /// A64: STP Dt1, Dt2, [Xn] - [RequiresUnsafe] public static unsafe void StorePair(short* address, Vector64 value1, Vector64 value2) { throw new PlatformNotSupportedException(); } /// A64: STP Dt1, Dt2, [Xn] - [RequiresUnsafe] public static unsafe void StorePair(int* address, Vector64 value1, Vector64 value2) { throw new PlatformNotSupportedException(); } /// A64: STP Dt1, Dt2, [Xn] - [RequiresUnsafe] public static unsafe void StorePair(long* address, Vector64 value1, Vector64 value2) { throw new PlatformNotSupportedException(); } /// A64: STP Dt1, Dt2, [Xn] - [RequiresUnsafe] public static unsafe void StorePair(sbyte* address, Vector64 value1, Vector64 value2) { throw new PlatformNotSupportedException(); } /// A64: STP Dt1, Dt2, [Xn] - [RequiresUnsafe] public static unsafe void StorePair(float* address, Vector64 value1, Vector64 value2) { throw new PlatformNotSupportedException(); } /// A64: STP Dt1, Dt2, [Xn] - [RequiresUnsafe] public static unsafe void StorePair(ushort* address, Vector64 value1, Vector64 value2) { throw new PlatformNotSupportedException(); } /// A64: STP Dt1, Dt2, [Xn] - [RequiresUnsafe] public static unsafe void StorePair(uint* address, Vector64 value1, Vector64 value2) { throw new PlatformNotSupportedException(); } /// A64: STP Dt1, Dt2, [Xn] - [RequiresUnsafe] public static unsafe void StorePair(ulong* address, Vector64 value1, Vector64 value2) { throw new PlatformNotSupportedException(); } /// A64: STP Qt1, Qt2, [Xn] - [RequiresUnsafe] public static unsafe void StorePair(byte* address, Vector128 value1, Vector128 value2) { throw new PlatformNotSupportedException(); } /// A64: STP Qt1, Qt2, [Xn] - [RequiresUnsafe] public static unsafe void StorePair(double* address, Vector128 value1, Vector128 value2) { throw new PlatformNotSupportedException(); } /// A64: STP Qt1, Qt2, [Xn] - [RequiresUnsafe] public static unsafe void StorePair(short* address, Vector128 value1, Vector128 value2) { throw new PlatformNotSupportedException(); } /// A64: STP Qt1, Qt2, [Xn] - [RequiresUnsafe] public static unsafe void StorePair(int* address, Vector128 value1, Vector128 value2) { throw new PlatformNotSupportedException(); } /// A64: STP Qt1, Qt2, [Xn] - [RequiresUnsafe] public static unsafe void StorePair(long* address, Vector128 value1, Vector128 value2) { throw new PlatformNotSupportedException(); } /// A64: STP Qt1, Qt2, [Xn] - [RequiresUnsafe] public static unsafe void StorePair(sbyte* address, Vector128 value1, Vector128 value2) { throw new PlatformNotSupportedException(); } /// A64: STP Qt1, Qt2, [Xn] - [RequiresUnsafe] public static unsafe void StorePair(float* address, Vector128 value1, Vector128 value2) { throw new PlatformNotSupportedException(); } /// A64: STP Qt1, Qt2, [Xn] - [RequiresUnsafe] public static unsafe void StorePair(ushort* address, Vector128 value1, Vector128 value2) { throw new PlatformNotSupportedException(); } /// A64: STP Qt1, Qt2, [Xn] - [RequiresUnsafe] public static unsafe void StorePair(uint* address, Vector128 value1, Vector128 value2) { throw new PlatformNotSupportedException(); } /// A64: STP Qt1, Qt2, [Xn] - [RequiresUnsafe] public static unsafe void StorePair(ulong* address, Vector128 value1, Vector128 value2) { throw new PlatformNotSupportedException(); } /// A64: STNP Dt1, Dt2, [Xn] - [RequiresUnsafe] public static unsafe void StorePairNonTemporal(byte* address, Vector64 value1, Vector64 value2) { throw new PlatformNotSupportedException(); } /// A64: STNP Dt1, Dt2, [Xn] - [RequiresUnsafe] public static unsafe void StorePairNonTemporal(double* address, Vector64 value1, Vector64 value2) { throw new PlatformNotSupportedException(); } /// A64: STNP Dt1, Dt2, [Xn] - [RequiresUnsafe] public static unsafe void StorePairNonTemporal(short* address, Vector64 value1, Vector64 value2) { throw new PlatformNotSupportedException(); } /// A64: STNP Dt1, Dt2, [Xn] - [RequiresUnsafe] public static unsafe void StorePairNonTemporal(int* address, Vector64 value1, Vector64 value2) { throw new PlatformNotSupportedException(); } /// A64: STNP Dt1, Dt2, [Xn] - [RequiresUnsafe] public static unsafe void StorePairNonTemporal(long* address, Vector64 value1, Vector64 value2) { throw new PlatformNotSupportedException(); } /// A64: STNP Dt1, Dt2, [Xn] - [RequiresUnsafe] public static unsafe void StorePairNonTemporal(sbyte* address, Vector64 value1, Vector64 value2) { throw new PlatformNotSupportedException(); } /// A64: STNP Dt1, Dt2, [Xn] - [RequiresUnsafe] public static unsafe void StorePairNonTemporal(float* address, Vector64 value1, Vector64 value2) { throw new PlatformNotSupportedException(); } /// A64: STNP Dt1, Dt2, [Xn] - [RequiresUnsafe] public static unsafe void StorePairNonTemporal(ushort* address, Vector64 value1, Vector64 value2) { throw new PlatformNotSupportedException(); } /// A64: STNP Dt1, Dt2, [Xn] - [RequiresUnsafe] public static unsafe void StorePairNonTemporal(uint* address, Vector64 value1, Vector64 value2) { throw new PlatformNotSupportedException(); } /// A64: STNP Dt1, Dt2, [Xn] - [RequiresUnsafe] public static unsafe void StorePairNonTemporal(ulong* address, Vector64 value1, Vector64 value2) { throw new PlatformNotSupportedException(); } /// A64: STNP Qt1, Qt2, [Xn] - [RequiresUnsafe] public static unsafe void StorePairNonTemporal(byte* address, Vector128 value1, Vector128 value2) { throw new PlatformNotSupportedException(); } /// A64: STNP Qt1, Qt2, [Xn] - [RequiresUnsafe] public static unsafe void StorePairNonTemporal(double* address, Vector128 value1, Vector128 value2) { throw new PlatformNotSupportedException(); } /// A64: STNP Qt1, Qt2, [Xn] - [RequiresUnsafe] public static unsafe void StorePairNonTemporal(short* address, Vector128 value1, Vector128 value2) { throw new PlatformNotSupportedException(); } /// A64: STNP Qt1, Qt2, [Xn] - [RequiresUnsafe] public static unsafe void StorePairNonTemporal(int* address, Vector128 value1, Vector128 value2) { throw new PlatformNotSupportedException(); } /// A64: STNP Qt1, Qt2, [Xn] - [RequiresUnsafe] public static unsafe void StorePairNonTemporal(long* address, Vector128 value1, Vector128 value2) { throw new PlatformNotSupportedException(); } /// A64: STNP Qt1, Qt2, [Xn] - [RequiresUnsafe] public static unsafe void StorePairNonTemporal(sbyte* address, Vector128 value1, Vector128 value2) { throw new PlatformNotSupportedException(); } /// A64: STNP Qt1, Qt2, [Xn] - [RequiresUnsafe] public static unsafe void StorePairNonTemporal(float* address, Vector128 value1, Vector128 value2) { throw new PlatformNotSupportedException(); } /// A64: STNP Qt1, Qt2, [Xn] - [RequiresUnsafe] public static unsafe void StorePairNonTemporal(ushort* address, Vector128 value1, Vector128 value2) { throw new PlatformNotSupportedException(); } /// A64: STNP Qt1, Qt2, [Xn] - [RequiresUnsafe] public static unsafe void StorePairNonTemporal(uint* address, Vector128 value1, Vector128 value2) { throw new PlatformNotSupportedException(); } /// A64: STNP Qt1, Qt2, [Xn] - [RequiresUnsafe] public static unsafe void StorePairNonTemporal(ulong* address, Vector128 value1, Vector128 value2) { throw new PlatformNotSupportedException(); } /// A64: STP St1, St2, [Xn] - [RequiresUnsafe] public static unsafe void StorePairScalar(int* address, Vector64 value1, Vector64 value2) { throw new PlatformNotSupportedException(); } /// A64: STP St1, St2, [Xn] - [RequiresUnsafe] public static unsafe void StorePairScalar(float* address, Vector64 value1, Vector64 value2) { throw new PlatformNotSupportedException(); } /// A64: STP St1, St2, [Xn] - [RequiresUnsafe] public static unsafe void StorePairScalar(uint* address, Vector64 value1, Vector64 value2) { throw new PlatformNotSupportedException(); } /// A64: STNP St1, St2, [Xn] - [RequiresUnsafe] public static unsafe void StorePairScalarNonTemporal(int* address, Vector64 value1, Vector64 value2) { throw new PlatformNotSupportedException(); } /// A64: STNP St1, St2, [Xn] - [RequiresUnsafe] public static unsafe void StorePairScalarNonTemporal(float* address, Vector64 value1, Vector64 value2) { throw new PlatformNotSupportedException(); } /// A64: STNP St1, St2, [Xn] - [RequiresUnsafe] public static unsafe void StorePairScalarNonTemporal(uint* address, Vector64 value1, Vector64 value2) { throw new PlatformNotSupportedException(); } /// /// void vst2_lane_s8 (int8_t * ptr, int8x16x2_t val, const int lane) /// A64: ST2 { Vt.16B, Vt+1.16B }[index], [Xn] /// - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(byte* address, (Vector128 value1, Vector128 value2) value, [ConstantExpected(Max = (byte)(15))] byte index) { throw new PlatformNotSupportedException(); } /// /// void vst2_lane_s8 (int8_t * ptr, int8x16x2_t val, const int lane) /// A64: ST2 { Vt.16B, Vt+1.16B }[index], [Xn] /// - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(sbyte* address, (Vector128 value1, Vector128 value2) value, [ConstantExpected(Max = (byte)(15))] byte index) { throw new PlatformNotSupportedException(); } /// /// void vst2_lane_s16 (int16_t * ptr, int16x8x2_t val, const int lane) /// A64: ST2 { Vt.8H, Vt+1.8H }[index], [Xn] /// - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(short* address, (Vector128 value1, Vector128 value2) value, [ConstantExpected(Max = (byte)(7))] byte index) { throw new PlatformNotSupportedException(); } /// /// void vst2_lane_s16 (int16_t * ptr, int16x8x2_t val, const int lane) /// A64: ST2 { Vt.8H, Vt+1.8H }[index], [Xn] /// - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(ushort* address, (Vector128 value1, Vector128 value2) value, [ConstantExpected(Max = (byte)(7))] byte index) { throw new PlatformNotSupportedException(); } /// /// void vst2_lane_s32 (int32_t * ptr, int32x4x2_t val, const int lane) /// A64: ST2 { Vt.4S, Vt+1.4S }[index], [Xn] /// - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(int* address, (Vector128 value1, Vector128 value2) value, [ConstantExpected(Max = (byte)(3))] byte index) { throw new PlatformNotSupportedException(); } /// /// void vst2_lane_s32 (int32_t * ptr, int32x4x2_t val, const int lane) /// A64: ST2 { Vt.4S, Vt+1.4S }[index], [Xn] /// - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(uint* address, (Vector128 value1, Vector128 value2) value, [ConstantExpected(Max = (byte)(3))] byte index) { throw new PlatformNotSupportedException(); } /// A64: ST2 { Vt.2D, Vt+1.2D }[index], [Xn] - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(long* address, (Vector128 value1, Vector128 value2) value, [ConstantExpected(Max = (byte)(1))] byte index) { throw new PlatformNotSupportedException(); } /// A64: ST2 { Vt.2D, Vt+1.2D }[index], [Xn] - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(ulong* address, (Vector128 value1, Vector128 value2) value, [ConstantExpected(Max = (byte)(1))] byte index) { throw new PlatformNotSupportedException(); } /// /// void vst2_lane_f32 (float32_t * ptr, float32x2x2_t val, const int lane) /// A64: ST2 { Vt.4S, Vt+1.4S }[index], [Xn] /// - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(float* address, (Vector128 value1, Vector128 value2) value, [ConstantExpected(Max = (byte)(3))] byte index) { throw new PlatformNotSupportedException(); } /// A64: ST2 { Vt.2D, Vt+1.2D }[index], [Xn] - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(double* address, (Vector128 value1, Vector128 value2) value, [ConstantExpected(Max = (byte)(1))] byte index) { throw new PlatformNotSupportedException(); } /// /// void vst3_lane_s8 (int8_t * ptr, int8x16x3_t val, const int lane) /// A64: ST3 { Vt.16B, Vt+1.16B, Vt+2.16B }[index], [Xn] /// - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(byte* address, (Vector128 value1, Vector128 value2, Vector128 value3) value, [ConstantExpected(Max = (byte)(15))] byte index) { throw new PlatformNotSupportedException(); } /// /// void vst3_lane_s8 (int8_t * ptr, int8x16x3_t val, const int lane) /// A64: ST3 { Vt.16B, Vt+1.16B, Vt+2.16B }[index], [Xn] /// - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(sbyte* address, (Vector128 value1, Vector128 value2, Vector128 value3) value, [ConstantExpected(Max = (byte)(15))] byte index) { throw new PlatformNotSupportedException(); } /// /// void vst3_lane_s16 (int16_t * ptr, int16x8x3_t val, const int lane) /// A64: ST3 { Vt.8H, Vt+1.8H, Vt+2.8H }[index], [Xn] /// - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(short* address, (Vector128 value1, Vector128 value2, Vector128 value3) value, [ConstantExpected(Max = (byte)(7))] byte index) { throw new PlatformNotSupportedException(); } /// /// void vst3_lane_s16 (int16_t * ptr, int16x8x3_t val, const int lane) /// A64: ST3 { Vt.8H, Vt+1.8H, Vt+2.8H }[index], [Xn] /// - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(ushort* address, (Vector128 value1, Vector128 value2, Vector128 value3) value, [ConstantExpected(Max = (byte)(7))] byte index) { throw new PlatformNotSupportedException(); } /// /// void vst3_lane_s32 (int32_t * ptr, int32x4x3_t val, const int lane) /// A64: ST3 { Vt.4S, Vt+1.4S, Vt+2.4S }[index], [Xn] /// - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(int* address, (Vector128 value1, Vector128 value2, Vector128 value3) value, [ConstantExpected(Max = (byte)(3))] byte index) { throw new PlatformNotSupportedException(); } /// /// void vst3_lane_s32 (int32_t * ptr, int32x4x3_t val, const int lane) /// A64: ST3 { Vt.4S, Vt+1.4S, Vt+2.4S }[index], [Xn] /// - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(uint* address, (Vector128 value1, Vector128 value2, Vector128 value3) value, [ConstantExpected(Max = (byte)(3))] byte index) { throw new PlatformNotSupportedException(); } /// A64: ST3 { Vt.2D, Vt+1.2D, Vt+2.2D }[index], [Xn] - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(long* address, (Vector128 value1, Vector128 value2, Vector128 value3) value, [ConstantExpected(Max = (byte)(1))] byte index) { throw new PlatformNotSupportedException(); } /// A64: ST3 { Vt.2D, Vt+1.2D, Vt+2.2D }[index], [Xn] - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(ulong* address, (Vector128 value1, Vector128 value2, Vector128 value3) value, [ConstantExpected(Max = (byte)(1))] byte index) { throw new PlatformNotSupportedException(); } /// /// void vst3_lane_f32 (float32_t * ptr, float32x2x3_t val, const int lane) /// A64: ST3 { Vt.4S, Vt+1.4S, Vt+2.4S }[index], [Xn] /// - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(float* address, (Vector128 value1, Vector128 value2, Vector128 value3) value, [ConstantExpected(Max = (byte)(3))] byte index) { throw new PlatformNotSupportedException(); } /// A64: ST3 { Vt.2D, Vt+1.2D, Vt+2.2D }[index], [Xn] - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(double* address, (Vector128 value1, Vector128 value2, Vector128 value3) value, [ConstantExpected(Max = (byte)(1))] byte index) { throw new PlatformNotSupportedException(); } /// /// void vst4_lane_s8 (int8_t * ptr, int8x16x4_t val, const int lane) /// A64: ST4 { Vt.16B, Vt+1.16B, Vt+2.16B, Vt+3.16B }[index], [Xn] /// - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(byte* address, (Vector128 value1, Vector128 value2, Vector128 value3, Vector128 value4) value, [ConstantExpected(Max = (byte)(15))] byte index) { throw new PlatformNotSupportedException(); } /// /// void vst4_lane_s8 (int8_t * ptr, int8x16x4_t val, const int lane) /// A64: ST4 { Vt.16B, Vt+1.16B, Vt+2.16B, Vt+3.16B }[index], [Xn] /// - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(sbyte* address, (Vector128 value1, Vector128 value2, Vector128 value3, Vector128 value4) value, [ConstantExpected(Max = (byte)(15))] byte index) { throw new PlatformNotSupportedException(); } /// /// void vst4_lane_s16 (int16_t * ptr, int16x8x4_t val, const int lane) /// A64: ST4 { Vt.8H, Vt+1.8H, Vt+2.8H, Vt+3.8H }[index], [Xn] /// - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(short* address, (Vector128 value1, Vector128 value2, Vector128 value3, Vector128 value4) value, [ConstantExpected(Max = (byte)(7))] byte index) { throw new PlatformNotSupportedException(); } /// /// void vst4_lane_s16 (int16_t * ptr, int16x8x4_t val, const int lane) /// A64: ST4 { Vt.8H, Vt+1.8H, Vt+2.8H, Vt+3.8H }[index], [Xn] /// - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(ushort* address, (Vector128 value1, Vector128 value2, Vector128 value3, Vector128 value4) value, [ConstantExpected(Max = (byte)(7))] byte index) { throw new PlatformNotSupportedException(); } /// /// void vst4_lane_s32 (int32_t * ptr, int32x4x4_t val, const int lane) /// A64: ST4 { Vt.4S, Vt+1.4S, Vt+2.4S, Vt+3.4S }[index], [Xn] /// - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(int* address, (Vector128 value1, Vector128 value2, Vector128 value3, Vector128 value4) value, [ConstantExpected(Max = (byte)(3))] byte index) { throw new PlatformNotSupportedException(); } /// /// void vst4_lane_s32 (int32_t * ptr, int32x4x4_t val, const int lane) /// A64: ST4 { Vt.4S, Vt+1.4S, Vt+2.4S, Vt+3.4S }[index], [Xn] /// - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(uint* address, (Vector128 value1, Vector128 value2, Vector128 value3, Vector128 value4) value, [ConstantExpected(Max = (byte)(3))] byte index) { throw new PlatformNotSupportedException(); } /// A64: ST4 { Vt.2D, Vt+1.2D, Vt+2.2D, Vt+3.2D }[index], [Xn] - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(long* address, (Vector128 value1, Vector128 value2, Vector128 value3, Vector128 value4) value, [ConstantExpected(Max = (byte)(1))] byte index) { throw new PlatformNotSupportedException(); } /// A64: ST4 { Vt.2D, Vt+1.2D, Vt+2.2D, Vt+3.2D }[index], [Xn] - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(ulong* address, (Vector128 value1, Vector128 value2, Vector128 value3, Vector128 value4) value, [ConstantExpected(Max = (byte)(1))] byte index) { throw new PlatformNotSupportedException(); } /// /// void vst4_lane_f32 (float32_t * ptr, float32x2x4_t val, const int lane) /// A64: ST4 { Vt.4S, Vt+1.4S, Vt+2.4S, Vt+3.4S }[index], [Xn] /// - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(float* address, (Vector128 value1, Vector128 value2, Vector128 value3, Vector128 value4) value, [ConstantExpected(Max = (byte)(3))] byte index) { throw new PlatformNotSupportedException(); } /// A64: ST4 { Vt.2D, Vt+1.2D, Vt+2.2D, Vt+3.2D }[index], [Xn] - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(double* address, (Vector128 value1, Vector128 value2, Vector128 value3, Vector128 value4) value, [ConstantExpected(Max = (byte)(1))] byte index) { throw new PlatformNotSupportedException(); } /// A64: ST2 { Vn.16B, Vn+1.16B }, [Xn] - [RequiresUnsafe] public static unsafe void StoreVectorAndZip(byte* address, (Vector128 Value1, Vector128 Value2) value) { throw new PlatformNotSupportedException(); } /// A64: ST2 { Vn.16B, Vn+1.16B }, [Xn] - [RequiresUnsafe] public static unsafe void StoreVectorAndZip(sbyte* address, (Vector128 Value1, Vector128 Value2) value) { throw new PlatformNotSupportedException(); } /// A64: ST2 { Vn.8H, Vn+1.8H }, [Xn] - [RequiresUnsafe] public static unsafe void StoreVectorAndZip(short* address, (Vector128 Value1, Vector128 Value2) value) { throw new PlatformNotSupportedException(); } /// A64: ST2 { Vn.8H, Vn+1.8H }, [Xn] - [RequiresUnsafe] public static unsafe void StoreVectorAndZip(ushort* address, (Vector128 Value1, Vector128 Value2) value) { throw new PlatformNotSupportedException(); } /// A64: ST2 { Vn.4S, Vn+1.4S }, [Xn] - [RequiresUnsafe] public static unsafe void StoreVectorAndZip(int* address, (Vector128 Value1, Vector128 Value2) value) { throw new PlatformNotSupportedException(); } /// A64: ST2 { Vn.4S, Vn+1.4S }, [Xn] - [RequiresUnsafe] public static unsafe void StoreVectorAndZip(uint* address, (Vector128 Value1, Vector128 Value2) value) { throw new PlatformNotSupportedException(); } /// A64: ST2 { Vn.2D, Vn+1.2D }, [Xn] - [RequiresUnsafe] public static unsafe void StoreVectorAndZip(long* address, (Vector128 Value1, Vector128 Value2) value) { throw new PlatformNotSupportedException(); } /// A64: ST2 { Vn.2D, Vn+1.2D }, [Xn] - [RequiresUnsafe] public static unsafe void StoreVectorAndZip(ulong* address, (Vector128 Value1, Vector128 Value2) value) { throw new PlatformNotSupportedException(); } /// A64: ST2 { Vn.4S, Vn+1.4S }, [Xn] - [RequiresUnsafe] public static unsafe void StoreVectorAndZip(float* address, (Vector128 Value1, Vector128 Value2) value) { throw new PlatformNotSupportedException(); } /// A64: ST2 { Vn.2D, Vn+1.2D }, [Xn] - [RequiresUnsafe] public static unsafe void StoreVectorAndZip(double* address, (Vector128 Value1, Vector128 Value2) value) { throw new PlatformNotSupportedException(); } /// A64: ST3 { Vn.16B, Vn+1.16B, Vn+2.16B }, [Xn] - [RequiresUnsafe] public static unsafe void StoreVectorAndZip(byte* address, (Vector128 Value1, Vector128 Value2, Vector128 Value3) value) { throw new PlatformNotSupportedException(); } /// A64: ST3 { Vn.16B, Vn+1.16B, Vn+2.16B }, [Xn] - [RequiresUnsafe] public static unsafe void StoreVectorAndZip(sbyte* address, (Vector128 Value1, Vector128 Value2, Vector128 Value3) value) { throw new PlatformNotSupportedException(); } /// A64: ST3 { Vn.8H, Vn+1.8H, Vn+2.8H }, [Xn] - [RequiresUnsafe] public static unsafe void StoreVectorAndZip(short* address, (Vector128 Value1, Vector128 Value2, Vector128 Value3) value) { throw new PlatformNotSupportedException(); } /// A64: ST3 { Vn.8H, Vn+1.8H, Vn+2.8H }, [Xn] - [RequiresUnsafe] public static unsafe void StoreVectorAndZip(ushort* address, (Vector128 Value1, Vector128 Value2, Vector128 Value3) value) { throw new PlatformNotSupportedException(); } /// A64: ST3 { Vn.4S, Vn+1.4S, Vn+2.4S }, [Xn] - [RequiresUnsafe] public static unsafe void StoreVectorAndZip(int* address, (Vector128 Value1, Vector128 Value2, Vector128 Value3) value) { throw new PlatformNotSupportedException(); } /// A64: ST3 { Vn.4S, Vn+1.4S, Vn+2.4S }, [Xn] - [RequiresUnsafe] public static unsafe void StoreVectorAndZip(uint* address, (Vector128 Value1, Vector128 Value2, Vector128 Value3) value) { throw new PlatformNotSupportedException(); } /// A64: ST3 { Vn.2D, Vn+1.2D, Vn+2.2D }, [Xn] - [RequiresUnsafe] public static unsafe void StoreVectorAndZip(long* address, (Vector128 Value1, Vector128 Value2, Vector128 Value3) value) { throw new PlatformNotSupportedException(); } /// A64: ST3 { Vn.2D, Vn+1.2D, Vn+2.2D }, [Xn] - [RequiresUnsafe] public static unsafe void StoreVectorAndZip(ulong* address, (Vector128 Value1, Vector128 Value2, Vector128 Value3) value) { throw new PlatformNotSupportedException(); } /// A64: ST3 { Vn.4S, Vn+1.4S, Vn+2.4S }, [Xn] - [RequiresUnsafe] public static unsafe void StoreVectorAndZip(float* address, (Vector128 Value1, Vector128 Value2, Vector128 Value3) value) { throw new PlatformNotSupportedException(); } /// A64: ST3 { Vn.2D, Vn+1.2D, Vn+2.2D }, [Xn] - [RequiresUnsafe] public static unsafe void StoreVectorAndZip(double* address, (Vector128 Value1, Vector128 Value2, Vector128 Value3) value) { throw new PlatformNotSupportedException(); } /// A64: ST4 { Vn.16B, Vn+1.16B, Vn+2.16B, Vn+3.16B }, [Xn] - [RequiresUnsafe] public static unsafe void StoreVectorAndZip(byte* address, (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) value) { throw new PlatformNotSupportedException(); } /// A64: ST4 { Vn.16B, Vn+1.16B, Vn+2.16B, Vn+3.16B }, [Xn] - [RequiresUnsafe] public static unsafe void StoreVectorAndZip(sbyte* address, (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) value) { throw new PlatformNotSupportedException(); } /// A64: ST4 { Vn.8H, Vn+1.8H, Vn+2.8H, Vn+3.8H }, [Xn] - [RequiresUnsafe] public static unsafe void StoreVectorAndZip(short* address, (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) value) { throw new PlatformNotSupportedException(); } /// A64: ST4 { Vn.8H, Vn+1.8H, Vn+2.8H, Vn+3.8H }, [Xn] - [RequiresUnsafe] public static unsafe void StoreVectorAndZip(ushort* address, (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) value) { throw new PlatformNotSupportedException(); } /// A64: ST4 { Vn.4S, Vn+1.4S, Vn+2.4S, Vn+3.4S }, [Xn] - [RequiresUnsafe] public static unsafe void StoreVectorAndZip(int* address, (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) value) { throw new PlatformNotSupportedException(); } /// A64: ST4 { Vn.4S, Vn+1.4S, Vn+2.4S, Vn+3.4S }, [Xn] - [RequiresUnsafe] public static unsafe void StoreVectorAndZip(uint* address, (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) value) { throw new PlatformNotSupportedException(); } /// A64: ST4 { Vn.2D, Vn+1.2D, Vn+2.2D, Vn+3.2D }, [Xn] - [RequiresUnsafe] public static unsafe void StoreVectorAndZip(long* address, (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) value) { throw new PlatformNotSupportedException(); } /// A64: ST4 { Vn.2D, Vn+1.2D, Vn+2.2D, Vn+3.2D }, [Xn] - [RequiresUnsafe] public static unsafe void StoreVectorAndZip(ulong* address, (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) value) { throw new PlatformNotSupportedException(); } /// A64: ST4 { Vn.4S, Vn+1.4S, Vn+2.4S, Vn+3.4S }, [Xn] - [RequiresUnsafe] public static unsafe void StoreVectorAndZip(float* address, (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) value) { throw new PlatformNotSupportedException(); } /// A64: ST4 { Vn.2D, Vn+1.2D, Vn+2.2D, Vn+3.2D }, [Xn] - [RequiresUnsafe] public static unsafe void StoreVectorAndZip(double* address, (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) value) { throw new PlatformNotSupportedException(); } /// A64: ST1 { Vn.16B, Vn+1.16B }, [Xn] - [RequiresUnsafe] public static unsafe void Store(byte* address, (Vector128 Value1, Vector128 Value2) value) { throw new PlatformNotSupportedException(); } /// A64: ST1 { Vn.16B, Vn+1.16B }, [Xn] - [RequiresUnsafe] public static unsafe void Store(sbyte* address, (Vector128 Value1, Vector128 Value2) value) { throw new PlatformNotSupportedException(); } /// A64: ST1 { Vn.8H, Vn+1.8H }, [Xn] - [RequiresUnsafe] public static unsafe void Store(short* address, (Vector128 Value1, Vector128 Value2) value) { throw new PlatformNotSupportedException(); } /// A64: ST1 { Vn.8H, Vn+1.8H }, [Xn] - [RequiresUnsafe] public static unsafe void Store(ushort* address, (Vector128 Value1, Vector128 Value2) value) { throw new PlatformNotSupportedException(); } /// A64: ST1 { Vn.4S, Vn+1.4S }, [Xn] - [RequiresUnsafe] public static unsafe void Store(int* address, (Vector128 Value1, Vector128 Value2) value) { throw new PlatformNotSupportedException(); } /// A64: ST1 { Vn.4S, Vn+1.4S }, [Xn] - [RequiresUnsafe] public static unsafe void Store(uint* address, (Vector128 Value1, Vector128 Value2) value) { throw new PlatformNotSupportedException(); } /// A64: ST1 { Vn.2D, Vn+1.2D }, [Xn] - [RequiresUnsafe] public static unsafe void Store(long* address, (Vector128 Value1, Vector128 Value2) value) { throw new PlatformNotSupportedException(); } /// A64: ST1 { Vn.2D, Vn+1.2D }, [Xn] - [RequiresUnsafe] public static unsafe void Store(ulong* address, (Vector128 Value1, Vector128 Value2) value) { throw new PlatformNotSupportedException(); } /// A64: ST1 { Vn.4S, Vn+1.4S }, [Xn] - [RequiresUnsafe] public static unsafe void Store(float* address, (Vector128 Value1, Vector128 Value2) value) { throw new PlatformNotSupportedException(); } /// A64: ST1 { Vn.2D, Vn+1.2D }, [Xn] - [RequiresUnsafe] public static unsafe void Store(double* address, (Vector128 Value1, Vector128 Value2) value) { throw new PlatformNotSupportedException(); } /// A64: ST1 { Vn.16B, Vn+1.16B, Vn+2.16B }, [Xn] - [RequiresUnsafe] public static unsafe void Store(byte* address, (Vector128 Value1, Vector128 Value2, Vector128 Value3) value) { throw new PlatformNotSupportedException(); } /// A64: ST1 { Vn.16B, Vn+1.16B, Vn+2.16B }, [Xn] - [RequiresUnsafe] public static unsafe void Store(sbyte* address, (Vector128 Value1, Vector128 Value2, Vector128 Value3) value) { throw new PlatformNotSupportedException(); } /// A64: ST1 { Vn.8H, Vn+1.8H, Vn+2.8H }, [Xn] - [RequiresUnsafe] public static unsafe void Store(short* address, (Vector128 Value1, Vector128 Value2, Vector128 Value3) value) { throw new PlatformNotSupportedException(); } /// A64: ST1 { Vn.8H, Vn+1.8H, Vn+2.8H }, [Xn] - [RequiresUnsafe] public static unsafe void Store(ushort* address, (Vector128 Value1, Vector128 Value2, Vector128 Value3) value) { throw new PlatformNotSupportedException(); } /// A64: ST1 { Vn.4S, Vn+1.4S, Vn+2.4S }, [Xn] - [RequiresUnsafe] public static unsafe void Store(int* address, (Vector128 Value1, Vector128 Value2, Vector128 Value3) value) { throw new PlatformNotSupportedException(); } /// A64: ST1 { Vn.4S, Vn+1.4S, Vn+2.4S }, [Xn] - [RequiresUnsafe] public static unsafe void Store(uint* address, (Vector128 Value1, Vector128 Value2, Vector128 Value3) value) { throw new PlatformNotSupportedException(); } /// A64: ST1 { Vn.2D, Vn+1.2D, Vn+2.2D }, [Xn] - [RequiresUnsafe] public static unsafe void Store(long* address, (Vector128 Value1, Vector128 Value2, Vector128 Value3) value) { throw new PlatformNotSupportedException(); } /// A64: ST1 { Vn.2D, Vn+1.2D, Vn+2.2D }, [Xn] - [RequiresUnsafe] public static unsafe void Store(ulong* address, (Vector128 Value1, Vector128 Value2, Vector128 Value3) value) { throw new PlatformNotSupportedException(); } /// A64: ST1 { Vn.4S, Vn+1.4S, Vn+2.4S }, [Xn] - [RequiresUnsafe] public static unsafe void Store(float* address, (Vector128 Value1, Vector128 Value2, Vector128 Value3) value) { throw new PlatformNotSupportedException(); } /// A64: ST1 { Vn.2D, Vn+1.2D, Vn+2.2D }, [Xn] - [RequiresUnsafe] public static unsafe void Store(double* address, (Vector128 Value1, Vector128 Value2, Vector128 Value3) value) { throw new PlatformNotSupportedException(); } /// A64: ST1 { Vn.16B, Vn+1.16B, Vn+2.16B, Vn+3.16B }, [Xn] - [RequiresUnsafe] public static unsafe void Store(byte* address, (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) value) { throw new PlatformNotSupportedException(); } /// A64: ST1 { Vn.16B, Vn+1.16B, Vn+2.16B, Vn+3.16B }, [Xn] - [RequiresUnsafe] public static unsafe void Store(sbyte* address, (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) value) { throw new PlatformNotSupportedException(); } /// A64: ST1 { Vn.8H, Vn+1.8H, Vn+2.8H, Vn+3.8H }, [Xn] - [RequiresUnsafe] public static unsafe void Store(short* address, (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) value) { throw new PlatformNotSupportedException(); } /// A64: ST1 { Vn.8H, Vn+1.8H, Vn+2.8H, Vn+3.8H }, [Xn] - [RequiresUnsafe] public static unsafe void Store(ushort* address, (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) value) { throw new PlatformNotSupportedException(); } /// A64: ST1 { Vn.4S, Vn+1.4S, Vn+2.4S, Vn+3.4S }, [Xn] - [RequiresUnsafe] public static unsafe void Store(int* address, (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) value) { throw new PlatformNotSupportedException(); } /// A64: ST1 { Vn.4S, Vn+1.4S, Vn+2.4S, Vn+3.4S }, [Xn] - [RequiresUnsafe] public static unsafe void Store(uint* address, (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) value) { throw new PlatformNotSupportedException(); } /// A64: ST1 { Vn.2D, Vn+1.2D, Vn+2.2D, Vn+3.2D }, [Xn] - [RequiresUnsafe] public static unsafe void Store(long* address, (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) value) { throw new PlatformNotSupportedException(); } /// A64: ST1 { Vn.2D, Vn+1.2D, Vn+2.2D, Vn+3.2D }, [Xn] - [RequiresUnsafe] public static unsafe void Store(ulong* address, (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) value) { throw new PlatformNotSupportedException(); } /// A64: ST1 { Vn.4S, Vn+1.4S, Vn+2.4S, Vn+3.4S }, [Xn] - [RequiresUnsafe] public static unsafe void Store(float* address, (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) value) { throw new PlatformNotSupportedException(); } /// A64: ST1 { Vn.2D, Vn+1.2D, Vn+2.2D, Vn+3.2D }, [Xn] - [RequiresUnsafe] public static unsafe void Store(double* address, (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) value) { throw new PlatformNotSupportedException(); } /// @@ -8790,7 +8485,6 @@ internal Arm64() { } /// A32: VLD1.8 { Dd[index] }, [Rn] /// A64: LD1 { Vt.B }[index], [Xn] /// - [RequiresUnsafe] public static unsafe Vector64 LoadAndInsertScalar(Vector64 value, [ConstantExpected(Max = (byte)(7))] byte index, byte* address) { throw new PlatformNotSupportedException(); } /// @@ -8798,7 +8492,6 @@ internal Arm64() { } /// A32: VLD1.16 { Dd[index] }, [Rn] /// A64: LD1 { Vt.H }[index], [Xn] /// - [RequiresUnsafe] public static unsafe Vector64 LoadAndInsertScalar(Vector64 value, [ConstantExpected(Max = (byte)(3))] byte index, short* address) { throw new PlatformNotSupportedException(); } /// @@ -8806,7 +8499,6 @@ internal Arm64() { } /// A32: VLD1.32 { Dd[index] }, [Rn] /// A64: LD1 { Vt.S }[index], [Xn] /// - [RequiresUnsafe] public static unsafe Vector64 LoadAndInsertScalar(Vector64 value, [ConstantExpected(Max = (byte)(1))] byte index, int* address) { throw new PlatformNotSupportedException(); } /// @@ -8814,7 +8506,6 @@ internal Arm64() { } /// A32: VLD1.8 { Dd[index] }, [Rn] /// A64: LD1 { Vt.B }[index], [Xn] /// - [RequiresUnsafe] public static unsafe Vector64 LoadAndInsertScalar(Vector64 value, [ConstantExpected(Max = (byte)(7))] byte index, sbyte* address) { throw new PlatformNotSupportedException(); } /// @@ -8822,7 +8513,6 @@ internal Arm64() { } /// A32: VLD1.32 { Dd[index] }, [Rn] /// A64: LD1 { Vt.S }[index], [Xn] /// - [RequiresUnsafe] public static unsafe Vector64 LoadAndInsertScalar(Vector64 value, [ConstantExpected(Max = (byte)(1))] byte index, float* address) { throw new PlatformNotSupportedException(); } /// @@ -8830,7 +8520,6 @@ internal Arm64() { } /// A32: VLD1.16 { Dd[index] }, [Rn] /// A64: LD1 { Vt.H }[index], [Xn] /// - [RequiresUnsafe] public static unsafe Vector64 LoadAndInsertScalar(Vector64 value, [ConstantExpected(Max = (byte)(3))] byte index, ushort* address) { throw new PlatformNotSupportedException(); } /// @@ -8838,7 +8527,6 @@ internal Arm64() { } /// A32: VLD1.32 { Dd[index] }, [Rn] /// A64: LD1 { Vt.S }[index], [Xn] /// - [RequiresUnsafe] public static unsafe Vector64 LoadAndInsertScalar(Vector64 value, [ConstantExpected(Max = (byte)(1))] byte index, uint* address) { throw new PlatformNotSupportedException(); } /// @@ -8846,7 +8534,6 @@ internal Arm64() { } /// A32: VLD1.8 { Dd[index] }, [Rn] /// A64: LD1 { Vt.B }[index], [Xn] /// - [RequiresUnsafe] public static unsafe Vector128 LoadAndInsertScalar(Vector128 value, [ConstantExpected(Max = (byte)(15))] byte index, byte* address) { throw new PlatformNotSupportedException(); } /// @@ -8854,7 +8541,6 @@ internal Arm64() { } /// A32: VLDR.64 Dd, [Rn] /// A64: LD1 { Vt.D }[index], [Xn] /// - [RequiresUnsafe] public static unsafe Vector128 LoadAndInsertScalar(Vector128 value, [ConstantExpected(Max = (byte)(1))] byte index, double* address) { throw new PlatformNotSupportedException(); } /// @@ -8862,7 +8548,6 @@ internal Arm64() { } /// A32: VLD1.16 { Dd[index] }, [Rn] /// A64: LD1 { Vt.H }[index], [Xn] /// - [RequiresUnsafe] public static unsafe Vector128 LoadAndInsertScalar(Vector128 value, [ConstantExpected(Max = (byte)(7))] byte index, short* address) { throw new PlatformNotSupportedException(); } /// @@ -8870,7 +8555,6 @@ internal Arm64() { } /// A32: VLD1.32 { Dd[index] }, [Rn] /// A64: LD1 { Vt.S }[index], [Xn] /// - [RequiresUnsafe] public static unsafe Vector128 LoadAndInsertScalar(Vector128 value, [ConstantExpected(Max = (byte)(3))] byte index, int* address) { throw new PlatformNotSupportedException(); } /// @@ -8878,7 +8562,6 @@ internal Arm64() { } /// A32: VLDR.64 Dd, [Rn] /// A64: LD1 { Vt.D }[index], [Xn] /// - [RequiresUnsafe] public static unsafe Vector128 LoadAndInsertScalar(Vector128 value, [ConstantExpected(Max = (byte)(1))] byte index, long* address) { throw new PlatformNotSupportedException(); } /// @@ -8886,7 +8569,6 @@ internal Arm64() { } /// A32: VLD1.8 { Dd[index] }, [Rn] /// A64: LD1 { Vt.B }[index], [Xn] /// - [RequiresUnsafe] public static unsafe Vector128 LoadAndInsertScalar(Vector128 value, [ConstantExpected(Max = (byte)(15))] byte index, sbyte* address) { throw new PlatformNotSupportedException(); } /// @@ -8894,7 +8576,6 @@ internal Arm64() { } /// A32: VLD1.32 { Dd[index] }, [Rn] /// A64: LD1 { Vt.S }[index], [Xn] /// - [RequiresUnsafe] public static unsafe Vector128 LoadAndInsertScalar(Vector128 value, [ConstantExpected(Max = (byte)(3))] byte index, float* address) { throw new PlatformNotSupportedException(); } /// @@ -8902,7 +8583,6 @@ internal Arm64() { } /// A32: VLD1.16 { Dd[index] }, [Rn] /// A64: LD1 { Vt.H }[index], [Xn] /// - [RequiresUnsafe] public static unsafe Vector128 LoadAndInsertScalar(Vector128 value, [ConstantExpected(Max = (byte)(7))] byte index, ushort* address) { throw new PlatformNotSupportedException(); } /// @@ -8910,7 +8590,6 @@ internal Arm64() { } /// A32: VLD1.32 { Dd[index] }, [Rn] /// A64: LD1 { Vt.S }[index], [Xn] /// - [RequiresUnsafe] public static unsafe Vector128 LoadAndInsertScalar(Vector128 value, [ConstantExpected(Max = (byte)(3))] byte index, uint* address) { throw new PlatformNotSupportedException(); } /// @@ -8918,91 +8597,69 @@ internal Arm64() { } /// A32: VLDR.64 Dd, [Rn] /// A64: LD1 { Vt.D }[index], [Xn] /// - [RequiresUnsafe] public static unsafe Vector128 LoadAndInsertScalar(Vector128 value, [ConstantExpected(Max = (byte)(1))] byte index, ulong* address) { throw new PlatformNotSupportedException(); } /// A64: LD2 { Vn.8B, Vn+1.8B }[Vm], [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) LoadAndInsertScalar((Vector64, Vector64) values, [ConstantExpected(Max = (byte)(7))] byte index, byte* address) { throw new PlatformNotSupportedException(); } /// A64: LD2 { Vn.8B, Vn+1.8B }[Vm], [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) LoadAndInsertScalar((Vector64, Vector64) values, [ConstantExpected(Max = (byte)(7))] byte index, sbyte* address) { throw new PlatformNotSupportedException(); } /// A64: LD2 { Vn.4H, Vn+1.4H }[Vm], [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) LoadAndInsertScalar((Vector64, Vector64) values, [ConstantExpected(Max = (byte)(3))] byte index, short* address) { throw new PlatformNotSupportedException(); } /// A64: LD2 { Vn.4H, Vn+1.4H }[Vm], [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) LoadAndInsertScalar((Vector64, Vector64) values, [ConstantExpected(Max = (byte)(3))] byte index, ushort* address) { throw new PlatformNotSupportedException(); } /// A64: LD2 { Vn.2S, Vn+1.2S }[Vm], [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) LoadAndInsertScalar((Vector64, Vector64) values, [ConstantExpected(Max = (byte)(1))] byte index, int* address) { throw new PlatformNotSupportedException(); } /// A64: LD2 { Vn.2S, Vn+1.2S }[Vm], [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) LoadAndInsertScalar((Vector64, Vector64) values, [ConstantExpected(Max = (byte)(1))] byte index, uint* address) { throw new PlatformNotSupportedException(); } /// A64: LD2 { Vn.2S, Vn+1.2S }[Vm], [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) LoadAndInsertScalar((Vector64, Vector64) values, [ConstantExpected(Max = (byte)(1))] byte index, float* address) { throw new PlatformNotSupportedException(); } /// A64: LD3 { Vn.8B, Vn+1.8B, Vn+2.8B }[Vm], [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3) LoadAndInsertScalar((Vector64, Vector64, Vector64) values, [ConstantExpected(Max = (byte)(7))] byte index, byte* address) { throw new PlatformNotSupportedException(); } /// A64: LD3 { Vn.8B, Vn+1.8B, Vn+2.8B }[Vm], [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3) LoadAndInsertScalar((Vector64, Vector64, Vector64) values, [ConstantExpected(Max = (byte)(7))] byte index, sbyte* address) { throw new PlatformNotSupportedException(); } /// A64: LD3 { Vn.4H, Vn+1.4H, Vn+2.4H }[Vm], [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3) LoadAndInsertScalar((Vector64, Vector64, Vector64) values, [ConstantExpected(Max = (byte)(3))] byte index, short* address) { throw new PlatformNotSupportedException(); } /// A64: LD3 { Vn.4H, Vn+1.4H, Vn+2.4H }[Vm], [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3) LoadAndInsertScalar((Vector64, Vector64, Vector64) values, [ConstantExpected(Max = (byte)(3))] byte index, ushort* address) { throw new PlatformNotSupportedException(); } /// A64: LD3 { Vn.2S, Vn+1.2S, Vn+2.2S }[Vm], [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3) LoadAndInsertScalar((Vector64, Vector64, Vector64) values, [ConstantExpected(Max = (byte)(1))] byte index, int* address) { throw new PlatformNotSupportedException(); } /// A64: LD3 { Vn.2S, Vn+1.2S, Vn+2.2S }[Vm], [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3) LoadAndInsertScalar((Vector64, Vector64, Vector64) values, [ConstantExpected(Max = (byte)(1))] byte index, uint* address) { throw new PlatformNotSupportedException(); } /// A64: LD3 { Vn.2S, Vn+1.2S, Vn+2.2S }[Vm], [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3) LoadAndInsertScalar((Vector64, Vector64, Vector64) values, [ConstantExpected(Max = (byte)(1))] byte index, float* address) { throw new PlatformNotSupportedException(); } /// A64: LD4 { Vn.8B, Vn+1.8B, Vn+2.8B, Vn+3.8B }[Vm], [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) LoadAndInsertScalar((Vector64, Vector64, Vector64, Vector64) values, [ConstantExpected(Max = (byte)(7))] byte index, byte* address) { throw new PlatformNotSupportedException(); } /// A64: LD4 { Vn.8B, Vn+1.8B, Vn+2.8B, Vn+3.8B }[Vm], [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) LoadAndInsertScalar((Vector64, Vector64, Vector64, Vector64) values, [ConstantExpected(Max = (byte)(7))] byte index, sbyte* address) { throw new PlatformNotSupportedException(); } /// A64: LD4 { Vn.4H, Vn+1.4H, Vn+2.4H, Vn+3.4H }[Vm], [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) LoadAndInsertScalar((Vector64, Vector64, Vector64, Vector64) values, [ConstantExpected(Max = (byte)(3))] byte index, short* address) { throw new PlatformNotSupportedException(); } /// A64: LD4 { Vn.4H, Vn+1.4H, Vn+2.4H, Vn+3.4H }[Vm], [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) LoadAndInsertScalar((Vector64, Vector64, Vector64, Vector64) values, [ConstantExpected(Max = (byte)(3))] byte index, ushort* address) { throw new PlatformNotSupportedException(); } /// A64: LD4 { Vn.2S, Vn+1.2S, Vn+2.2S, Vn+3.2S }[Vm], [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) LoadAndInsertScalar((Vector64, Vector64, Vector64, Vector64) values, [ConstantExpected(Max = (byte)(1))] byte index, int* address) { throw new PlatformNotSupportedException(); } /// A64: LD4 { Vn.2S, Vn+1.2S, Vn+2.2S, Vn+3.2S }[Vm], [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) LoadAndInsertScalar((Vector64, Vector64, Vector64, Vector64) values, [ConstantExpected(Max = (byte)(1))] byte index, uint* address) { throw new PlatformNotSupportedException(); } /// A64: LD4 { Vn.2S, Vn+1.2S, Vn+2.2S, Vn+3.2S }[Vm], [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) LoadAndInsertScalar((Vector64, Vector64, Vector64, Vector64) values, [ConstantExpected(Max = (byte)(1))] byte index, float* address) { throw new PlatformNotSupportedException(); } /// @@ -9010,7 +8667,6 @@ internal Arm64() { } /// A32: VLD1.8 { Dd[] }, [Rn] /// A64: LD1R { Vt.8B }, [Xn] /// - [RequiresUnsafe] public static unsafe Vector64 LoadAndReplicateToVector64(byte* address) { throw new PlatformNotSupportedException(); } /// @@ -9018,7 +8674,6 @@ internal Arm64() { } /// A32: VLD1.16 { Dd[] }, [Rn] /// A64: LD1R { Vt.4H }, [Xn] /// - [RequiresUnsafe] public static unsafe Vector64 LoadAndReplicateToVector64(short* address) { throw new PlatformNotSupportedException(); } /// @@ -9026,7 +8681,6 @@ internal Arm64() { } /// A32: VLD1.32 { Dd[] }, [Rn] /// A64: LD1R { Vt.2S }, [Xn] /// - [RequiresUnsafe] public static unsafe Vector64 LoadAndReplicateToVector64(int* address) { throw new PlatformNotSupportedException(); } /// @@ -9034,7 +8688,6 @@ internal Arm64() { } /// A32: VLD1.8 { Dd[] }, [Rn] /// A64: LD1R { Vt.8B }, [Xn] /// - [RequiresUnsafe] public static unsafe Vector64 LoadAndReplicateToVector64(sbyte* address) { throw new PlatformNotSupportedException(); } /// @@ -9042,7 +8695,6 @@ internal Arm64() { } /// A32: VLD1.32 { Dd[] }, [Rn] /// A64: LD1R { Vt.2S }, [Xn] /// - [RequiresUnsafe] public static unsafe Vector64 LoadAndReplicateToVector64(float* address) { throw new PlatformNotSupportedException(); } /// @@ -9050,7 +8702,6 @@ internal Arm64() { } /// A32: VLD1.16 { Dd[] }, [Rn] /// A64: LD1R { Vt.4H }, [Xn] /// - [RequiresUnsafe] public static unsafe Vector64 LoadAndReplicateToVector64(ushort* address) { throw new PlatformNotSupportedException(); } /// @@ -9058,7 +8709,6 @@ internal Arm64() { } /// A32: VLD1.32 { Dd[] }, [Rn] /// A64: LD1R { Vt.2S }, [Xn] /// - [RequiresUnsafe] public static unsafe Vector64 LoadAndReplicateToVector64(uint* address) { throw new PlatformNotSupportedException(); } /// @@ -9066,7 +8716,6 @@ internal Arm64() { } /// A32: VLD1.8 { Dd[], Dd+1[] }, [Rn] /// A64: LD1R { Vt.16B }, [Xn] /// - [RequiresUnsafe] public static unsafe Vector128 LoadAndReplicateToVector128(byte* address) { throw new PlatformNotSupportedException(); } /// @@ -9074,7 +8723,6 @@ internal Arm64() { } /// A32: VLD1.16 { Dd[], Dd+1[] }, [Rn] /// A64: LD1R { Vt.8H }, [Xn] /// - [RequiresUnsafe] public static unsafe Vector128 LoadAndReplicateToVector128(short* address) { throw new PlatformNotSupportedException(); } /// @@ -9082,7 +8730,6 @@ internal Arm64() { } /// A32: VLD1.32 { Dd[], Dd+1[] }, [Rn] /// A64: LD1R { Vt.4S }, [Xn] /// - [RequiresUnsafe] public static unsafe Vector128 LoadAndReplicateToVector128(int* address) { throw new PlatformNotSupportedException(); } /// @@ -9090,7 +8737,6 @@ internal Arm64() { } /// A32: VLD1.8 { Dd[], Dd+1[] }, [Rn] /// A64: LD1R { Vt.16B }, [Xn] /// - [RequiresUnsafe] public static unsafe Vector128 LoadAndReplicateToVector128(sbyte* address) { throw new PlatformNotSupportedException(); } /// @@ -9098,7 +8744,6 @@ internal Arm64() { } /// A32: VLD1.32 { Dd[], Dd+1[] }, [Rn] /// A64: LD1R { Vt.4S }, [Xn] /// - [RequiresUnsafe] public static unsafe Vector128 LoadAndReplicateToVector128(float* address) { throw new PlatformNotSupportedException(); } /// @@ -9106,7 +8751,6 @@ internal Arm64() { } /// A32: VLD1.16 { Dd[], Dd+1[] }, [Rn] /// A64: LD1R { Vt.8H }, [Xn] /// - [RequiresUnsafe] public static unsafe Vector128 LoadAndReplicateToVector128(ushort* address) { throw new PlatformNotSupportedException(); } /// @@ -9114,91 +8758,69 @@ internal Arm64() { } /// A32: VLD1.32 { Dd[], Dd+1[] }, [Rn] /// A64: LD1R { Vt.4S }, [Xn] /// - [RequiresUnsafe] public static unsafe Vector128 LoadAndReplicateToVector128(uint* address) { throw new PlatformNotSupportedException(); } /// A64: LD2R { Vn.8B, Vn+1.8B }, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) LoadAndReplicateToVector64x2(byte* address) { throw new PlatformNotSupportedException(); } /// A64: LD2R { Vn.8B, Vn+1.8B }, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) LoadAndReplicateToVector64x2(sbyte* address) { throw new PlatformNotSupportedException(); } /// A64: LD2R { Vn.4H, Vn+1.4H }, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) LoadAndReplicateToVector64x2(short* address) { throw new PlatformNotSupportedException(); } /// A64: LD2R { Vn.4H, Vn+1.4H }, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) LoadAndReplicateToVector64x2(ushort* address) { throw new PlatformNotSupportedException(); } /// A64: LD2R { Vn.2S, Vn+1.2S }, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) LoadAndReplicateToVector64x2(int* address) { throw new PlatformNotSupportedException(); } /// A64: LD2R { Vn.2S, Vn+1.2S }, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) LoadAndReplicateToVector64x2(uint* address) { throw new PlatformNotSupportedException(); } /// A64: LD2R { Vn.2S, Vn+1.2S }, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) LoadAndReplicateToVector64x2(float* address) { throw new PlatformNotSupportedException(); } /// A64: LD3R { Vn.8B, Vn+1.8B, Vn+2.8B }, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3) LoadAndReplicateToVector64x3(byte* address) { throw new PlatformNotSupportedException(); } /// A64: LD3R { Vn.8B, Vn+1.8B, Vn+2.8B }, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3) LoadAndReplicateToVector64x3(sbyte* address) { throw new PlatformNotSupportedException(); } /// A64: LD3R { Vn.4H, Vn+1.4H, Vn+2.4H }, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3) LoadAndReplicateToVector64x3(short* address) { throw new PlatformNotSupportedException(); } /// A64: LD3R { Vn.4H, Vn+1.4H, Vn+2.4H }, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3) LoadAndReplicateToVector64x3(ushort* address) { throw new PlatformNotSupportedException(); } /// A64: LD3R { Vn.2S, Vn+1.2S, Vn+2.2S }, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3) LoadAndReplicateToVector64x3(int* address) { throw new PlatformNotSupportedException(); } /// A64: LD3R { Vn.2S, Vn+1.2S, Vn+2.2S }, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3) LoadAndReplicateToVector64x3(uint* address) { throw new PlatformNotSupportedException(); } /// A64: LD3R { Vn.2S, Vn+1.2S, Vn+2.2S }, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3) LoadAndReplicateToVector64x3(float* address) { throw new PlatformNotSupportedException(); } /// A64: LD4R { Vn.8B, Vn+1.8B, Vn+2.8B, Vn+3.8B }, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) LoadAndReplicateToVector64x4(byte* address) { throw new PlatformNotSupportedException(); } /// A64: LD4R { Vn.8B, Vn+1.8B, Vn+2.8B, Vn+3.8B }, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) LoadAndReplicateToVector64x4(sbyte* address) { throw new PlatformNotSupportedException(); } /// A64: LD4R { Vn.4H, Vn+1.4H, Vn+2.4H, Vn+3.4H }, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) LoadAndReplicateToVector64x4(short* address) { throw new PlatformNotSupportedException(); } /// A64: LD4R { Vn.4H, Vn+1.4H, Vn+2.4H, Vn+3.4H }, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) LoadAndReplicateToVector64x4(ushort* address) { throw new PlatformNotSupportedException(); } /// A64: LD4R { Vn.2S, Vn+1.2S, Vn+2.2S, Vn+3.2S }, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) LoadAndReplicateToVector64x4(int* address) { throw new PlatformNotSupportedException(); } /// A64: LD4R { Vn.2S, Vn+1.2S, Vn+2.2S, Vn+3.2S }, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) LoadAndReplicateToVector64x4(uint* address) { throw new PlatformNotSupportedException(); } /// A64: LD4R { Vn.2S, Vn+1.2S, Vn+2.2S, Vn+3.2S }, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) LoadAndReplicateToVector64x4(float* address) { throw new PlatformNotSupportedException(); } /// @@ -9206,7 +8828,6 @@ internal Arm64() { } /// A32: VLD1.8 Dd, [Rn] /// A64: LD1 Vt.8B, [Xn] /// - [RequiresUnsafe] public static unsafe Vector64 LoadVector64(byte* address) { throw new PlatformNotSupportedException(); } /// @@ -9214,7 +8835,6 @@ internal Arm64() { } /// A32: VLD1.64 Dd, [Rn] /// A64: LD1 Vt.1D, [Xn] /// - [RequiresUnsafe] public static unsafe Vector64 LoadVector64(double* address) { throw new PlatformNotSupportedException(); } /// @@ -9222,7 +8842,6 @@ internal Arm64() { } /// A32: VLD1.16 Dd, [Rn] /// A64: LD1 Vt.4H, [Xn] /// - [RequiresUnsafe] public static unsafe Vector64 LoadVector64(short* address) { throw new PlatformNotSupportedException(); } /// @@ -9230,7 +8849,6 @@ internal Arm64() { } /// A32: VLD1.32 Dd, [Rn] /// A64: LD1 Vt.2S, [Xn] /// - [RequiresUnsafe] public static unsafe Vector64 LoadVector64(int* address) { throw new PlatformNotSupportedException(); } /// @@ -9238,7 +8856,6 @@ internal Arm64() { } /// A32: VLD1.64 Dd, [Rn] /// A64: LD1 Vt.1D, [Xn] /// - [RequiresUnsafe] public static unsafe Vector64 LoadVector64(long* address) { throw new PlatformNotSupportedException(); } /// @@ -9246,7 +8863,6 @@ internal Arm64() { } /// A32: VLD1.8 Dd, [Rn] /// A64: LD1 Vt.8B, [Xn] /// - [RequiresUnsafe] public static unsafe Vector64 LoadVector64(sbyte* address) { throw new PlatformNotSupportedException(); } /// @@ -9254,7 +8870,6 @@ internal Arm64() { } /// A32: VLD1.32 Dd, [Rn] /// A64: LD1 Vt.2S, [Xn] /// - [RequiresUnsafe] public static unsafe Vector64 LoadVector64(float* address) { throw new PlatformNotSupportedException(); } /// @@ -9262,7 +8877,6 @@ internal Arm64() { } /// A32: VLD1.16 Dd, [Rn] /// A64: LD1 Vt.4H, [Xn] /// - [RequiresUnsafe] public static unsafe Vector64 LoadVector64(ushort* address) { throw new PlatformNotSupportedException(); } /// @@ -9270,7 +8884,6 @@ internal Arm64() { } /// A32: VLD1.32 Dd, [Rn] /// A64: LD1 Vt.2S, [Xn] /// - [RequiresUnsafe] public static unsafe Vector64 LoadVector64(uint* address) { throw new PlatformNotSupportedException(); } /// @@ -9278,7 +8891,6 @@ internal Arm64() { } /// A32: VLD1.64 Dd, [Rn] /// A64: LD1 Vt.1D, [Xn] /// - [RequiresUnsafe] public static unsafe Vector64 LoadVector64(ulong* address) { throw new PlatformNotSupportedException(); } /// @@ -9286,7 +8898,6 @@ internal Arm64() { } /// A32: VLD1.8 Dd, Dd+1, [Rn] /// A64: LD1 Vt.16B, [Xn] /// - [RequiresUnsafe] public static unsafe Vector128 LoadVector128(byte* address) { throw new PlatformNotSupportedException(); } /// @@ -9294,7 +8905,6 @@ internal Arm64() { } /// A32: VLD1.64 Dd, Dd+1, [Rn] /// A64: LD1 Vt.2D, [Xn] /// - [RequiresUnsafe] public static unsafe Vector128 LoadVector128(double* address) { throw new PlatformNotSupportedException(); } /// @@ -9302,7 +8912,6 @@ internal Arm64() { } /// A32: VLD1.16 Dd, Dd+1, [Rn] /// A64: LD1 Vt.8H, [Xn] /// - [RequiresUnsafe] public static unsafe Vector128 LoadVector128(short* address) { throw new PlatformNotSupportedException(); } /// @@ -9310,7 +8919,6 @@ internal Arm64() { } /// A32: VLD1.32 Dd, Dd+1, [Rn] /// A64: LD1 Vt.4S, [Xn] /// - [RequiresUnsafe] public static unsafe Vector128 LoadVector128(int* address) { throw new PlatformNotSupportedException(); } /// @@ -9318,7 +8926,6 @@ internal Arm64() { } /// A32: VLD1.64 Dd, Dd+1, [Rn] /// A64: LD1 Vt.2D, [Xn] /// - [RequiresUnsafe] public static unsafe Vector128 LoadVector128(long* address) { throw new PlatformNotSupportedException(); } /// @@ -9326,7 +8933,6 @@ internal Arm64() { } /// A32: VLD1.8 Dd, Dd+1, [Rn] /// A64: LD1 Vt.16B, [Xn] /// - [RequiresUnsafe] public static unsafe Vector128 LoadVector128(sbyte* address) { throw new PlatformNotSupportedException(); } /// @@ -9334,7 +8940,6 @@ internal Arm64() { } /// A32: VLD1.32 Dd, Dd+1, [Rn] /// A64: LD1 Vt.4S, [Xn] /// - [RequiresUnsafe] public static unsafe Vector128 LoadVector128(float* address) { throw new PlatformNotSupportedException(); } /// @@ -9342,7 +8947,6 @@ internal Arm64() { } /// A32: VLD1.16 Dd, Dd+1, [Rn] /// A64: LD1 Vt.8H, [Xn] /// - [RequiresUnsafe] public static unsafe Vector128 LoadVector128(ushort* address) { throw new PlatformNotSupportedException(); } /// @@ -9350,7 +8954,6 @@ internal Arm64() { } /// A32: VLD1.32 Dd, Dd+1, [Rn] /// A64: LD1 Vt.4S, [Xn] /// - [RequiresUnsafe] public static unsafe Vector128 LoadVector128(uint* address) { throw new PlatformNotSupportedException(); } /// @@ -9358,175 +8961,132 @@ internal Arm64() { } /// A32: VLD1.64 Dd, Dd+1, [Rn] /// A64: LD1 Vt.2D, [Xn] /// - [RequiresUnsafe] public static unsafe Vector128 LoadVector128(ulong* address) { throw new PlatformNotSupportedException(); } /// A64: LD2 { Vn.8B, Vn+1.8B }, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) Load2xVector64AndUnzip(byte* address) { throw new PlatformNotSupportedException(); } /// A64: LD2 { Vn.8B, Vn+1.8B }, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) Load2xVector64AndUnzip(sbyte* address) { throw new PlatformNotSupportedException(); } /// A64: LD2 { Vn.4H, Vn+1.4H }, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) Load2xVector64AndUnzip(short* address) { throw new PlatformNotSupportedException(); } /// A64: LD2 { Vn.4H, Vn+1.4H }, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) Load2xVector64AndUnzip(ushort* address) { throw new PlatformNotSupportedException(); } /// A64: LD2 { Vn.2S, Vn+1.2S }, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) Load2xVector64AndUnzip(int* address) { throw new PlatformNotSupportedException(); } /// A64: LD2 { Vn.2S, Vn+1.2S }, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) Load2xVector64AndUnzip(uint* address) { throw new PlatformNotSupportedException(); } /// A64: LD2 { Vn.2S, Vn+1.2S }, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) Load2xVector64AndUnzip(float* address) { throw new PlatformNotSupportedException(); } /// A64: LD3 { Vn.8B, Vn+1.8B, Vn+2.8B }, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3) Load3xVector64AndUnzip(byte* address) { throw new PlatformNotSupportedException(); } /// A64: LD3 { Vn.8B, Vn+1.8B, Vn+2.8B }, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3) Load3xVector64AndUnzip(sbyte* address) { throw new PlatformNotSupportedException(); } /// A64: LD3 { Vn.4H, Vn+1.4H, Vn+2.4H }, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3) Load3xVector64AndUnzip(short* address) { throw new PlatformNotSupportedException(); } /// A64: LD3 { Vn.4H, Vn+1.4H, Vn+2.4H }, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3) Load3xVector64AndUnzip(ushort* address) { throw new PlatformNotSupportedException(); } /// A64: LD3 { Vn.2S, Vn+1.2S, Vn+2.2S }, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3) Load3xVector64AndUnzip(int* address) { throw new PlatformNotSupportedException(); } /// A64: LD3 { Vn.2S, Vn+1.2S, Vn+2.2S }, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3) Load3xVector64AndUnzip(uint* address) { throw new PlatformNotSupportedException(); } /// A64: LD3 { Vn.2S, Vn+1.2S, Vn+2.2S }, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3) Load3xVector64AndUnzip(float* address) { throw new PlatformNotSupportedException(); } /// A64: LD4 { Vn.8B, Vn+1.8B, Vn+2.8B, Vn+3.8B }, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) Load4xVector64AndUnzip(byte* address) { throw new PlatformNotSupportedException(); } /// A64: LD4 { Vn.8B, Vn+1.8B, Vn+2.8B, Vn+3.8B }, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) Load4xVector64AndUnzip(sbyte* address) { throw new PlatformNotSupportedException(); } /// A64: LD4 { Vn.4H, Vn+1.4H, Vn+2.4H, Vn+3.4H }, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) Load4xVector64AndUnzip(short* address) { throw new PlatformNotSupportedException(); } /// A64: LD4 { Vn.4H, Vn+1.4H, Vn+2.4H, Vn+3.4H }, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) Load4xVector64AndUnzip(ushort* address) { throw new PlatformNotSupportedException(); } /// A64: LD4 { Vn.2S, Vn+1.2S, Vn+2.2S, Vn+3.2S }, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) Load4xVector64AndUnzip(int* address) { throw new PlatformNotSupportedException(); } /// A64: LD4 { Vn.2S, Vn+1.2S, Vn+2.2S, Vn+3.2S }, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) Load4xVector64AndUnzip(uint* address) { throw new PlatformNotSupportedException(); } /// A64: LD4 { Vn.4S, Vn+1.4S, Vn+2.4S, Vn+3.2S }, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) Load4xVector64AndUnzip(float* address) { throw new PlatformNotSupportedException(); } /// A64: LD1 { Vn.8B, Vn+1.8B }, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) Load2xVector64(byte* address) { throw new PlatformNotSupportedException(); } /// A64: LD1 { Vn.8B, Vn+1.8B }, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) Load2xVector64(sbyte* address) { throw new PlatformNotSupportedException(); } /// A64: LD1 { Vn.4H, Vn+1.4H }, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) Load2xVector64(short* address) { throw new PlatformNotSupportedException(); } /// A64: LD1 { Vn.4H, Vn+1.4H }, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) Load2xVector64(ushort* address) { throw new PlatformNotSupportedException(); } /// A64: LD1 { Vn.2S, Vn+1.2S }, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) Load2xVector64(int* address) { throw new PlatformNotSupportedException(); } /// A64: LD1 { Vn.2S, Vn+1.2S }, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) Load2xVector64(uint* address) { throw new PlatformNotSupportedException(); } /// A64: LD1 { Vn.2S, Vn+1.2S }, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) Load2xVector64(float* address) { throw new PlatformNotSupportedException(); } /// A64: LD1 { Vn.8B, Vn+1.8B, Vn+2.8B }, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3) Load3xVector64(byte* address) { throw new PlatformNotSupportedException(); } /// A64: LD1 { Vn.8B, Vn+1.8B, Vn+2.8B }, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3) Load3xVector64(sbyte* address) { throw new PlatformNotSupportedException(); } /// A64: LD1 { Vn.4H, Vn+1.4H, Vn+2.4H }, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3) Load3xVector64(short* address) { throw new PlatformNotSupportedException(); } /// A64: LD1 { Vn.4H, Vn+1.4H, Vn+2.4H }, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3) Load3xVector64(ushort* address) { throw new PlatformNotSupportedException(); } /// A64: LD1 { Vn.2S, Vn+1.2S, Vn+2.2S }, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3) Load3xVector64(int* address) { throw new PlatformNotSupportedException(); } /// A64: LD1 { Vn.2S, Vn+1.2S, Vn+2.2S }, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3) Load3xVector64(uint* address) { throw new PlatformNotSupportedException(); } /// A64: LD1 { Vn.2S, Vn+1.2S, Vn+2.2S }, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3) Load3xVector64(float* address) { throw new PlatformNotSupportedException(); } /// A64: LD1 { Vn.8B, Vn+1.8B, Vn+2.8B, Vn+3.8B }, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) Load4xVector64(byte* address) { throw new PlatformNotSupportedException(); } /// A64: LD1 { Vn.8B, Vn+1.8B, Vn+2.8B, Vn+3.8B }, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) Load4xVector64(sbyte* address) { throw new PlatformNotSupportedException(); } /// A64: LD1 { Vn.4H, Vn+1.4H, Vn+2.4H, Vn+3.4H }, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) Load4xVector64(short* address) { throw new PlatformNotSupportedException(); } /// A64: LD1 { Vn.4H, Vn+1.4H, Vn+2.4H, Vn+3.4H }, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) Load4xVector64(ushort* address) { throw new PlatformNotSupportedException(); } /// A64: LD1 { Vn.2S, Vn+1.2S, Vn+2.2S, Vn+3.2S }, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) Load4xVector64(int* address) { throw new PlatformNotSupportedException(); } /// A64: LD1 { Vn.2S, Vn+1.2S, Vn+2.2S, Vn+3.2S }, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) Load4xVector64(uint* address) { throw new PlatformNotSupportedException(); } /// A64: LD1 { Vn.2S, Vn+1.2S, Vn+2.2S, Vn+3.2S }, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) Load4xVector64(float* address) { throw new PlatformNotSupportedException(); } /// @@ -15391,7 +14951,6 @@ internal Arm64() { } /// A32: VST1.8 { Dd }, [Rn] /// A64: ST1 { Vt.8B }, [Xn] /// - [RequiresUnsafe] public static unsafe void Store(byte* address, Vector64 source) { throw new PlatformNotSupportedException(); } /// @@ -15399,7 +14958,6 @@ internal Arm64() { } /// A32: VST1.64 { Dd }, [Rn] /// A64: ST1 { Vt.1D }, [Xn] /// - [RequiresUnsafe] public static unsafe void Store(double* address, Vector64 source) { throw new PlatformNotSupportedException(); } /// @@ -15407,7 +14965,6 @@ internal Arm64() { } /// A32: VST1.16 { Dd }, [Rn] /// A64: ST1 {Vt.4H }, [Xn] /// - [RequiresUnsafe] public static unsafe void Store(short* address, Vector64 source) { throw new PlatformNotSupportedException(); } /// @@ -15415,7 +14972,6 @@ internal Arm64() { } /// A32: VST1.32 { Dd }, [Rn] /// A64: ST1 { Vt.2S }, [Xn] /// - [RequiresUnsafe] public static unsafe void Store(int* address, Vector64 source) { throw new PlatformNotSupportedException(); } /// @@ -15423,7 +14979,6 @@ internal Arm64() { } /// A32: VST1.64 { Dd }, [Rn] /// A64: ST1 { Vt.1D }, [Xn] /// - [RequiresUnsafe] public static unsafe void Store(long* address, Vector64 source) { throw new PlatformNotSupportedException(); } /// @@ -15431,7 +14986,6 @@ internal Arm64() { } /// A32: VST1.8 { Dd }, [Rn] /// A64: ST1 { Vt.8B }, [Xn] /// - [RequiresUnsafe] public static unsafe void Store(sbyte* address, Vector64 source) { throw new PlatformNotSupportedException(); } /// @@ -15439,7 +14993,6 @@ internal Arm64() { } /// A32: VST1.32 { Dd }, [Rn] /// A64: ST1 { Vt.2S }, [Xn] /// - [RequiresUnsafe] public static unsafe void Store(float* address, Vector64 source) { throw new PlatformNotSupportedException(); } /// @@ -15447,7 +15000,6 @@ internal Arm64() { } /// A32: VST1.16 { Dd }, [Rn] /// A64: ST1 { Vt.4H }, [Xn] /// - [RequiresUnsafe] public static unsafe void Store(ushort* address, Vector64 source) { throw new PlatformNotSupportedException(); } /// @@ -15455,7 +15007,6 @@ internal Arm64() { } /// A32: VST1.32 { Dd }, [Rn] /// A64: ST1 { Vt.2S }, [Xn] /// - [RequiresUnsafe] public static unsafe void Store(uint* address, Vector64 source) { throw new PlatformNotSupportedException(); } /// @@ -15463,7 +15014,6 @@ internal Arm64() { } /// A32: VST1.64 { Dd }, [Rn] /// A64: ST1 { Vt.1D }, [Xn] /// - [RequiresUnsafe] public static unsafe void Store(ulong* address, Vector64 source) { throw new PlatformNotSupportedException(); } /// @@ -15471,7 +15021,6 @@ internal Arm64() { } /// A32: VST1.8 { Dd, Dd+1 }, [Rn] /// A64: ST1 { Vt.16B }, [Xn] /// - [RequiresUnsafe] public static unsafe void Store(byte* address, Vector128 source) { throw new PlatformNotSupportedException(); } /// @@ -15479,7 +15028,6 @@ internal Arm64() { } /// A32: VST1.64 { Dd, Dd+1 }, [Rn] /// A64: ST1 { Vt.2D }, [Xn] /// - [RequiresUnsafe] public static unsafe void Store(double* address, Vector128 source) { throw new PlatformNotSupportedException(); } /// @@ -15487,7 +15035,6 @@ internal Arm64() { } /// A32: VST1.16 { Dd, Dd+1 }, [Rn] /// A64: ST1 { Vt.8H }, [Xn] /// - [RequiresUnsafe] public static unsafe void Store(short* address, Vector128 source) { throw new PlatformNotSupportedException(); } /// @@ -15495,7 +15042,6 @@ internal Arm64() { } /// A32: VST1.32 { Dd, Dd+1 }, [Rn] /// A64: ST1 { Vt.4S }, [Xn] /// - [RequiresUnsafe] public static unsafe void Store(int* address, Vector128 source) { throw new PlatformNotSupportedException(); } /// @@ -15503,7 +15049,6 @@ internal Arm64() { } /// A32: VST1.64 { Dd, Dd+1 }, [Rn] /// A64: ST1 { Vt.2D }, [Xn] /// - [RequiresUnsafe] public static unsafe void Store(long* address, Vector128 source) { throw new PlatformNotSupportedException(); } /// @@ -15511,7 +15056,6 @@ internal Arm64() { } /// A32: VST1.8 { Dd, Dd+1 }, [Rn] /// A64: ST1 { Vt.16B }, [Xn] /// - [RequiresUnsafe] public static unsafe void Store(sbyte* address, Vector128 source) { throw new PlatformNotSupportedException(); } /// @@ -15519,7 +15063,6 @@ internal Arm64() { } /// A32: VST1.32 { Dd, Dd+1 }, [Rn] /// A64: ST1 { Vt.4S }, [Xn] /// - [RequiresUnsafe] public static unsafe void Store(float* address, Vector128 source) { throw new PlatformNotSupportedException(); } /// @@ -15527,7 +15070,6 @@ internal Arm64() { } /// A32: VST1.16 { Dd, Dd+1 }, [Rn] /// A64: ST1 { Vt.8H }, [Xn] /// - [RequiresUnsafe] public static unsafe void Store(ushort* address, Vector128 source) { throw new PlatformNotSupportedException(); } /// @@ -15535,7 +15077,6 @@ internal Arm64() { } /// A32: VST1.32 { Dd, Dd+1 }, [Rn] /// A64: ST1 { Vt.4S }, [Xn] /// - [RequiresUnsafe] public static unsafe void Store(uint* address, Vector128 source) { throw new PlatformNotSupportedException(); } /// @@ -15543,7 +15084,6 @@ internal Arm64() { } /// A32: VST1.64 { Dd, Dd+1 }, [Rn] /// A64: ST1 { Vt.2D }, [Xn] /// - [RequiresUnsafe] public static unsafe void Store(ulong* address, Vector128 source) { throw new PlatformNotSupportedException(); } /// @@ -15551,7 +15091,6 @@ internal Arm64() { } /// A32: VST1.8 { Dd[index] }, [Rn] /// A64: ST1 { Vt.B }[index], [Xn] /// - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(byte* address, Vector64 value, [ConstantExpected(Max = (byte)(7))] byte index) { throw new PlatformNotSupportedException(); } /// @@ -15559,7 +15098,6 @@ internal Arm64() { } /// A32: VST1.16 { Dd[index] }, [Rn] /// A64: ST1 { Vt.H }[index], [Xn] /// - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(short* address, Vector64 value, [ConstantExpected(Max = (byte)(3))] byte index) { throw new PlatformNotSupportedException(); } /// @@ -15567,7 +15105,6 @@ internal Arm64() { } /// A32: VST1.32 { Dd[index] }, [Rn] /// A64: ST1 { Vt.S }[index], [Xn] /// - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(int* address, Vector64 value, [ConstantExpected(Max = (byte)(1))] byte index) { throw new PlatformNotSupportedException(); } /// @@ -15575,7 +15112,6 @@ internal Arm64() { } /// A32: VST1.8 { Dd[index] }, [Rn] /// A64: ST1 { Vt.B }[index], [Xn] /// - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(sbyte* address, Vector64 value, [ConstantExpected(Max = (byte)(7))] byte index) { throw new PlatformNotSupportedException(); } /// @@ -15583,7 +15119,6 @@ internal Arm64() { } /// A32: VST1.32 { Dd[index] }, [Rn] /// A64: ST1 { Vt.S }[index], [Xn] /// - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(float* address, Vector64 value, [ConstantExpected(Max = (byte)(1))] byte index) { throw new PlatformNotSupportedException(); } /// @@ -15591,7 +15126,6 @@ internal Arm64() { } /// A32: VST1.16 { Dd[index] }, [Rn] /// A64: ST1 { Vt.H }[index], [Xn] /// - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(ushort* address, Vector64 value, [ConstantExpected(Max = (byte)(3))] byte index) { throw new PlatformNotSupportedException(); } /// @@ -15599,7 +15133,6 @@ internal Arm64() { } /// A32: VST1.32 { Dd[index] }, [Rn] /// A64: ST1 { Vt.S }[index], [Xn] /// - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(uint* address, Vector64 value, [ConstantExpected(Max = (byte)(1))] byte index) { throw new PlatformNotSupportedException(); } /// @@ -15607,7 +15140,6 @@ internal Arm64() { } /// A32: VST1.8 { Dd[index] }, [Rn] /// A64: ST1 { Vt.B }[index], [Xn] /// - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(byte* address, Vector128 value, [ConstantExpected(Max = (byte)(15))] byte index) { throw new PlatformNotSupportedException(); } /// @@ -15615,7 +15147,6 @@ internal Arm64() { } /// A32: VSTR.64 Dd, [Rn] /// A64: ST1 { Vt.D }[index], [Xn] /// - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(double* address, Vector128 value, [ConstantExpected(Max = (byte)(1))] byte index) { throw new PlatformNotSupportedException(); } /// @@ -15623,7 +15154,6 @@ internal Arm64() { } /// A32: VST1.16 { Dd[index] }, [Rn] /// A64: ST1 { Vt.H }[index], [Xn] /// - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(short* address, Vector128 value, [ConstantExpected(Max = (byte)(7))] byte index) { throw new PlatformNotSupportedException(); } /// @@ -15631,7 +15161,6 @@ internal Arm64() { } /// A32: VST1.32 { Dd[index] }, [Rn] /// A64: ST1 { Vt.S }[index], [Xn] /// - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(int* address, Vector128 value, [ConstantExpected(Max = (byte)(3))] byte index) { throw new PlatformNotSupportedException(); } /// @@ -15639,7 +15168,6 @@ internal Arm64() { } /// A32: VSTR.64 Dd, [Rn] /// A64: ST1 { Vt.D }[index], [Xn] /// - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(long* address, Vector128 value, [ConstantExpected(Max = (byte)(1))] byte index) { throw new PlatformNotSupportedException(); } /// @@ -15647,7 +15175,6 @@ internal Arm64() { } /// A32: VST1.8 { Dd[index] }, [Rn] /// A64: ST1 { Vt.B }[index], [Xn] /// - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(sbyte* address, Vector128 value, [ConstantExpected(Max = (byte)(15))] byte index) { throw new PlatformNotSupportedException(); } /// @@ -15655,7 +15182,6 @@ internal Arm64() { } /// A32: VST1.32 { Dd[index] }, [Rn] /// A64: ST1 { Vt.S }[index], [Xn] /// - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(float* address, Vector128 value, [ConstantExpected(Max = (byte)(3))] byte index) { throw new PlatformNotSupportedException(); } /// @@ -15663,7 +15189,6 @@ internal Arm64() { } /// A32: VST1.16 { Dd[index] }, [Rn] /// A64: ST1 { Vt.H }[index], [Xn] /// - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(ushort* address, Vector128 value, [ConstantExpected(Max = (byte)(7))] byte index) { throw new PlatformNotSupportedException(); } /// @@ -15671,7 +15196,6 @@ internal Arm64() { } /// A32: VST1.32 { Dd[index] }, [Rn] /// A64: ST1 { Vt.S }[index], [Xn] /// - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(uint* address, Vector128 value, [ConstantExpected(Max = (byte)(3))] byte index) { throw new PlatformNotSupportedException(); } /// @@ -15679,259 +15203,195 @@ internal Arm64() { } /// A32: VSTR.64 Dd, [Rn] /// A64: ST1 { Vt.D }[index], [Xn] /// - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(ulong* address, Vector128 value, [ConstantExpected(Max = (byte)(1))] byte index) { throw new PlatformNotSupportedException(); } /// A64: ST2 { Vt.8B, Vt+1.8B }[index], [Xn] - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(byte* address, (Vector64 value1, Vector64 value2) value, [ConstantExpected(Max = (byte)(7))] byte index) { throw new PlatformNotSupportedException(); } /// A64: ST2 { Vt.8B, Vt+1.8B }[index], [Xn] - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(sbyte* address, (Vector64 value1, Vector64 value2) value, [ConstantExpected(Max = (byte)(7))] byte index) { throw new PlatformNotSupportedException(); } /// A64: ST2 { Vt.4H, Vt+1.4H }[index], [Xn] - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(short* address, (Vector64 value1, Vector64 value2) value, [ConstantExpected(Max = (byte)(3))] byte index) { throw new PlatformNotSupportedException(); } /// A64: ST2 { Vt.4H, Vt+1.4H }[index], [Xn] - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(ushort* address, (Vector64 value1, Vector64 value2) value, [ConstantExpected(Max = (byte)(3))] byte index) { throw new PlatformNotSupportedException(); } /// A64: ST2 { Vt.2S, Vt+1.2S }[index], [Xn] - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(int* address, (Vector64 value1, Vector64 value2) value, [ConstantExpected(Max = (byte)(1))] byte index) { throw new PlatformNotSupportedException(); } /// A64: ST2 { Vt.2S, Vt+1.2S }[index], [Xn] - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(uint* address, (Vector64 value1, Vector64 value2) value, [ConstantExpected(Max = (byte)(1))] byte index) { throw new PlatformNotSupportedException(); } /// A64: ST2 { Vt.2S, Vt+1.2S }[index], [Xn] - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(float* address, (Vector64 value1, Vector64 value2) value, [ConstantExpected(Max = (byte)(1))] byte index) { throw new PlatformNotSupportedException(); } /// A64: ST3 { Vt.8B, Vt+1.8B, Vt+2.8B }[index], [Xn] - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(byte* address, (Vector64 value1, Vector64 value2, Vector64 value3) value, [ConstantExpected(Max = (byte)(7))] byte index) { throw new PlatformNotSupportedException(); } /// A64: ST3 { Vt.8B, Vt+1.8B, Vt+2.8B }[index], [Xn] - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(sbyte* address, (Vector64 value1, Vector64 value2, Vector64 value3) value, [ConstantExpected(Max = (byte)(7))] byte index) { throw new PlatformNotSupportedException(); } /// A64: ST3 { Vt.4H, Vt+1.4H, Vt+2.4H }[index], [Xn] - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(short* address, (Vector64 value1, Vector64 value2, Vector64 value3) value, [ConstantExpected(Max = (byte)(3))] byte index) { throw new PlatformNotSupportedException(); } /// A64: ST3 { Vt.4H, Vt+1.4H, Vt+2.4H }[index], [Xn] - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(ushort* address, (Vector64 value1, Vector64 value2, Vector64 value3) value, [ConstantExpected(Max = (byte)(3))] byte index) { throw new PlatformNotSupportedException(); } /// A64: ST3 { Vt.2S, Vt+1.2S, Vt+2.2S }[index], [Xn] - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(int* address, (Vector64 value1, Vector64 value2, Vector64 value3) value, [ConstantExpected(Max = (byte)(1))] byte index) { throw new PlatformNotSupportedException(); } /// A64: ST3 { Vt.2S, Vt+1.2S, Vt+2.2S }[index], [Xn] - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(uint* address, (Vector64 value1, Vector64 value2, Vector64 value3) value, [ConstantExpected(Max = (byte)(1))] byte index) { throw new PlatformNotSupportedException(); } /// A64: ST2 { Vt.2S, Vt+1.2S, Vt+2.2S }[index], [Xn] - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(float* address, (Vector64 value1, Vector64 value2, Vector64 value3) value, [ConstantExpected(Max = (byte)(1))] byte index) { throw new PlatformNotSupportedException(); } /// A64: ST4 { Vt.8B, Vt+1.8B, Vt+2.8B, Vt+3.8B }[index], [Xn] - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(byte* address, (Vector64 value1, Vector64 value2, Vector64 value3, Vector64 value4) value, [ConstantExpected(Max = (byte)(7))] byte index) { throw new PlatformNotSupportedException(); } /// A64: ST4 { Vt.8B, Vt+1.8B, Vt+2.8B, Vt+3.8B }[index], [Xn] - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(sbyte* address, (Vector64 value1, Vector64 value2, Vector64 value3, Vector64 value4) value, [ConstantExpected(Max = (byte)(7))] byte index) { throw new PlatformNotSupportedException(); } /// A64: ST4 { Vt.4H, Vt+1.4H, Vt+2.4H, Vt+3.4H }[index], [Xn] - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(short* address, (Vector64 value1, Vector64 value2, Vector64 value3, Vector64 value4) value, [ConstantExpected(Max = (byte)(3))] byte index) { throw new PlatformNotSupportedException(); } /// A64: ST4 { Vt.4H, Vt+1.4H, Vt+2.4H, Vt+3.4H }[index], [Xn] - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(ushort* address, (Vector64 value1, Vector64 value2, Vector64 value3, Vector64 value4) value, [ConstantExpected(Max = (byte)(3))] byte index) { throw new PlatformNotSupportedException(); } /// A64: ST4 { Vt.2S, Vt+1.2S, Vt+2.2S, Vt+3.2S }[index], [Xn] - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(int* address, (Vector64 value1, Vector64 value2, Vector64 value3, Vector64 value4) value, [ConstantExpected(Max = (byte)(1))] byte index) { throw new PlatformNotSupportedException(); } /// A64: ST4 { Vt.2S, Vt+1.2S, Vt+2.2S, Vt+3.2S }[index], [Xn] - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(uint* address, (Vector64 value1, Vector64 value2, Vector64 value3, Vector64 value4) value, [ConstantExpected(Max = (byte)(1))] byte index) { throw new PlatformNotSupportedException(); } /// A64: ST4 { Vt.2S, Vt+1.2S, Vt+2.2S, Vt+3.2S }[index], [Xn] - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(float* address, (Vector64 value1, Vector64 value2, Vector64 value3, Vector64 value4) value, [ConstantExpected(Max = (byte)(1))] byte index) { throw new PlatformNotSupportedException(); } /// A64: ST2 { Vn.8B, Vn+1.8B }, [Xn] - [RequiresUnsafe] public static unsafe void StoreVectorAndZip(byte* address, (Vector64 Value1, Vector64 Value2) value) { throw new PlatformNotSupportedException(); } /// A64: ST2 { Vn.8B, Vn+1.8B }, [Xn] - [RequiresUnsafe] public static unsafe void StoreVectorAndZip(sbyte* address, (Vector64 Value1, Vector64 Value2) value) { throw new PlatformNotSupportedException(); } /// A64: ST2 { Vn.4H, Vn+1.4H }, [Xn] - [RequiresUnsafe] public static unsafe void StoreVectorAndZip(short* address, (Vector64 Value1, Vector64 Value2) value) { throw new PlatformNotSupportedException(); } /// A64: ST2 { Vn.4H, Vn+1.4H }, [Xn] - [RequiresUnsafe] public static unsafe void StoreVectorAndZip(ushort* address, (Vector64 Value1, Vector64 Value2) value) { throw new PlatformNotSupportedException(); } /// A64: ST2 { Vn.2S, Vn+1.2S }, [Xn] - [RequiresUnsafe] public static unsafe void StoreVectorAndZip(int* address, (Vector64 Value1, Vector64 Value2) value) { throw new PlatformNotSupportedException(); } /// A64: ST2 { Vn.2S, Vn+1.2S }, [Xn] - [RequiresUnsafe] public static unsafe void StoreVectorAndZip(uint* address, (Vector64 Value1, Vector64 Value2) value) { throw new PlatformNotSupportedException(); } /// A64: ST2 { Vn.2S, Vn+1.2S }, [Xn] - [RequiresUnsafe] public static unsafe void StoreVectorAndZip(float* address, (Vector64 Value1, Vector64 Value2) value) { throw new PlatformNotSupportedException(); } /// A64: ST3 { Vn.8B, Vn+1.8B, Vn+2.8B }, [Xn] - [RequiresUnsafe] public static unsafe void StoreVectorAndZip(byte* address, (Vector64 Value1, Vector64 Value2, Vector64 Value3) value) { throw new PlatformNotSupportedException(); } /// A64: ST3 { Vn.8B, Vn+1.8B, Vn+2.8B }, [Xn] - [RequiresUnsafe] public static unsafe void StoreVectorAndZip(sbyte* address, (Vector64 Value1, Vector64 Value2, Vector64 Value3) value) { throw new PlatformNotSupportedException(); } /// A64: ST3 { Vn.4H, Vn+1.4H, Vn+2.4H }, [Xn] - [RequiresUnsafe] public static unsafe void StoreVectorAndZip(short* address, (Vector64 Value1, Vector64 Value2, Vector64 Value3) value) { throw new PlatformNotSupportedException(); } /// A64: ST3 { Vn.4H, Vn+1.4H, Vn+2.4H }, [Xn] - [RequiresUnsafe] public static unsafe void StoreVectorAndZip(ushort* address, (Vector64 Value1, Vector64 Value2, Vector64 Value3) value) { throw new PlatformNotSupportedException(); } /// A64: ST3 { Vn.2S, Vn+1.2S, Vn+2.2S }, [Xn] - [RequiresUnsafe] public static unsafe void StoreVectorAndZip(int* address, (Vector64 Value1, Vector64 Value2, Vector64 Value3) value) { throw new PlatformNotSupportedException(); } /// A64: ST3 { Vn.2S, Vn+1.2S, Vn+2.2S }, [Xn] - [RequiresUnsafe] public static unsafe void StoreVectorAndZip(uint* address, (Vector64 Value1, Vector64 Value2, Vector64 Value3) value) { throw new PlatformNotSupportedException(); } /// A64: ST3 { Vn.2S, Vn+1.2S, Vn+2.2S }, [Xn] - [RequiresUnsafe] public static unsafe void StoreVectorAndZip(float* address, (Vector64 Value1, Vector64 Value2, Vector64 Value3) value) { throw new PlatformNotSupportedException(); } /// A64: ST4 { Vn.8B, Vn+1.8B, Vn+2.8B, Vn+3.8B }, [Xn] - [RequiresUnsafe] public static unsafe void StoreVectorAndZip(byte* address, (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) value) { throw new PlatformNotSupportedException(); } /// A64: ST4 { Vn.8B, Vn+1.8B, Vn+2.8B, Vn+3.8B }, [Xn] - [RequiresUnsafe] public static unsafe void StoreVectorAndZip(sbyte* address, (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) value) { throw new PlatformNotSupportedException(); } /// A64: ST4 { Vn.4H, Vn+1.4H, Vn+2.4H, Vn+3.4H }, [Xn] - [RequiresUnsafe] public static unsafe void StoreVectorAndZip(short* address, (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) value) { throw new PlatformNotSupportedException(); } /// A64: ST4 { Vn.4H, Vn+1.4H, Vn+2.4H, Vn+3.4H }, [Xn] - [RequiresUnsafe] public static unsafe void StoreVectorAndZip(ushort* address, (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) value) { throw new PlatformNotSupportedException(); } /// A64: ST4 { Vn.2S, Vn+1.2S, Vn+2.2S, Vn+3.2S }, [Xn] - [RequiresUnsafe] public static unsafe void StoreVectorAndZip(int* address, (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) value) { throw new PlatformNotSupportedException(); } /// A64: ST4 { Vn.2S, Vn+1.2S, Vn+2.2S, Vn+3.2S }, [Xn] - [RequiresUnsafe] public static unsafe void StoreVectorAndZip(uint* address, (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) value) { throw new PlatformNotSupportedException(); } /// A64: ST4 { Vn.2S, Vn+1.2S, Vn+2.2S, Vn+3.2S }, [Xn] - [RequiresUnsafe] public static unsafe void StoreVectorAndZip(float* address, (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) value) { throw new PlatformNotSupportedException(); } /// A64: ST1 { Vn.8B, Vn+1.8B }, [Xn] - [RequiresUnsafe] public static unsafe void Store(byte* address, (Vector64 Value1, Vector64 Value2) value) { throw new PlatformNotSupportedException(); } /// A64: ST1 { Vn.8B, Vn+1.8B }, [Xn] - [RequiresUnsafe] public static unsafe void Store(sbyte* address, (Vector64 Value1, Vector64 Value2) value) { throw new PlatformNotSupportedException(); } /// A64: ST1 { Vn.4H, Vn+1.4H }, [Xn] - [RequiresUnsafe] public static unsafe void Store(short* address, (Vector64 Value1, Vector64 Value2) value) { throw new PlatformNotSupportedException(); } /// A64: ST1 { Vn.4H, Vn+1.4H }, [Xn] - [RequiresUnsafe] public static unsafe void Store(ushort* address, (Vector64 Value1, Vector64 Value2) value) { throw new PlatformNotSupportedException(); } /// A64: ST1 { Vn.2S, Vn+1.2S }, [Xn] - [RequiresUnsafe] public static unsafe void Store(int* address, (Vector64 Value1, Vector64 Value2) value) { throw new PlatformNotSupportedException(); } /// A64: ST1 { Vn.2S, Vn+1.2S }, [Xn] - [RequiresUnsafe] public static unsafe void Store(uint* address, (Vector64 Value1, Vector64 Value2) value) { throw new PlatformNotSupportedException(); } /// A64: ST1 { Vn.2S, Vn+1.2S }, [Xn] - [RequiresUnsafe] public static unsafe void Store(float* address, (Vector64 Value1, Vector64 Value2) value) { throw new PlatformNotSupportedException(); } /// A64: ST1 { Vn.8B, Vn+1.8B, Vn+2.8B }, [Xn] - [RequiresUnsafe] public static unsafe void Store(byte* address, (Vector64 Value1, Vector64 Value2, Vector64 Value3) value) { throw new PlatformNotSupportedException(); } /// A64: ST1 { Vn.8B, Vn+1.8B, Vn+2.8B }, [Xn] - [RequiresUnsafe] public static unsafe void Store(sbyte* address, (Vector64 Value1, Vector64 Value2, Vector64 Value3) value) { throw new PlatformNotSupportedException(); } /// A64: ST1 { Vn.4H, Vn+1.4H, Vn+2.4H }, [Xn] - [RequiresUnsafe] public static unsafe void Store(short* address, (Vector64 Value1, Vector64 Value2, Vector64 Value3) value) { throw new PlatformNotSupportedException(); } /// A64: ST1 { Vn.4H, Vn+1.4H, Vn+2.4H }, [Xn] - [RequiresUnsafe] public static unsafe void Store(ushort* address, (Vector64 Value1, Vector64 Value2, Vector64 Value3) value) { throw new PlatformNotSupportedException(); } /// A64: ST1 { Vn.2S, Vn+1.2S, Vn+2.2S }, [Xn] - [RequiresUnsafe] public static unsafe void Store(int* address, (Vector64 Value1, Vector64 Value2, Vector64 Value3) value) { throw new PlatformNotSupportedException(); } /// A64: ST1 { Vn.2S, Vn+1.2S, Vn+2.2S }, [Xn] - [RequiresUnsafe] public static unsafe void Store(uint* address, (Vector64 Value1, Vector64 Value2, Vector64 Value3) value) { throw new PlatformNotSupportedException(); } /// A64: ST1 { Vn.2S, Vn+1.2S, Vn+2.2S }, [Xn] - [RequiresUnsafe] public static unsafe void Store(float* address, (Vector64 Value1, Vector64 Value2, Vector64 Value3) value) { throw new PlatformNotSupportedException(); } /// A64: ST1 { Vn.8B, Vn+1.8B, Vn+2.8B, Vn+3.8B }, [Xn] - [RequiresUnsafe] public static unsafe void Store(byte* address, (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) value) { throw new PlatformNotSupportedException(); } /// A64: ST1 { Vn.8B, Vn+1.8B, Vn+2.8B, Vn+3.8B }, [Xn] - [RequiresUnsafe] public static unsafe void Store(sbyte* address, (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) value) { throw new PlatformNotSupportedException(); } /// A64: ST1 { Vn.4H, Vn+1.4H, Vn+2.4H, Vn+3.4H }, [Xn] - [RequiresUnsafe] public static unsafe void Store(short* address, (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) value) { throw new PlatformNotSupportedException(); } /// A64: ST1 { Vn.4H, Vn+1.4H, Vn+2.4H, Vn+3.4H }, [Xn] - [RequiresUnsafe] public static unsafe void Store(ushort* address, (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) value) { throw new PlatformNotSupportedException(); } /// A64: ST1 { Vn.2S, Vn+1.2S, Vn+2.2S, Vn+3.2S }, [Xn] - [RequiresUnsafe] public static unsafe void Store(int* address, (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) value) { throw new PlatformNotSupportedException(); } /// A64: ST1 { Vn.2S, Vn+1.2S, Vn+2.2S, Vn+3.2S }, [Xn] - [RequiresUnsafe] public static unsafe void Store(uint* address, (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) value) { throw new PlatformNotSupportedException(); } /// A64: ST1 { Vn.2S, Vn+1.2S, Vn+2.2S, Vn+3.2S }, [Xn] - [RequiresUnsafe] public static unsafe void Store(float* address, (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) value) { throw new PlatformNotSupportedException(); } /// diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Arm/AdvSimd.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Arm/AdvSimd.cs index 3a5c3ced5e1b57..3bb907d6dea15f 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Arm/AdvSimd.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Arm/AdvSimd.cs @@ -1554,688 +1554,519 @@ internal Arm64() { } public static Vector128 InsertSelectedScalar(Vector128 result, [ConstantExpected(Max = (byte)(1))] byte resultIndex, Vector128 value, [ConstantExpected(Max = (byte)(1))] byte valueIndex) => Insert(result, resultIndex, Extract(value, valueIndex)); /// A64: LD2 { Vn.16B, Vn+1.16B }[Vm], [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) LoadAndInsertScalar((Vector128, Vector128) values, [ConstantExpected(Max = (byte)(15))] byte index, byte* address) => LoadAndInsertScalar(values, index, address); /// A64: LD2 { Vn.16B, Vn+1.16B }[Vm], [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) LoadAndInsertScalar((Vector128, Vector128) values, [ConstantExpected(Max = (byte)(15))] byte index, sbyte* address) => LoadAndInsertScalar(values, index, address); /// A64: LD2 { Vn.8H, Vn+1.8H }[Vm], [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) LoadAndInsertScalar((Vector128, Vector128) values, [ConstantExpected(Max = (byte)(7))] byte index, short* address) => LoadAndInsertScalar(values, index, address); /// A64: LD2 { Vn.8H, Vn+1.8H }[Vm], [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) LoadAndInsertScalar((Vector128, Vector128) values, [ConstantExpected(Max = (byte)(7))] byte index, ushort* address) => LoadAndInsertScalar(values, index, address); /// A64: LD2 { Vn.4S, Vn+1.4S }[Vm], [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) LoadAndInsertScalar((Vector128, Vector128) values, [ConstantExpected(Max = (byte)(3))] byte index, int* address) => LoadAndInsertScalar(values, index, address); /// A64: LD2 { Vn.4S, Vn+1.4S }[Vm], [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) LoadAndInsertScalar((Vector128, Vector128) values, [ConstantExpected(Max = (byte)(3))] byte index, uint* address) => LoadAndInsertScalar(values, index, address); /// A64: LD2 { Vn.2D, Vn+1.2D }[Vm], [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) LoadAndInsertScalar((Vector128, Vector128) values, [ConstantExpected(Max = (byte)(1))] byte index, long* address) => LoadAndInsertScalar(values, index, address); /// A64: LD2 { Vn.2D, Vn+1.2D }[Vm], [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) LoadAndInsertScalar((Vector128, Vector128) values, [ConstantExpected(Max = (byte)(1))] byte index, ulong* address) => LoadAndInsertScalar(values, index, address); /// A64: LD2 { Vn.4S, Vn+1.4S }[Vm], [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) LoadAndInsertScalar((Vector128, Vector128) values, [ConstantExpected(Max = (byte)(3))] byte index, float* address) => LoadAndInsertScalar(values, index, address); /// A64: LD2 { Vn.2D, Vn+1.2D }[Vm], [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) LoadAndInsertScalar((Vector128, Vector128) values, [ConstantExpected(Max = (byte)(1))] byte index, double* address) => LoadAndInsertScalar(values, index, address); /// A64: LD3 { Vn.16B, Vn+1.16B, Vn+2.16B }[Vm], [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) LoadAndInsertScalar((Vector128, Vector128, Vector128) values, [ConstantExpected(Max = (byte)(15))] byte index, byte* address) => LoadAndInsertScalar(values, index, address); /// A64: LD3 { Vn.16B, Vn+1.16B, Vn+2.16B }[Vm], [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) LoadAndInsertScalar((Vector128, Vector128, Vector128) values, [ConstantExpected(Max = (byte)(15))] byte index, sbyte* address) => LoadAndInsertScalar(values, index, address); /// A64: LD3 { Vn.8H, Vn+1.8H, Vn+2.8H }[Vm], [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) LoadAndInsertScalar((Vector128, Vector128, Vector128) values, [ConstantExpected(Max = (byte)(7))] byte index, short* address) => LoadAndInsertScalar(values, index, address); /// A64: LD3 { Vn.8H, Vn+1.8H, Vn+2.8H }[Vm], [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) LoadAndInsertScalar((Vector128, Vector128, Vector128) values, [ConstantExpected(Max = (byte)(7))] byte index, ushort* address) => LoadAndInsertScalar(values, index, address); /// A64: LD3 { Vn.4S, Vn+1.4S, Vn+2.4S }[Vm], [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) LoadAndInsertScalar((Vector128, Vector128, Vector128) values, [ConstantExpected(Max = (byte)(3))] byte index, int* address) => LoadAndInsertScalar(values, index, address); /// A64: LD3 { Vn.4S, Vn+1.4S, Vn+2.4S }[Vm], [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) LoadAndInsertScalar((Vector128, Vector128, Vector128) values, [ConstantExpected(Max = (byte)(3))] byte index, uint* address) => LoadAndInsertScalar(values, index, address); /// A64: LD3 { Vn.2D, Vn+1.2D, Vn+2.2D }[Vm], [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) LoadAndInsertScalar((Vector128, Vector128, Vector128) values, [ConstantExpected(Max = (byte)(1))] byte index, long* address) => LoadAndInsertScalar(values, index, address); /// A64: LD3 { Vn.2D, Vn+1.2D, Vn+2.2D }[Vm], [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) LoadAndInsertScalar((Vector128, Vector128, Vector128) values, [ConstantExpected(Max = (byte)(1))] byte index, ulong* address) => LoadAndInsertScalar(values, index, address); /// A64: LD3 { Vn.4S, Vn+1.4S, Vn+2.4S }[Vm], [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) LoadAndInsertScalar((Vector128, Vector128, Vector128) values, [ConstantExpected(Max = (byte)(3))] byte index, float* address) => LoadAndInsertScalar(values, index, address); /// A64: LD3 { Vn.2D, Vn+1.2D, Vn+2.2D }[Vm], [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) LoadAndInsertScalar((Vector128, Vector128, Vector128) values, [ConstantExpected(Max = (byte)(1))] byte index, double* address) => LoadAndInsertScalar(values, index, address); /// A64: LD4 { Vn.16B, Vn+1.16B, Vn+2.16B, Vn+3.16B }[Vm], [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) LoadAndInsertScalar((Vector128, Vector128, Vector128, Vector128) values, [ConstantExpected(Max = (byte)(15))] byte index, byte* address) => LoadAndInsertScalar(values, index, address); /// A64: LD4 { Vn.16B, Vn+1.16B, Vn+2.16B, Vn+3.16B }[Vm], [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) LoadAndInsertScalar((Vector128, Vector128, Vector128, Vector128) values, [ConstantExpected(Max = (byte)(15))] byte index, sbyte* address) => LoadAndInsertScalar(values, index, address); /// A64: LD4 { Vn.8H, Vn+1.8H, Vn+2.8H, Vn+3.8H }[Vm], [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) LoadAndInsertScalar((Vector128, Vector128, Vector128, Vector128) values, [ConstantExpected(Max = (byte)(7))] byte index, short* address) => LoadAndInsertScalar(values, index, address); /// A64: LD4 { Vn.8H, Vn+1.8H, Vn+2.8H, Vn+3.8H }[Vm], [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) LoadAndInsertScalar((Vector128, Vector128, Vector128, Vector128) values, [ConstantExpected(Max = (byte)(7))] byte index, ushort* address) => LoadAndInsertScalar(values, index, address); /// A64: LD4 { Vn.4S, Vn+1.4S, Vn+2.4S, Vn+3.4S }[Vm], [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) LoadAndInsertScalar((Vector128, Vector128, Vector128, Vector128) values, [ConstantExpected(Max = (byte)(3))] byte index, int* address) => LoadAndInsertScalar(values, index, address); /// A64: LD4 { Vn.4S, Vn+1.4S, Vn+2.4S, Vn+3.4S }[Vm], [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) LoadAndInsertScalar((Vector128, Vector128, Vector128, Vector128) values, [ConstantExpected(Max = (byte)(3))] byte index, uint* address) => LoadAndInsertScalar(values, index, address); /// A64: LD4 { Vn.2D, Vn+1.2D, Vn+2.2D, Vn+3.2D }[Vm], [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) LoadAndInsertScalar((Vector128, Vector128, Vector128, Vector128) values, [ConstantExpected(Max = (byte)(1))] byte index, long* address) => LoadAndInsertScalar(values, index, address); /// A64: LD4 { Vn.2D, Vn+1.2D, Vn+2.2D, Vn+3.2D }[Vm], [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) LoadAndInsertScalar((Vector128, Vector128, Vector128, Vector128) values, [ConstantExpected(Max = (byte)(1))] byte index, ulong* address) => LoadAndInsertScalar(values, index, address); /// A64: LD4 { Vn.4S, Vn+1.4S, Vn+2.4S, Vn+3.4S }[Vm], [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) LoadAndInsertScalar((Vector128, Vector128, Vector128, Vector128) values, [ConstantExpected(Max = (byte)(3))] byte index, float* address) => LoadAndInsertScalar(values, index, address); /// A64: LD4 { Vn.2D, Vn+1.2D, Vn+2.2D, Vn+3.2D }[Vm], [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) LoadAndInsertScalar((Vector128, Vector128, Vector128, Vector128) values, [ConstantExpected(Max = (byte)(1))] byte index, double* address) => LoadAndInsertScalar(values, index, address); /// /// float64x2_t vld1q_dup_f64 (float64_t const * ptr) /// A64: LD1R { Vt.2D }, [Xn] /// - [RequiresUnsafe] public static unsafe Vector128 LoadAndReplicateToVector128(double* address) => LoadAndReplicateToVector128(address); /// /// int64x2_t vld1q_dup_s64 (int64_t const * ptr) /// A64: LD1R { Vt.2D }, [Xn] /// - [RequiresUnsafe] public static unsafe Vector128 LoadAndReplicateToVector128(long* address) => LoadAndReplicateToVector128(address); /// /// uint64x2_t vld1q_dup_u64 (uint64_t const * ptr) /// A64: LD1R { Vt.2D }, [Xn] /// - [RequiresUnsafe] public static unsafe Vector128 LoadAndReplicateToVector128(ulong* address) => LoadAndReplicateToVector128(address); /// A64: LD2R { Vn.16B, Vn+1.16B }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) LoadAndReplicateToVector128x2(byte* address) => LoadAndReplicateToVector128x2(address); /// A64: LD2R { Vn.16B, Vn+1.16B }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) LoadAndReplicateToVector128x2(sbyte* address) => LoadAndReplicateToVector128x2(address); /// A64: LD2R { Vn.8H, Vn+1.8H }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) LoadAndReplicateToVector128x2(short* address) => LoadAndReplicateToVector128x2(address); /// A64: LD2R { Vn.8H, Vn+1.8H }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) LoadAndReplicateToVector128x2(ushort* address) => LoadAndReplicateToVector128x2(address); /// A64: LD2R { Vn.4S, Vn+1.4S }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) LoadAndReplicateToVector128x2(int* address) => LoadAndReplicateToVector128x2(address); /// A64: LD2R { Vn.4S, Vn+1.4S }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) LoadAndReplicateToVector128x2(uint* address) => LoadAndReplicateToVector128x2(address); /// A64: LD2R { Vn.2D, Vn+1.2D }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) LoadAndReplicateToVector128x2(long* address) => LoadAndReplicateToVector128x2(address); /// A64: LD2R { Vn.2D, Vn+1.2D }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) LoadAndReplicateToVector128x2(ulong* address) => LoadAndReplicateToVector128x2(address); /// A64: LD2R { Vn.4S, Vn+1.4S }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) LoadAndReplicateToVector128x2(float* address) => LoadAndReplicateToVector128x2(address); /// A64: LD2R { Vn.2D, Vn+1.2D }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) LoadAndReplicateToVector128x2(double* address) => LoadAndReplicateToVector128x2(address); /// A64: LD3R { Vn.16B, Vn+1.16B, Vn+2.16B }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) LoadAndReplicateToVector128x3(byte* address) => LoadAndReplicateToVector128x3(address); /// A64: LD3R { Vn.16B, Vn+1.16B, Vn+2.16B }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) LoadAndReplicateToVector128x3(sbyte* address) => LoadAndReplicateToVector128x3(address); /// A64: LD3R { Vn.8H, Vn+1.8H, Vn+2.8H }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) LoadAndReplicateToVector128x3(short* address) => LoadAndReplicateToVector128x3(address); /// A64: LD3R { Vn.8H, Vn+1.8H, Vn+2.8H }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) LoadAndReplicateToVector128x3(ushort* address) => LoadAndReplicateToVector128x3(address); /// A64: LD3R { Vn.4S, Vn+1.4S, Vn+2.4S }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) LoadAndReplicateToVector128x3(int* address) => LoadAndReplicateToVector128x3(address); /// A64: LD3R { Vn.4S, Vn+1.4S, Vn+2.4S }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) LoadAndReplicateToVector128x3(uint* address) => LoadAndReplicateToVector128x3(address); /// A64: LD3R { Vn.2D, Vn+1.2D, Vn+2.2D }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) LoadAndReplicateToVector128x3(long* address) => LoadAndReplicateToVector128x3(address); /// A64: LD3R { Vn.2D, Vn+1.2D, Vn+2.2D }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) LoadAndReplicateToVector128x3(ulong* address) => LoadAndReplicateToVector128x3(address); /// A64: LD3R { Vn.4S, Vn+1.4S, Vn+2.4S }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) LoadAndReplicateToVector128x3(float* address) => LoadAndReplicateToVector128x3(address); /// A64: LD3R { Vn.2D, Vn+1.2D, Vn+2.2D }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) LoadAndReplicateToVector128x3(double* address) => LoadAndReplicateToVector128x3(address); /// A64: LD4R { Vn.16B, Vn+1.16B, Vn+2.16B, Vn+3.16B }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) LoadAndReplicateToVector128x4(byte* address) => LoadAndReplicateToVector128x4(address); /// A64: LD4R { Vn.16B, Vn+1.16B, Vn+2.16B, Vn+3.16B }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) LoadAndReplicateToVector128x4(sbyte* address) => LoadAndReplicateToVector128x4(address); /// A64: LD4R { Vn.8H, Vn+1.8H, Vn+2.8H, Vn+3.8H }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) LoadAndReplicateToVector128x4(short* address) => LoadAndReplicateToVector128x4(address); /// A64: LD4R { Vn.8H, Vn+1.8H, Vn+2.8H, Vn+3.8H }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) LoadAndReplicateToVector128x4(ushort* address) => LoadAndReplicateToVector128x4(address); /// A64: LD4R { Vn.4S, Vn+1.4S, Vn+2.4S, Vn+3.4S }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) LoadAndReplicateToVector128x4(int* address) => LoadAndReplicateToVector128x4(address); /// A64: LD4R { Vn.4S, Vn+1.4S, Vn+2.4S, Vn+3.4S }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) LoadAndReplicateToVector128x4(uint* address) => LoadAndReplicateToVector128x4(address); /// A64: LD4R { Vn.2D, Vn+1.2D, Vn+2.2D, Vn+3.2D }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) LoadAndReplicateToVector128x4(long* address) => LoadAndReplicateToVector128x4(address); /// A64: LD4R { Vn.2D, Vn+1.2D, Vn+2.2D, Vn+3.2D }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) LoadAndReplicateToVector128x4(ulong* address) => LoadAndReplicateToVector128x4(address); /// A64: LD4R { Vn.4S, Vn+1.4S, Vn+2.4S, Vn+3.4S }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) LoadAndReplicateToVector128x4(float* address) => LoadAndReplicateToVector128x4(address); /// A64: LD4R { Vn.2D, Vn+1.2D, Vn+2.2D, Vn+3.2D }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) LoadAndReplicateToVector128x4(double* address) => LoadAndReplicateToVector128x4(address); /// A64: LDP Dt1, Dt2, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) LoadPairVector64(byte* address) => LoadPairVector64(address); /// A64: LDP Dt1, Dt2, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) LoadPairVector64(double* address) => LoadPairVector64(address); /// A64: LDP Dt1, Dt2, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) LoadPairVector64(short* address) => LoadPairVector64(address); /// A64: LDP Dt1, Dt2, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) LoadPairVector64(int* address) => LoadPairVector64(address); /// A64: LDP Dt1, Dt2, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) LoadPairVector64(long* address) => LoadPairVector64(address); /// A64: LDP Dt1, Dt2, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) LoadPairVector64(sbyte* address) => LoadPairVector64(address); /// A64: LDP Dt1, Dt2, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) LoadPairVector64(float* address) => LoadPairVector64(address); /// A64: LDP Dt1, Dt2, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) LoadPairVector64(ushort* address) => LoadPairVector64(address); /// A64: LDP Dt1, Dt2, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) LoadPairVector64(uint* address) => LoadPairVector64(address); /// A64: LDP Dt1, Dt2, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) LoadPairVector64(ulong* address) => LoadPairVector64(address); /// A64: LDP St1, St2, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) LoadPairScalarVector64(int* address) => LoadPairScalarVector64(address); /// A64: LDP St1, St2, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) LoadPairScalarVector64(float* address) => LoadPairScalarVector64(address); /// A64: LDP St1, St2, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) LoadPairScalarVector64(uint* address) => LoadPairScalarVector64(address); /// A64: LDP Qt1, Qt2, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) LoadPairVector128(byte* address) => LoadPairVector128(address); /// A64: LDP Qt1, Qt2, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) LoadPairVector128(double* address) => LoadPairVector128(address); /// A64: LDP Qt1, Qt2, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) LoadPairVector128(short* address) => LoadPairVector128(address); /// A64: LDP Qt1, Qt2, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) LoadPairVector128(int* address) => LoadPairVector128(address); /// A64: LDP Qt1, Qt2, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) LoadPairVector128(long* address) => LoadPairVector128(address); /// A64: LDP Qt1, Qt2, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) LoadPairVector128(sbyte* address) => LoadPairVector128(address); /// A64: LDP Qt1, Qt2, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) LoadPairVector128(float* address) => LoadPairVector128(address); /// A64: LDP Qt1, Qt2, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) LoadPairVector128(ushort* address) => LoadPairVector128(address); /// A64: LDP Qt1, Qt2, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) LoadPairVector128(uint* address) => LoadPairVector128(address); /// A64: LDP Qt1, Qt2, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) LoadPairVector128(ulong* address) => LoadPairVector128(address); /// A64: LDNP Dt1, Dt2, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) LoadPairVector64NonTemporal(byte* address) => LoadPairVector64NonTemporal(address); /// A64: LDNP Dt1, Dt2, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) LoadPairVector64NonTemporal(double* address) => LoadPairVector64NonTemporal(address); /// A64: LDNP Dt1, Dt2, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) LoadPairVector64NonTemporal(short* address) => LoadPairVector64NonTemporal(address); /// A64: LDNP Dt1, Dt2, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) LoadPairVector64NonTemporal(int* address) => LoadPairVector64NonTemporal(address); /// A64: LDNP Dt1, Dt2, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) LoadPairVector64NonTemporal(long* address) => LoadPairVector64NonTemporal(address); /// A64: LDNP Dt1, Dt2, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) LoadPairVector64NonTemporal(sbyte* address) => LoadPairVector64NonTemporal(address); /// A64: LDNP Dt1, Dt2, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) LoadPairVector64NonTemporal(float* address) => LoadPairVector64NonTemporal(address); /// A64: LDNP Dt1, Dt2, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) LoadPairVector64NonTemporal(ushort* address) => LoadPairVector64NonTemporal(address); /// A64: LDNP Dt1, Dt2, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) LoadPairVector64NonTemporal(uint* address) => LoadPairVector64NonTemporal(address); /// A64: LDNP Dt1, Dt2, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) LoadPairVector64NonTemporal(ulong* address) => LoadPairVector64NonTemporal(address); /// A64: LDNP St1, St2, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) LoadPairScalarVector64NonTemporal(int* address) => LoadPairScalarVector64NonTemporal(address); /// A64: LDNP St1, St2, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) LoadPairScalarVector64NonTemporal(float* address) => LoadPairScalarVector64NonTemporal(address); /// A64: LDNP St1, St2, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) LoadPairScalarVector64NonTemporal(uint* address) => LoadPairScalarVector64NonTemporal(address); /// A64: LDNP Qt1, Qt2, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) LoadPairVector128NonTemporal(byte* address) => LoadPairVector128NonTemporal(address); /// A64: LDNP Qt1, Qt2, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) LoadPairVector128NonTemporal(double* address) => LoadPairVector128NonTemporal(address); /// A64: LDNP Qt1, Qt2, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) LoadPairVector128NonTemporal(short* address) => LoadPairVector128NonTemporal(address); /// A64: LDNP Qt1, Qt2, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) LoadPairVector128NonTemporal(int* address) => LoadPairVector128NonTemporal(address); /// A64: LDNP Qt1, Qt2, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) LoadPairVector128NonTemporal(long* address) => LoadPairVector128NonTemporal(address); /// A64: LDNP Qt1, Qt2, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) LoadPairVector128NonTemporal(sbyte* address) => LoadPairVector128NonTemporal(address); /// A64: LDNP Qt1, Qt2, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) LoadPairVector128NonTemporal(float* address) => LoadPairVector128NonTemporal(address); /// A64: LDNP Qt1, Qt2, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) LoadPairVector128NonTemporal(ushort* address) => LoadPairVector128NonTemporal(address); /// A64: LDNP Qt1, Qt2, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) LoadPairVector128NonTemporal(uint* address) => LoadPairVector128NonTemporal(address); /// A64: LDNP Qt1, Qt2, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) LoadPairVector128NonTemporal(ulong* address) => LoadPairVector128NonTemporal(address); /// A64: LD2 { Vn.16B, Vn+1.16B }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) Load2xVector128AndUnzip(byte* address) => Load2xVector128AndUnzip(address); /// A64: LD2 { Vn.16B, Vn+1.16B }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) Load2xVector128AndUnzip(sbyte* address) => Load2xVector128AndUnzip(address); /// A64: LD2 { Vn.8H, Vn+1.8H }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) Load2xVector128AndUnzip(short* address) => Load2xVector128AndUnzip(address); /// A64: LD2 { Vn.8H, Vn+1.8H }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) Load2xVector128AndUnzip(ushort* address) => Load2xVector128AndUnzip(address); /// A64: LD2 { Vn.4S, Vn+1.4S }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) Load2xVector128AndUnzip(int* address) => Load2xVector128AndUnzip(address); /// A64: LD2 { Vn.4S, Vn+1.4S }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) Load2xVector128AndUnzip(uint* address) => Load2xVector128AndUnzip(address); /// A64: LD2 { Vn.2D, Vn+1.2D }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) Load2xVector128AndUnzip(long* address) => Load2xVector128AndUnzip(address); /// A64: LD2 { Vn.2D, Vn+1.2D }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) Load2xVector128AndUnzip(ulong* address) => Load2xVector128AndUnzip(address); /// A64: LD2 { Vn.4S, Vn+1.4S }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) Load2xVector128AndUnzip(float* address) => Load2xVector128AndUnzip(address); /// A64: LD2 { Vn.2D, Vn+1.2D }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) Load2xVector128AndUnzip(double* address) => Load2xVector128AndUnzip(address); /// A64: LD3 { Vn.16B, Vn+1.16B, Vn+2.16B }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) Load3xVector128AndUnzip(byte* address) => Load3xVector128AndUnzip(address); /// A64: LD3 { Vn.16B, Vn+1.16B, Vn+2.16B }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) Load3xVector128AndUnzip(sbyte* address) => Load3xVector128AndUnzip(address); /// A64: LD3 { Vn.8H, Vn+1.8H, Vn+2.8H }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) Load3xVector128AndUnzip(short* address) => Load3xVector128AndUnzip(address); /// A64: LD3 { Vn.8H, Vn+1.8H, Vn+2.8H }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) Load3xVector128AndUnzip(ushort* address) => Load3xVector128AndUnzip(address); /// A64: LD3 { Vn.4S, Vn+1.4S, Vn+2.4S }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) Load3xVector128AndUnzip(int* address) => Load3xVector128AndUnzip(address); /// A64: LD3 { Vn.4S, Vn+1.4S, Vn+2.4S }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) Load3xVector128AndUnzip(uint* address) => Load3xVector128AndUnzip(address); /// A64: LD3 { Vn.2D, Vn+1.2D, Vn+2.2D }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) Load3xVector128AndUnzip(long* address) => Load3xVector128AndUnzip(address); /// A64: LD3 { Vn.2D, Vn+1.2D, Vn+2.2D }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) Load3xVector128AndUnzip(ulong* address) => Load3xVector128AndUnzip(address); /// A64: LD3 { Vn.4S, Vn+1.4S, Vn+2.4S }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) Load3xVector128AndUnzip(float* address) => Load3xVector128AndUnzip(address); /// A64: LD3 { Vn.2D, Vn+1.2D, Vn+2.2D }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) Load3xVector128AndUnzip(double* address) => Load3xVector128AndUnzip(address); /// A64: LD4 { Vn.16B, Vn+1.16B, Vn+2.16B, Vn+3.16B }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) Load4xVector128AndUnzip(byte* address) => Load4xVector128AndUnzip(address); /// A64: LD4 { Vn.16B, Vn+1.16B, Vn+2.16B, Vn+3.16B }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) Load4xVector128AndUnzip(sbyte* address) => Load4xVector128AndUnzip(address); /// A64: LD4 { Vn.8H, Vn+1.8H, Vn+2.8H, Vn+3.8H }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) Load4xVector128AndUnzip(short* address) => Load4xVector128AndUnzip(address); /// A64: LD4 { Vn.8H, Vn+1.8H, Vn+2.8H, Vn+3.8H }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) Load4xVector128AndUnzip(ushort* address) => Load4xVector128AndUnzip(address); /// A64: LD4 { Vn.4S, Vn+1.4S, Vn+2.4S, Vn+3.4S }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) Load4xVector128AndUnzip(int* address) => Load4xVector128AndUnzip(address); /// A64: LD4 { Vn.4S, Vn+1.4S, Vn+2.4S, Vn+3.4S }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) Load4xVector128AndUnzip(uint* address) => Load4xVector128AndUnzip(address); /// A64: LD4 { Vn.2D, Vn+1.2D, Vn+2.2D, Vn+3.2D }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) Load4xVector128AndUnzip(long* address) => Load4xVector128AndUnzip(address); /// A64: LD4 { Vn.2D, Vn+1.2D, Vn+2.2D, Vn+3.2D }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) Load4xVector128AndUnzip(ulong* address) => Load4xVector128AndUnzip(address); /// A64: LD4 { Vn.4S, Vn+1.4S, Vn+2.4S, Vn+3.4S }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) Load4xVector128AndUnzip(float* address) => Load4xVector128AndUnzip(address); /// A64: LD4 { Vn.2D, Vn+1.2D, Vn+2.2D, Vn+3.2D }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) Load4xVector128AndUnzip(double* address) => Load4xVector128AndUnzip(address); /// A64: LD1 { Vn.16B, Vn+1.16B }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) Load2xVector128(byte* address) => Load2xVector128(address); /// A64: LD1 { Vn.16B, Vn+1.16B }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) Load2xVector128(sbyte* address) => Load2xVector128(address); /// A64: LD1 { Vn.8H, Vn+1.8H }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) Load2xVector128(short* address) => Load2xVector128(address); /// A64: LD1 { Vn.8H, Vn+1.8H }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) Load2xVector128(ushort* address) => Load2xVector128(address); /// A64: LD1 { Vn.4S, Vn+1.4S }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) Load2xVector128(int* address) => Load2xVector128(address); /// A64: LD1 { Vn.4S, Vn+1.4S }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) Load2xVector128(uint* address) => Load2xVector128(address); /// A64: LD1 { Vn.2D, Vn+1.2D }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) Load2xVector128(long* address) => Load2xVector128(address); /// A64: LD1 { Vn.2D, Vn+1.2D }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) Load2xVector128(ulong* address) => Load2xVector128(address); /// A64: LD1 { Vn.4S, Vn+1.4S }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) Load2xVector128(float* address) => Load2xVector128(address); /// A64: LD1 { Vn.2D, Vn+1.2D }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) Load2xVector128(double* address) => Load2xVector128(address); /// A64: LD1 { Vn.16B, Vn+1.16B, Vn+2.16B }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) Load3xVector128(byte* address) => Load3xVector128(address); /// A64: LD1 { Vn.16B, Vn+1.16B, Vn+2.16B }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) Load3xVector128(sbyte* address) => Load3xVector128(address); /// A64: LD1 { Vn.8H, Vn+1.8H, Vn+2.8H }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) Load3xVector128(short* address) => Load3xVector128(address); /// A64: LD1 { Vn.8H, Vn+1.8H, Vn+2.8H }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) Load3xVector128(ushort* address) => Load3xVector128(address); /// A64: LD1 { Vn.4S, Vn+1.4S, Vn+2.4S }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) Load3xVector128(int* address) => Load3xVector128(address); /// A64: LD1 { Vn.4S, Vn+1.4S, Vn+2.4S }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) Load3xVector128(uint* address) => Load3xVector128(address); /// A64: LD1 { Vn.2D, Vn+1.2D, Vn+2.2D }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) Load3xVector128(long* address) => Load3xVector128(address); /// A64: LD1 { Vn.2D, Vn+1.2D, Vn+2.2D }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) Load3xVector128(ulong* address) => Load3xVector128(address); /// A64: LD1 { Vn.4S, Vn+1.4S, Vn+2.4S }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) Load3xVector128(float* address) => Load3xVector128(address); /// A64: LD1 { Vn.2D, Vn+1.2D, Vn+2.2D }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) Load3xVector128(double* address) => Load3xVector128(address); /// A64: LD1 { Vn.16B, Vn+1.16B, Vn+2.16B, Vn+3.16B }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) Load4xVector128(byte* address) => Load4xVector128(address); /// A64: LD1 { Vn.16B, Vn+1.16B, Vn+2.16B, Vn+3.16B }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) Load4xVector128(sbyte* address) => Load4xVector128(address); /// A64: LD1 { Vn.8H, Vn+1.8H, Vn+2.8H, Vn+3.8H }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) Load4xVector128(short* address) => Load4xVector128(address); /// A64: LD1 { Vn.8H, Vn+1.8H, Vn+2.8H, Vn+3.8H }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) Load4xVector128(ushort* address) => Load4xVector128(address); /// A64: LD1 { Vn.4S, Vn+1.4S, Vn+2.4S, Vn+3.4S }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) Load4xVector128(int* address) => Load4xVector128(address); /// A64: LD1 { Vn.4S, Vn+1.4S, Vn+2.4S, Vn+3.4S }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) Load4xVector128(uint* address) => Load4xVector128(address); /// A64: LD1 { Vn.2D, Vn+1.2D, Vn+2.2D, Vn+3.2D }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) Load4xVector128(long* address) => Load4xVector128(address); /// A64: LD1 { Vn.2D, Vn+1.2D, Vn+2.2D, Vn+3.2D}, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) Load4xVector128(ulong* address) => Load4xVector128(address); /// A64: LD1 { Vn.4S, Vn+1.4S, Vn+2.4S, Vn+3.4S }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) Load4xVector128(float* address) => Load4xVector128(address); /// A64: LD1 { Vn.2D, Vn+1.2D, Vn+2.2D, Vn+3.2D }, [Xn] - [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) Load4xVector128(double* address) => Load4xVector128(address); /// @@ -3390,610 +3221,474 @@ internal Arm64() { } public static Vector128 Sqrt(Vector128 value) => Sqrt(value); /// A64: STP Dt1, Dt2, [Xn] - [RequiresUnsafe] public static unsafe void StorePair(byte* address, Vector64 value1, Vector64 value2) => StorePair(address, value1, value2); /// A64: STP Dt1, Dt2, [Xn] - [RequiresUnsafe] public static unsafe void StorePair(double* address, Vector64 value1, Vector64 value2) => StorePair(address, value1, value2); /// A64: STP Dt1, Dt2, [Xn] - [RequiresUnsafe] public static unsafe void StorePair(short* address, Vector64 value1, Vector64 value2) => StorePair(address, value1, value2); /// A64: STP Dt1, Dt2, [Xn] - [RequiresUnsafe] public static unsafe void StorePair(int* address, Vector64 value1, Vector64 value2) => StorePair(address, value1, value2); /// A64: STP Dt1, Dt2, [Xn] - [RequiresUnsafe] public static unsafe void StorePair(long* address, Vector64 value1, Vector64 value2) => StorePair(address, value1, value2); /// A64: STP Dt1, Dt2, [Xn] - [RequiresUnsafe] public static unsafe void StorePair(sbyte* address, Vector64 value1, Vector64 value2) => StorePair(address, value1, value2); /// A64: STP Dt1, Dt2, [Xn] - [RequiresUnsafe] public static unsafe void StorePair(float* address, Vector64 value1, Vector64 value2) => StorePair(address, value1, value2); /// A64: STP Dt1, Dt2, [Xn] - [RequiresUnsafe] public static unsafe void StorePair(ushort* address, Vector64 value1, Vector64 value2) => StorePair(address, value1, value2); /// A64: STP Dt1, Dt2, [Xn] - [RequiresUnsafe] public static unsafe void StorePair(uint* address, Vector64 value1, Vector64 value2) => StorePair(address, value1, value2); /// A64: STP Dt1, Dt2, [Xn] - [RequiresUnsafe] public static unsafe void StorePair(ulong* address, Vector64 value1, Vector64 value2) => StorePair(address, value1, value2); /// A64: STP Qt1, Qt2, [Xn] - [RequiresUnsafe] public static unsafe void StorePair(byte* address, Vector128 value1, Vector128 value2) => StorePair(address, value1, value2); /// A64: STP Qt1, Qt2, [Xn] - [RequiresUnsafe] public static unsafe void StorePair(double* address, Vector128 value1, Vector128 value2) => StorePair(address, value1, value2); /// A64: STP Qt1, Qt2, [Xn] - [RequiresUnsafe] public static unsafe void StorePair(short* address, Vector128 value1, Vector128 value2) => StorePair(address, value1, value2); /// A64: STP Qt1, Qt2, [Xn] - [RequiresUnsafe] public static unsafe void StorePair(int* address, Vector128 value1, Vector128 value2) => StorePair(address, value1, value2); /// A64: STP Qt1, Qt2, [Xn] - [RequiresUnsafe] public static unsafe void StorePair(long* address, Vector128 value1, Vector128 value2) => StorePair(address, value1, value2); /// A64: STP Qt1, Qt2, [Xn] - [RequiresUnsafe] public static unsafe void StorePair(sbyte* address, Vector128 value1, Vector128 value2) => StorePair(address, value1, value2); /// A64: STP Qt1, Qt2, [Xn] - [RequiresUnsafe] public static unsafe void StorePair(float* address, Vector128 value1, Vector128 value2) => StorePair(address, value1, value2); /// A64: STP Qt1, Qt2, [Xn] - [RequiresUnsafe] public static unsafe void StorePair(ushort* address, Vector128 value1, Vector128 value2) => StorePair(address, value1, value2); /// A64: STP Qt1, Qt2, [Xn] - [RequiresUnsafe] public static unsafe void StorePair(uint* address, Vector128 value1, Vector128 value2) => StorePair(address, value1, value2); /// A64: STP Qt1, Qt2, [Xn] - [RequiresUnsafe] public static unsafe void StorePair(ulong* address, Vector128 value1, Vector128 value2) => StorePair(address, value1, value2); /// A64: STNP Dt1, Dt2, [Xn] - [RequiresUnsafe] public static unsafe void StorePairNonTemporal(byte* address, Vector64 value1, Vector64 value2) => StorePairNonTemporal(address, value1, value2); /// A64: STNP Dt1, Dt2, [Xn] - [RequiresUnsafe] public static unsafe void StorePairNonTemporal(double* address, Vector64 value1, Vector64 value2) => StorePairNonTemporal(address, value1, value2); /// A64: STNP Dt1, Dt2, [Xn] - [RequiresUnsafe] public static unsafe void StorePairNonTemporal(short* address, Vector64 value1, Vector64 value2) => StorePairNonTemporal(address, value1, value2); /// A64: STNP Dt1, Dt2, [Xn] - [RequiresUnsafe] public static unsafe void StorePairNonTemporal(int* address, Vector64 value1, Vector64 value2) => StorePairNonTemporal(address, value1, value2); /// A64: STNP Dt1, Dt2, [Xn] - [RequiresUnsafe] public static unsafe void StorePairNonTemporal(long* address, Vector64 value1, Vector64 value2) => StorePairNonTemporal(address, value1, value2); /// A64: STNP Dt1, Dt2, [Xn] - [RequiresUnsafe] public static unsafe void StorePairNonTemporal(sbyte* address, Vector64 value1, Vector64 value2) => StorePairNonTemporal(address, value1, value2); /// A64: STNP Dt1, Dt2, [Xn] - [RequiresUnsafe] public static unsafe void StorePairNonTemporal(float* address, Vector64 value1, Vector64 value2) => StorePairNonTemporal(address, value1, value2); /// A64: STNP Dt1, Dt2, [Xn] - [RequiresUnsafe] public static unsafe void StorePairNonTemporal(ushort* address, Vector64 value1, Vector64 value2) => StorePairNonTemporal(address, value1, value2); /// A64: STNP Dt1, Dt2, [Xn] - [RequiresUnsafe] public static unsafe void StorePairNonTemporal(uint* address, Vector64 value1, Vector64 value2) => StorePairNonTemporal(address, value1, value2); /// A64: STNP Dt1, Dt2, [Xn] - [RequiresUnsafe] public static unsafe void StorePairNonTemporal(ulong* address, Vector64 value1, Vector64 value2) => StorePairNonTemporal(address, value1, value2); /// A64: STNP Qt1, Qt2, [Xn] - [RequiresUnsafe] public static unsafe void StorePairNonTemporal(byte* address, Vector128 value1, Vector128 value2) => StorePairNonTemporal(address, value1, value2); /// A64: STNP Qt1, Qt2, [Xn] - [RequiresUnsafe] public static unsafe void StorePairNonTemporal(double* address, Vector128 value1, Vector128 value2) => StorePairNonTemporal(address, value1, value2); /// A64: STNP Qt1, Qt2, [Xn] - [RequiresUnsafe] public static unsafe void StorePairNonTemporal(short* address, Vector128 value1, Vector128 value2) => StorePairNonTemporal(address, value1, value2); /// A64: STNP Qt1, Qt2, [Xn] - [RequiresUnsafe] public static unsafe void StorePairNonTemporal(int* address, Vector128 value1, Vector128 value2) => StorePairNonTemporal(address, value1, value2); /// A64: STNP Qt1, Qt2, [Xn] - [RequiresUnsafe] public static unsafe void StorePairNonTemporal(long* address, Vector128 value1, Vector128 value2) => StorePairNonTemporal(address, value1, value2); /// A64: STNP Qt1, Qt2, [Xn] - [RequiresUnsafe] public static unsafe void StorePairNonTemporal(sbyte* address, Vector128 value1, Vector128 value2) => StorePairNonTemporal(address, value1, value2); /// A64: STNP Qt1, Qt2, [Xn] - [RequiresUnsafe] public static unsafe void StorePairNonTemporal(float* address, Vector128 value1, Vector128 value2) => StorePairNonTemporal(address, value1, value2); /// A64: STNP Qt1, Qt2, [Xn] - [RequiresUnsafe] public static unsafe void StorePairNonTemporal(ushort* address, Vector128 value1, Vector128 value2) => StorePairNonTemporal(address, value1, value2); /// A64: STNP Qt1, Qt2, [Xn] - [RequiresUnsafe] public static unsafe void StorePairNonTemporal(uint* address, Vector128 value1, Vector128 value2) => StorePairNonTemporal(address, value1, value2); /// A64: STNP Qt1, Qt2, [Xn] - [RequiresUnsafe] public static unsafe void StorePairNonTemporal(ulong* address, Vector128 value1, Vector128 value2) => StorePairNonTemporal(address, value1, value2); /// A64: STP St1, St2, [Xn] - [RequiresUnsafe] public static unsafe void StorePairScalar(int* address, Vector64 value1, Vector64 value2) => StorePairScalar(address, value1, value2); /// A64: STP St1, St2, [Xn] - [RequiresUnsafe] public static unsafe void StorePairScalar(float* address, Vector64 value1, Vector64 value2) => StorePairScalar(address, value1, value2); /// A64: STP St1, St2, [Xn] - [RequiresUnsafe] public static unsafe void StorePairScalar(uint* address, Vector64 value1, Vector64 value2) => StorePairScalar(address, value1, value2); /// A64: STNP St1, St2, [Xn] - [RequiresUnsafe] public static unsafe void StorePairScalarNonTemporal(int* address, Vector64 value1, Vector64 value2) => StorePairScalarNonTemporal(address, value1, value2); /// A64: STNP St1, St2, [Xn] - [RequiresUnsafe] public static unsafe void StorePairScalarNonTemporal(float* address, Vector64 value1, Vector64 value2) => StorePairScalarNonTemporal(address, value1, value2); /// A64: STNP St1, St2, [Xn] - [RequiresUnsafe] public static unsafe void StorePairScalarNonTemporal(uint* address, Vector64 value1, Vector64 value2) => StorePairScalarNonTemporal(address, value1, value2); /// /// void vst2_lane_s8 (int8_t * ptr, int8x16x2_t val, const int lane) /// A64: ST2 { Vt.16B, Vt+1.16B }[index], [Xn] /// - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(byte* address, (Vector128 value1, Vector128 value2) value, [ConstantExpected(Max = (byte)(15))] byte index) => StoreSelectedScalar(address, value, index); /// /// void vst2_lane_s8 (int8_t * ptr, int8x16x2_t val, const int lane) /// A64: ST2 { Vt.16B, Vt+1.16B }[index], [Xn] /// - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(sbyte* address, (Vector128 value1, Vector128 value2) value, [ConstantExpected(Max = (byte)(15))] byte index) => StoreSelectedScalar(address, value, index); /// /// void vst2_lane_s16 (int16_t * ptr, int16x8x2_t val, const int lane) /// A64: ST2 { Vt.8H, Vt+1.8H }[index], [Xn] /// - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(short* address, (Vector128 value1, Vector128 value2) value, [ConstantExpected(Max = (byte)(7))] byte index) => StoreSelectedScalar(address, value, index); /// /// void vst2_lane_s16 (int16_t * ptr, int16x8x2_t val, const int lane) /// A64: ST2 { Vt.8H, Vt+1.8H }[index], [Xn] /// - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(ushort* address, (Vector128 value1, Vector128 value2) value, [ConstantExpected(Max = (byte)(7))] byte index) => StoreSelectedScalar(address, value, index); /// /// void vst2_lane_s32 (int32_t * ptr, int32x4x2_t val, const int lane) /// A64: ST2 { Vt.4S, Vt+1.4S }[index], [Xn] /// - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(int* address, (Vector128 value1, Vector128 value2) value, [ConstantExpected(Max = (byte)(3))] byte index) => StoreSelectedScalar(address, value, index); /// /// void vst2_lane_s32 (int32_t * ptr, int32x4x2_t val, const int lane) /// A64: ST2 { Vt.4S, Vt+1.4S }[index], [Xn] /// - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(uint* address, (Vector128 value1, Vector128 value2) value, [ConstantExpected(Max = (byte)(3))] byte index) => StoreSelectedScalar(address, value, index); /// A64: ST2 { Vt.2D, Vt+1.2D }[index], [Xn] - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(long* address, (Vector128 value1, Vector128 value2) value, [ConstantExpected(Max = (byte)(1))] byte index) => StoreSelectedScalar(address, value, index); /// A64: ST2 { Vt.2D, Vt+1.2D }[index], [Xn] - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(ulong* address, (Vector128 value1, Vector128 value2) value, [ConstantExpected(Max = (byte)(1))] byte index) => StoreSelectedScalar(address, value, index); /// /// void vst2_lane_f32 (float32_t * ptr, float32x2x2_t val, const int lane) /// A64: ST2 { Vt.4S, Vt+1.4S }[index], [Xn] /// - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(float* address, (Vector128 value1, Vector128 value2) value, [ConstantExpected(Max = (byte)(3))] byte index) => StoreSelectedScalar(address, value, index); /// A64: ST2 { Vt.2D, Vt+1.2D }[index], [Xn] - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(double* address, (Vector128 value1, Vector128 value2) value, [ConstantExpected(Max = (byte)(1))] byte index) => StoreSelectedScalar(address, value, index); /// /// void vst3_lane_s8 (int8_t * ptr, int8x16x3_t val, const int lane) /// A64: ST3 { Vt.16B, Vt+1.16B, Vt+2.16B }[index], [Xn] /// - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(byte* address, (Vector128 value1, Vector128 value2, Vector128 value3) value, [ConstantExpected(Max = (byte)(15))] byte index) => StoreSelectedScalar(address, value, index); /// /// void vst3_lane_s8 (int8_t * ptr, int8x16x3_t val, const int lane) /// A64: ST3 { Vt.16B, Vt+1.16B, Vt+2.16B }[index], [Xn] /// - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(sbyte* address, (Vector128 value1, Vector128 value2, Vector128 value3) value, [ConstantExpected(Max = (byte)(15))] byte index) => StoreSelectedScalar(address, value, index); /// /// void vst3_lane_s16 (int16_t * ptr, int16x8x3_t val, const int lane) /// A64: ST3 { Vt.8H, Vt+1.8H, Vt+2.8H }[index], [Xn] /// - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(short* address, (Vector128 value1, Vector128 value2, Vector128 value3) value, [ConstantExpected(Max = (byte)(7))] byte index) => StoreSelectedScalar(address, value, index); /// /// void vst3_lane_s16 (int16_t * ptr, int16x8x3_t val, const int lane) /// A64: ST3 { Vt.8H, Vt+1.8H, Vt+2.8H }[index], [Xn] /// - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(ushort* address, (Vector128 value1, Vector128 value2, Vector128 value3) value, [ConstantExpected(Max = (byte)(7))] byte index) => StoreSelectedScalar(address, value, index); /// /// void vst3_lane_s32 (int32_t * ptr, int32x4x3_t val, const int lane) /// A64: ST3 { Vt.4S, Vt+1.4S, Vt+2.4S }[index], [Xn] /// - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(int* address, (Vector128 value1, Vector128 value2, Vector128 value3) value, [ConstantExpected(Max = (byte)(3))] byte index) => StoreSelectedScalar(address, value, index); /// /// void vst3_lane_s32 (int32_t * ptr, int32x4x3_t val, const int lane) /// A64: ST3 { Vt.4S, Vt+1.4S, Vt+2.4S }[index], [Xn] /// - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(uint* address, (Vector128 value1, Vector128 value2, Vector128 value3) value, [ConstantExpected(Max = (byte)(3))] byte index) => StoreSelectedScalar(address, value, index); /// A64: ST3 { Vt.2D, Vt+1.2D, Vt+2.2D }[index], [Xn] - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(long* address, (Vector128 value1, Vector128 value2, Vector128 value3) value, [ConstantExpected(Max = (byte)(1))] byte index) => StoreSelectedScalar(address, value, index); /// A64: ST3 { Vt.2D, Vt+1.2D, Vt+2.2D }[index], [Xn] - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(ulong* address, (Vector128 value1, Vector128 value2, Vector128 value3) value, [ConstantExpected(Max = (byte)(1))] byte index) => StoreSelectedScalar(address, value, index); /// /// void vst3_lane_f32 (float32_t * ptr, float32x2x3_t val, const int lane) /// A64: ST3 { Vt.4S, Vt+1.4S, Vt+2.4S }[index], [Xn] /// - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(float* address, (Vector128 value1, Vector128 value2, Vector128 value3) value, [ConstantExpected(Max = (byte)(3))] byte index) => StoreSelectedScalar(address, value, index); /// A64: ST3 { Vt.2D, Vt+1.2D, Vt+2.2D }[index], [Xn] - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(double* address, (Vector128 value1, Vector128 value2, Vector128 value3) value, [ConstantExpected(Max = (byte)(1))] byte index) => StoreSelectedScalar(address, value, index); /// /// void vst4_lane_s8 (int8_t * ptr, int8x16x4_t val, const int lane) /// A64: ST4 { Vt.16B, Vt+1.16B, Vt+2.16B, Vt+3.16B }[index], [Xn] /// - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(byte* address, (Vector128 value1, Vector128 value2, Vector128 value3, Vector128 value4) value, [ConstantExpected(Max = (byte)(15))] byte index) => StoreSelectedScalar(address, value, index); /// /// void vst4_lane_s8 (int8_t * ptr, int8x16x4_t val, const int lane) /// A64: ST4 { Vt.16B, Vt+1.16B, Vt+2.16B, Vt+3.16B }[index], [Xn] /// - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(sbyte* address, (Vector128 value1, Vector128 value2, Vector128 value3, Vector128 value4) value, [ConstantExpected(Max = (byte)(15))] byte index) => StoreSelectedScalar(address, value, index); /// /// void vst4_lane_s16 (int16_t * ptr, int16x8x4_t val, const int lane) /// A64: ST4 { Vt.8H, Vt+1.8H, Vt+2.8H, Vt+3.8H }[index], [Xn] /// - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(short* address, (Vector128 value1, Vector128 value2, Vector128 value3, Vector128 value4) value, [ConstantExpected(Max = (byte)(7))] byte index) => StoreSelectedScalar(address, value, index); /// /// void vst4_lane_s16 (int16_t * ptr, int16x8x4_t val, const int lane) /// A64: ST4 { Vt.8H, Vt+1.8H, Vt+2.8H, Vt+3.8H }[index], [Xn] /// - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(ushort* address, (Vector128 value1, Vector128 value2, Vector128 value3, Vector128 value4) value, [ConstantExpected(Max = (byte)(7))] byte index) => StoreSelectedScalar(address, value, index); /// /// void vst4_lane_s32 (int32_t * ptr, int32x4x4_t val, const int lane) /// A64: ST4 { Vt.4S, Vt+1.4S, Vt+2.4S, Vt+3.4S }[index], [Xn] /// - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(int* address, (Vector128 value1, Vector128 value2, Vector128 value3, Vector128 value4) value, [ConstantExpected(Max = (byte)(3))] byte index) => StoreSelectedScalar(address, value, index); /// /// void vst4_lane_s32 (int32_t * ptr, int32x4x4_t val, const int lane) /// A64: ST4 { Vt.4S, Vt+1.4S, Vt+2.4S, Vt+3.4S }[index], [Xn] /// - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(uint* address, (Vector128 value1, Vector128 value2, Vector128 value3, Vector128 value4) value, [ConstantExpected(Max = (byte)(3))] byte index) => StoreSelectedScalar(address, value, index); /// A64: ST4 { Vt.2D, Vt+1.2D, Vt+2.2D, Vt+3.2D }[index], [Xn] - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(long* address, (Vector128 value1, Vector128 value2, Vector128 value3, Vector128 value4) value, [ConstantExpected(Max = (byte)(1))] byte index) => StoreSelectedScalar(address, value, index); /// A64: ST4 { Vt.2D, Vt+1.2D, Vt+2.2D, Vt+3.2D }[index], [Xn] - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(ulong* address, (Vector128 value1, Vector128 value2, Vector128 value3, Vector128 value4) value, [ConstantExpected(Max = (byte)(1))] byte index) => StoreSelectedScalar(address, value, index); /// /// void vst4_lane_f32 (float32_t * ptr, float32x2x4_t val, const int lane) /// A64: ST4 { Vt.4S, Vt+1.4S, Vt+2.4S, Vt+3.4S }[index], [Xn] /// - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(float* address, (Vector128 value1, Vector128 value2, Vector128 value3, Vector128 value4) value, [ConstantExpected(Max = (byte)(3))] byte index) => StoreSelectedScalar(address, value, index); /// A64: ST4 { Vt.2D, Vt+1.2D, Vt+2.2D, Vt+3.2D }[index], [Xn] - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(double* address, (Vector128 value1, Vector128 value2, Vector128 value3, Vector128 value4) value, [ConstantExpected(Max = (byte)(1))] byte index) => StoreSelectedScalar(address, value, index); /// A64: ST2 { Vn.16B, Vn+1.16B }, [Xn] - [RequiresUnsafe] public static unsafe void StoreVectorAndZip(byte* address, (Vector128 Value1, Vector128 Value2) value) => StoreVectorAndZip(address, value); /// A64: ST2 { Vn.16B, Vn+1.16B }, [Xn] - [RequiresUnsafe] public static unsafe void StoreVectorAndZip(sbyte* address, (Vector128 Value1, Vector128 Value2) value) => StoreVectorAndZip(address, value); /// A64: ST2 { Vn.8H, Vn+1.8H }, [Xn] - [RequiresUnsafe] public static unsafe void StoreVectorAndZip(short* address, (Vector128 Value1, Vector128 Value2) value) => StoreVectorAndZip(address, value); /// A64: ST2 { Vn.8H, Vn+1.8H }, [Xn] - [RequiresUnsafe] public static unsafe void StoreVectorAndZip(ushort* address, (Vector128 Value1, Vector128 Value2) value) => StoreVectorAndZip(address, value); /// A64: ST2 { Vn.4S, Vn+1.4S }, [Xn] - [RequiresUnsafe] public static unsafe void StoreVectorAndZip(int* address, (Vector128 Value1, Vector128 Value2) value) => StoreVectorAndZip(address, value); /// A64: ST2 { Vn.4S, Vn+1.4S }, [Xn] - [RequiresUnsafe] public static unsafe void StoreVectorAndZip(uint* address, (Vector128 Value1, Vector128 Value2) value) => StoreVectorAndZip(address, value); /// A64: ST2 { Vn.2D, Vn+1.2D }, [Xn] - [RequiresUnsafe] public static unsafe void StoreVectorAndZip(long* address, (Vector128 Value1, Vector128 Value2) value) => StoreVectorAndZip(address, value); /// A64: ST2 { Vn.2D, Vn+1.2D }, [Xn] - [RequiresUnsafe] public static unsafe void StoreVectorAndZip(ulong* address, (Vector128 Value1, Vector128 Value2) value) => StoreVectorAndZip(address, value); /// A64: ST2 { Vn.4S, Vn+1.4S }, [Xn] - [RequiresUnsafe] public static unsafe void StoreVectorAndZip(float* address, (Vector128 Value1, Vector128 Value2) value) => StoreVectorAndZip(address, value); /// A64: ST2 { Vn.2D, Vn+1.2D }, [Xn] - [RequiresUnsafe] public static unsafe void StoreVectorAndZip(double* address, (Vector128 Value1, Vector128 Value2) value) => StoreVectorAndZip(address, value); /// A64: ST3 { Vn.16B, Vn+1.16B, Vn+2.16B }, [Xn] - [RequiresUnsafe] public static unsafe void StoreVectorAndZip(byte* address, (Vector128 Value1, Vector128 Value2, Vector128 Value3) value) => StoreVectorAndZip(address, value); /// A64: ST3 { Vn.16B, Vn+1.16B, Vn+2.16B }, [Xn] - [RequiresUnsafe] public static unsafe void StoreVectorAndZip(sbyte* address, (Vector128 Value1, Vector128 Value2, Vector128 Value3) value) => StoreVectorAndZip(address, value); /// A64: ST3 { Vn.8H, Vn+1.8H, Vn+2.8H }, [Xn] - [RequiresUnsafe] public static unsafe void StoreVectorAndZip(short* address, (Vector128 Value1, Vector128 Value2, Vector128 Value3) value) => StoreVectorAndZip(address, value); /// A64: ST3 { Vn.8H, Vn+1.8H, Vn+2.8H }, [Xn] - [RequiresUnsafe] public static unsafe void StoreVectorAndZip(ushort* address, (Vector128 Value1, Vector128 Value2, Vector128 Value3) value) => StoreVectorAndZip(address, value); /// A64: ST3 { Vn.4S, Vn+1.4S, Vn+2.4S }, [Xn] - [RequiresUnsafe] public static unsafe void StoreVectorAndZip(int* address, (Vector128 Value1, Vector128 Value2, Vector128 Value3) value) => StoreVectorAndZip(address, value); /// A64: ST3 { Vn.4S, Vn+1.4S, Vn+2.4S }, [Xn] - [RequiresUnsafe] public static unsafe void StoreVectorAndZip(uint* address, (Vector128 Value1, Vector128 Value2, Vector128 Value3) value) => StoreVectorAndZip(address, value); /// A64: ST3 { Vn.2D, Vn+1.2D, Vn+2.2D }, [Xn] - [RequiresUnsafe] public static unsafe void StoreVectorAndZip(long* address, (Vector128 Value1, Vector128 Value2, Vector128 Value3) value) => StoreVectorAndZip(address, value); /// A64: ST3 { Vn.2D, Vn+1.2D, Vn+2.2D }, [Xn] - [RequiresUnsafe] public static unsafe void StoreVectorAndZip(ulong* address, (Vector128 Value1, Vector128 Value2, Vector128 Value3) value) => StoreVectorAndZip(address, value); /// A64: ST3 { Vn.4S, Vn+1.4S, Vn+2.4S }, [Xn] - [RequiresUnsafe] public static unsafe void StoreVectorAndZip(float* address, (Vector128 Value1, Vector128 Value2, Vector128 Value3) value) => StoreVectorAndZip(address, value); /// A64: ST3 { Vn.2D, Vn+1.2D, Vn+2.2D }, [Xn] - [RequiresUnsafe] public static unsafe void StoreVectorAndZip(double* address, (Vector128 Value1, Vector128 Value2, Vector128 Value3) value) => StoreVectorAndZip(address, value); /// A64: ST4 { Vn.16B, Vn+1.16B, Vn+2.16B, Vn+3.16B }, [Xn] - [RequiresUnsafe] public static unsafe void StoreVectorAndZip(byte* address, (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) value) => StoreVectorAndZip(address, value); /// A64: ST4 { Vn.16B, Vn+1.16B, Vn+2.16B, Vn+3.16B }, [Xn] - [RequiresUnsafe] public static unsafe void StoreVectorAndZip(sbyte* address, (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) value) => StoreVectorAndZip(address, value); /// A64: ST4 { Vn.8H, Vn+1.8H, Vn+2.8H, Vn+3.8H }, [Xn] - [RequiresUnsafe] public static unsafe void StoreVectorAndZip(short* address, (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) value) => StoreVectorAndZip(address, value); /// A64: ST4 { Vn.8H, Vn+1.8H, Vn+2.8H, Vn+3.8H }, [Xn] - [RequiresUnsafe] public static unsafe void StoreVectorAndZip(ushort* address, (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) value) => StoreVectorAndZip(address, value); /// A64: ST4 { Vn.4S, Vn+1.4S, Vn+2.4S, Vn+3.4S }, [Xn] - [RequiresUnsafe] public static unsafe void StoreVectorAndZip(int* address, (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) value) => StoreVectorAndZip(address, value); /// A64: ST4 { Vn.4S, Vn+1.4S, Vn+2.4S, Vn+3.4S }, [Xn] - [RequiresUnsafe] public static unsafe void StoreVectorAndZip(uint* address, (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) value) => StoreVectorAndZip(address, value); /// A64: ST4 { Vn.2D, Vn+1.2D, Vn+2.2D, Vn+3.2D }, [Xn] - [RequiresUnsafe] public static unsafe void StoreVectorAndZip(long* address, (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) value) => StoreVectorAndZip(address, value); /// A64: ST4 { Vn.2D, Vn+1.2D, Vn+2.2D, Vn+3.2D }, [Xn] - [RequiresUnsafe] public static unsafe void StoreVectorAndZip(ulong* address, (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) value) => StoreVectorAndZip(address, value); /// A64: ST4 { Vn.4S, Vn+1.4S, Vn+2.4S, Vn+3.4S }, [Xn] - [RequiresUnsafe] public static unsafe void StoreVectorAndZip(float* address, (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) value) => StoreVectorAndZip(address, value); /// A64: ST4 { Vn.2D, Vn+1.2D, Vn+2.2D, Vn+3.2D }, [Xn] - [RequiresUnsafe] public static unsafe void StoreVectorAndZip(double* address, (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) value) => StoreVectorAndZip(address, value); /// A64: ST1 { Vn.16B, Vn+1.16B }, [Xn] - [RequiresUnsafe] public static unsafe void Store(byte* address, (Vector128 Value1, Vector128 Value2) value) => Store(address, value); /// A64: ST1 { Vn.16B, Vn+1.16B }, [Xn] - [RequiresUnsafe] public static unsafe void Store(sbyte* address, (Vector128 Value1, Vector128 Value2) value) => Store(address, value); /// A64: ST1 { Vn.8H, Vn+1.8H }, [Xn] - [RequiresUnsafe] public static unsafe void Store(short* address, (Vector128 Value1, Vector128 Value2) value) => Store(address, value); /// A64: ST1 { Vn.8H, Vn+1.8H }, [Xn] - [RequiresUnsafe] public static unsafe void Store(ushort* address, (Vector128 Value1, Vector128 Value2) value) => Store(address, value); /// A64: ST1 { Vn.4S, Vn+1.4S }, [Xn] - [RequiresUnsafe] public static unsafe void Store(int* address, (Vector128 Value1, Vector128 Value2) value) => Store(address, value); /// A64: ST1 { Vn.4S, Vn+1.4S }, [Xn] - [RequiresUnsafe] public static unsafe void Store(uint* address, (Vector128 Value1, Vector128 Value2) value) => Store(address, value); /// A64: ST1 { Vn.2D, Vn+1.2D }, [Xn] - [RequiresUnsafe] public static unsafe void Store(long* address, (Vector128 Value1, Vector128 Value2) value) => Store(address, value); /// A64: ST1 { Vn.2D, Vn+1.2D }, [Xn] - [RequiresUnsafe] public static unsafe void Store(ulong* address, (Vector128 Value1, Vector128 Value2) value) => Store(address, value); /// A64: ST1 { Vn.4S, Vn+1.4S }, [Xn] - [RequiresUnsafe] public static unsafe void Store(float* address, (Vector128 Value1, Vector128 Value2) value) => Store(address, value); /// A64: ST1 { Vn.2D, Vn+1.2D }, [Xn] - [RequiresUnsafe] public static unsafe void Store(double* address, (Vector128 Value1, Vector128 Value2) value) => Store(address, value); /// A64: ST1 { Vn.16B, Vn+1.16B, Vn+2.16B }, [Xn] - [RequiresUnsafe] public static unsafe void Store(byte* address, (Vector128 Value1, Vector128 Value2, Vector128 Value3) value) => Store(address, value); /// A64: ST1 { Vn.16B, Vn+1.16B, Vn+2.16B }, [Xn] - [RequiresUnsafe] public static unsafe void Store(sbyte* address, (Vector128 Value1, Vector128 Value2, Vector128 Value3) value) => Store(address, value); /// A64: ST1 { Vn.8H, Vn+1.8H, Vn+2.8H }, [Xn] - [RequiresUnsafe] public static unsafe void Store(short* address, (Vector128 Value1, Vector128 Value2, Vector128 Value3) value) => Store(address, value); /// A64: ST1 { Vn.8H, Vn+1.8H, Vn+2.8H }, [Xn] - [RequiresUnsafe] public static unsafe void Store(ushort* address, (Vector128 Value1, Vector128 Value2, Vector128 Value3) value) => Store(address, value); /// A64: ST1 { Vn.4S, Vn+1.4S, Vn+2.4S }, [Xn] - [RequiresUnsafe] public static unsafe void Store(int* address, (Vector128 Value1, Vector128 Value2, Vector128 Value3) value) => Store(address, value); /// A64: ST1 { Vn.4S, Vn+1.4S, Vn+2.4S }, [Xn] - [RequiresUnsafe] public static unsafe void Store(uint* address, (Vector128 Value1, Vector128 Value2, Vector128 Value3) value) => Store(address, value); /// A64: ST1 { Vn.2D, Vn+1.2D, Vn+2.2D }, [Xn] - [RequiresUnsafe] public static unsafe void Store(long* address, (Vector128 Value1, Vector128 Value2, Vector128 Value3) value) => Store(address, value); /// A64: ST1 { Vn.2D, Vn+1.2D, Vn+2.2D }, [Xn] - [RequiresUnsafe] public static unsafe void Store(ulong* address, (Vector128 Value1, Vector128 Value2, Vector128 Value3) value) => Store(address, value); /// A64: ST1 { Vn.4S, Vn+1.4S, Vn+2.4S }, [Xn] - [RequiresUnsafe] public static unsafe void Store(float* address, (Vector128 Value1, Vector128 Value2, Vector128 Value3) value) => Store(address, value); /// A64: ST1 { Vn.2D, Vn+1.2D, Vn+2.2D }, [Xn] - [RequiresUnsafe] public static unsafe void Store(double* address, (Vector128 Value1, Vector128 Value2, Vector128 Value3) value) => Store(address, value); /// A64: ST1 { Vn.16B, Vn+1.16B, Vn+2.16B, Vn+3.16B }, [Xn] - [RequiresUnsafe] public static unsafe void Store(byte* address, (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) value) => Store(address, value); /// A64: ST1 { Vn.16B, Vn+1.16B, Vn+2.16B, Vn+3.16B }, [Xn] - [RequiresUnsafe] public static unsafe void Store(sbyte* address, (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) value) => Store(address, value); /// A64: ST1 { Vn.8H, Vn+1.8H, Vn+2.8H, Vn+3.8H }, [Xn] - [RequiresUnsafe] public static unsafe void Store(short* address, (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) value) => Store(address, value); /// A64: ST1 { Vn.8H, Vn+1.8H, Vn+2.8H, Vn+3.8H }, [Xn] - [RequiresUnsafe] public static unsafe void Store(ushort* address, (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) value) => Store(address, value); /// A64: ST1 { Vn.4S, Vn+1.4S, Vn+2.4S, Vn+3.4S }, [Xn] - [RequiresUnsafe] public static unsafe void Store(int* address, (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) value) => Store(address, value); /// A64: ST1 { Vn.4S, Vn+1.4S, Vn+2.4S, Vn+3.4S }, [Xn] - [RequiresUnsafe] public static unsafe void Store(uint* address, (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) value) => Store(address, value); /// A64: ST1 { Vn.2D, Vn+1.2D, Vn+2.2D, Vn+3.2D }, [Xn] - [RequiresUnsafe] public static unsafe void Store(long* address, (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) value) => Store(address, value); /// A64: ST1 { Vn.2D, Vn+1.2D, Vn+2.2D, Vn+3.2D }, [Xn] - [RequiresUnsafe] public static unsafe void Store(ulong* address, (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) value) => Store(address, value); /// A64: ST1 { Vn.4S, Vn+1.4S, Vn+2.4S, Vn+3.4S }, [Xn] - [RequiresUnsafe] public static unsafe void Store(float* address, (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) value) => Store(address, value); /// A64: ST1 { Vn.2D, Vn+1.2D, Vn+2.2D, Vn+3.2D }, [Xn] - [RequiresUnsafe] public static unsafe void Store(double* address, (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) value) => Store(address, value); /// @@ -8794,7 +8489,6 @@ internal Arm64() { } /// A32: VLD1.8 { Dd[index] }, [Rn] /// A64: LD1 { Vt.B }[index], [Xn] /// - [RequiresUnsafe] public static unsafe Vector64 LoadAndInsertScalar(Vector64 value, [ConstantExpected(Max = (byte)(7))] byte index, byte* address) => LoadAndInsertScalar(value, index, address); /// @@ -8802,7 +8496,6 @@ internal Arm64() { } /// A32: VLD1.16 { Dd[index] }, [Rn] /// A64: LD1 { Vt.H }[index], [Xn] /// - [RequiresUnsafe] public static unsafe Vector64 LoadAndInsertScalar(Vector64 value, [ConstantExpected(Max = (byte)(3))] byte index, short* address) => LoadAndInsertScalar(value, index, address); /// @@ -8810,7 +8503,6 @@ internal Arm64() { } /// A32: VLD1.32 { Dd[index] }, [Rn] /// A64: LD1 { Vt.S }[index], [Xn] /// - [RequiresUnsafe] public static unsafe Vector64 LoadAndInsertScalar(Vector64 value, [ConstantExpected(Max = (byte)(1))] byte index, int* address) => LoadAndInsertScalar(value, index, address); /// @@ -8818,7 +8510,6 @@ internal Arm64() { } /// A32: VLD1.8 { Dd[index] }, [Rn] /// A64: LD1 { Vt.B }[index], [Xn] /// - [RequiresUnsafe] public static unsafe Vector64 LoadAndInsertScalar(Vector64 value, [ConstantExpected(Max = (byte)(7))] byte index, sbyte* address) => LoadAndInsertScalar(value, index, address); /// @@ -8826,7 +8517,6 @@ internal Arm64() { } /// A32: VLD1.32 { Dd[index] }, [Rn] /// A64: LD1 { Vt.S }[index], [Xn] /// - [RequiresUnsafe] public static unsafe Vector64 LoadAndInsertScalar(Vector64 value, [ConstantExpected(Max = (byte)(1))] byte index, float* address) => LoadAndInsertScalar(value, index, address); /// @@ -8834,7 +8524,6 @@ internal Arm64() { } /// A32: VLD1.16 { Dd[index] }, [Rn] /// A64: LD1 { Vt.H }[index], [Xn] /// - [RequiresUnsafe] public static unsafe Vector64 LoadAndInsertScalar(Vector64 value, [ConstantExpected(Max = (byte)(3))] byte index, ushort* address) => LoadAndInsertScalar(value, index, address); /// @@ -8842,7 +8531,6 @@ internal Arm64() { } /// A32: VLD1.32 { Dd[index] }, [Rn] /// A64: LD1 { Vt.S }[index], [Xn] /// - [RequiresUnsafe] public static unsafe Vector64 LoadAndInsertScalar(Vector64 value, [ConstantExpected(Max = (byte)(1))] byte index, uint* address) => LoadAndInsertScalar(value, index, address); /// @@ -8850,7 +8538,6 @@ internal Arm64() { } /// A32: VLD1.8 { Dd[index] }, [Rn] /// A64: LD1 { Vt.B }[index], [Xn] /// - [RequiresUnsafe] public static unsafe Vector128 LoadAndInsertScalar(Vector128 value, [ConstantExpected(Max = (byte)(15))] byte index, byte* address) => LoadAndInsertScalar(value, index, address); /// @@ -8858,7 +8545,6 @@ internal Arm64() { } /// A32: VLDR.64 Dd, [Rn] /// A64: LD1 { Vt.D }[index], [Xn] /// - [RequiresUnsafe] public static unsafe Vector128 LoadAndInsertScalar(Vector128 value, [ConstantExpected(Max = (byte)(1))] byte index, double* address) => LoadAndInsertScalar(value, index, address); /// @@ -8866,7 +8552,6 @@ internal Arm64() { } /// A32: VLD1.16 { Dd[index] }, [Rn] /// A64: LD1 { Vt.H }[index], [Xn] /// - [RequiresUnsafe] public static unsafe Vector128 LoadAndInsertScalar(Vector128 value, [ConstantExpected(Max = (byte)(7))] byte index, short* address) => LoadAndInsertScalar(value, index, address); /// @@ -8874,7 +8559,6 @@ internal Arm64() { } /// A32: VLD1.32 { Dd[index] }, [Rn] /// A64: LD1 { Vt.S }[index], [Xn] /// - [RequiresUnsafe] public static unsafe Vector128 LoadAndInsertScalar(Vector128 value, [ConstantExpected(Max = (byte)(3))] byte index, int* address) => LoadAndInsertScalar(value, index, address); /// @@ -8882,7 +8566,6 @@ internal Arm64() { } /// A32: VLDR.64 Dd, [Rn] /// A64: LD1 { Vt.D }[index], [Xn] /// - [RequiresUnsafe] public static unsafe Vector128 LoadAndInsertScalar(Vector128 value, [ConstantExpected(Max = (byte)(1))] byte index, long* address) => LoadAndInsertScalar(value, index, address); /// @@ -8890,7 +8573,6 @@ internal Arm64() { } /// A32: VLD1.8 { Dd[index] }, [Rn] /// A64: LD1 { Vt.B }[index], [Xn] /// - [RequiresUnsafe] public static unsafe Vector128 LoadAndInsertScalar(Vector128 value, [ConstantExpected(Max = (byte)(15))] byte index, sbyte* address) => LoadAndInsertScalar(value, index, address); /// @@ -8898,7 +8580,6 @@ internal Arm64() { } /// A32: VLD1.32 { Dd[index] }, [Rn] /// A64: LD1 { Vt.S }[index], [Xn] /// - [RequiresUnsafe] public static unsafe Vector128 LoadAndInsertScalar(Vector128 value, [ConstantExpected(Max = (byte)(3))] byte index, float* address) => LoadAndInsertScalar(value, index, address); /// @@ -8906,7 +8587,6 @@ internal Arm64() { } /// A32: VLD1.16 { Dd[index] }, [Rn] /// A64: LD1 { Vt.H }[index], [Xn] /// - [RequiresUnsafe] public static unsafe Vector128 LoadAndInsertScalar(Vector128 value, [ConstantExpected(Max = (byte)(7))] byte index, ushort* address) => LoadAndInsertScalar(value, index, address); /// @@ -8914,7 +8594,6 @@ internal Arm64() { } /// A32: VLD1.32 { Dd[index] }, [Rn] /// A64: LD1 { Vt.S }[index], [Xn] /// - [RequiresUnsafe] public static unsafe Vector128 LoadAndInsertScalar(Vector128 value, [ConstantExpected(Max = (byte)(3))] byte index, uint* address) => LoadAndInsertScalar(value, index, address); /// @@ -8922,91 +8601,69 @@ internal Arm64() { } /// A32: VLDR.64 Dd, [Rn] /// A64: LD1 { Vt.D }[index], [Xn] /// - [RequiresUnsafe] public static unsafe Vector128 LoadAndInsertScalar(Vector128 value, [ConstantExpected(Max = (byte)(1))] byte index, ulong* address) => LoadAndInsertScalar(value, index, address); /// A64: LD2 { Vn.8B, Vn+1.8B }[Vm], [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) LoadAndInsertScalar((Vector64, Vector64) values, [ConstantExpected(Max = (byte)(7))] byte index, byte* address) => LoadAndInsertScalar(values, index, address); /// A64: LD2 { Vn.8B, Vn+1.8B }[Vm], [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) LoadAndInsertScalar((Vector64, Vector64) values, [ConstantExpected(Max = (byte)(7))] byte index, sbyte* address) => LoadAndInsertScalar(values, index, address); /// A64: LD2 { Vn.4H, Vn+1.4H }[Vm], [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) LoadAndInsertScalar((Vector64, Vector64) values, [ConstantExpected(Max = (byte)(3))] byte index, short* address) => LoadAndInsertScalar(values, index, address); /// A64: LD2 { Vn.4H, Vn+1.4H }[Vm], [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) LoadAndInsertScalar((Vector64, Vector64) values, [ConstantExpected(Max = (byte)(3))] byte index, ushort* address) => LoadAndInsertScalar(values, index, address); /// A64: LD2 { Vn.2S, Vn+1.2S }[Vm], [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) LoadAndInsertScalar((Vector64, Vector64) values, [ConstantExpected(Max = (byte)(1))] byte index, int* address) => LoadAndInsertScalar(values, index, address); /// A64: LD2 { Vn.2S, Vn+1.2S }[Vm], [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) LoadAndInsertScalar((Vector64, Vector64) values, [ConstantExpected(Max = (byte)(1))] byte index, uint* address) => LoadAndInsertScalar(values, index, address); /// A64: LD2 { Vn.2S, Vn+1.2S }[Vm], [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) LoadAndInsertScalar((Vector64, Vector64) values, [ConstantExpected(Max = (byte)(1))] byte index, float* address) => LoadAndInsertScalar(values, index, address); /// A64: LD3 { Vn.8B, Vn+1.8B, Vn+2.8B }[Vm], [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3) LoadAndInsertScalar((Vector64, Vector64, Vector64) values, [ConstantExpected(Max = (byte)(7))] byte index, byte* address) => LoadAndInsertScalar(values, index, address); /// A64: LD3 { Vn.8B, Vn+1.8B, Vn+2.8B }[Vm], [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3) LoadAndInsertScalar((Vector64, Vector64, Vector64) values, [ConstantExpected(Max = (byte)(7))] byte index, sbyte* address) => LoadAndInsertScalar(values, index, address); /// A64: LD3 { Vn.4H, Vn+1.4H, Vn+2.4H }[Vm], [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3) LoadAndInsertScalar((Vector64, Vector64, Vector64) values, [ConstantExpected(Max = (byte)(3))] byte index, short* address) => LoadAndInsertScalar(values, index, address); /// A64: LD3 { Vn.4H, Vn+1.4H, Vn+2.4H }[Vm], [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3) LoadAndInsertScalar((Vector64, Vector64, Vector64) values, [ConstantExpected(Max = (byte)(3))] byte index, ushort* address) => LoadAndInsertScalar(values, index, address); /// A64: LD3 { Vn.2S, Vn+1.2S, Vn+2.2S }[Vm], [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3) LoadAndInsertScalar((Vector64, Vector64, Vector64) values, [ConstantExpected(Max = (byte)(1))] byte index, int* address) => LoadAndInsertScalar(values, index, address); /// A64: LD3 { Vn.2S, Vn+1.2S, Vn+2.2S }[Vm], [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3) LoadAndInsertScalar((Vector64, Vector64, Vector64) values, [ConstantExpected(Max = (byte)(1))] byte index, uint* address) => LoadAndInsertScalar(values, index, address); /// A64: LD3 { Vn.2S, Vn+1.2S, Vn+2.2S }[Vm], [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3) LoadAndInsertScalar((Vector64, Vector64, Vector64) values, [ConstantExpected(Max = (byte)(1))] byte index, float* address) => LoadAndInsertScalar(values, index, address); /// A64: LD4 { Vn.8B, Vn+1.8B, Vn+2.8B, Vn+3.8B }[Vm], [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) LoadAndInsertScalar((Vector64, Vector64, Vector64, Vector64) values, [ConstantExpected(Max = (byte)(7))] byte index, byte* address) => LoadAndInsertScalar(values, index, address); /// A64: LD4 { Vn.8B, Vn+1.8B, Vn+2.8B, Vn+3.8B }[Vm], [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) LoadAndInsertScalar((Vector64, Vector64, Vector64, Vector64) values, [ConstantExpected(Max = (byte)(7))] byte index, sbyte* address) => LoadAndInsertScalar(values, index, address); /// A64: LD4 { Vn.4H, Vn+1.4H, Vn+2.4H, Vn+3.4H }[Vm], [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) LoadAndInsertScalar((Vector64, Vector64, Vector64, Vector64) values, [ConstantExpected(Max = (byte)(3))] byte index, short* address) => LoadAndInsertScalar(values, index, address); /// A64: LD4 { Vn.4H, Vn+1.4H, Vn+2.4H, Vn+3.4H }[Vm], [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) LoadAndInsertScalar((Vector64, Vector64, Vector64, Vector64) values, [ConstantExpected(Max = (byte)(3))] byte index, ushort* address) => LoadAndInsertScalar(values, index, address); /// A64: LD4 { Vn.2S, Vn+1.2S, Vn+2.2S, Vn+3.2S }[Vm], [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) LoadAndInsertScalar((Vector64, Vector64, Vector64, Vector64) values, [ConstantExpected(Max = (byte)(1))] byte index, int* address) => LoadAndInsertScalar(values, index, address); /// A64: LD4 { Vn.2S, Vn+1.2S, Vn+2.2S, Vn+3.2S }[Vm], [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) LoadAndInsertScalar((Vector64, Vector64, Vector64, Vector64) values, [ConstantExpected(Max = (byte)(1))] byte index, uint* address) => LoadAndInsertScalar(values, index, address); /// A64: LD4 { Vn.2S, Vn+1.2S, Vn+2.2S, Vn+3.2S }[Vm], [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) LoadAndInsertScalar((Vector64, Vector64, Vector64, Vector64) values, [ConstantExpected(Max = (byte)(1))] byte index, float* address) => LoadAndInsertScalar(values, index, address); /// @@ -9014,7 +8671,6 @@ internal Arm64() { } /// A32: VLD1.8 { Dd[] }, [Rn] /// A64: LD1R { Vt.8B }, [Xn] /// - [RequiresUnsafe] public static unsafe Vector64 LoadAndReplicateToVector64(byte* address) => LoadAndReplicateToVector64(address); /// @@ -9022,7 +8678,6 @@ internal Arm64() { } /// A32: VLD1.16 { Dd[] }, [Rn] /// A64: LD1R { Vt.4H }, [Xn] /// - [RequiresUnsafe] public static unsafe Vector64 LoadAndReplicateToVector64(short* address) => LoadAndReplicateToVector64(address); /// @@ -9030,7 +8685,6 @@ internal Arm64() { } /// A32: VLD1.32 { Dd[] }, [Rn] /// A64: LD1R { Vt.2S }, [Xn] /// - [RequiresUnsafe] public static unsafe Vector64 LoadAndReplicateToVector64(int* address) => LoadAndReplicateToVector64(address); /// @@ -9038,7 +8692,6 @@ internal Arm64() { } /// A32: VLD1.8 { Dd[] }, [Rn] /// A64: LD1R { Vt.8B }, [Xn] /// - [RequiresUnsafe] public static unsafe Vector64 LoadAndReplicateToVector64(sbyte* address) => LoadAndReplicateToVector64(address); /// @@ -9046,7 +8699,6 @@ internal Arm64() { } /// A32: VLD1.32 { Dd[] }, [Rn] /// A64: LD1R { Vt.2S }, [Xn] /// - [RequiresUnsafe] public static unsafe Vector64 LoadAndReplicateToVector64(float* address) => LoadAndReplicateToVector64(address); /// @@ -9054,7 +8706,6 @@ internal Arm64() { } /// A32: VLD1.16 { Dd[] }, [Rn] /// A64: LD1R { Vt.4H }, [Xn] /// - [RequiresUnsafe] public static unsafe Vector64 LoadAndReplicateToVector64(ushort* address) => LoadAndReplicateToVector64(address); /// @@ -9062,7 +8713,6 @@ internal Arm64() { } /// A32: VLD1.32 { Dd[] }, [Rn] /// A64: LD1R { Vt.2S }, [Xn] /// - [RequiresUnsafe] public static unsafe Vector64 LoadAndReplicateToVector64(uint* address) => LoadAndReplicateToVector64(address); /// @@ -9070,7 +8720,6 @@ internal Arm64() { } /// A32: VLD1.8 { Dd[], Dd+1[] }, [Rn] /// A64: LD1R { Vt.16B }, [Xn] /// - [RequiresUnsafe] public static unsafe Vector128 LoadAndReplicateToVector128(byte* address) => LoadAndReplicateToVector128(address); /// @@ -9078,7 +8727,6 @@ internal Arm64() { } /// A32: VLD1.16 { Dd[], Dd+1[] }, [Rn] /// A64: LD1R { Vt.8H }, [Xn] /// - [RequiresUnsafe] public static unsafe Vector128 LoadAndReplicateToVector128(short* address) => LoadAndReplicateToVector128(address); /// @@ -9086,7 +8734,6 @@ internal Arm64() { } /// A32: VLD1.32 { Dd[], Dd+1[] }, [Rn] /// A64: LD1R { Vt.4S }, [Xn] /// - [RequiresUnsafe] public static unsafe Vector128 LoadAndReplicateToVector128(int* address) => LoadAndReplicateToVector128(address); /// @@ -9094,7 +8741,6 @@ internal Arm64() { } /// A32: VLD1.8 { Dd[], Dd+1[] }, [Rn] /// A64: LD1R { Vt.16B }, [Xn] /// - [RequiresUnsafe] public static unsafe Vector128 LoadAndReplicateToVector128(sbyte* address) => LoadAndReplicateToVector128(address); /// @@ -9102,7 +8748,6 @@ internal Arm64() { } /// A32: VLD1.32 { Dd[], Dd+1[] }, [Rn] /// A64: LD1R { Vt.4S }, [Xn] /// - [RequiresUnsafe] public static unsafe Vector128 LoadAndReplicateToVector128(float* address) => LoadAndReplicateToVector128(address); /// @@ -9110,7 +8755,6 @@ internal Arm64() { } /// A32: VLD1.16 { Dd[], Dd+1[] }, [Rn] /// A64: LD1R { Vt.8H }, [Xn] /// - [RequiresUnsafe] public static unsafe Vector128 LoadAndReplicateToVector128(ushort* address) => LoadAndReplicateToVector128(address); /// @@ -9118,91 +8762,69 @@ internal Arm64() { } /// A32: VLD1.32 { Dd[], Dd+1[] }, [Rn] /// A64: LD1R { Vt.4S }, [Xn] /// - [RequiresUnsafe] public static unsafe Vector128 LoadAndReplicateToVector128(uint* address) => LoadAndReplicateToVector128(address); /// A64: LD2R { Vn.8B, Vn+1.8B }, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) LoadAndReplicateToVector64x2(byte* address) => LoadAndReplicateToVector64x2(address); /// A64: LD2R { Vn.8B, Vn+1.8B }, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) LoadAndReplicateToVector64x2(sbyte* address) => LoadAndReplicateToVector64x2(address); /// A64: LD2R { Vn.4H, Vn+1.4H }, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) LoadAndReplicateToVector64x2(short* address) => LoadAndReplicateToVector64x2(address); /// A64: LD2R { Vn.4H, Vn+1.4H }, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) LoadAndReplicateToVector64x2(ushort* address) => LoadAndReplicateToVector64x2(address); /// A64: LD2R { Vn.2S, Vn+1.2S }, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) LoadAndReplicateToVector64x2(int* address) => LoadAndReplicateToVector64x2(address); /// A64: LD2R { Vn.2S, Vn+1.2S }, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) LoadAndReplicateToVector64x2(uint* address) => LoadAndReplicateToVector64x2(address); /// A64: LD2R { Vn.2S, Vn+1.2S }, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) LoadAndReplicateToVector64x2(float* address) => LoadAndReplicateToVector64x2(address); /// A64: LD3R { Vn.8B, Vn+1.8B, Vn+2.8B }, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3) LoadAndReplicateToVector64x3(byte* address) => LoadAndReplicateToVector64x3(address); /// A64: LD3R { Vn.8B, Vn+1.8B, Vn+2.8B }, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3) LoadAndReplicateToVector64x3(sbyte* address) => LoadAndReplicateToVector64x3(address); /// A64: LD3R { Vn.4H, Vn+1.4H, Vn+2.4H }, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3) LoadAndReplicateToVector64x3(short* address) => LoadAndReplicateToVector64x3(address); /// A64: LD3R { Vn.4H, Vn+1.4H, Vn+2.4H }, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3) LoadAndReplicateToVector64x3(ushort* address) => LoadAndReplicateToVector64x3(address); /// A64: LD3R { Vn.2S, Vn+1.2S, Vn+2.2S }, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3) LoadAndReplicateToVector64x3(int* address) => LoadAndReplicateToVector64x3(address); /// A64: LD3R { Vn.2S, Vn+1.2S, Vn+2.2S }, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3) LoadAndReplicateToVector64x3(uint* address) => LoadAndReplicateToVector64x3(address); /// A64: LD3R { Vn.2S, Vn+1.2S, Vn+2.2S }, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3) LoadAndReplicateToVector64x3(float* address) => LoadAndReplicateToVector64x3(address); /// A64: LD4R { Vn.8B, Vn+1.8B, Vn+2.8B, Vn+3.8B }, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) LoadAndReplicateToVector64x4(byte* address) => LoadAndReplicateToVector64x4(address); /// A64: LD4R { Vn.8B, Vn+1.8B, Vn+2.8B, Vn+3.8B }, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) LoadAndReplicateToVector64x4(sbyte* address) => LoadAndReplicateToVector64x4(address); /// A64: LD4R { Vn.4H, Vn+1.4H, Vn+2.4H, Vn+3.4H }, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) LoadAndReplicateToVector64x4(short* address) => LoadAndReplicateToVector64x4(address); /// A64: LD4R { Vn.4H, Vn+1.4H, Vn+2.4H, Vn+3.4H }, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) LoadAndReplicateToVector64x4(ushort* address) => LoadAndReplicateToVector64x4(address); /// A64: LD4R { Vn.2S, Vn+1.2S, Vn+2.2S, Vn+3.2S }, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) LoadAndReplicateToVector64x4(int* address) => LoadAndReplicateToVector64x4(address); /// A64: LD4R { Vn.2S, Vn+1.2S, Vn+2.2S, Vn+3.2S }, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) LoadAndReplicateToVector64x4(uint* address) => LoadAndReplicateToVector64x4(address); /// A64: LD4R { Vn.2S, Vn+1.2S, Vn+2.2S, Vn+3.2S }, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) LoadAndReplicateToVector64x4(float* address) => LoadAndReplicateToVector64x4(address); /// @@ -9210,7 +8832,6 @@ internal Arm64() { } /// A32: VLD1.8 Dd, [Rn] /// A64: LD1 Vt.8B, [Xn] /// - [RequiresUnsafe] public static unsafe Vector64 LoadVector64(byte* address) => LoadVector64(address); /// @@ -9218,7 +8839,6 @@ internal Arm64() { } /// A32: VLD1.64 Dd, [Rn] /// A64: LD1 Vt.1D, [Xn] /// - [RequiresUnsafe] public static unsafe Vector64 LoadVector64(double* address) => LoadVector64(address); /// @@ -9226,7 +8846,6 @@ internal Arm64() { } /// A32: VLD1.16 Dd, [Rn] /// A64: LD1 Vt.4H, [Xn] /// - [RequiresUnsafe] public static unsafe Vector64 LoadVector64(short* address) => LoadVector64(address); /// @@ -9234,7 +8853,6 @@ internal Arm64() { } /// A32: VLD1.32 Dd, [Rn] /// A64: LD1 Vt.2S, [Xn] /// - [RequiresUnsafe] public static unsafe Vector64 LoadVector64(int* address) => LoadVector64(address); /// @@ -9242,7 +8860,6 @@ internal Arm64() { } /// A32: VLD1.64 Dd, [Rn] /// A64: LD1 Vt.1D, [Xn] /// - [RequiresUnsafe] public static unsafe Vector64 LoadVector64(long* address) => LoadVector64(address); /// @@ -9250,7 +8867,6 @@ internal Arm64() { } /// A32: VLD1.8 Dd, [Rn] /// A64: LD1 Vt.8B, [Xn] /// - [RequiresUnsafe] public static unsafe Vector64 LoadVector64(sbyte* address) => LoadVector64(address); /// @@ -9258,7 +8874,6 @@ internal Arm64() { } /// A32: VLD1.32 Dd, [Rn] /// A64: LD1 Vt.2S, [Xn] /// - [RequiresUnsafe] public static unsafe Vector64 LoadVector64(float* address) => LoadVector64(address); /// @@ -9266,7 +8881,6 @@ internal Arm64() { } /// A32: VLD1.16 Dd, [Rn] /// A64: LD1 Vt.4H, [Xn] /// - [RequiresUnsafe] public static unsafe Vector64 LoadVector64(ushort* address) => LoadVector64(address); /// @@ -9274,7 +8888,6 @@ internal Arm64() { } /// A32: VLD1.32 Dd, [Rn] /// A64: LD1 Vt.2S, [Xn] /// - [RequiresUnsafe] public static unsafe Vector64 LoadVector64(uint* address) => LoadVector64(address); /// @@ -9282,7 +8895,6 @@ internal Arm64() { } /// A32: VLD1.64 Dd, [Rn] /// A64: LD1 Vt.1D, [Xn] /// - [RequiresUnsafe] public static unsafe Vector64 LoadVector64(ulong* address) => LoadVector64(address); /// @@ -9290,7 +8902,6 @@ internal Arm64() { } /// A32: VLD1.8 Dd, Dd+1, [Rn] /// A64: LD1 Vt.16B, [Xn] /// - [RequiresUnsafe] public static unsafe Vector128 LoadVector128(byte* address) => LoadVector128(address); /// @@ -9298,7 +8909,6 @@ internal Arm64() { } /// A32: VLD1.64 Dd, Dd+1, [Rn] /// A64: LD1 Vt.2D, [Xn] /// - [RequiresUnsafe] public static unsafe Vector128 LoadVector128(double* address) => LoadVector128(address); /// @@ -9306,7 +8916,6 @@ internal Arm64() { } /// A32: VLD1.16 Dd, Dd+1, [Rn] /// A64: LD1 Vt.8H, [Xn] /// - [RequiresUnsafe] public static unsafe Vector128 LoadVector128(short* address) => LoadVector128(address); /// @@ -9314,7 +8923,6 @@ internal Arm64() { } /// A32: VLD1.32 Dd, Dd+1, [Rn] /// A64: LD1 Vt.4S, [Xn] /// - [RequiresUnsafe] public static unsafe Vector128 LoadVector128(int* address) => LoadVector128(address); /// @@ -9322,7 +8930,6 @@ internal Arm64() { } /// A32: VLD1.64 Dd, Dd+1, [Rn] /// A64: LD1 Vt.2D, [Xn] /// - [RequiresUnsafe] public static unsafe Vector128 LoadVector128(long* address) => LoadVector128(address); /// @@ -9330,7 +8937,6 @@ internal Arm64() { } /// A32: VLD1.8 Dd, Dd+1, [Rn] /// A64: LD1 Vt.16B, [Xn] /// - [RequiresUnsafe] public static unsafe Vector128 LoadVector128(sbyte* address) => LoadVector128(address); /// @@ -9338,7 +8944,6 @@ internal Arm64() { } /// A32: VLD1.32 Dd, Dd+1, [Rn] /// A64: LD1 Vt.4S, [Xn] /// - [RequiresUnsafe] public static unsafe Vector128 LoadVector128(float* address) => LoadVector128(address); /// @@ -9346,7 +8951,6 @@ internal Arm64() { } /// A32: VLD1.16 Dd, Dd+1, [Rn] /// A64: LD1 Vt.8H, [Xn] /// - [RequiresUnsafe] public static unsafe Vector128 LoadVector128(ushort* address) => LoadVector128(address); /// @@ -9354,7 +8958,6 @@ internal Arm64() { } /// A32: VLD1.32 Dd, Dd+1, [Rn] /// A64: LD1 Vt.4S, [Xn] /// - [RequiresUnsafe] public static unsafe Vector128 LoadVector128(uint* address) => LoadVector128(address); /// @@ -9362,175 +8965,132 @@ internal Arm64() { } /// A32: VLD1.64 Dd, Dd+1, [Rn] /// A64: LD1 Vt.2D, [Xn] /// - [RequiresUnsafe] public static unsafe Vector128 LoadVector128(ulong* address) => LoadVector128(address); /// A64: LD2 { Vn.8B, Vn+1.8B }, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) Load2xVector64AndUnzip(byte* address) => Load2xVector64AndUnzip(address); /// A64: LD2 { Vn.8B, Vn+1.8B }, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) Load2xVector64AndUnzip(sbyte* address) => Load2xVector64AndUnzip(address); /// A64: LD2 { Vn.4H, Vn+1.4H }, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) Load2xVector64AndUnzip(short* address) => Load2xVector64AndUnzip(address); /// A64: LD2 { Vn.4H, Vn+1.4H }, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) Load2xVector64AndUnzip(ushort* address) => Load2xVector64AndUnzip(address); /// A64: LD2 { Vn.2S, Vn+1.2S }, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) Load2xVector64AndUnzip(int* address) => Load2xVector64AndUnzip(address); /// A64: LD2 { Vn.2S, Vn+1.2S }, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) Load2xVector64AndUnzip(uint* address) => Load2xVector64AndUnzip(address); /// A64: LD2 { Vn.2S, Vn+1.2S }, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) Load2xVector64AndUnzip(float* address) => Load2xVector64AndUnzip(address); /// A64: LD3 { Vn.8B, Vn+1.8B, Vn+2.8B }, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3) Load3xVector64AndUnzip(byte* address) => Load3xVector64AndUnzip(address); /// A64: LD3 { Vn.8B, Vn+1.8B, Vn+2.8B }, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3) Load3xVector64AndUnzip(sbyte* address) => Load3xVector64AndUnzip(address); /// A64: LD3 { Vn.4H, Vn+1.4H, Vn+2.4H }, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3) Load3xVector64AndUnzip(short* address) => Load3xVector64AndUnzip(address); /// A64: LD3 { Vn.4H, Vn+1.4H, Vn+2.4H }, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3) Load3xVector64AndUnzip(ushort* address) => Load3xVector64AndUnzip(address); /// A64: LD3 { Vn.2S, Vn+1.2S, Vn+2.2S }, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3) Load3xVector64AndUnzip(int* address) => Load3xVector64AndUnzip(address); /// A64: LD3 { Vn.2S, Vn+1.2S, Vn+2.2S }, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3) Load3xVector64AndUnzip(uint* address) => Load3xVector64AndUnzip(address); /// A64: LD3 { Vn.2S, Vn+1.2S, Vn+2.2S }, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3) Load3xVector64AndUnzip(float* address) => Load3xVector64AndUnzip(address); /// A64: LD4 { Vn.8B, Vn+1.8B, Vn+2.8B, Vn+3.8B }, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) Load4xVector64AndUnzip(byte* address) => Load4xVector64AndUnzip(address); /// A64: LD4 { Vn.8B, Vn+1.8B, Vn+2.8B, Vn+3.8B }, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) Load4xVector64AndUnzip(sbyte* address) => Load4xVector64AndUnzip(address); /// A64: LD4 { Vn.4H, Vn+1.4H, Vn+2.4H, Vn+3.4H }, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) Load4xVector64AndUnzip(short* address) => Load4xVector64AndUnzip(address); /// A64: LD4 { Vn.4H, Vn+1.4H, Vn+2.4H, Vn+3.4H }, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) Load4xVector64AndUnzip(ushort* address) => Load4xVector64AndUnzip(address); /// A64: LD4 { Vn.2S, Vn+1.2S, Vn+2.2S, Vn+3.2S }, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) Load4xVector64AndUnzip(int* address) => Load4xVector64AndUnzip(address); /// A64: LD4 { Vn.2S, Vn+1.2S, Vn+2.2S, Vn+3.2S }, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) Load4xVector64AndUnzip(uint* address) => Load4xVector64AndUnzip(address); /// A64: LD4 { Vn.4S, Vn+1.4S, Vn+2.4S, Vn+3.2S }, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) Load4xVector64AndUnzip(float* address) => Load4xVector64AndUnzip(address); /// A64: LD1 { Vn.8B, Vn+1.8B }, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) Load2xVector64(byte* address) => Load2xVector64(address); /// A64: LD1 { Vn.8B, Vn+1.8B }, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) Load2xVector64(sbyte* address) => Load2xVector64(address); /// A64: LD1 { Vn.4H, Vn+1.4H }, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) Load2xVector64(short* address) => Load2xVector64(address); /// A64: LD1 { Vn.4H, Vn+1.4H }, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) Load2xVector64(ushort* address) => Load2xVector64(address); /// A64: LD1 { Vn.2S, Vn+1.2S }, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) Load2xVector64(int* address) => Load2xVector64(address); /// A64: LD1 { Vn.2S, Vn+1.2S }, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) Load2xVector64(uint* address) => Load2xVector64(address); /// A64: LD1 { Vn.2S, Vn+1.2S }, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) Load2xVector64(float* address) => Load2xVector64(address); /// A64: LD1 { Vn.8B, Vn+1.8B, Vn+2.8B }, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3) Load3xVector64(byte* address) => Load3xVector64(address); /// A64: LD1 { Vn.8B, Vn+1.8B, Vn+2.8B }, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3) Load3xVector64(sbyte* address) => Load3xVector64(address); /// A64: LD1 { Vn.4H, Vn+1.4H, Vn+2.4H }, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3) Load3xVector64(short* address) => Load3xVector64(address); /// A64: LD1 { Vn.4H, Vn+1.4H, Vn+2.4H }, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3) Load3xVector64(ushort* address) => Load3xVector64(address); /// A64: LD1 { Vn.2S, Vn+1.2S, Vn+2.2S }, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3) Load3xVector64(int* address) => Load3xVector64(address); /// A64: LD1 { Vn.2S, Vn+1.2S, Vn+2.2S }, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3) Load3xVector64(uint* address) => Load3xVector64(address); /// A64: LD1 { Vn.2S, Vn+1.2S, Vn+2.2S }, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3) Load3xVector64(float* address) => Load3xVector64(address); /// A64: LD1 { Vn.8B, Vn+1.8B, Vn+2.8B, Vn+3.8B }, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) Load4xVector64(byte* address) => Load4xVector64(address); /// A64: LD1 { Vn.8B, Vn+1.8B, Vn+2.8B, Vn+3.8B }, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) Load4xVector64(sbyte* address) => Load4xVector64(address); /// A64: LD1 { Vn.4H, Vn+1.4H, Vn+2.4H, Vn+3.4H }, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) Load4xVector64(short* address) => Load4xVector64(address); /// A64: LD1 { Vn.4H, Vn+1.4H, Vn+2.4H, Vn+3.4H }, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) Load4xVector64(ushort* address) => Load4xVector64(address); /// A64: LD1 { Vn.2S, Vn+1.2S, Vn+2.2S, Vn+3.2S }, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) Load4xVector64(int* address) => Load4xVector64(address); /// A64: LD1 { Vn.2S, Vn+1.2S, Vn+2.2S, Vn+3.2S }, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) Load4xVector64(uint* address) => Load4xVector64(address); /// A64: LD1 { Vn.2S, Vn+1.2S, Vn+2.2S, Vn+3.2S }, [Xn] - [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) Load4xVector64(float* address) => Load4xVector64(address); /// @@ -15395,7 +14955,6 @@ internal Arm64() { } /// A32: VST1.8 { Dd }, [Rn] /// A64: ST1 { Vt.8B }, [Xn] /// - [RequiresUnsafe] public static unsafe void Store(byte* address, Vector64 source) => Store(address, source); /// @@ -15403,7 +14962,6 @@ internal Arm64() { } /// A32: VST1.64 { Dd }, [Rn] /// A64: ST1 { Vt.1D }, [Xn] /// - [RequiresUnsafe] public static unsafe void Store(double* address, Vector64 source) => Store(address, source); /// @@ -15411,7 +14969,6 @@ internal Arm64() { } /// A32: VST1.16 { Dd }, [Rn] /// A64: ST1 {Vt.4H }, [Xn] /// - [RequiresUnsafe] public static unsafe void Store(short* address, Vector64 source) => Store(address, source); /// @@ -15419,7 +14976,6 @@ internal Arm64() { } /// A32: VST1.32 { Dd }, [Rn] /// A64: ST1 { Vt.2S }, [Xn] /// - [RequiresUnsafe] public static unsafe void Store(int* address, Vector64 source) => Store(address, source); /// @@ -15427,7 +14983,6 @@ internal Arm64() { } /// A32: VST1.64 { Dd }, [Rn] /// A64: ST1 { Vt.1D }, [Xn] /// - [RequiresUnsafe] public static unsafe void Store(long* address, Vector64 source) => Store(address, source); /// @@ -15435,7 +14990,6 @@ internal Arm64() { } /// A32: VST1.8 { Dd }, [Rn] /// A64: ST1 { Vt.8B }, [Xn] /// - [RequiresUnsafe] public static unsafe void Store(sbyte* address, Vector64 source) => Store(address, source); /// @@ -15443,7 +14997,6 @@ internal Arm64() { } /// A32: VST1.32 { Dd }, [Rn] /// A64: ST1 { Vt.2S }, [Xn] /// - [RequiresUnsafe] public static unsafe void Store(float* address, Vector64 source) => Store(address, source); /// @@ -15451,7 +15004,6 @@ internal Arm64() { } /// A32: VST1.16 { Dd }, [Rn] /// A64: ST1 { Vt.4H }, [Xn] /// - [RequiresUnsafe] public static unsafe void Store(ushort* address, Vector64 source) => Store(address, source); /// @@ -15459,7 +15011,6 @@ internal Arm64() { } /// A32: VST1.32 { Dd }, [Rn] /// A64: ST1 { Vt.2S }, [Xn] /// - [RequiresUnsafe] public static unsafe void Store(uint* address, Vector64 source) => Store(address, source); /// @@ -15467,7 +15018,6 @@ internal Arm64() { } /// A32: VST1.64 { Dd }, [Rn] /// A64: ST1 { Vt.1D }, [Xn] /// - [RequiresUnsafe] public static unsafe void Store(ulong* address, Vector64 source) => Store(address, source); /// @@ -15475,7 +15025,6 @@ internal Arm64() { } /// A32: VST1.8 { Dd, Dd+1 }, [Rn] /// A64: ST1 { Vt.16B }, [Xn] /// - [RequiresUnsafe] public static unsafe void Store(byte* address, Vector128 source) => Store(address, source); /// @@ -15483,7 +15032,6 @@ internal Arm64() { } /// A32: VST1.64 { Dd, Dd+1 }, [Rn] /// A64: ST1 { Vt.2D }, [Xn] /// - [RequiresUnsafe] public static unsafe void Store(double* address, Vector128 source) => Store(address, source); /// @@ -15491,7 +15039,6 @@ internal Arm64() { } /// A32: VST1.16 { Dd, Dd+1 }, [Rn] /// A64: ST1 { Vt.8H }, [Xn] /// - [RequiresUnsafe] public static unsafe void Store(short* address, Vector128 source) => Store(address, source); /// @@ -15499,7 +15046,6 @@ internal Arm64() { } /// A32: VST1.32 { Dd, Dd+1 }, [Rn] /// A64: ST1 { Vt.4S }, [Xn] /// - [RequiresUnsafe] public static unsafe void Store(int* address, Vector128 source) => Store(address, source); /// @@ -15507,7 +15053,6 @@ internal Arm64() { } /// A32: VST1.64 { Dd, Dd+1 }, [Rn] /// A64: ST1 { Vt.2D }, [Xn] /// - [RequiresUnsafe] public static unsafe void Store(long* address, Vector128 source) => Store(address, source); /// @@ -15515,7 +15060,6 @@ internal Arm64() { } /// A32: VST1.8 { Dd, Dd+1 }, [Rn] /// A64: ST1 { Vt.16B }, [Xn] /// - [RequiresUnsafe] public static unsafe void Store(sbyte* address, Vector128 source) => Store(address, source); /// @@ -15523,7 +15067,6 @@ internal Arm64() { } /// A32: VST1.32 { Dd, Dd+1 }, [Rn] /// A64: ST1 { Vt.4S }, [Xn] /// - [RequiresUnsafe] public static unsafe void Store(float* address, Vector128 source) => Store(address, source); /// @@ -15531,7 +15074,6 @@ internal Arm64() { } /// A32: VST1.16 { Dd, Dd+1 }, [Rn] /// A64: ST1 { Vt.8H }, [Xn] /// - [RequiresUnsafe] public static unsafe void Store(ushort* address, Vector128 source) => Store(address, source); /// @@ -15539,7 +15081,6 @@ internal Arm64() { } /// A32: VST1.32 { Dd, Dd+1 }, [Rn] /// A64: ST1 { Vt.4S }, [Xn] /// - [RequiresUnsafe] public static unsafe void Store(uint* address, Vector128 source) => Store(address, source); /// @@ -15547,7 +15088,6 @@ internal Arm64() { } /// A32: VST1.64 { Dd, Dd+1 }, [Rn] /// A64: ST1 { Vt.2D }, [Xn] /// - [RequiresUnsafe] public static unsafe void Store(ulong* address, Vector128 source) => Store(address, source); /// @@ -15555,7 +15095,6 @@ internal Arm64() { } /// A32: VST1.8 { Dd[index] }, [Rn] /// A64: ST1 { Vt.B }[index], [Xn] /// - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(byte* address, Vector64 value, [ConstantExpected(Max = (byte)(7))] byte index) => StoreSelectedScalar(address, value, index); /// @@ -15563,7 +15102,6 @@ internal Arm64() { } /// A32: VST1.16 { Dd[index] }, [Rn] /// A64: ST1 { Vt.H }[index], [Xn] /// - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(short* address, Vector64 value, [ConstantExpected(Max = (byte)(3))] byte index) => StoreSelectedScalar(address, value, index); /// @@ -15571,7 +15109,6 @@ internal Arm64() { } /// A32: VST1.32 { Dd[index] }, [Rn] /// A64: ST1 { Vt.S }[index], [Xn] /// - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(int* address, Vector64 value, [ConstantExpected(Max = (byte)(1))] byte index) => StoreSelectedScalar(address, value, index); /// @@ -15579,7 +15116,6 @@ internal Arm64() { } /// A32: VST1.8 { Dd[index] }, [Rn] /// A64: ST1 { Vt.B }[index], [Xn] /// - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(sbyte* address, Vector64 value, [ConstantExpected(Max = (byte)(7))] byte index) => StoreSelectedScalar(address, value, index); /// @@ -15587,7 +15123,6 @@ internal Arm64() { } /// A32: VST1.32 { Dd[index] }, [Rn] /// A64: ST1 { Vt.S }[index], [Xn] /// - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(float* address, Vector64 value, [ConstantExpected(Max = (byte)(1))] byte index) => StoreSelectedScalar(address, value, index); /// @@ -15595,7 +15130,6 @@ internal Arm64() { } /// A32: VST1.16 { Dd[index] }, [Rn] /// A64: ST1 { Vt.H }[index], [Xn] /// - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(ushort* address, Vector64 value, [ConstantExpected(Max = (byte)(3))] byte index) => StoreSelectedScalar(address, value, index); /// @@ -15603,7 +15137,6 @@ internal Arm64() { } /// A32: VST1.32 { Dd[index] }, [Rn] /// A64: ST1 { Vt.S }[index], [Xn] /// - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(uint* address, Vector64 value, [ConstantExpected(Max = (byte)(1))] byte index) => StoreSelectedScalar(address, value, index); /// @@ -15611,7 +15144,6 @@ internal Arm64() { } /// A32: VST1.8 { Dd[index] }, [Rn] /// A64: ST1 { Vt.B }[index], [Xn] /// - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(byte* address, Vector128 value, [ConstantExpected(Max = (byte)(15))] byte index) => StoreSelectedScalar(address, value, index); /// @@ -15619,7 +15151,6 @@ internal Arm64() { } /// A32: VSTR.64 Dd, [Rn] /// A64: ST1 { Vt.D }[index], [Xn] /// - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(double* address, Vector128 value, [ConstantExpected(Max = (byte)(1))] byte index) => StoreSelectedScalar(address, value, index); /// @@ -15627,7 +15158,6 @@ internal Arm64() { } /// A32: VST1.16 { Dd[index] }, [Rn] /// A64: ST1 { Vt.H }[index], [Xn] /// - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(short* address, Vector128 value, [ConstantExpected(Max = (byte)(7))] byte index) => StoreSelectedScalar(address, value, index); /// @@ -15635,7 +15165,6 @@ internal Arm64() { } /// A32: VST1.32 { Dd[index] }, [Rn] /// A64: ST1 { Vt.S }[index], [Xn] /// - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(int* address, Vector128 value, [ConstantExpected(Max = (byte)(3))] byte index) => StoreSelectedScalar(address, value, index); /// @@ -15643,7 +15172,6 @@ internal Arm64() { } /// A32: VSTR.64 Dd, [Rn] /// A64: ST1 { Vt.D }[index], [Xn] /// - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(long* address, Vector128 value, [ConstantExpected(Max = (byte)(1))] byte index) => StoreSelectedScalar(address, value, index); /// @@ -15651,7 +15179,6 @@ internal Arm64() { } /// A32: VST1.8 { Dd[index] }, [Rn] /// A64: ST1 { Vt.B }[index], [Xn] /// - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(sbyte* address, Vector128 value, [ConstantExpected(Max = (byte)(15))] byte index) => StoreSelectedScalar(address, value, index); /// @@ -15659,7 +15186,6 @@ internal Arm64() { } /// A32: VST1.32 { Dd[index] }, [Rn] /// A64: ST1 { Vt.S }[index], [Xn] /// - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(float* address, Vector128 value, [ConstantExpected(Max = (byte)(3))] byte index) => StoreSelectedScalar(address, value, index); /// @@ -15667,7 +15193,6 @@ internal Arm64() { } /// A32: VST1.16 { Dd[index] }, [Rn] /// A64: ST1 { Vt.H }[index], [Xn] /// - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(ushort* address, Vector128 value, [ConstantExpected(Max = (byte)(7))] byte index) => StoreSelectedScalar(address, value, index); /// @@ -15675,7 +15200,6 @@ internal Arm64() { } /// A32: VST1.32 { Dd[index] }, [Rn] /// A64: ST1 { Vt.S }[index], [Xn] /// - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(uint* address, Vector128 value, [ConstantExpected(Max = (byte)(3))] byte index) => StoreSelectedScalar(address, value, index); /// @@ -15683,259 +15207,195 @@ internal Arm64() { } /// A32: VSTR.64 Dd, [Rn] /// A64: ST1 { Vt.D }[index], [Xn] /// - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(ulong* address, Vector128 value, [ConstantExpected(Max = (byte)(1))] byte index) => StoreSelectedScalar(address, value, index); /// A64: ST2 { Vt.8B, Vt+1.8B }[index], [Xn] - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(byte* address, (Vector64 value1, Vector64 value2) value, [ConstantExpected(Max = (byte)(7))] byte index) => StoreSelectedScalar(address, value, index); /// A64: ST2 { Vt.8B, Vt+1.8B }[index], [Xn] - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(sbyte* address, (Vector64 value1, Vector64 value2) value, [ConstantExpected(Max = (byte)(7))] byte index) => StoreSelectedScalar(address, value, index); /// A64: ST2 { Vt.4H, Vt+1.4H }[index], [Xn] - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(short* address, (Vector64 value1, Vector64 value2) value, [ConstantExpected(Max = (byte)(3))] byte index) => StoreSelectedScalar(address, value, index); /// A64: ST2 { Vt.4H, Vt+1.4H }[index], [Xn] - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(ushort* address, (Vector64 value1, Vector64 value2) value, [ConstantExpected(Max = (byte)(3))] byte index) => StoreSelectedScalar(address, value, index); /// A64: ST2 { Vt.2S, Vt+1.2S }[index], [Xn] - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(int* address, (Vector64 value1, Vector64 value2) value, [ConstantExpected(Max = (byte)(1))] byte index) => StoreSelectedScalar(address, value, index); /// A64: ST2 { Vt.2S, Vt+1.2S }[index], [Xn] - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(uint* address, (Vector64 value1, Vector64 value2) value, [ConstantExpected(Max = (byte)(1))] byte index) => StoreSelectedScalar(address, value, index); /// A64: ST2 { Vt.2S, Vt+1.2S }[index], [Xn] - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(float* address, (Vector64 value1, Vector64 value2) value, [ConstantExpected(Max = (byte)(1))] byte index) => StoreSelectedScalar(address, value, index); /// A64: ST3 { Vt.8B, Vt+1.8B, Vt+2.8B }[index], [Xn] - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(byte* address, (Vector64 value1, Vector64 value2, Vector64 value3) value, [ConstantExpected(Max = (byte)(7))] byte index) => StoreSelectedScalar(address, value, index); /// A64: ST3 { Vt.8B, Vt+1.8B, Vt+2.8B }[index], [Xn] - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(sbyte* address, (Vector64 value1, Vector64 value2, Vector64 value3) value, [ConstantExpected(Max = (byte)(7))] byte index) => StoreSelectedScalar(address, value, index); /// A64: ST3 { Vt.4H, Vt+1.4H, Vt+2.4H }[index], [Xn] - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(short* address, (Vector64 value1, Vector64 value2, Vector64 value3) value, [ConstantExpected(Max = (byte)(3))] byte index) => StoreSelectedScalar(address, value, index); /// A64: ST3 { Vt.4H, Vt+1.4H, Vt+2.4H }[index], [Xn] - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(ushort* address, (Vector64 value1, Vector64 value2, Vector64 value3) value, [ConstantExpected(Max = (byte)(3))] byte index) => StoreSelectedScalar(address, value, index); /// A64: ST3 { Vt.2S, Vt+1.2S, Vt+2.2S }[index], [Xn] - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(int* address, (Vector64 value1, Vector64 value2, Vector64 value3) value, [ConstantExpected(Max = (byte)(1))] byte index) => StoreSelectedScalar(address, value, index); /// A64: ST3 { Vt.2S, Vt+1.2S, Vt+2.2S }[index], [Xn] - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(uint* address, (Vector64 value1, Vector64 value2, Vector64 value3) value, [ConstantExpected(Max = (byte)(1))] byte index) => StoreSelectedScalar(address, value, index); /// A64: ST2 { Vt.2S, Vt+1.2S, Vt+2.2S }[index], [Xn] - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(float* address, (Vector64 value1, Vector64 value2, Vector64 value3) value, [ConstantExpected(Max = (byte)(1))] byte index) => StoreSelectedScalar(address, value, index); /// A64: ST4 { Vt.8B, Vt+1.8B, Vt+2.8B, Vt+3.8B }[index], [Xn] - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(byte* address, (Vector64 value1, Vector64 value2, Vector64 value3, Vector64 value4) value, [ConstantExpected(Max = (byte)(7))] byte index) => StoreSelectedScalar(address, value, index); /// A64: ST4 { Vt.8B, Vt+1.8B, Vt+2.8B, Vt+3.8B }[index], [Xn] - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(sbyte* address, (Vector64 value1, Vector64 value2, Vector64 value3, Vector64 value4) value, [ConstantExpected(Max = (byte)(7))] byte index) => StoreSelectedScalar(address, value, index); /// A64: ST4 { Vt.4H, Vt+1.4H, Vt+2.4H, Vt+3.4H }[index], [Xn] - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(short* address, (Vector64 value1, Vector64 value2, Vector64 value3, Vector64 value4) value, [ConstantExpected(Max = (byte)(3))] byte index) => StoreSelectedScalar(address, value, index); /// A64: ST4 { Vt.4H, Vt+1.4H, Vt+2.4H, Vt+3.4H }[index], [Xn] - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(ushort* address, (Vector64 value1, Vector64 value2, Vector64 value3, Vector64 value4) value, [ConstantExpected(Max = (byte)(3))] byte index) => StoreSelectedScalar(address, value, index); /// A64: ST4 { Vt.2S, Vt+1.2S, Vt+2.2S, Vt+3.2S }[index], [Xn] - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(int* address, (Vector64 value1, Vector64 value2, Vector64 value3, Vector64 value4) value, [ConstantExpected(Max = (byte)(1))] byte index) => StoreSelectedScalar(address, value, index); /// A64: ST4 { Vt.2S, Vt+1.2S, Vt+2.2S, Vt+3.2S }[index], [Xn] - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(uint* address, (Vector64 value1, Vector64 value2, Vector64 value3, Vector64 value4) value, [ConstantExpected(Max = (byte)(1))] byte index) => StoreSelectedScalar(address, value, index); /// A64: ST4 { Vt.2S, Vt+1.2S, Vt+2.2S, Vt+3.2S }[index], [Xn] - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(float* address, (Vector64 value1, Vector64 value2, Vector64 value3, Vector64 value4) value, [ConstantExpected(Max = (byte)(1))] byte index) => StoreSelectedScalar(address, value, index); /// A64: ST2 { Vn.8B, Vn+1.8B }, [Xn] - [RequiresUnsafe] public static unsafe void StoreVectorAndZip(byte* address, (Vector64 Value1, Vector64 Value2) value) => StoreVectorAndZip(address, value); /// A64: ST2 { Vn.8B, Vn+1.8B }, [Xn] - [RequiresUnsafe] public static unsafe void StoreVectorAndZip(sbyte* address, (Vector64 Value1, Vector64 Value2) value) => StoreVectorAndZip(address, value); /// A64: ST2 { Vn.4H, Vn+1.4H }, [Xn] - [RequiresUnsafe] public static unsafe void StoreVectorAndZip(short* address, (Vector64 Value1, Vector64 Value2) value) => StoreVectorAndZip(address, value); /// A64: ST2 { Vn.4H, Vn+1.4H }, [Xn] - [RequiresUnsafe] public static unsafe void StoreVectorAndZip(ushort* address, (Vector64 Value1, Vector64 Value2) value) => StoreVectorAndZip(address, value); /// A64: ST2 { Vn.2S, Vn+1.2S }, [Xn] - [RequiresUnsafe] public static unsafe void StoreVectorAndZip(int* address, (Vector64 Value1, Vector64 Value2) value) => StoreVectorAndZip(address, value); /// A64: ST2 { Vn.2S, Vn+1.2S }, [Xn] - [RequiresUnsafe] public static unsafe void StoreVectorAndZip(uint* address, (Vector64 Value1, Vector64 Value2) value) => StoreVectorAndZip(address, value); /// A64: ST2 { Vn.2S, Vn+1.2S }, [Xn] - [RequiresUnsafe] public static unsafe void StoreVectorAndZip(float* address, (Vector64 Value1, Vector64 Value2) value) => StoreVectorAndZip(address, value); /// A64: ST3 { Vn.8B, Vn+1.8B, Vn+2.8B }, [Xn] - [RequiresUnsafe] public static unsafe void StoreVectorAndZip(byte* address, (Vector64 Value1, Vector64 Value2, Vector64 Value3) value) => StoreVectorAndZip(address, value); /// A64: ST3 { Vn.8B, Vn+1.8B, Vn+2.8B }, [Xn] - [RequiresUnsafe] public static unsafe void StoreVectorAndZip(sbyte* address, (Vector64 Value1, Vector64 Value2, Vector64 Value3) value) => StoreVectorAndZip(address, value); /// A64: ST3 { Vn.4H, Vn+1.4H, Vn+2.4H }, [Xn] - [RequiresUnsafe] public static unsafe void StoreVectorAndZip(short* address, (Vector64 Value1, Vector64 Value2, Vector64 Value3) value) => StoreVectorAndZip(address, value); /// A64: ST3 { Vn.4H, Vn+1.4H, Vn+2.4H }, [Xn] - [RequiresUnsafe] public static unsafe void StoreVectorAndZip(ushort* address, (Vector64 Value1, Vector64 Value2, Vector64 Value3) value) => StoreVectorAndZip(address, value); /// A64: ST3 { Vn.2S, Vn+1.2S, Vn+2.2S }, [Xn] - [RequiresUnsafe] public static unsafe void StoreVectorAndZip(int* address, (Vector64 Value1, Vector64 Value2, Vector64 Value3) value) => StoreVectorAndZip(address, value); /// A64: ST3 { Vn.2S, Vn+1.2S, Vn+2.2S }, [Xn] - [RequiresUnsafe] public static unsafe void StoreVectorAndZip(uint* address, (Vector64 Value1, Vector64 Value2, Vector64 Value3) value) => StoreVectorAndZip(address, value); /// A64: ST3 { Vn.2S, Vn+1.2S, Vn+2.2S }, [Xn] - [RequiresUnsafe] public static unsafe void StoreVectorAndZip(float* address, (Vector64 Value1, Vector64 Value2, Vector64 Value3) value) => StoreVectorAndZip(address, value); /// A64: ST4 { Vn.8B, Vn+1.8B, Vn+2.8B, Vn+3.8B }, [Xn] - [RequiresUnsafe] public static unsafe void StoreVectorAndZip(byte* address, (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) value) => StoreVectorAndZip(address, value); /// A64: ST4 { Vn.8B, Vn+1.8B, Vn+2.8B, Vn+3.8B }, [Xn] - [RequiresUnsafe] public static unsafe void StoreVectorAndZip(sbyte* address, (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) value) => StoreVectorAndZip(address, value); /// A64: ST4 { Vn.4H, Vn+1.4H, Vn+2.4H, Vn+3.4H }, [Xn] - [RequiresUnsafe] public static unsafe void StoreVectorAndZip(short* address, (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) value) => StoreVectorAndZip(address, value); /// A64: ST4 { Vn.4H, Vn+1.4H, Vn+2.4H, Vn+3.4H }, [Xn] - [RequiresUnsafe] public static unsafe void StoreVectorAndZip(ushort* address, (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) value) => StoreVectorAndZip(address, value); /// A64: ST4 { Vn.2S, Vn+1.2S, Vn+2.2S, Vn+3.2S }, [Xn] - [RequiresUnsafe] public static unsafe void StoreVectorAndZip(int* address, (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) value) => StoreVectorAndZip(address, value); /// A64: ST4 { Vn.2S, Vn+1.2S, Vn+2.2S, Vn+3.2S }, [Xn] - [RequiresUnsafe] public static unsafe void StoreVectorAndZip(uint* address, (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) value) => StoreVectorAndZip(address, value); /// A64: ST4 { Vn.2S, Vn+1.2S, Vn+2.2S, Vn+3.2S }, [Xn] - [RequiresUnsafe] public static unsafe void StoreVectorAndZip(float* address, (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) value) => StoreVectorAndZip(address, value); /// A64: ST1 { Vn.8B, Vn+1.8B }, [Xn] - [RequiresUnsafe] public static unsafe void Store(byte* address, (Vector64 Value1, Vector64 Value2) value) => Store(address, value); /// A64: ST1 { Vn.8B, Vn+1.8B }, [Xn] - [RequiresUnsafe] public static unsafe void Store(sbyte* address, (Vector64 Value1, Vector64 Value2) value) => Store(address, value); /// A64: ST1 { Vn.4H, Vn+1.4H }, [Xn] - [RequiresUnsafe] public static unsafe void Store(short* address, (Vector64 Value1, Vector64 Value2) value) => Store(address, value); /// A64: ST1 { Vn.4H, Vn+1.4H }, [Xn] - [RequiresUnsafe] public static unsafe void Store(ushort* address, (Vector64 Value1, Vector64 Value2) value) => Store(address, value); /// A64: ST1 { Vn.2S, Vn+1.2S }, [Xn] - [RequiresUnsafe] public static unsafe void Store(int* address, (Vector64 Value1, Vector64 Value2) value) => Store(address, value); /// A64: ST1 { Vn.2S, Vn+1.2S }, [Xn] - [RequiresUnsafe] public static unsafe void Store(uint* address, (Vector64 Value1, Vector64 Value2) value) => Store(address, value); /// A64: ST1 { Vn.2S, Vn+1.2S }, [Xn] - [RequiresUnsafe] public static unsafe void Store(float* address, (Vector64 Value1, Vector64 Value2) value) => Store(address, value); /// A64: ST1 { Vn.8B, Vn+1.8B, Vn+2.8B }, [Xn] - [RequiresUnsafe] public static unsafe void Store(byte* address, (Vector64 Value1, Vector64 Value2, Vector64 Value3) value) => Store(address, value); /// A64: ST1 { Vn.8B, Vn+1.8B, Vn+2.8B }, [Xn] - [RequiresUnsafe] public static unsafe void Store(sbyte* address, (Vector64 Value1, Vector64 Value2, Vector64 Value3) value) => Store(address, value); /// A64: ST1 { Vn.4H, Vn+1.4H, Vn+2.4H }, [Xn] - [RequiresUnsafe] public static unsafe void Store(short* address, (Vector64 Value1, Vector64 Value2, Vector64 Value3) value) => Store(address, value); /// A64: ST1 { Vn.4H, Vn+1.4H, Vn+2.4H }, [Xn] - [RequiresUnsafe] public static unsafe void Store(ushort* address, (Vector64 Value1, Vector64 Value2, Vector64 Value3) value) => Store(address, value); /// A64: ST1 { Vn.2S, Vn+1.2S, Vn+2.2S }, [Xn] - [RequiresUnsafe] public static unsafe void Store(int* address, (Vector64 Value1, Vector64 Value2, Vector64 Value3) value) => Store(address, value); /// A64: ST1 { Vn.2S, Vn+1.2S, Vn+2.2S }, [Xn] - [RequiresUnsafe] public static unsafe void Store(uint* address, (Vector64 Value1, Vector64 Value2, Vector64 Value3) value) => Store(address, value); /// A64: ST1 { Vn.2S, Vn+1.2S, Vn+2.2S }, [Xn] - [RequiresUnsafe] public static unsafe void Store(float* address, (Vector64 Value1, Vector64 Value2, Vector64 Value3) value) => Store(address, value); /// A64: ST1 { Vn.8B, Vn+1.8B, Vn+2.8B, Vn+3.8B }, [Xn] - [RequiresUnsafe] public static unsafe void Store(byte* address, (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) value) => Store(address, value); /// A64: ST1 { Vn.8B, Vn+1.8B, Vn+2.8B, Vn+3.8B }, [Xn] - [RequiresUnsafe] public static unsafe void Store(sbyte* address, (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) value) => Store(address, value); /// A64: ST1 { Vn.4H, Vn+1.4H, Vn+2.4H, Vn+3.4H }, [Xn] - [RequiresUnsafe] public static unsafe void Store(short* address, (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) value) => Store(address, value); /// A64: ST1 { Vn.4H, Vn+1.4H, Vn+2.4H, Vn+3.4H }, [Xn] - [RequiresUnsafe] public static unsafe void Store(ushort* address, (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) value) => Store(address, value); /// A64: ST1 { Vn.2S, Vn+1.2S, Vn+2.2S, Vn+3.2S }, [Xn] - [RequiresUnsafe] public static unsafe void Store(int* address, (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) value) => Store(address, value); /// A64: ST1 { Vn.2S, Vn+1.2S, Vn+2.2S, Vn+3.2S }, [Xn] - [RequiresUnsafe] public static unsafe void Store(uint* address, (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) value) => Store(address, value); /// A64: ST1 { Vn.2S, Vn+1.2S, Vn+2.2S, Vn+3.2S }, [Xn] - [RequiresUnsafe] public static unsafe void Store(float* address, (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) value) => Store(address, value); /// diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Arm/Sve.PlatformNotSupported.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Arm/Sve.PlatformNotSupported.cs index 97eef9134747c6..5d307832f5307c 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Arm/Sve.PlatformNotSupported.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Arm/Sve.PlatformNotSupported.cs @@ -3778,14 +3778,12 @@ internal Arm64() { } /// void svprfh_gather_[s32]index(svbool_t pg, const void *base, svint32_t indices, enum svprfop op) /// PRFH op, Pg, [Xbase, Zindices.S, SXTW #1] /// - [RequiresUnsafe] public static unsafe void GatherPrefetch16Bit(Vector mask, void* address, Vector indices, [ConstantExpected] SvePrefetchType prefetchType) { throw new PlatformNotSupportedException(); } /// /// void svprfh_gather_[s64]index(svbool_t pg, const void *base, svint64_t indices, enum svprfop op) /// PRFH op, Pg, [Xbase, Zindices.D, LSL #1] /// - [RequiresUnsafe] public static unsafe void GatherPrefetch16Bit(Vector mask, void* address, Vector indices, [ConstantExpected] SvePrefetchType prefetchType) { throw new PlatformNotSupportedException(); } // @@ -3799,7 +3797,6 @@ internal Arm64() { } /// void svprfh_gather_[u32]index(svbool_t pg, const void *base, svuint32_t indices, enum svprfop op) /// PRFH op, Pg, [Xbase, Zindices.S, UXTW #1] /// - [RequiresUnsafe] public static unsafe void GatherPrefetch16Bit(Vector mask, void* address, Vector indices, [ConstantExpected] SvePrefetchType prefetchType) { throw new PlatformNotSupportedException(); } /// @@ -3812,21 +3809,18 @@ internal Arm64() { } /// void svprfh_gather_[u64]index(svbool_t pg, const void *base, svuint64_t indices, enum svprfop op) /// PRFH op, Pg, [Xbase, Zindices.D, LSL #1] /// - [RequiresUnsafe] public static unsafe void GatherPrefetch16Bit(Vector mask, void* address, Vector indices, [ConstantExpected] SvePrefetchType prefetchType) { throw new PlatformNotSupportedException(); } /// /// void svprfh_gather_[s32]index(svbool_t pg, const void *base, svint32_t indices, enum svprfop op) /// PRFH op, Pg, [Xbase, Zindices.S, SXTW #1] /// - [RequiresUnsafe] public static unsafe void GatherPrefetch16Bit(Vector mask, void* address, Vector indices, [ConstantExpected] SvePrefetchType prefetchType) { throw new PlatformNotSupportedException(); } /// /// void svprfh_gather_[s64]index(svbool_t pg, const void *base, svint64_t indices, enum svprfop op) /// PRFH op, Pg, [Xbase, Zindices.D, LSL #1] /// - [RequiresUnsafe] public static unsafe void GatherPrefetch16Bit(Vector mask, void* address, Vector indices, [ConstantExpected] SvePrefetchType prefetchType) { throw new PlatformNotSupportedException(); } // @@ -3840,7 +3834,6 @@ internal Arm64() { } /// void svprfh_gather_[u32]index(svbool_t pg, const void *base, svuint32_t indices, enum svprfop op) /// PRFH op, Pg, [Xbase, Zindices.S, UXTW #1] /// - [RequiresUnsafe] public static unsafe void GatherPrefetch16Bit(Vector mask, void* address, Vector indices, [ConstantExpected] SvePrefetchType prefetchType) { throw new PlatformNotSupportedException(); } /// @@ -3853,7 +3846,6 @@ internal Arm64() { } /// void svprfh_gather_[u64]index(svbool_t pg, const void *base, svuint64_t indices, enum svprfop op) /// PRFH op, Pg, [Xbase, Zindices.D, LSL #1] /// - [RequiresUnsafe] public static unsafe void GatherPrefetch16Bit(Vector mask, void* address, Vector indices, [ConstantExpected] SvePrefetchType prefetchType) { throw new PlatformNotSupportedException(); } @@ -3863,14 +3855,12 @@ internal Arm64() { } /// void svprfw_gather_[s32]index(svbool_t pg, const void *base, svint32_t indices, enum svprfop op) /// PRFW op, Pg, [Xbase, Zindices.S, SXTW #2] /// - [RequiresUnsafe] public static unsafe void GatherPrefetch32Bit(Vector mask, void* address, Vector indices, [ConstantExpected] SvePrefetchType prefetchType) { throw new PlatformNotSupportedException(); } /// /// void svprfw_gather_[s64]index(svbool_t pg, const void *base, svint64_t indices, enum svprfop op) /// PRFW op, Pg, [Xbase, Zindices.D, LSL #2] /// - [RequiresUnsafe] public static unsafe void GatherPrefetch32Bit(Vector mask, void* address, Vector indices, [ConstantExpected] SvePrefetchType prefetchType) { throw new PlatformNotSupportedException(); } // @@ -3884,7 +3874,6 @@ internal Arm64() { } /// void svprfw_gather_[u32]index(svbool_t pg, const void *base, svuint32_t indices, enum svprfop op) /// PRFW op, Pg, [Xbase, Zindices.S, UXTW #2] /// - [RequiresUnsafe] public static unsafe void GatherPrefetch32Bit(Vector mask, void* address, Vector indices, [ConstantExpected] SvePrefetchType prefetchType) { throw new PlatformNotSupportedException(); } /// @@ -3897,21 +3886,18 @@ internal Arm64() { } /// void svprfw_gather_[u64]index(svbool_t pg, const void *base, svuint64_t indices, enum svprfop op) /// PRFW op, Pg, [Xbase, Zindices.D, LSL #2] /// - [RequiresUnsafe] public static unsafe void GatherPrefetch32Bit(Vector mask, void* address, Vector indices, [ConstantExpected] SvePrefetchType prefetchType) { throw new PlatformNotSupportedException(); } /// /// void svprfw_gather_[s32]index(svbool_t pg, const void *base, svint32_t indices, enum svprfop op) /// PRFW op, Pg, [Xbase, Zindices.S, SXTW #2] /// - [RequiresUnsafe] public static unsafe void GatherPrefetch32Bit(Vector mask, void* address, Vector indices, [ConstantExpected] SvePrefetchType prefetchType) { throw new PlatformNotSupportedException(); } /// /// void svprfw_gather_[s64]index(svbool_t pg, const void *base, svint64_t indices, enum svprfop op) /// PRFW op, Pg, [Xbase, Zindices.D, LSL #2] /// - [RequiresUnsafe] public static unsafe void GatherPrefetch32Bit(Vector mask, void* address, Vector indices, [ConstantExpected] SvePrefetchType prefetchType) { throw new PlatformNotSupportedException(); } // @@ -3925,7 +3911,6 @@ internal Arm64() { } /// void svprfw_gather_[u32]index(svbool_t pg, const void *base, svuint32_t indices, enum svprfop op) /// PRFW op, Pg, [Xbase, Zindices.S, UXTW #2] /// - [RequiresUnsafe] public static unsafe void GatherPrefetch32Bit(Vector mask, void* address, Vector indices, [ConstantExpected] SvePrefetchType prefetchType) { throw new PlatformNotSupportedException(); } /// @@ -3938,7 +3923,6 @@ internal Arm64() { } /// void svprfw_gather_[u64]index(svbool_t pg, const void *base, svuint64_t indices, enum svprfop op) /// PRFW op, Pg, [Xbase, Zindices.D, LSL #2] /// - [RequiresUnsafe] public static unsafe void GatherPrefetch32Bit(Vector mask, void* address, Vector indices, [ConstantExpected] SvePrefetchType prefetchType) { throw new PlatformNotSupportedException(); } @@ -3948,14 +3932,12 @@ internal Arm64() { } /// void svprfd_gather_[s32]index(svbool_t pg, const void *base, svint32_t indices, enum svprfop op) /// PRFD op, Pg, [Xbase, Zindices.S, SXTW #3] /// - [RequiresUnsafe] public static unsafe void GatherPrefetch64Bit(Vector mask, void* address, Vector indices, [ConstantExpected] SvePrefetchType prefetchType) { throw new PlatformNotSupportedException(); } /// /// void svprfd_gather_[s64]index(svbool_t pg, const void *base, svint64_t indices, enum svprfop op) /// PRFD op, Pg, [Xbase, Zindices.D, LSL #3] /// - [RequiresUnsafe] public static unsafe void GatherPrefetch64Bit(Vector mask, void* address, Vector indices, [ConstantExpected] SvePrefetchType prefetchType) { throw new PlatformNotSupportedException(); } // @@ -3969,7 +3951,6 @@ internal Arm64() { } /// void svprfd_gather_[u32]index(svbool_t pg, const void *base, svuint32_t indices, enum svprfop op) /// PRFD op, Pg, [Xbase, Zindices.S, UXTW #3] /// - [RequiresUnsafe] public static unsafe void GatherPrefetch64Bit(Vector mask, void* address, Vector indices, [ConstantExpected] SvePrefetchType prefetchType) { throw new PlatformNotSupportedException(); } /// @@ -3982,21 +3963,18 @@ internal Arm64() { } /// void svprfd_gather_[u64]index(svbool_t pg, const void *base, svuint64_t indices, enum svprfop op) /// PRFD op, Pg, [Xbase, Zindices.D, LSL #3] /// - [RequiresUnsafe] public static unsafe void GatherPrefetch64Bit(Vector mask, void* address, Vector indices, [ConstantExpected] SvePrefetchType prefetchType) { throw new PlatformNotSupportedException(); } /// /// void svprfd_gather_[s32]index(svbool_t pg, const void *base, svint32_t indices, enum svprfop op) /// PRFD op, Pg, [Xbase, Zindices.S, SXTW #3] /// - [RequiresUnsafe] public static unsafe void GatherPrefetch64Bit(Vector mask, void* address, Vector indices, [ConstantExpected] SvePrefetchType prefetchType) { throw new PlatformNotSupportedException(); } /// /// void svprfd_gather_[s64]index(svbool_t pg, const void *base, svint64_t indices, enum svprfop op) /// PRFD op, Pg, [Xbase, Zindices.D, LSL #3] /// - [RequiresUnsafe] public static unsafe void GatherPrefetch64Bit(Vector mask, void* address, Vector indices, [ConstantExpected] SvePrefetchType prefetchType) { throw new PlatformNotSupportedException(); } // @@ -4010,7 +3988,6 @@ internal Arm64() { } /// void svprfd_gather_[u32]index(svbool_t pg, const void *base, svuint32_t indices, enum svprfop op) /// PRFD op, Pg, [Xbase, Zindices.S, UXTW #3] /// - [RequiresUnsafe] public static unsafe void GatherPrefetch64Bit(Vector mask, void* address, Vector indices, [ConstantExpected] SvePrefetchType prefetchType) { throw new PlatformNotSupportedException(); } /// @@ -4023,7 +4000,6 @@ internal Arm64() { } /// void svprfd_gather_[u64]index(svbool_t pg, const void *base, svuint64_t indices, enum svprfop op) /// PRFD op, Pg, [Xbase, Zindices.D, LSL #3] /// - [RequiresUnsafe] public static unsafe void GatherPrefetch64Bit(Vector mask, void* address, Vector indices, [ConstantExpected] SvePrefetchType prefetchType) { throw new PlatformNotSupportedException(); } @@ -4033,14 +4009,12 @@ internal Arm64() { } /// void svprfb_gather_[s32]offset(svbool_t pg, const void *base, svint32_t offsets, enum svprfop op) /// PRFB op, Pg, [Xbase, Zoffsets.S, SXTW] /// - [RequiresUnsafe] public static unsafe void GatherPrefetch8Bit(Vector mask, void* address, Vector offsets, [ConstantExpected] SvePrefetchType prefetchType) { throw new PlatformNotSupportedException(); } /// /// void svprfb_gather_[s64]offset(svbool_t pg, const void *base, svint64_t offsets, enum svprfop op) /// PRFB op, Pg, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe void GatherPrefetch8Bit(Vector mask, void* address, Vector offsets, [ConstantExpected] SvePrefetchType prefetchType) { throw new PlatformNotSupportedException(); } // @@ -4054,7 +4028,6 @@ internal Arm64() { } /// void svprfb_gather_[u32]offset(svbool_t pg, const void *base, svuint32_t offsets, enum svprfop op) /// PRFB op, Pg, [Xbase, Zoffsets.S, UXTW] /// - [RequiresUnsafe] public static unsafe void GatherPrefetch8Bit(Vector mask, void* address, Vector offsets, [ConstantExpected] SvePrefetchType prefetchType) { throw new PlatformNotSupportedException(); } /// @@ -4067,21 +4040,18 @@ internal Arm64() { } /// void svprfb_gather_[u64]offset(svbool_t pg, const void *base, svuint64_t offsets, enum svprfop op) /// PRFB op, Pg, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe void GatherPrefetch8Bit(Vector mask, void* address, Vector offsets, [ConstantExpected] SvePrefetchType prefetchType) { throw new PlatformNotSupportedException(); } /// /// void svprfb_gather_[s32]offset(svbool_t pg, const void *base, svint32_t offsets, enum svprfop op) /// PRFB op, Pg, [Xbase, Zoffsets.S, SXTW] /// - [RequiresUnsafe] public static unsafe void GatherPrefetch8Bit(Vector mask, void* address, Vector offsets, [ConstantExpected] SvePrefetchType prefetchType) { throw new PlatformNotSupportedException(); } /// /// void svprfb_gather_[s64]offset(svbool_t pg, const void *base, svint64_t offsets, enum svprfop op) /// PRFB op, Pg, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe void GatherPrefetch8Bit(Vector mask, void* address, Vector offsets, [ConstantExpected] SvePrefetchType prefetchType) { throw new PlatformNotSupportedException(); } // @@ -4095,7 +4065,6 @@ internal Arm64() { } /// void svprfb_gather_[u32]offset(svbool_t pg, const void *base, svuint32_t offsets, enum svprfop op) /// PRFB op, Pg, [Xbase, Zoffsets.S, UXTW] /// - [RequiresUnsafe] public static unsafe void GatherPrefetch8Bit(Vector mask, void* address, Vector offsets, [ConstantExpected] SvePrefetchType prefetchType) { throw new PlatformNotSupportedException(); } /// @@ -4108,7 +4077,6 @@ internal Arm64() { } /// void svprfb_gather_[u64]offset(svbool_t pg, const void *base, svuint64_t offsets, enum svprfop op) /// PRFB op, Pg, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe void GatherPrefetch8Bit(Vector mask, void* address, Vector offsets, [ConstantExpected] SvePrefetchType prefetchType) { throw new PlatformNotSupportedException(); } @@ -4118,7 +4086,6 @@ internal Arm64() { } /// svfloat64_t svld1_gather_[s64]index[_f64](svbool_t pg, const float64_t *base, svint64_t indices) /// LD1D Zresult.D, Pg/Z, [Xbase, Zindices.D, LSL #3] /// - [RequiresUnsafe] public static unsafe Vector GatherVector(Vector mask, double* address, Vector indices) { throw new PlatformNotSupportedException(); } /// @@ -4131,14 +4098,12 @@ internal Arm64() { } /// svfloat64_t svld1_gather_[u64]index[_f64](svbool_t pg, const float64_t *base, svuint64_t indices) /// LD1D Zresult.D, Pg/Z, [Xbase, Zindices.D, LSL #3] /// - [RequiresUnsafe] public static unsafe Vector GatherVector(Vector mask, double* address, Vector indices) { throw new PlatformNotSupportedException(); } /// /// svint32_t svld1_gather_[s32]index[_s32](svbool_t pg, const int32_t *base, svint32_t indices) /// LD1W Zresult.S, Pg/Z, [Xbase, Zindices.S, SXTW #2] /// - [RequiresUnsafe] public static unsafe Vector GatherVector(Vector mask, int* address, Vector indices) { throw new PlatformNotSupportedException(); } // @@ -4152,14 +4117,12 @@ internal Arm64() { } /// svint32_t svld1_gather_[u32]index[_s32](svbool_t pg, const int32_t *base, svuint32_t indices) /// LD1W Zresult.S, Pg/Z, [Xbase, Zindices.S, UXTW #2] /// - [RequiresUnsafe] public static unsafe Vector GatherVector(Vector mask, int* address, Vector indices) { throw new PlatformNotSupportedException(); } /// /// svint64_t svld1_gather_[s64]index[_s64](svbool_t pg, const int64_t *base, svint64_t indices) /// LD1D Zresult.D, Pg/Z, [Xbase, Zindices.D, LSL #3] /// - [RequiresUnsafe] public static unsafe Vector GatherVector(Vector mask, long* address, Vector indices) { throw new PlatformNotSupportedException(); } /// @@ -4172,14 +4135,12 @@ internal Arm64() { } /// svint64_t svld1_gather_[u64]index[_s64](svbool_t pg, const int64_t *base, svuint64_t indices) /// LD1D Zresult.D, Pg/Z, [Xbase, Zindices.D, LSL #3] /// - [RequiresUnsafe] public static unsafe Vector GatherVector(Vector mask, long* address, Vector indices) { throw new PlatformNotSupportedException(); } /// /// svfloat32_t svld1_gather_[s32]index[_f32](svbool_t pg, const float32_t *base, svint32_t indices) /// LD1W Zresult.S, Pg/Z, [Xbase, Zindices.S, SXTW #2] /// - [RequiresUnsafe] public static unsafe Vector GatherVector(Vector mask, float* address, Vector indices) { throw new PlatformNotSupportedException(); } // @@ -4193,14 +4154,12 @@ internal Arm64() { } /// svfloat32_t svld1_gather_[u32]index[_f32](svbool_t pg, const float32_t *base, svuint32_t indices) /// LD1W Zresult.S, Pg/Z, [Xbase, Zindices.S, UXTW #2] /// - [RequiresUnsafe] public static unsafe Vector GatherVector(Vector mask, float* address, Vector indices) { throw new PlatformNotSupportedException(); } /// /// svuint32_t svld1_gather_[s32]index[_u32](svbool_t pg, const uint32_t *base, svint32_t indices) /// LD1W Zresult.S, Pg/Z, [Xbase, Zindices.S, SXTW #2] /// - [RequiresUnsafe] public static unsafe Vector GatherVector(Vector mask, uint* address, Vector indices) { throw new PlatformNotSupportedException(); } // @@ -4214,14 +4173,12 @@ internal Arm64() { } /// svuint32_t svld1_gather_[u32]index[_u32](svbool_t pg, const uint32_t *base, svuint32_t indices) /// LD1W Zresult.S, Pg/Z, [Xbase, Zindices.S, UXTW #2] /// - [RequiresUnsafe] public static unsafe Vector GatherVector(Vector mask, uint* address, Vector indices) { throw new PlatformNotSupportedException(); } /// /// svuint64_t svld1_gather_[s64]index[_u64](svbool_t pg, const uint64_t *base, svint64_t indices) /// LD1D Zresult.D, Pg/Z, [Xbase, Zindices.D, LSL #3] /// - [RequiresUnsafe] public static unsafe Vector GatherVector(Vector mask, ulong* address, Vector indices) { throw new PlatformNotSupportedException(); } /// @@ -4234,7 +4191,6 @@ internal Arm64() { } /// svuint64_t svld1_gather_[u64]index[_u64](svbool_t pg, const uint64_t *base, svuint64_t indices) /// LD1D Zresult.D, Pg/Z, [Xbase, Zindices.D, LSL #3] /// - [RequiresUnsafe] public static unsafe Vector GatherVector(Vector mask, ulong* address, Vector indices) { throw new PlatformNotSupportedException(); } @@ -4244,7 +4200,6 @@ internal Arm64() { } /// svint32_t svld1ub_gather_[s32]offset_s32(svbool_t pg, const uint8_t *base, svint32_t offsets) /// LD1B Zresult.S, Pg/Z, [Xbase, Zoffsets.S, SXTW] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorByteZeroExtend(Vector mask, byte* address, Vector indices) { throw new PlatformNotSupportedException(); } // @@ -4258,14 +4213,12 @@ internal Arm64() { } /// svint32_t svld1ub_gather_[u32]offset_s32(svbool_t pg, const uint8_t *base, svuint32_t offsets) /// LD1B Zresult.S, Pg/Z, [Xbase, Zoffsets.S, UXTW] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorByteZeroExtend(Vector mask, byte* address, Vector indices) { throw new PlatformNotSupportedException(); } /// /// svint64_t svld1ub_gather_[s64]offset_s64(svbool_t pg, const uint8_t *base, svint64_t offsets) /// LD1B Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorByteZeroExtend(Vector mask, byte* address, Vector indices) { throw new PlatformNotSupportedException(); } /// @@ -4278,14 +4231,12 @@ internal Arm64() { } /// svint64_t svld1ub_gather_[u64]offset_s64(svbool_t pg, const uint8_t *base, svuint64_t offsets) /// LD1B Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorByteZeroExtend(Vector mask, byte* address, Vector indices) { throw new PlatformNotSupportedException(); } /// /// svuint32_t svld1ub_gather_[s32]offset_u32(svbool_t pg, const uint8_t *base, svint32_t offsets) /// LD1B Zresult.S, Pg/Z, [Xbase, Zoffsets.S, SXTW] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorByteZeroExtend(Vector mask, byte* address, Vector indices) { throw new PlatformNotSupportedException(); } // @@ -4299,14 +4250,12 @@ internal Arm64() { } /// svuint32_t svld1ub_gather_[u32]offset_u32(svbool_t pg, const uint8_t *base, svuint32_t offsets) /// LD1B Zresult.S, Pg/Z, [Xbase, Zoffsets.S, UXTW] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorByteZeroExtend(Vector mask, byte* address, Vector indices) { throw new PlatformNotSupportedException(); } /// /// svuint64_t svld1ub_gather_[s64]offset_u64(svbool_t pg, const uint8_t *base, svint64_t offsets) /// LD1B Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorByteZeroExtend(Vector mask, byte* address, Vector indices) { throw new PlatformNotSupportedException(); } /// @@ -4319,7 +4268,6 @@ internal Arm64() { } /// svuint64_t svld1ub_gather_[u64]offset_u64(svbool_t pg, const uint8_t *base, svuint64_t offsets) /// LD1B Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorByteZeroExtend(Vector mask, byte* address, Vector indices) { throw new PlatformNotSupportedException(); } @@ -4329,7 +4277,6 @@ internal Arm64() { } /// svint32_t svldff1ub_gather_[s32]offset_s32(svbool_t pg, const uint8_t *base, svint32_t offsets) /// LDFF1B Zresult.S, Pg/Z, [Xbase, Zoffsets.S, SXTW] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorByteZeroExtendFirstFaulting(Vector mask, byte* address, Vector offsets) { throw new PlatformNotSupportedException(); } // @@ -4343,14 +4290,12 @@ internal Arm64() { } /// svint32_t svldff1ub_gather_[u32]offset_s32(svbool_t pg, const uint8_t *base, svuint32_t offsets) /// LDFF1B Zresult.S, Pg/Z, [Xbase, Zoffsets.S, UXTW] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorByteZeroExtendFirstFaulting(Vector mask, byte* address, Vector offsets) { throw new PlatformNotSupportedException(); } /// /// svint64_t svldff1ub_gather_[s64]offset_s64(svbool_t pg, const uint8_t *base, svint64_t offsets) /// LDFF1B Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorByteZeroExtendFirstFaulting(Vector mask, byte* address, Vector offsets) { throw new PlatformNotSupportedException(); } /// @@ -4363,14 +4308,12 @@ internal Arm64() { } /// svint64_t svldff1ub_gather_[u64]offset_s64(svbool_t pg, const uint8_t *base, svuint64_t offsets) /// LDFF1B Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorByteZeroExtendFirstFaulting(Vector mask, byte* address, Vector offsets) { throw new PlatformNotSupportedException(); } /// /// svuint32_t svldff1ub_gather_[s32]offset_u32(svbool_t pg, const uint8_t *base, svint32_t offsets) /// LDFF1B Zresult.S, Pg/Z, [Xbase, Zoffsets.S, SXTW] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorByteZeroExtendFirstFaulting(Vector mask, byte* address, Vector offsets) { throw new PlatformNotSupportedException(); } // @@ -4384,14 +4327,12 @@ internal Arm64() { } /// svuint32_t svldff1ub_gather_[u32]offset_u32(svbool_t pg, const uint8_t *base, svuint32_t offsets) /// LDFF1B Zresult.S, Pg/Z, [Xbase, Zoffsets.S, UXTW] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorByteZeroExtendFirstFaulting(Vector mask, byte* address, Vector offsets) { throw new PlatformNotSupportedException(); } /// /// svuint64_t svldff1ub_gather_[s64]offset_u64(svbool_t pg, const uint8_t *base, svint64_t offsets) /// LDFF1B Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorByteZeroExtendFirstFaulting(Vector mask, byte* address, Vector offsets) { throw new PlatformNotSupportedException(); } /// @@ -4404,7 +4345,6 @@ internal Arm64() { } /// svuint64_t svldff1ub_gather_[u64]offset_u64(svbool_t pg, const uint8_t *base, svuint64_t offsets) /// LDFF1B Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorByteZeroExtendFirstFaulting(Vector mask, byte* address, Vector offsets) { throw new PlatformNotSupportedException(); } @@ -4414,7 +4354,6 @@ internal Arm64() { } /// svfloat64_t svldff1_gather_[s64]index[_f64](svbool_t pg, const float64_t *base, svint64_t indices) /// LDFF1D Zresult.D, Pg/Z, [Xbase, Zindices.D, LSL #3] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorFirstFaulting(Vector mask, double* address, Vector indices) { throw new PlatformNotSupportedException(); } /// @@ -4427,7 +4366,6 @@ internal Arm64() { } /// svfloat64_t svldff1_gather_[u64]index[_f64](svbool_t pg, const float64_t *base, svuint64_t indices) /// LDFF1D Zresult.D, Pg/Z, [Xbase, Zindices.D, LSL #3] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorFirstFaulting(Vector mask, double* address, Vector indices) { throw new PlatformNotSupportedException(); } // @@ -4441,14 +4379,12 @@ internal Arm64() { } /// svint32_t svldff1_gather_[s32]index[_s32](svbool_t pg, const int32_t *base, svint32_t indices) /// LDFF1W Zresult.S, Pg/Z, [Xbase, Zindices.S, SXTW #2] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorFirstFaulting(Vector mask, int* address, Vector indices) { throw new PlatformNotSupportedException(); } /// /// svint32_t svldff1_gather_[u32]index[_s32](svbool_t pg, const int32_t *base, svuint32_t indices) /// LDFF1W Zresult.S, Pg/Z, [Xbase, Zindices.S, UXTW #2] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorFirstFaulting(Vector mask, int* address, Vector indices) { throw new PlatformNotSupportedException(); } /// @@ -4461,21 +4397,18 @@ internal Arm64() { } /// svint64_t svldff1_gather_[s64]index[_s64](svbool_t pg, const int64_t *base, svint64_t indices) /// LDFF1D Zresult.D, Pg/Z, [Xbase, Zindices.D, LSL #3] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorFirstFaulting(Vector mask, long* address, Vector indices) { throw new PlatformNotSupportedException(); } /// /// svint64_t svldff1_gather_[u64]index[_s64](svbool_t pg, const int64_t *base, svuint64_t indices) /// LDFF1D Zresult.D, Pg/Z, [Xbase, Zindices.D, LSL #3] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorFirstFaulting(Vector mask, long* address, Vector indices) { throw new PlatformNotSupportedException(); } /// /// svfloat32_t svldff1_gather_[s32]index[_f32](svbool_t pg, const float32_t *base, svint32_t indices) /// LDFF1W Zresult.S, Pg/Z, [Xbase, Zindices.S, SXTW #2] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorFirstFaulting(Vector mask, float* address, Vector indices) { throw new PlatformNotSupportedException(); } // @@ -4489,7 +4422,6 @@ internal Arm64() { } /// svfloat32_t svldff1_gather_[u32]index[_f32](svbool_t pg, const float32_t *base, svuint32_t indices) /// LDFF1W Zresult.S, Pg/Z, [Xbase, Zindices.S, UXTW #2] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorFirstFaulting(Vector mask, float* address, Vector indices) { throw new PlatformNotSupportedException(); } // @@ -4503,14 +4435,12 @@ internal Arm64() { } /// svuint32_t svldff1_gather_[s32]index[_u32](svbool_t pg, const uint32_t *base, svint32_t indices) /// LDFF1W Zresult.S, Pg/Z, [Xbase, Zindices.S, SXTW #2] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorFirstFaulting(Vector mask, uint* address, Vector indices) { throw new PlatformNotSupportedException(); } /// /// svuint32_t svldff1_gather_[u32]index[_u32](svbool_t pg, const uint32_t *base, svuint32_t indices) /// LDFF1W Zresult.S, Pg/Z, [Xbase, Zindices.S, UXTW #2] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorFirstFaulting(Vector mask, uint* address, Vector indices) { throw new PlatformNotSupportedException(); } /// @@ -4523,14 +4453,12 @@ internal Arm64() { } /// svuint64_t svldff1_gather_[s64]index[_u64](svbool_t pg, const uint64_t *base, svint64_t indices) /// LDFF1D Zresult.D, Pg/Z, [Xbase, Zindices.D, LSL #3] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorFirstFaulting(Vector mask, ulong* address, Vector indices) { throw new PlatformNotSupportedException(); } /// /// svuint64_t svldff1_gather_[u64]index[_u64](svbool_t pg, const uint64_t *base, svuint64_t indices) /// LDFF1D Zresult.D, Pg/Z, [Xbase, Zindices.D, LSL #3] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorFirstFaulting(Vector mask, ulong* address, Vector indices) { throw new PlatformNotSupportedException(); } @@ -4540,7 +4468,6 @@ internal Arm64() { } /// svint32_t svld1sh_gather_[s32]index_s32(svbool_t pg, const int16_t *base, svint32_t indices) /// LD1SH Zresult.S, Pg/Z, [Xbase, Zindices.S, SXTW #1] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorInt16SignExtend(Vector mask, short* address, Vector indices) { throw new PlatformNotSupportedException(); } // @@ -4554,14 +4481,12 @@ internal Arm64() { } /// svint32_t svld1sh_gather_[u32]index_s32(svbool_t pg, const int16_t *base, svuint32_t indices) /// LD1SH Zresult.S, Pg/Z, [Xbase, Zindices.S, UXTW #1] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorInt16SignExtend(Vector mask, short* address, Vector indices) { throw new PlatformNotSupportedException(); } /// /// svint64_t svld1sh_gather_[s64]index_s64(svbool_t pg, const int16_t *base, svint64_t indices) /// LD1SH Zresult.D, Pg/Z, [Xbase, Zindices.D, LSL #1] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorInt16SignExtend(Vector mask, short* address, Vector indices) { throw new PlatformNotSupportedException(); } /// @@ -4574,14 +4499,12 @@ internal Arm64() { } /// svint64_t svld1sh_gather_[u64]index_s64(svbool_t pg, const int16_t *base, svuint64_t indices) /// LD1SH Zresult.D, Pg/Z, [Xbase, Zindices.D, LSL #1] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorInt16SignExtend(Vector mask, short* address, Vector indices) { throw new PlatformNotSupportedException(); } /// /// svuint32_t svld1sh_gather_[s32]index_u32(svbool_t pg, const int16_t *base, svint32_t indices) /// LD1SH Zresult.S, Pg/Z, [Xbase, Zindices.S, SXTW #1] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorInt16SignExtend(Vector mask, short* address, Vector indices) { throw new PlatformNotSupportedException(); } // @@ -4595,14 +4518,12 @@ internal Arm64() { } /// svuint32_t svld1sh_gather_[u32]index_u32(svbool_t pg, const int16_t *base, svuint32_t indices) /// LD1SH Zresult.S, Pg/Z, [Xbase, Zindices.S, UXTW #1] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorInt16SignExtend(Vector mask, short* address, Vector indices) { throw new PlatformNotSupportedException(); } /// /// svuint64_t svld1sh_gather_[s64]index_u64(svbool_t pg, const int16_t *base, svint64_t indices) /// LD1SH Zresult.D, Pg/Z, [Xbase, Zindices.D, LSL #1] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorInt16SignExtend(Vector mask, short* address, Vector indices) { throw new PlatformNotSupportedException(); } /// @@ -4615,7 +4536,6 @@ internal Arm64() { } /// svuint64_t svld1sh_gather_[u64]index_u64(svbool_t pg, const int16_t *base, svuint64_t indices) /// LD1SH Zresult.D, Pg/Z, [Xbase, Zindices.D, LSL #1] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorInt16SignExtend(Vector mask, short* address, Vector indices) { throw new PlatformNotSupportedException(); } @@ -4625,7 +4545,6 @@ internal Arm64() { } /// svint32_t svldff1sh_gather_[s32]index_s32(svbool_t pg, const int16_t *base, svint32_t indices) /// LDFF1SH Zresult.S, Pg/Z, [Xbase, Zindices.S, SXTW #1] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorInt16SignExtendFirstFaulting(Vector mask, short* address, Vector indices) { throw new PlatformNotSupportedException(); } // @@ -4639,14 +4558,12 @@ internal Arm64() { } /// svint32_t svldff1sh_gather_[u32]index_s32(svbool_t pg, const int16_t *base, svuint32_t indices) /// LDFF1SH Zresult.S, Pg/Z, [Xbase, Zindices.S, UXTW #1] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorInt16SignExtendFirstFaulting(Vector mask, short* address, Vector indices) { throw new PlatformNotSupportedException(); } /// /// svint64_t svldff1sh_gather_[s64]index_s64(svbool_t pg, const int16_t *base, svint64_t indices) /// LDFF1SH Zresult.D, Pg/Z, [Xbase, Zindices.D, LSL #1] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorInt16SignExtendFirstFaulting(Vector mask, short* address, Vector indices) { throw new PlatformNotSupportedException(); } /// @@ -4659,14 +4576,12 @@ internal Arm64() { } /// svint64_t svldff1sh_gather_[u64]index_s64(svbool_t pg, const int16_t *base, svuint64_t indices) /// LDFF1SH Zresult.D, Pg/Z, [Xbase, Zindices.D, LSL #1] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorInt16SignExtendFirstFaulting(Vector mask, short* address, Vector indices) { throw new PlatformNotSupportedException(); } /// /// svuint32_t svldff1sh_gather_[s32]index_u32(svbool_t pg, const int16_t *base, svint32_t indices) /// LDFF1SH Zresult.S, Pg/Z, [Xbase, Zindices.S, SXTW #1] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorInt16SignExtendFirstFaulting(Vector mask, short* address, Vector indices) { throw new PlatformNotSupportedException(); } // @@ -4680,14 +4595,12 @@ internal Arm64() { } /// svuint32_t svldff1sh_gather_[u32]index_u32(svbool_t pg, const int16_t *base, svuint32_t indices) /// LDFF1SH Zresult.S, Pg/Z, [Xbase, Zindices.S, UXTW #1] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorInt16SignExtendFirstFaulting(Vector mask, short* address, Vector indices) { throw new PlatformNotSupportedException(); } /// /// svuint64_t svldff1sh_gather_[s64]index_u64(svbool_t pg, const int16_t *base, svint64_t indices) /// LDFF1SH Zresult.D, Pg/Z, [Xbase, Zindices.D, LSL #1] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorInt16SignExtendFirstFaulting(Vector mask, short* address, Vector indices) { throw new PlatformNotSupportedException(); } /// @@ -4700,7 +4613,6 @@ internal Arm64() { } /// svuint64_t svldff1sh_gather_[u64]index_u64(svbool_t pg, const int16_t *base, svuint64_t indices) /// LDFF1SH Zresult.D, Pg/Z, [Xbase, Zindices.D, LSL #1] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorInt16SignExtendFirstFaulting(Vector mask, short* address, Vector indices) { throw new PlatformNotSupportedException(); } @@ -4710,56 +4622,48 @@ internal Arm64() { } /// svint32_t svld1sh_gather_[s32]offset_s32(svbool_t pg, const int16_t *base, svint32_t offsets) /// LD1SH Zresult.S, Pg/Z, [Xbase, Zoffsets.S, SXTW] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorInt16WithByteOffsetsSignExtend(Vector mask, short* address, Vector offsets) { throw new PlatformNotSupportedException(); } /// /// svint32_t svld1sh_gather_[u32]offset_s32(svbool_t pg, const int16_t *base, svuint32_t offsets) /// LD1SH Zresult.S, Pg/Z, [Xbase, Zoffsets.S, UXTW] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorInt16WithByteOffsetsSignExtend(Vector mask, short* address, Vector offsets) { throw new PlatformNotSupportedException(); } /// /// svint64_t svld1sh_gather_[s64]offset_s64(svbool_t pg, const int16_t *base, svint64_t offsets) /// LD1SH Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorInt16WithByteOffsetsSignExtend(Vector mask, short* address, Vector offsets) { throw new PlatformNotSupportedException(); } /// /// svint64_t svld1sh_gather_[u64]offset_s64(svbool_t pg, const int16_t *base, svuint64_t offsets) /// LD1SH Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorInt16WithByteOffsetsSignExtend(Vector mask, short* address, Vector offsets) { throw new PlatformNotSupportedException(); } /// /// svuint32_t svld1sh_gather_[s32]offset_u32(svbool_t pg, const int16_t *base, svint32_t offsets) /// LD1SH Zresult.S, Pg/Z, [Xbase, Zoffsets.S, SXTW] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorInt16WithByteOffsetsSignExtend(Vector mask, short* address, Vector offsets) { throw new PlatformNotSupportedException(); } /// /// svuint32_t svld1sh_gather_[u32]offset_u32(svbool_t pg, const int16_t *base, svuint32_t offsets) /// LD1SH Zresult.S, Pg/Z, [Xbase, Zoffsets.S, UXTW] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorInt16WithByteOffsetsSignExtend(Vector mask, short* address, Vector offsets) { throw new PlatformNotSupportedException(); } /// /// svuint64_t svld1sh_gather_[s64]offset_u64(svbool_t pg, const int16_t *base, svint64_t offsets) /// LD1SH Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorInt16WithByteOffsetsSignExtend(Vector mask, short* address, Vector offsets) { throw new PlatformNotSupportedException(); } /// /// svuint64_t svld1sh_gather_[u64]offset_u64(svbool_t pg, const int16_t *base, svuint64_t offsets) /// LD1SH Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorInt16WithByteOffsetsSignExtend(Vector mask, short* address, Vector offsets) { throw new PlatformNotSupportedException(); } @@ -4769,56 +4673,48 @@ internal Arm64() { } /// svint32_t svldff1sh_gather_[s32]offset_s32(svbool_t pg, const int16_t *base, svint32_t offsets) /// LDFF1SH Zresult.S, Pg/Z, [Xbase, Zoffsets.S, SXTW] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorInt16WithByteOffsetsSignExtendFirstFaulting(Vector mask, short* address, Vector offsets) { throw new PlatformNotSupportedException(); } /// /// svint32_t svldff1sh_gather_[u32]offset_s32(svbool_t pg, const int16_t *base, svuint32_t offsets) /// LDFF1SH Zresult.S, Pg/Z, [Xbase, Zoffsets.S, UXTW] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorInt16WithByteOffsetsSignExtendFirstFaulting(Vector mask, short* address, Vector offsets) { throw new PlatformNotSupportedException(); } /// /// svint64_t svldff1sh_gather_[s64]offset_s64(svbool_t pg, const int16_t *base, svint64_t offsets) /// LDFF1SH Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorInt16WithByteOffsetsSignExtendFirstFaulting(Vector mask, short* address, Vector offsets) { throw new PlatformNotSupportedException(); } /// /// svint64_t svldff1sh_gather_[u64]offset_s64(svbool_t pg, const int16_t *base, svuint64_t offsets) /// LDFF1SH Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorInt16WithByteOffsetsSignExtendFirstFaulting(Vector mask, short* address, Vector offsets) { throw new PlatformNotSupportedException(); } /// /// svuint32_t svldff1sh_gather_[s32]offset_u32(svbool_t pg, const int16_t *base, svint32_t offsets) /// LDFF1SH Zresult.S, Pg/Z, [Xbase, Zoffsets.S, SXTW] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorInt16WithByteOffsetsSignExtendFirstFaulting(Vector mask, short* address, Vector offsets) { throw new PlatformNotSupportedException(); } /// /// svuint32_t svldff1sh_gather_[u32]offset_u32(svbool_t pg, const int16_t *base, svuint32_t offsets) /// LDFF1SH Zresult.S, Pg/Z, [Xbase, Zoffsets.S, UXTW] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorInt16WithByteOffsetsSignExtendFirstFaulting(Vector mask, short* address, Vector offsets) { throw new PlatformNotSupportedException(); } /// /// svuint64_t svldff1sh_gather_[s64]offset_u64(svbool_t pg, const int16_t *base, svint64_t offsets) /// LDFF1SH Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorInt16WithByteOffsetsSignExtendFirstFaulting(Vector mask, short* address, Vector offsets) { throw new PlatformNotSupportedException(); } /// /// svuint64_t svldff1sh_gather_[u64]offset_u64(svbool_t pg, const int16_t *base, svuint64_t offsets) /// LDFF1SH Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorInt16WithByteOffsetsSignExtendFirstFaulting(Vector mask, short* address, Vector offsets) { throw new PlatformNotSupportedException(); } @@ -4828,7 +4724,6 @@ internal Arm64() { } /// svint64_t svld1sw_gather_[s64]index_s64(svbool_t pg, const int32_t *base, svint64_t indices) /// LD1SW Zresult.D, Pg/Z, [Xbase, Zindices.D, LSL #2] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorInt32SignExtend(Vector mask, int* address, Vector indices) { throw new PlatformNotSupportedException(); } /// @@ -4841,14 +4736,12 @@ internal Arm64() { } /// svint64_t svld1sw_gather_[u64]index_s64(svbool_t pg, const int32_t *base, svuint64_t indices) /// LD1SW Zresult.D, Pg/Z, [Xbase, Zindices.D, LSL #2] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorInt32SignExtend(Vector mask, int* address, Vector indices) { throw new PlatformNotSupportedException(); } /// /// svuint64_t svld1sw_gather_[s64]index_u64(svbool_t pg, const int32_t *base, svint64_t indices) /// LD1SW Zresult.D, Pg/Z, [Xbase, Zindices.D, LSL #2] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorInt32SignExtend(Vector mask, int* address, Vector indices) { throw new PlatformNotSupportedException(); } /// @@ -4861,7 +4754,6 @@ internal Arm64() { } /// svuint64_t svld1sw_gather_[u64]index_u64(svbool_t pg, const int32_t *base, svuint64_t indices) /// LD1SW Zresult.D, Pg/Z, [Xbase, Zindices.D, LSL #2] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorInt32SignExtend(Vector mask, int* address, Vector indices) { throw new PlatformNotSupportedException(); } @@ -4871,7 +4763,6 @@ internal Arm64() { } /// svint64_t svldff1sw_gather_[s64]index_s64(svbool_t pg, const int32_t *base, svint64_t indices) /// LDFF1SW Zresult.D, Pg/Z, [Xbase, Zindices.D, LSL #2] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorInt32SignExtendFirstFaulting(Vector mask, int* address, Vector indices) { throw new PlatformNotSupportedException(); } /// @@ -4884,14 +4775,12 @@ internal Arm64() { } /// svint64_t svldff1sw_gather_[u64]index_s64(svbool_t pg, const int32_t *base, svuint64_t indices) /// LDFF1SW Zresult.D, Pg/Z, [Xbase, Zindices.D, LSL #2] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorInt32SignExtendFirstFaulting(Vector mask, int* address, Vector indices) { throw new PlatformNotSupportedException(); } /// /// svuint64_t svldff1sw_gather_[s64]index_u64(svbool_t pg, const int32_t *base, svint64_t indices) /// LDFF1SW Zresult.D, Pg/Z, [Xbase, Zindices.D, LSL #2] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorInt32SignExtendFirstFaulting(Vector mask, int* address, Vector indices) { throw new PlatformNotSupportedException(); } /// @@ -4904,7 +4793,6 @@ internal Arm64() { } /// svuint64_t svldff1sw_gather_[u64]index_u64(svbool_t pg, const int32_t *base, svuint64_t indices) /// LDFF1SW Zresult.D, Pg/Z, [Xbase, Zindices.D, LSL #2] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorInt32SignExtendFirstFaulting(Vector mask, int* address, Vector indices) { throw new PlatformNotSupportedException(); } @@ -4914,28 +4802,24 @@ internal Arm64() { } /// svint64_t svld1sw_gather_[s64]offset_s64(svbool_t pg, const int32_t *base, svint64_t offsets) /// LD1SW Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorInt32WithByteOffsetsSignExtend(Vector mask, int* address, Vector offsets) { throw new PlatformNotSupportedException(); } /// /// svint64_t svld1sw_gather_[u64]offset_s64(svbool_t pg, const int32_t *base, svuint64_t offsets) /// LD1SW Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorInt32WithByteOffsetsSignExtend(Vector mask, int* address, Vector offsets) { throw new PlatformNotSupportedException(); } /// /// svuint64_t svld1sw_gather_[s64]offset_u64(svbool_t pg, const int32_t *base, svint64_t offsets) /// LD1SW Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorInt32WithByteOffsetsSignExtend(Vector mask, int* address, Vector offsets) { throw new PlatformNotSupportedException(); } /// /// svuint64_t svld1sw_gather_[u64]offset_u64(svbool_t pg, const int32_t *base, svuint64_t offsets) /// LD1SW Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorInt32WithByteOffsetsSignExtend(Vector mask, int* address, Vector offsets) { throw new PlatformNotSupportedException(); } @@ -4945,28 +4829,24 @@ internal Arm64() { } /// svint64_t svldff1sw_gather_[s64]offset_s64(svbool_t pg, const int32_t *base, svint64_t offsets) /// LDFF1SW Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorInt32WithByteOffsetsSignExtendFirstFaulting(Vector mask, int* address, Vector offsets) { throw new PlatformNotSupportedException(); } /// /// svint64_t svldff1sw_gather_[u64]offset_s64(svbool_t pg, const int32_t *base, svuint64_t offsets) /// LDFF1SW Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorInt32WithByteOffsetsSignExtendFirstFaulting(Vector mask, int* address, Vector offsets) { throw new PlatformNotSupportedException(); } /// /// svuint64_t svldff1sw_gather_[s64]offset_u64(svbool_t pg, const int32_t *base, svint64_t offsets) /// LDFF1SW Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorInt32WithByteOffsetsSignExtendFirstFaulting(Vector mask, int* address, Vector offsets) { throw new PlatformNotSupportedException(); } /// /// svuint64_t svldff1sw_gather_[u64]offset_u64(svbool_t pg, const int32_t *base, svuint64_t offsets) /// LDFF1SW Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorInt32WithByteOffsetsSignExtendFirstFaulting(Vector mask, int* address, Vector offsets) { throw new PlatformNotSupportedException(); } @@ -4976,7 +4856,6 @@ internal Arm64() { } /// svint32_t svld1sb_gather_[s32]offset_s32(svbool_t pg, const int8_t *base, svint32_t offsets) /// LD1SB Zresult.S, Pg/Z, [Xbase, Zoffsets.S, SXTW] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorSByteSignExtend(Vector mask, sbyte* address, Vector indices) { throw new PlatformNotSupportedException(); } // @@ -4990,14 +4869,12 @@ internal Arm64() { } /// svint32_t svld1sb_gather_[u32]offset_s32(svbool_t pg, const int8_t *base, svuint32_t offsets) /// LD1SB Zresult.S, Pg/Z, [Xbase, Zoffsets.S, UXTW] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorSByteSignExtend(Vector mask, sbyte* address, Vector indices) { throw new PlatformNotSupportedException(); } /// /// svint64_t svld1sb_gather_[s64]offset_s64(svbool_t pg, const int8_t *base, svint64_t offsets) /// LD1SB Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorSByteSignExtend(Vector mask, sbyte* address, Vector indices) { throw new PlatformNotSupportedException(); } /// @@ -5010,14 +4887,12 @@ internal Arm64() { } /// svint64_t svld1sb_gather_[u64]offset_s64(svbool_t pg, const int8_t *base, svuint64_t offsets) /// LD1SB Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorSByteSignExtend(Vector mask, sbyte* address, Vector indices) { throw new PlatformNotSupportedException(); } /// /// svuint32_t svld1sb_gather_[s32]offset_u32(svbool_t pg, const int8_t *base, svint32_t offsets) /// LD1SB Zresult.S, Pg/Z, [Xbase, Zoffsets.S, SXTW] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorSByteSignExtend(Vector mask, sbyte* address, Vector indices) { throw new PlatformNotSupportedException(); } // @@ -5031,14 +4906,12 @@ internal Arm64() { } /// svuint32_t svld1sb_gather_[u32]offset_u32(svbool_t pg, const int8_t *base, svuint32_t offsets) /// LD1SB Zresult.S, Pg/Z, [Xbase, Zoffsets.S, UXTW] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorSByteSignExtend(Vector mask, sbyte* address, Vector indices) { throw new PlatformNotSupportedException(); } /// /// svuint64_t svld1sb_gather_[s64]offset_u64(svbool_t pg, const int8_t *base, svint64_t offsets) /// LD1SB Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorSByteSignExtend(Vector mask, sbyte* address, Vector indices) { throw new PlatformNotSupportedException(); } /// @@ -5051,7 +4924,6 @@ internal Arm64() { } /// svuint64_t svld1sb_gather_[u64]offset_u64(svbool_t pg, const int8_t *base, svuint64_t offsets) /// LD1SB Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorSByteSignExtend(Vector mask, sbyte* address, Vector indices) { throw new PlatformNotSupportedException(); } @@ -5061,7 +4933,6 @@ internal Arm64() { } /// svint32_t svldff1sb_gather_[s32]offset_s32(svbool_t pg, const int8_t *base, svint32_t offsets) /// LDFF1SB Zresult.S, Pg/Z, [Xbase, Zoffsets.S, SXTW] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorSByteSignExtendFirstFaulting(Vector mask, sbyte* address, Vector offsets) { throw new PlatformNotSupportedException(); } // @@ -5075,14 +4946,12 @@ internal Arm64() { } /// svint32_t svldff1sb_gather_[u32]offset_s32(svbool_t pg, const int8_t *base, svuint32_t offsets) /// LDFF1SB Zresult.S, Pg/Z, [Xbase, Zoffsets.S, UXTW] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorSByteSignExtendFirstFaulting(Vector mask, sbyte* address, Vector offsets) { throw new PlatformNotSupportedException(); } /// /// svint64_t svldff1sb_gather_[s64]offset_s64(svbool_t pg, const int8_t *base, svint64_t offsets) /// LDFF1SB Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorSByteSignExtendFirstFaulting(Vector mask, sbyte* address, Vector offsets) { throw new PlatformNotSupportedException(); } /// @@ -5095,14 +4964,12 @@ internal Arm64() { } /// svint64_t svldff1sb_gather_[u64]offset_s64(svbool_t pg, const int8_t *base, svuint64_t offsets) /// LDFF1SB Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorSByteSignExtendFirstFaulting(Vector mask, sbyte* address, Vector offsets) { throw new PlatformNotSupportedException(); } /// /// svuint32_t svldff1sb_gather_[s32]offset_u32(svbool_t pg, const int8_t *base, svint32_t offsets) /// LDFF1SB Zresult.S, Pg/Z, [Xbase, Zoffsets.S, SXTW] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorSByteSignExtendFirstFaulting(Vector mask, sbyte* address, Vector offsets) { throw new PlatformNotSupportedException(); } // @@ -5116,14 +4983,12 @@ internal Arm64() { } /// svuint32_t svldff1sb_gather_[u32]offset_u32(svbool_t pg, const int8_t *base, svuint32_t offsets) /// LDFF1SB Zresult.S, Pg/Z, [Xbase, Zoffsets.S, UXTW] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorSByteSignExtendFirstFaulting(Vector mask, sbyte* address, Vector offsets) { throw new PlatformNotSupportedException(); } /// /// svuint64_t svldff1sb_gather_[s64]offset_u64(svbool_t pg, const int8_t *base, svint64_t offsets) /// LDFF1SB Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorSByteSignExtendFirstFaulting(Vector mask, sbyte* address, Vector offsets) { throw new PlatformNotSupportedException(); } /// @@ -5136,7 +5001,6 @@ internal Arm64() { } /// svuint64_t svldff1sb_gather_[u64]offset_u64(svbool_t pg, const int8_t *base, svuint64_t offsets) /// LDFF1SB Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorSByteSignExtendFirstFaulting(Vector mask, sbyte* address, Vector offsets) { throw new PlatformNotSupportedException(); } @@ -5146,56 +5010,48 @@ internal Arm64() { } /// svint32_t svld1uh_gather_[s32]offset_s32(svbool_t pg, const uint16_t *base, svint32_t offsets) /// LD1H Zresult.S, Pg/Z, [Xbase, Zoffsets.S, SXTW] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorUInt16WithByteOffsetsZeroExtend(Vector mask, ushort* address, Vector offsets) { throw new PlatformNotSupportedException(); } /// /// svint32_t svld1uh_gather_[u32]offset_s32(svbool_t pg, const uint16_t *base, svuint32_t offsets) /// LD1H Zresult.S, Pg/Z, [Xbase, Zoffsets.S, UXTW] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorUInt16WithByteOffsetsZeroExtend(Vector mask, ushort* address, Vector offsets) { throw new PlatformNotSupportedException(); } /// /// svint64_t svld1uh_gather_[s64]offset_s64(svbool_t pg, const uint16_t *base, svint64_t offsets) /// LD1H Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorUInt16WithByteOffsetsZeroExtend(Vector mask, ushort* address, Vector offsets) { throw new PlatformNotSupportedException(); } /// /// svint64_t svld1uh_gather_[u64]offset_s64(svbool_t pg, const uint16_t *base, svuint64_t offsets) /// LD1H Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorUInt16WithByteOffsetsZeroExtend(Vector mask, ushort* address, Vector offsets) { throw new PlatformNotSupportedException(); } /// /// svuint32_t svld1uh_gather_[s32]offset_u32(svbool_t pg, const uint16_t *base, svint32_t offsets) /// LD1H Zresult.S, Pg/Z, [Xbase, Zoffsets.S, SXTW] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorUInt16WithByteOffsetsZeroExtend(Vector mask, ushort* address, Vector offsets) { throw new PlatformNotSupportedException(); } /// /// svuint32_t svld1uh_gather_[u32]offset_u32(svbool_t pg, const uint16_t *base, svuint32_t offsets) /// LD1H Zresult.S, Pg/Z, [Xbase, Zoffsets.S, UXTW] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorUInt16WithByteOffsetsZeroExtend(Vector mask, ushort* address, Vector offsets) { throw new PlatformNotSupportedException(); } /// /// svuint64_t svld1uh_gather_[s64]offset_u64(svbool_t pg, const uint16_t *base, svint64_t offsets) /// LD1H Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorUInt16WithByteOffsetsZeroExtend(Vector mask, ushort* address, Vector offsets) { throw new PlatformNotSupportedException(); } /// /// svuint64_t svld1uh_gather_[u64]offset_u64(svbool_t pg, const uint16_t *base, svuint64_t offsets) /// LD1H Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorUInt16WithByteOffsetsZeroExtend(Vector mask, ushort* address, Vector offsets) { throw new PlatformNotSupportedException(); } @@ -5205,56 +5061,48 @@ internal Arm64() { } /// svint32_t svldff1uh_gather_[s32]offset_s32(svbool_t pg, const uint16_t *base, svint32_t offsets) /// LDFF1H Zresult.S, Pg/Z, [Xbase, Zoffsets.S, SXTW] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorUInt16WithByteOffsetsZeroExtendFirstFaulting(Vector mask, ushort* address, Vector offsets) { throw new PlatformNotSupportedException(); } /// /// svint32_t svldff1uh_gather_[u32]offset_s32(svbool_t pg, const uint16_t *base, svuint32_t offsets) /// LDFF1H Zresult.S, Pg/Z, [Xbase, Zoffsets.S, UXTW] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorUInt16WithByteOffsetsZeroExtendFirstFaulting(Vector mask, ushort* address, Vector offsets) { throw new PlatformNotSupportedException(); } /// /// svint64_t svldff1uh_gather_[s64]offset_s64(svbool_t pg, const uint16_t *base, svint64_t offsets) /// LDFF1H Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorUInt16WithByteOffsetsZeroExtendFirstFaulting(Vector mask, ushort* address, Vector offsets) { throw new PlatformNotSupportedException(); } /// /// svint64_t svldff1uh_gather_[u64]offset_s64(svbool_t pg, const uint16_t *base, svuint64_t offsets) /// LDFF1H Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorUInt16WithByteOffsetsZeroExtendFirstFaulting(Vector mask, ushort* address, Vector offsets) { throw new PlatformNotSupportedException(); } /// /// svuint32_t svldff1uh_gather_[s32]offset_u32(svbool_t pg, const uint16_t *base, svint32_t offsets) /// LDFF1H Zresult.S, Pg/Z, [Xbase, Zoffsets.S, SXTW] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorUInt16WithByteOffsetsZeroExtendFirstFaulting(Vector mask, ushort* address, Vector offsets) { throw new PlatformNotSupportedException(); } /// /// svuint32_t svldff1uh_gather_[u32]offset_u32(svbool_t pg, const uint16_t *base, svuint32_t offsets) /// LDFF1H Zresult.S, Pg/Z, [Xbase, Zoffsets.S, UXTW] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorUInt16WithByteOffsetsZeroExtendFirstFaulting(Vector mask, ushort* address, Vector offsets) { throw new PlatformNotSupportedException(); } /// /// svuint64_t svldff1uh_gather_[s64]offset_u64(svbool_t pg, const uint16_t *base, svint64_t offsets) /// LDFF1H Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorUInt16WithByteOffsetsZeroExtendFirstFaulting(Vector mask, ushort* address, Vector offsets) { throw new PlatformNotSupportedException(); } /// /// svuint64_t svldff1uh_gather_[u64]offset_u64(svbool_t pg, const uint16_t *base, svuint64_t offsets) /// LDFF1H Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorUInt16WithByteOffsetsZeroExtendFirstFaulting(Vector mask, ushort* address, Vector offsets) { throw new PlatformNotSupportedException(); } @@ -5264,7 +5112,6 @@ internal Arm64() { } /// svint32_t svld1uh_gather_[s32]index_s32(svbool_t pg, const uint16_t *base, svint32_t indices) /// LD1H Zresult.S, Pg/Z, [Xbase, Zindices.S, SXTW #1] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorUInt16ZeroExtend(Vector mask, ushort* address, Vector indices) { throw new PlatformNotSupportedException(); } // @@ -5278,14 +5125,12 @@ internal Arm64() { } /// svint32_t svld1uh_gather_[u32]index_s32(svbool_t pg, const uint16_t *base, svuint32_t indices) /// LD1H Zresult.S, Pg/Z, [Xbase, Zindices.S, UXTW #1] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorUInt16ZeroExtend(Vector mask, ushort* address, Vector indices) { throw new PlatformNotSupportedException(); } /// /// svint64_t svld1uh_gather_[s64]index_s64(svbool_t pg, const uint16_t *base, svint64_t indices) /// LD1H Zresult.D, Pg/Z, [Xbase, Zindices.D, LSL #1] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorUInt16ZeroExtend(Vector mask, ushort* address, Vector indices) { throw new PlatformNotSupportedException(); } /// @@ -5298,14 +5143,12 @@ internal Arm64() { } /// svint64_t svld1uh_gather_[u64]index_s64(svbool_t pg, const uint16_t *base, svuint64_t indices) /// LD1H Zresult.D, Pg/Z, [Xbase, Zindices.D, LSL #1] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorUInt16ZeroExtend(Vector mask, ushort* address, Vector indices) { throw new PlatformNotSupportedException(); } /// /// svuint32_t svld1uh_gather_[s32]index_u32(svbool_t pg, const uint16_t *base, svint32_t indices) /// LD1H Zresult.S, Pg/Z, [Xbase, Zindices.S, SXTW #1] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorUInt16ZeroExtend(Vector mask, ushort* address, Vector indices) { throw new PlatformNotSupportedException(); } // @@ -5319,14 +5162,12 @@ internal Arm64() { } /// svuint32_t svld1uh_gather_[u32]index_u32(svbool_t pg, const uint16_t *base, svuint32_t indices) /// LD1H Zresult.S, Pg/Z, [Xbase, Zindices.S, UXTW #1] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorUInt16ZeroExtend(Vector mask, ushort* address, Vector indices) { throw new PlatformNotSupportedException(); } /// /// svuint64_t svld1uh_gather_[s64]index_u64(svbool_t pg, const uint16_t *base, svint64_t indices) /// LD1H Zresult.D, Pg/Z, [Xbase, Zindices.D, LSL #1] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorUInt16ZeroExtend(Vector mask, ushort* address, Vector indices) { throw new PlatformNotSupportedException(); } /// @@ -5339,7 +5180,6 @@ internal Arm64() { } /// svuint64_t svld1uh_gather_[u64]index_u64(svbool_t pg, const uint16_t *base, svuint64_t indices) /// LD1H Zresult.D, Pg/Z, [Xbase, Zindices.D, LSL #1] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorUInt16ZeroExtend(Vector mask, ushort* address, Vector indices) { throw new PlatformNotSupportedException(); } @@ -5349,7 +5189,6 @@ internal Arm64() { } /// svint32_t svldff1uh_gather_[s32]index_s32(svbool_t pg, const uint16_t *base, svint32_t indices) /// LDFF1H Zresult.S, Pg/Z, [Xbase, Zindices.S, SXTW #1] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorUInt16ZeroExtendFirstFaulting(Vector mask, ushort* address, Vector indices) { throw new PlatformNotSupportedException(); } // @@ -5363,14 +5202,12 @@ internal Arm64() { } /// svint32_t svldff1uh_gather_[u32]index_s32(svbool_t pg, const uint16_t *base, svuint32_t indices) /// LDFF1H Zresult.S, Pg/Z, [Xbase, Zindices.S, UXTW #1] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorUInt16ZeroExtendFirstFaulting(Vector mask, ushort* address, Vector indices) { throw new PlatformNotSupportedException(); } /// /// svint64_t svldff1uh_gather_[s64]index_s64(svbool_t pg, const uint16_t *base, svint64_t indices) /// LDFF1H Zresult.D, Pg/Z, [Xbase, Zindices.D, LSL #1] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorUInt16ZeroExtendFirstFaulting(Vector mask, ushort* address, Vector indices) { throw new PlatformNotSupportedException(); } /// @@ -5383,14 +5220,12 @@ internal Arm64() { } /// svint64_t svldff1uh_gather_[u64]index_s64(svbool_t pg, const uint16_t *base, svuint64_t indices) /// LDFF1H Zresult.D, Pg/Z, [Xbase, Zindices.D, LSL #1] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorUInt16ZeroExtendFirstFaulting(Vector mask, ushort* address, Vector indices) { throw new PlatformNotSupportedException(); } /// /// svuint32_t svldff1uh_gather_[s32]index_u32(svbool_t pg, const uint16_t *base, svint32_t indices) /// LDFF1H Zresult.S, Pg/Z, [Xbase, Zindices.S, SXTW #1] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorUInt16ZeroExtendFirstFaulting(Vector mask, ushort* address, Vector indices) { throw new PlatformNotSupportedException(); } // @@ -5404,14 +5239,12 @@ internal Arm64() { } /// svuint32_t svldff1uh_gather_[u32]index_u32(svbool_t pg, const uint16_t *base, svuint32_t indices) /// LDFF1H Zresult.S, Pg/Z, [Xbase, Zindices.S, UXTW #1] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorUInt16ZeroExtendFirstFaulting(Vector mask, ushort* address, Vector indices) { throw new PlatformNotSupportedException(); } /// /// svuint64_t svldff1uh_gather_[s64]index_u64(svbool_t pg, const uint16_t *base, svint64_t indices) /// LDFF1H Zresult.D, Pg/Z, [Xbase, Zindices.D, LSL #1] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorUInt16ZeroExtendFirstFaulting(Vector mask, ushort* address, Vector indices) { throw new PlatformNotSupportedException(); } /// @@ -5424,7 +5257,6 @@ internal Arm64() { } /// svuint64_t svldff1uh_gather_[u64]index_u64(svbool_t pg, const uint16_t *base, svuint64_t indices) /// LDFF1H Zresult.D, Pg/Z, [Xbase, Zindices.D, LSL #1] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorUInt16ZeroExtendFirstFaulting(Vector mask, ushort* address, Vector indices) { throw new PlatformNotSupportedException(); } @@ -5434,28 +5266,24 @@ internal Arm64() { } /// svint64_t svld1uw_gather_[s64]offset_s64(svbool_t pg, const uint32_t *base, svint64_t offsets) /// LD1W Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorUInt32WithByteOffsetsZeroExtend(Vector mask, uint* address, Vector offsets) { throw new PlatformNotSupportedException(); } /// /// svint64_t svld1uw_gather_[u64]offset_s64(svbool_t pg, const uint32_t *base, svuint64_t offsets) /// LD1W Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorUInt32WithByteOffsetsZeroExtend(Vector mask, uint* address, Vector offsets) { throw new PlatformNotSupportedException(); } /// /// svuint64_t svld1uw_gather_[s64]offset_u64(svbool_t pg, const uint32_t *base, svint64_t offsets) /// LD1W Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorUInt32WithByteOffsetsZeroExtend(Vector mask, uint* address, Vector offsets) { throw new PlatformNotSupportedException(); } /// /// svuint64_t svld1uw_gather_[u64]offset_u64(svbool_t pg, const uint32_t *base, svuint64_t offsets) /// LD1W Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorUInt32WithByteOffsetsZeroExtend(Vector mask, uint* address, Vector offsets) { throw new PlatformNotSupportedException(); } @@ -5465,28 +5293,24 @@ internal Arm64() { } /// svint64_t svldff1uw_gather_[s64]offset_s64(svbool_t pg, const uint32_t *base, svint64_t offsets) /// LDFF1W Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorUInt32WithByteOffsetsZeroExtendFirstFaulting(Vector mask, uint* address, Vector offsets) { throw new PlatformNotSupportedException(); } /// /// svint64_t svldff1uw_gather_[u64]offset_s64(svbool_t pg, const uint32_t *base, svuint64_t offsets) /// LDFF1W Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorUInt32WithByteOffsetsZeroExtendFirstFaulting(Vector mask, uint* address, Vector offsets) { throw new PlatformNotSupportedException(); } /// /// svuint64_t svldff1uw_gather_[s64]offset_u64(svbool_t pg, const uint32_t *base, svint64_t offsets) /// LDFF1W Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorUInt32WithByteOffsetsZeroExtendFirstFaulting(Vector mask, uint* address, Vector offsets) { throw new PlatformNotSupportedException(); } /// /// svuint64_t svldff1uw_gather_[u64]offset_u64(svbool_t pg, const uint32_t *base, svuint64_t offsets) /// LDFF1W Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorUInt32WithByteOffsetsZeroExtendFirstFaulting(Vector mask, uint* address, Vector offsets) { throw new PlatformNotSupportedException(); } @@ -5496,7 +5320,6 @@ internal Arm64() { } /// svint64_t svld1uw_gather_[s64]index_s64(svbool_t pg, const uint32_t *base, svint64_t indices) /// LD1W Zresult.D, Pg/Z, [Xbase, Zindices.D, LSL #2] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorUInt32ZeroExtend(Vector mask, uint* address, Vector indices) { throw new PlatformNotSupportedException(); } /// @@ -5509,14 +5332,12 @@ internal Arm64() { } /// svint64_t svld1uw_gather_[u64]index_s64(svbool_t pg, const uint32_t *base, svuint64_t indices) /// LD1W Zresult.D, Pg/Z, [Xbase, Zindices.D, LSL #2] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorUInt32ZeroExtend(Vector mask, uint* address, Vector indices) { throw new PlatformNotSupportedException(); } /// /// svuint64_t svld1uw_gather_[s64]index_u64(svbool_t pg, const uint32_t *base, svint64_t indices) /// LD1W Zresult.D, Pg/Z, [Xbase, Zindices.D, LSL #2] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorUInt32ZeroExtend(Vector mask, uint* address, Vector indices) { throw new PlatformNotSupportedException(); } /// @@ -5529,7 +5350,6 @@ internal Arm64() { } /// svuint64_t svld1uw_gather_[u64]index_u64(svbool_t pg, const uint32_t *base, svuint64_t indices) /// LD1W Zresult.D, Pg/Z, [Xbase, Zindices.D, LSL #2] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorUInt32ZeroExtend(Vector mask, uint* address, Vector indices) { throw new PlatformNotSupportedException(); } @@ -5539,7 +5359,6 @@ internal Arm64() { } /// svint64_t svldff1uw_gather_[s64]index_s64(svbool_t pg, const uint32_t *base, svint64_t indices) /// LDFF1W Zresult.D, Pg/Z, [Xbase, Zindices.D, LSL #2] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorUInt32ZeroExtendFirstFaulting(Vector mask, uint* address, Vector indices) { throw new PlatformNotSupportedException(); } /// @@ -5552,14 +5371,12 @@ internal Arm64() { } /// svint64_t svldff1uw_gather_[u64]index_s64(svbool_t pg, const uint32_t *base, svuint64_t indices) /// LDFF1W Zresult.D, Pg/Z, [Xbase, Zindices.D, LSL #2] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorUInt32ZeroExtendFirstFaulting(Vector mask, uint* address, Vector indices) { throw new PlatformNotSupportedException(); } /// /// svuint64_t svldff1uw_gather_[s64]index_u64(svbool_t pg, const uint32_t *base, svint64_t indices) /// LDFF1W Zresult.D, Pg/Z, [Xbase, Zindices.D, LSL #2] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorUInt32ZeroExtendFirstFaulting(Vector mask, uint* address, Vector indices) { throw new PlatformNotSupportedException(); } /// @@ -5572,7 +5389,6 @@ internal Arm64() { } /// svuint64_t svldff1uw_gather_[u64]index_u64(svbool_t pg, const uint32_t *base, svuint64_t indices) /// LDFF1W Zresult.D, Pg/Z, [Xbase, Zindices.D, LSL #2] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorUInt32ZeroExtendFirstFaulting(Vector mask, uint* address, Vector indices) { throw new PlatformNotSupportedException(); } @@ -5582,84 +5398,72 @@ internal Arm64() { } /// svfloat64_t svldff1_gather_[s64]offset[_f64](svbool_t pg, const float64_t *base, svint64_t offsets) /// LDFF1D Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorWithByteOffsetFirstFaulting(Vector mask, double* address, Vector offsets) { throw new PlatformNotSupportedException(); } /// /// svfloat64_t svldff1_gather_[u64]offset[_f64](svbool_t pg, const float64_t *base, svuint64_t offsets) /// LDFF1D Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorWithByteOffsetFirstFaulting(Vector mask, double* address, Vector offsets) { throw new PlatformNotSupportedException(); } /// /// svint32_t svldff1_gather_[s32]offset[_s32](svbool_t pg, const int32_t *base, svint32_t offsets) /// LDFF1W Zresult.S, Pg/Z, [Xbase, Zoffsets.S, SXTW] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorWithByteOffsetFirstFaulting(Vector mask, int* address, Vector offsets) { throw new PlatformNotSupportedException(); } /// /// svint32_t svldff1_gather_[u32]offset[_s32](svbool_t pg, const int32_t *base, svuint32_t offsets) /// LDFF1W Zresult.S, Pg/Z, [Xbase, Zoffsets.S, UXTW] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorWithByteOffsetFirstFaulting(Vector mask, int* address, Vector offsets) { throw new PlatformNotSupportedException(); } /// /// svint64_t svldff1_gather_[s64]offset[_s64](svbool_t pg, const int64_t *base, svint64_t offsets) /// LDFF1D Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorWithByteOffsetFirstFaulting(Vector mask, long* address, Vector offsets) { throw new PlatformNotSupportedException(); } /// /// svint64_t svldff1_gather_[u64]offset[_s64](svbool_t pg, const int64_t *base, svuint64_t offsets) /// LDFF1D Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorWithByteOffsetFirstFaulting(Vector mask, long* address, Vector offsets) { throw new PlatformNotSupportedException(); } /// /// svfloat32_t svldff1_gather_[s32]offset[_f32](svbool_t pg, const float32_t *base, svint32_t offsets) /// LDFF1W Zresult.S, Pg/Z, [Xbase, Zoffsets.S, SXTW] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorWithByteOffsetFirstFaulting(Vector mask, float* address, Vector offsets) { throw new PlatformNotSupportedException(); } /// /// svfloat32_t svldff1_gather_[u32]offset[_f32](svbool_t pg, const float32_t *base, svuint32_t offsets) /// LDFF1W Zresult.S, Pg/Z, [Xbase, Zoffsets.S, UXTW] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorWithByteOffsetFirstFaulting(Vector mask, float* address, Vector offsets) { throw new PlatformNotSupportedException(); } /// /// svuint32_t svldff1_gather_[s32]offset[_u32](svbool_t pg, const uint32_t *base, svint32_t offsets) /// LDFF1W Zresult.S, Pg/Z, [Xbase, Zoffsets.S, SXTW] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorWithByteOffsetFirstFaulting(Vector mask, uint* address, Vector offsets) { throw new PlatformNotSupportedException(); } /// /// svuint32_t svldff1_gather_[u32]offset[_u32](svbool_t pg, const uint32_t *base, svuint32_t offsets) /// LDFF1W Zresult.S, Pg/Z, [Xbase, Zoffsets.S, UXTW] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorWithByteOffsetFirstFaulting(Vector mask, uint* address, Vector offsets) { throw new PlatformNotSupportedException(); } /// /// svuint64_t svldff1_gather_[s64]offset[_u64](svbool_t pg, const uint64_t *base, svint64_t offsets) /// LDFF1D Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorWithByteOffsetFirstFaulting(Vector mask, ulong* address, Vector offsets) { throw new PlatformNotSupportedException(); } /// /// svuint64_t svldff1_gather_[u64]offset[_u64](svbool_t pg, const uint64_t *base, svuint64_t offsets) /// LDFF1D Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorWithByteOffsetFirstFaulting(Vector mask, ulong* address, Vector offsets) { throw new PlatformNotSupportedException(); } @@ -5669,84 +5473,72 @@ internal Arm64() { } /// svfloat64_t svld1_gather_[s64]offset[_f64](svbool_t pg, const float64_t *base, svint64_t offsets) /// LD1D Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorWithByteOffsets(Vector mask, double* address, Vector offsets) { throw new PlatformNotSupportedException(); } /// /// svfloat64_t svld1_gather_[u64]offset[_f64](svbool_t pg, const float64_t *base, svuint64_t offsets) /// LD1D Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorWithByteOffsets(Vector mask, double* address, Vector offsets) { throw new PlatformNotSupportedException(); } /// /// svint32_t svld1_gather_[s32]offset[_s32](svbool_t pg, const int32_t *base, svint32_t offsets) /// LD1W Zresult.S, Pg/Z, [Xbase, Zoffsets.S, SXTW] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorWithByteOffsets(Vector mask, int* address, Vector offsets) { throw new PlatformNotSupportedException(); } /// /// svint32_t svld1_gather_[u32]offset[_s32](svbool_t pg, const int32_t *base, svuint32_t offsets) /// LD1W Zresult.S, Pg/Z, [Xbase, Zoffsets.S, UXTW] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorWithByteOffsets(Vector mask, int* address, Vector offsets) { throw new PlatformNotSupportedException(); } /// /// svint64_t svld1_gather_[s64]offset[_s64](svbool_t pg, const int64_t *base, svint64_t offsets) /// LD1D Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorWithByteOffsets(Vector mask, long* address, Vector offsets) { throw new PlatformNotSupportedException(); } /// /// svint64_t svld1_gather_[u64]offset[_s64](svbool_t pg, const int64_t *base, svuint64_t offsets) /// LD1D Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorWithByteOffsets(Vector mask, long* address, Vector offsets) { throw new PlatformNotSupportedException(); } /// /// svfloat32_t svld1_gather_[s32]offset[_f32](svbool_t pg, const float32_t *base, svint32_t offsets) /// LD1W Zresult.S, Pg/Z, [Xbase, Zoffsets.S, SXTW] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorWithByteOffsets(Vector mask, float* address, Vector offsets) { throw new PlatformNotSupportedException(); } /// /// svfloat32_t svld1_gather_[u32]offset[_f32](svbool_t pg, const float32_t *base, svuint32_t offsets) /// LD1W Zresult.S, Pg/Z, [Xbase, Zoffsets.S, UXTW] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorWithByteOffsets(Vector mask, float* address, Vector offsets) { throw new PlatformNotSupportedException(); } /// /// svuint32_t svld1_gather_[s32]offset[_u32](svbool_t pg, const uint32_t *base, svint32_t offsets) /// LD1W Zresult.S, Pg/Z, [Xbase, Zoffsets.S, SXTW] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorWithByteOffsets(Vector mask, uint* address, Vector offsets) { throw new PlatformNotSupportedException(); } /// /// svuint32_t svld1_gather_[u32]offset[_u32](svbool_t pg, const uint32_t *base, svuint32_t offsets) /// LD1W Zresult.S, Pg/Z, [Xbase, Zoffsets.S, UXTW] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorWithByteOffsets(Vector mask, uint* address, Vector offsets) { throw new PlatformNotSupportedException(); } /// /// svuint64_t svld1_gather_[s64]offset[_u64](svbool_t pg, const uint64_t *base, svint64_t offsets) /// LD1D Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorWithByteOffsets(Vector mask, ulong* address, Vector offsets) { throw new PlatformNotSupportedException(); } /// /// svuint64_t svld1_gather_[u64]offset[_u64](svbool_t pg, const uint64_t *base, svuint64_t offsets) /// LD1D Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorWithByteOffsets(Vector mask, ulong* address, Vector offsets) { throw new PlatformNotSupportedException(); } @@ -6058,7 +5850,6 @@ internal Arm64() { } /// LD1B Zresult.B, Pg/Z, [Xarray, Xindex] /// LD1B Zresult.B, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe Vector LoadVector(Vector mask, byte* address) { throw new PlatformNotSupportedException(); } /// @@ -6066,7 +5857,6 @@ internal Arm64() { } /// LD1D Zresult.D, Pg/Z, [Xarray, Xindex, LSL #3] /// LD1D Zresult.D, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe Vector LoadVector(Vector mask, double* address) { throw new PlatformNotSupportedException(); } /// @@ -6074,7 +5864,6 @@ internal Arm64() { } /// LD1H Zresult.H, Pg/Z, [Xarray, Xindex, LSL #1] /// LD1H Zresult.H, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe Vector LoadVector(Vector mask, short* address) { throw new PlatformNotSupportedException(); } /// @@ -6082,7 +5871,6 @@ internal Arm64() { } /// LD1W Zresult.S, Pg/Z, [Xarray, Xindex, LSL #2] /// LD1W Zresult.S, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe Vector LoadVector(Vector mask, int* address) { throw new PlatformNotSupportedException(); } /// @@ -6090,7 +5878,6 @@ internal Arm64() { } /// LD1D Zresult.D, Pg/Z, [Xarray, Xindex, LSL #3] /// LD1D Zresult.D, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe Vector LoadVector(Vector mask, long* address) { throw new PlatformNotSupportedException(); } /// @@ -6098,7 +5885,6 @@ internal Arm64() { } /// LD1B Zresult.B, Pg/Z, [Xarray, Xindex] /// LD1B Zresult.B, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe Vector LoadVector(Vector mask, sbyte* address) { throw new PlatformNotSupportedException(); } /// @@ -6106,7 +5892,6 @@ internal Arm64() { } /// LD1W Zresult.S, Pg/Z, [Xarray, Xindex, LSL #2] /// LD1W Zresult.S, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe Vector LoadVector(Vector mask, float* address) { throw new PlatformNotSupportedException(); } /// @@ -6114,7 +5899,6 @@ internal Arm64() { } /// LD1H Zresult.H, Pg/Z, [Xarray, Xindex, LSL #1] /// LD1H Zresult.H, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe Vector LoadVector(Vector mask, ushort* address) { throw new PlatformNotSupportedException(); } /// @@ -6122,7 +5906,6 @@ internal Arm64() { } /// LD1W Zresult.S, Pg/Z, [Xarray, Xindex, LSL #2] /// LD1W Zresult.S, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe Vector LoadVector(Vector mask, uint* address) { throw new PlatformNotSupportedException(); } /// @@ -6130,7 +5913,6 @@ internal Arm64() { } /// LD1D Zresult.D, Pg/Z, [Xarray, Xindex, LSL #3] /// LD1D Zresult.D, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe Vector LoadVector(Vector mask, ulong* address) { throw new PlatformNotSupportedException(); } @@ -6140,70 +5922,60 @@ internal Arm64() { } /// svuint8_t svld1rq[_u8](svbool_t pg, const uint8_t *base) /// LD1RQB Zresult.B, Pg/Z, [Xbase, #0] /// - [RequiresUnsafe] public static unsafe Vector LoadVector128AndReplicateToVector(Vector mask, byte* address) { throw new PlatformNotSupportedException(); } /// /// svfloat64_t svld1rq[_f64](svbool_t pg, const float64_t *base) /// LD1RQD Zresult.D, Pg/Z, [Xbase, #0] /// - [RequiresUnsafe] public static unsafe Vector LoadVector128AndReplicateToVector(Vector mask, double* address) { throw new PlatformNotSupportedException(); } /// /// svint16_t svld1rq[_s16](svbool_t pg, const int16_t *base) /// LD1RQH Zresult.H, Pg/Z, [Xbase, #0] /// - [RequiresUnsafe] public static unsafe Vector LoadVector128AndReplicateToVector(Vector mask, short* address) { throw new PlatformNotSupportedException(); } /// /// svint32_t svld1rq[_s32](svbool_t pg, const int32_t *base) /// LD1RQW Zresult.S, Pg/Z, [Xbase, #0] /// - [RequiresUnsafe] public static unsafe Vector LoadVector128AndReplicateToVector(Vector mask, int* address) { throw new PlatformNotSupportedException(); } /// /// svint64_t svld1rq[_s64](svbool_t pg, const int64_t *base) /// LD1RQD Zresult.D, Pg/Z, [Xbase, #0] /// - [RequiresUnsafe] public static unsafe Vector LoadVector128AndReplicateToVector(Vector mask, long* address) { throw new PlatformNotSupportedException(); } /// /// svint8_t svld1rq[_s8](svbool_t pg, const int8_t *base) /// LD1RQB Zresult.B, Pg/Z, [Xbase, #0] /// - [RequiresUnsafe] public static unsafe Vector LoadVector128AndReplicateToVector(Vector mask, sbyte* address) { throw new PlatformNotSupportedException(); } /// /// svfloat32_t svld1rq[_f32](svbool_t pg, const float32_t *base) /// LD1RQW Zresult.S, Pg/Z, [Xbase, #0] /// - [RequiresUnsafe] public static unsafe Vector LoadVector128AndReplicateToVector(Vector mask, float* address) { throw new PlatformNotSupportedException(); } /// /// svuint16_t svld1rq[_u16](svbool_t pg, const uint16_t *base) /// LD1RQH Zresult.H, Pg/Z, [Xbase, #0] /// - [RequiresUnsafe] public static unsafe Vector LoadVector128AndReplicateToVector(Vector mask, ushort* address) { throw new PlatformNotSupportedException(); } /// /// svuint32_t svld1rq[_u32](svbool_t pg, const uint32_t *base) /// LD1RQW Zresult.S, Pg/Z, [Xbase, #0] /// - [RequiresUnsafe] public static unsafe Vector LoadVector128AndReplicateToVector(Vector mask, uint* address) { throw new PlatformNotSupportedException(); } /// /// svuint64_t svld1rq[_u64](svbool_t pg, const uint64_t *base) /// LD1RQD Zresult.D, Pg/Z, [Xbase, #0] /// - [RequiresUnsafe] public static unsafe Vector LoadVector128AndReplicateToVector(Vector mask, ulong* address) { throw new PlatformNotSupportedException(); } @@ -6213,7 +5985,6 @@ internal Arm64() { } /// svint16_t svldnf1ub_s16(svbool_t pg, const uint8_t *base) /// LDNF1B Zresult.H, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorByteNonFaultingZeroExtendToInt16(Vector mask, byte* address) { throw new PlatformNotSupportedException(); } @@ -6223,7 +5994,6 @@ internal Arm64() { } /// svint32_t svldnf1ub_s32(svbool_t pg, const uint8_t *base) /// LDNF1B Zresult.S, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorByteNonFaultingZeroExtendToInt32(Vector mask, byte* address) { throw new PlatformNotSupportedException(); } @@ -6233,7 +6003,6 @@ internal Arm64() { } /// svint64_t svldnf1ub_s64(svbool_t pg, const uint8_t *base) /// LDNF1B Zresult.D, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorByteNonFaultingZeroExtendToInt64(Vector mask, byte* address) { throw new PlatformNotSupportedException(); } @@ -6243,7 +6012,6 @@ internal Arm64() { } /// svuint16_t svldnf1ub_u16(svbool_t pg, const uint8_t *base) /// LDNF1B Zresult.H, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorByteNonFaultingZeroExtendToUInt16(Vector mask, byte* address) { throw new PlatformNotSupportedException(); } @@ -6253,7 +6021,6 @@ internal Arm64() { } /// svuint32_t svldnf1ub_u32(svbool_t pg, const uint8_t *base) /// LDNF1B Zresult.S, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorByteNonFaultingZeroExtendToUInt32(Vector mask, byte* address) { throw new PlatformNotSupportedException(); } @@ -6263,7 +6030,6 @@ internal Arm64() { } /// svuint64_t svldnf1ub_u64(svbool_t pg, const uint8_t *base) /// LDNF1B Zresult.D, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorByteNonFaultingZeroExtendToUInt64(Vector mask, byte* address) { throw new PlatformNotSupportedException(); } @@ -6271,42 +6037,36 @@ internal Arm64() { } /// svint16_t svldff1ub_s16(svbool_t pg, const uint8_t *base) /// LDFF1B Zresult.H, Pg/Z, [Xbase, XZR] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorByteZeroExtendFirstFaulting(Vector mask, byte* address) { throw new PlatformNotSupportedException(); } /// /// svint32_t svldff1ub_s32(svbool_t pg, const uint8_t *base) /// LDFF1B Zresult.S, Pg/Z, [Xbase, XZR] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorByteZeroExtendFirstFaulting(Vector mask, byte* address) { throw new PlatformNotSupportedException(); } /// /// svint64_t svldff1ub_s64(svbool_t pg, const uint8_t *base) /// LDFF1B Zresult.D, Pg/Z, [Xbase, XZR] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorByteZeroExtendFirstFaulting(Vector mask, byte* address) { throw new PlatformNotSupportedException(); } /// /// svuint16_t svldff1ub_u16(svbool_t pg, const uint8_t *base) /// LDFF1B Zresult.H, Pg/Z, [Xbase, XZR] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorByteZeroExtendFirstFaulting(Vector mask, byte* address) { throw new PlatformNotSupportedException(); } /// /// svuint32_t svldff1ub_u32(svbool_t pg, const uint8_t *base) /// LDFF1B Zresult.S, Pg/Z, [Xbase, XZR] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorByteZeroExtendFirstFaulting(Vector mask, byte* address) { throw new PlatformNotSupportedException(); } /// /// svuint64_t svldff1ub_u64(svbool_t pg, const uint8_t *base) /// LDFF1B Zresult.D, Pg/Z, [Xbase, XZR] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorByteZeroExtendFirstFaulting(Vector mask, byte* address) { throw new PlatformNotSupportedException(); } @@ -6316,7 +6076,6 @@ internal Arm64() { } /// svint16_t svld1ub_s16(svbool_t pg, const uint8_t *base) /// LD1B Zresult.H, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorByteZeroExtendToInt16(Vector mask, byte* address) { throw new PlatformNotSupportedException(); } @@ -6326,7 +6085,6 @@ internal Arm64() { } /// svint32_t svld1ub_s32(svbool_t pg, const uint8_t *base) /// LD1B Zresult.S, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorByteZeroExtendToInt32(Vector mask, byte* address) { throw new PlatformNotSupportedException(); } @@ -6336,7 +6094,6 @@ internal Arm64() { } /// svint64_t svld1ub_s64(svbool_t pg, const uint8_t *base) /// LD1B Zresult.D, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorByteZeroExtendToInt64(Vector mask, byte* address) { throw new PlatformNotSupportedException(); } @@ -6346,7 +6103,6 @@ internal Arm64() { } /// svuint16_t svld1ub_u16(svbool_t pg, const uint8_t *base) /// LD1B Zresult.H, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorByteZeroExtendToUInt16(Vector mask, byte* address) { throw new PlatformNotSupportedException(); } @@ -6356,7 +6112,6 @@ internal Arm64() { } /// svuint32_t svld1ub_u32(svbool_t pg, const uint8_t *base) /// LD1B Zresult.S, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorByteZeroExtendToUInt32(Vector mask, byte* address) { throw new PlatformNotSupportedException(); } @@ -6366,7 +6121,6 @@ internal Arm64() { } /// svuint64_t svld1ub_u64(svbool_t pg, const uint8_t *base) /// LD1B Zresult.D, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorByteZeroExtendToUInt64(Vector mask, byte* address) { throw new PlatformNotSupportedException(); } @@ -6376,70 +6130,60 @@ internal Arm64() { } /// svuint8_t svldff1[_u8](svbool_t pg, const uint8_t *base) /// LDFF1B Zresult.B, Pg/Z, [Xbase, XZR] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorFirstFaulting(Vector mask, byte* address) { throw new PlatformNotSupportedException(); } /// /// svfloat64_t svldff1[_f64](svbool_t pg, const float64_t *base) /// LDFF1D Zresult.D, Pg/Z, [Xbase, XZR, LSL #3] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorFirstFaulting(Vector mask, double* address) { throw new PlatformNotSupportedException(); } /// /// svint16_t svldff1[_s16](svbool_t pg, const int16_t *base) /// LDFF1H Zresult.H, Pg/Z, [Xbase, XZR, LSL #1] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorFirstFaulting(Vector mask, short* address) { throw new PlatformNotSupportedException(); } /// /// svint32_t svldff1[_s32](svbool_t pg, const int32_t *base) /// LDFF1W Zresult.S, Pg/Z, [Xbase, XZR, LSL #2] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorFirstFaulting(Vector mask, int* address) { throw new PlatformNotSupportedException(); } /// /// svint64_t svldff1[_s64](svbool_t pg, const int64_t *base) /// LDFF1D Zresult.D, Pg/Z, [Xbase, XZR, LSL #3] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorFirstFaulting(Vector mask, long* address) { throw new PlatformNotSupportedException(); } /// /// svint8_t svldff1[_s8](svbool_t pg, const int8_t *base) /// LDFF1B Zresult.B, Pg/Z, [Xbase, XZR] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorFirstFaulting(Vector mask, sbyte* address) { throw new PlatformNotSupportedException(); } /// /// svfloat32_t svldff1[_f32](svbool_t pg, const float32_t *base) /// LDFF1W Zresult.S, Pg/Z, [Xbase, XZR, LSL #2] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorFirstFaulting(Vector mask, float* address) { throw new PlatformNotSupportedException(); } /// /// svuint16_t svldff1[_u16](svbool_t pg, const uint16_t *base) /// LDFF1H Zresult.H, Pg/Z, [Xbase, XZR, LSL #1] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorFirstFaulting(Vector mask, ushort* address) { throw new PlatformNotSupportedException(); } /// /// svuint32_t svldff1[_u32](svbool_t pg, const uint32_t *base) /// LDFF1W Zresult.S, Pg/Z, [Xbase, XZR, LSL #2] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorFirstFaulting(Vector mask, uint* address) { throw new PlatformNotSupportedException(); } /// /// svuint64_t svldff1[_u64](svbool_t pg, const uint64_t *base) /// LDFF1D Zresult.D, Pg/Z, [Xbase, XZR, LSL #3] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorFirstFaulting(Vector mask, ulong* address) { throw new PlatformNotSupportedException(); } @@ -6449,7 +6193,6 @@ internal Arm64() { } /// svint32_t svldnf1sh_s32(svbool_t pg, const int16_t *base) /// LDNF1SH Zresult.S, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorInt16NonFaultingSignExtendToInt32(Vector mask, short* address) { throw new PlatformNotSupportedException(); } @@ -6459,7 +6202,6 @@ internal Arm64() { } /// svint64_t svldnf1sh_s64(svbool_t pg, const int16_t *base) /// LDNF1SH Zresult.D, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorInt16NonFaultingSignExtendToInt64(Vector mask, short* address) { throw new PlatformNotSupportedException(); } @@ -6469,7 +6211,6 @@ internal Arm64() { } /// svuint32_t svldnf1sh_u32(svbool_t pg, const int16_t *base) /// LDNF1SH Zresult.S, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorInt16NonFaultingSignExtendToUInt32(Vector mask, short* address) { throw new PlatformNotSupportedException(); } @@ -6479,7 +6220,6 @@ internal Arm64() { } /// svuint64_t svldnf1sh_u64(svbool_t pg, const int16_t *base) /// LDNF1SH Zresult.D, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorInt16NonFaultingSignExtendToUInt64(Vector mask, short* address) { throw new PlatformNotSupportedException(); } @@ -6489,28 +6229,24 @@ internal Arm64() { } /// svint32_t svldff1sh_s32(svbool_t pg, const int16_t *base) /// LDFF1SH Zresult.S, Pg/Z, [Xbase, XZR, LSL #1] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorInt16SignExtendFirstFaulting(Vector mask, short* address) { throw new PlatformNotSupportedException(); } /// /// svint64_t svldff1sh_s64(svbool_t pg, const int16_t *base) /// LDFF1SH Zresult.D, Pg/Z, [Xbase, XZR, LSL #1] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorInt16SignExtendFirstFaulting(Vector mask, short* address) { throw new PlatformNotSupportedException(); } /// /// svuint32_t svldff1sh_u32(svbool_t pg, const int16_t *base) /// LDFF1SH Zresult.S, Pg/Z, [Xbase, XZR, LSL #1] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorInt16SignExtendFirstFaulting(Vector mask, short* address) { throw new PlatformNotSupportedException(); } /// /// svuint64_t svldff1sh_u64(svbool_t pg, const int16_t *base) /// LDFF1SH Zresult.D, Pg/Z, [Xbase, XZR, LSL #1] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorInt16SignExtendFirstFaulting(Vector mask, short* address) { throw new PlatformNotSupportedException(); } @@ -6520,7 +6256,6 @@ internal Arm64() { } /// svint32_t svld1sh_s32(svbool_t pg, const int16_t *base) /// LD1SH Zresult.S, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorInt16SignExtendToInt32(Vector mask, short* address) { throw new PlatformNotSupportedException(); } @@ -6530,7 +6265,6 @@ internal Arm64() { } /// svint64_t svld1sh_s64(svbool_t pg, const int16_t *base) /// LD1SH Zresult.D, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorInt16SignExtendToInt64(Vector mask, short* address) { throw new PlatformNotSupportedException(); } @@ -6540,7 +6274,6 @@ internal Arm64() { } /// svuint32_t svld1sh_u32(svbool_t pg, const int16_t *base) /// LD1SH Zresult.S, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorInt16SignExtendToUInt32(Vector mask, short* address) { throw new PlatformNotSupportedException(); } @@ -6550,7 +6283,6 @@ internal Arm64() { } /// svuint64_t svld1sh_u64(svbool_t pg, const int16_t *base) /// LD1SH Zresult.D, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorInt16SignExtendToUInt64(Vector mask, short* address) { throw new PlatformNotSupportedException(); } @@ -6560,7 +6292,6 @@ internal Arm64() { } /// svint64_t svldnf1sw_s64(svbool_t pg, const int32_t *base) /// LDNF1SW Zresult.D, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorInt32NonFaultingSignExtendToInt64(Vector mask, int* address) { throw new PlatformNotSupportedException(); } @@ -6570,7 +6301,6 @@ internal Arm64() { } /// svuint64_t svldnf1sw_u64(svbool_t pg, const int32_t *base) /// LDNF1SW Zresult.D, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorInt32NonFaultingSignExtendToUInt64(Vector mask, int* address) { throw new PlatformNotSupportedException(); } @@ -6580,14 +6310,12 @@ internal Arm64() { } /// svint64_t svldff1sw_s64(svbool_t pg, const int32_t *base) /// LDFF1SW Zresult.D, Pg/Z, [Xbase, XZR, LSL #2] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorInt32SignExtendFirstFaulting(Vector mask, int* address) { throw new PlatformNotSupportedException(); } /// /// svuint64_t svldff1sw_u64(svbool_t pg, const int32_t *base) /// LDFF1SW Zresult.D, Pg/Z, [Xbase, XZR, LSL #2] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorInt32SignExtendFirstFaulting(Vector mask, int* address) { throw new PlatformNotSupportedException(); } @@ -6597,7 +6325,6 @@ internal Arm64() { } /// svint64_t svld1sw_s64(svbool_t pg, const int32_t *base) /// LD1SW Zresult.D, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorInt32SignExtendToInt64(Vector mask, int* address) { throw new PlatformNotSupportedException(); } @@ -6607,7 +6334,6 @@ internal Arm64() { } /// svuint64_t svld1sw_u64(svbool_t pg, const int32_t *base) /// LD1SW Zresult.D, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorInt32SignExtendToUInt64(Vector mask, int* address) { throw new PlatformNotSupportedException(); } @@ -6617,70 +6343,60 @@ internal Arm64() { } /// svuint8_t svldnf1[_u8](svbool_t pg, const uint8_t *base) /// LDNF1B Zresult.B, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorNonFaulting(Vector mask, byte* address) { throw new PlatformNotSupportedException(); } /// /// svfloat64_t svldnf1[_f64](svbool_t pg, const float64_t *base) /// LDNF1D Zresult.D, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorNonFaulting(Vector mask, double* address) { throw new PlatformNotSupportedException(); } /// /// svint16_t svldnf1[_s16](svbool_t pg, const int16_t *base) /// LDNF1H Zresult.H, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorNonFaulting(Vector mask, short* address) { throw new PlatformNotSupportedException(); } /// /// svint32_t svldnf1[_s32](svbool_t pg, const int32_t *base) /// LDNF1W Zresult.S, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorNonFaulting(Vector mask, int* address) { throw new PlatformNotSupportedException(); } /// /// svint64_t svldnf1[_s64](svbool_t pg, const int64_t *base) /// LDNF1D Zresult.D, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorNonFaulting(Vector mask, long* address) { throw new PlatformNotSupportedException(); } /// /// svint8_t svldnf1[_s8](svbool_t pg, const int8_t *base) /// LDNF1B Zresult.B, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorNonFaulting(Vector mask, sbyte* address) { throw new PlatformNotSupportedException(); } /// /// svfloat32_t svldnf1[_f32](svbool_t pg, const float32_t *base) /// LDNF1W Zresult.S, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorNonFaulting(Vector mask, float* address) { throw new PlatformNotSupportedException(); } /// /// svuint16_t svldnf1[_u16](svbool_t pg, const uint16_t *base) /// LDNF1H Zresult.H, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorNonFaulting(Vector mask, ushort* address) { throw new PlatformNotSupportedException(); } /// /// svuint32_t svldnf1[_u32](svbool_t pg, const uint32_t *base) /// LDNF1W Zresult.S, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorNonFaulting(Vector mask, uint* address) { throw new PlatformNotSupportedException(); } /// /// svuint64_t svldnf1[_u64](svbool_t pg, const uint64_t *base) /// LDNF1D Zresult.D, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorNonFaulting(Vector mask, ulong* address) { throw new PlatformNotSupportedException(); } @@ -6690,70 +6406,60 @@ internal Arm64() { } /// svuint8_t svldnt1[_u8](svbool_t pg, const uint8_t *base) /// LDNT1B Zresult.B, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorNonTemporal(Vector mask, byte* address) { throw new PlatformNotSupportedException(); } /// /// svfloat64_t svldnt1[_f64](svbool_t pg, const float64_t *base) /// LDNT1D Zresult.D, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorNonTemporal(Vector mask, double* address) { throw new PlatformNotSupportedException(); } /// /// svint16_t svldnt1[_s16](svbool_t pg, const int16_t *base) /// LDNT1H Zresult.H, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorNonTemporal(Vector mask, short* address) { throw new PlatformNotSupportedException(); } /// /// svint32_t svldnt1[_s32](svbool_t pg, const int32_t *base) /// LDNT1W Zresult.S, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorNonTemporal(Vector mask, int* address) { throw new PlatformNotSupportedException(); } /// /// svint64_t svldnt1[_s64](svbool_t pg, const int64_t *base) /// LDNT1D Zresult.D, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorNonTemporal(Vector mask, long* address) { throw new PlatformNotSupportedException(); } /// /// svint8_t svldnt1[_s8](svbool_t pg, const int8_t *base) /// LDNT1B Zresult.B, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorNonTemporal(Vector mask, sbyte* address) { throw new PlatformNotSupportedException(); } /// /// svfloat32_t svldnt1[_f32](svbool_t pg, const float32_t *base) /// LDNT1W Zresult.S, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorNonTemporal(Vector mask, float* address) { throw new PlatformNotSupportedException(); } /// /// svuint16_t svldnt1[_u16](svbool_t pg, const uint16_t *base) /// LDNT1H Zresult.H, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorNonTemporal(Vector mask, ushort* address) { throw new PlatformNotSupportedException(); } /// /// svuint32_t svldnt1[_u32](svbool_t pg, const uint32_t *base) /// LDNT1W Zresult.S, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorNonTemporal(Vector mask, uint* address) { throw new PlatformNotSupportedException(); } /// /// svuint64_t svldnt1[_u64](svbool_t pg, const uint64_t *base) /// LDNT1D Zresult.D, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorNonTemporal(Vector mask, ulong* address) { throw new PlatformNotSupportedException(); } @@ -6763,7 +6469,6 @@ internal Arm64() { } /// svint16_t svldnf1sb_s16(svbool_t pg, const int8_t *base) /// LDNF1SB Zresult.H, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorSByteNonFaultingSignExtendToInt16(Vector mask, sbyte* address) { throw new PlatformNotSupportedException(); } @@ -6773,7 +6478,6 @@ internal Arm64() { } /// svint32_t svldnf1sb_s32(svbool_t pg, const int8_t *base) /// LDNF1SB Zresult.S, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorSByteNonFaultingSignExtendToInt32(Vector mask, sbyte* address) { throw new PlatformNotSupportedException(); } @@ -6783,7 +6487,6 @@ internal Arm64() { } /// svint64_t svldnf1sb_s64(svbool_t pg, const int8_t *base) /// LDNF1SB Zresult.D, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorSByteNonFaultingSignExtendToInt64(Vector mask, sbyte* address) { throw new PlatformNotSupportedException(); } @@ -6793,7 +6496,6 @@ internal Arm64() { } /// svuint16_t svldnf1sb_u16(svbool_t pg, const int8_t *base) /// LDNF1SB Zresult.H, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorSByteNonFaultingSignExtendToUInt16(Vector mask, sbyte* address) { throw new PlatformNotSupportedException(); } @@ -6803,7 +6505,6 @@ internal Arm64() { } /// svuint32_t svldnf1sb_u32(svbool_t pg, const int8_t *base) /// LDNF1SB Zresult.S, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorSByteNonFaultingSignExtendToUInt32(Vector mask, sbyte* address) { throw new PlatformNotSupportedException(); } @@ -6813,7 +6514,6 @@ internal Arm64() { } /// svuint64_t svldnf1sb_u64(svbool_t pg, const int8_t *base) /// LDNF1SB Zresult.D, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorSByteNonFaultingSignExtendToUInt64(Vector mask, sbyte* address) { throw new PlatformNotSupportedException(); } @@ -6823,42 +6523,36 @@ internal Arm64() { } /// svint16_t svldff1sb_s16(svbool_t pg, const int8_t *base) /// LDFF1SB Zresult.H, Pg/Z, [Xbase, XZR] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorSByteSignExtendFirstFaulting(Vector mask, sbyte* address) { throw new PlatformNotSupportedException(); } /// /// svint32_t svldff1sb_s32(svbool_t pg, const int8_t *base) /// LDFF1SB Zresult.S, Pg/Z, [Xbase, XZR] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorSByteSignExtendFirstFaulting(Vector mask, sbyte* address) { throw new PlatformNotSupportedException(); } /// /// svint64_t svldff1sb_s64(svbool_t pg, const int8_t *base) /// LDFF1SB Zresult.D, Pg/Z, [Xbase, XZR] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorSByteSignExtendFirstFaulting(Vector mask, sbyte* address) { throw new PlatformNotSupportedException(); } /// /// svuint16_t svldff1sb_u16(svbool_t pg, const int8_t *base) /// LDFF1SB Zresult.H, Pg/Z, [Xbase, XZR] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorSByteSignExtendFirstFaulting(Vector mask, sbyte* address) { throw new PlatformNotSupportedException(); } /// /// svuint32_t svldff1sb_u32(svbool_t pg, const int8_t *base) /// LDFF1SB Zresult.S, Pg/Z, [Xbase, XZR] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorSByteSignExtendFirstFaulting(Vector mask, sbyte* address) { throw new PlatformNotSupportedException(); } /// /// svuint64_t svldff1sb_u64(svbool_t pg, const int8_t *base) /// LDFF1SB Zresult.D, Pg/Z, [Xbase, XZR] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorSByteSignExtendFirstFaulting(Vector mask, sbyte* address) { throw new PlatformNotSupportedException(); } @@ -6868,7 +6562,6 @@ internal Arm64() { } /// svint16_t svld1sb_s16(svbool_t pg, const int8_t *base) /// LD1SB Zresult.H, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorSByteSignExtendToInt16(Vector mask, sbyte* address) { throw new PlatformNotSupportedException(); } @@ -6878,7 +6571,6 @@ internal Arm64() { } /// svint32_t svld1sb_s32(svbool_t pg, const int8_t *base) /// LD1SB Zresult.S, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorSByteSignExtendToInt32(Vector mask, sbyte* address) { throw new PlatformNotSupportedException(); } @@ -6888,7 +6580,6 @@ internal Arm64() { } /// svint64_t svld1sb_s64(svbool_t pg, const int8_t *base) /// LD1SB Zresult.D, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorSByteSignExtendToInt64(Vector mask, sbyte* address) { throw new PlatformNotSupportedException(); } @@ -6898,7 +6589,6 @@ internal Arm64() { } /// svuint16_t svld1sb_u16(svbool_t pg, const int8_t *base) /// LD1SB Zresult.H, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorSByteSignExtendToUInt16(Vector mask, sbyte* address) { throw new PlatformNotSupportedException(); } @@ -6908,7 +6598,6 @@ internal Arm64() { } /// svuint32_t svld1sb_u32(svbool_t pg, const int8_t *base) /// LD1SB Zresult.S, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorSByteSignExtendToUInt32(Vector mask, sbyte* address) { throw new PlatformNotSupportedException(); } @@ -6918,7 +6607,6 @@ internal Arm64() { } /// svuint64_t svld1sb_u64(svbool_t pg, const int8_t *base) /// LD1SB Zresult.D, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorSByteSignExtendToUInt64(Vector mask, sbyte* address) { throw new PlatformNotSupportedException(); } @@ -6928,7 +6616,6 @@ internal Arm64() { } /// svint32_t svldnf1uh_s32(svbool_t pg, const uint16_t *base) /// LDNF1H Zresult.S, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorUInt16NonFaultingZeroExtendToInt32(Vector mask, ushort* address) { throw new PlatformNotSupportedException(); } @@ -6938,7 +6625,6 @@ internal Arm64() { } /// svint64_t svldnf1uh_s64(svbool_t pg, const uint16_t *base) /// LDNF1H Zresult.D, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorUInt16NonFaultingZeroExtendToInt64(Vector mask, ushort* address) { throw new PlatformNotSupportedException(); } @@ -6948,7 +6634,6 @@ internal Arm64() { } /// svuint32_t svldnf1uh_u32(svbool_t pg, const uint16_t *base) /// LDNF1H Zresult.S, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorUInt16NonFaultingZeroExtendToUInt32(Vector mask, ushort* address) { throw new PlatformNotSupportedException(); } @@ -6958,7 +6643,6 @@ internal Arm64() { } /// svuint64_t svldnf1uh_u64(svbool_t pg, const uint16_t *base) /// LDNF1H Zresult.D, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorUInt16NonFaultingZeroExtendToUInt64(Vector mask, ushort* address) { throw new PlatformNotSupportedException(); } @@ -6968,28 +6652,24 @@ internal Arm64() { } /// svint32_t svldff1uh_s32(svbool_t pg, const uint16_t *base) /// LDFF1H Zresult.S, Pg/Z, [Xbase, XZR, LSL #1] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorUInt16ZeroExtendFirstFaulting(Vector mask, ushort* address) { throw new PlatformNotSupportedException(); } /// /// svint64_t svldff1uh_s64(svbool_t pg, const uint16_t *base) /// LDFF1H Zresult.D, Pg/Z, [Xbase, XZR, LSL #1] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorUInt16ZeroExtendFirstFaulting(Vector mask, ushort* address) { throw new PlatformNotSupportedException(); } /// /// svuint32_t svldff1uh_u32(svbool_t pg, const uint16_t *base) /// LDFF1H Zresult.S, Pg/Z, [Xbase, XZR, LSL #1] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorUInt16ZeroExtendFirstFaulting(Vector mask, ushort* address) { throw new PlatformNotSupportedException(); } /// /// svuint64_t svldff1uh_u64(svbool_t pg, const uint16_t *base) /// LDFF1H Zresult.D, Pg/Z, [Xbase, XZR, LSL #1] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorUInt16ZeroExtendFirstFaulting(Vector mask, ushort* address) { throw new PlatformNotSupportedException(); } @@ -6999,7 +6679,6 @@ internal Arm64() { } /// svint32_t svld1uh_s32(svbool_t pg, const uint16_t *base) /// LD1H Zresult.S, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorUInt16ZeroExtendToInt32(Vector mask, ushort* address) { throw new PlatformNotSupportedException(); } @@ -7009,7 +6688,6 @@ internal Arm64() { } /// svint64_t svld1uh_s64(svbool_t pg, const uint16_t *base) /// LD1H Zresult.D, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorUInt16ZeroExtendToInt64(Vector mask, ushort* address) { throw new PlatformNotSupportedException(); } @@ -7019,7 +6697,6 @@ internal Arm64() { } /// svuint32_t svld1uh_u32(svbool_t pg, const uint16_t *base) /// LD1H Zresult.S, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorUInt16ZeroExtendToUInt32(Vector mask, ushort* address) { throw new PlatformNotSupportedException(); } @@ -7029,7 +6706,6 @@ internal Arm64() { } /// svuint64_t svld1uh_u64(svbool_t pg, const uint16_t *base) /// LD1H Zresult.D, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorUInt16ZeroExtendToUInt64(Vector mask, ushort* address) { throw new PlatformNotSupportedException(); } @@ -7039,7 +6715,6 @@ internal Arm64() { } /// svint64_t svldnf1uw_s64(svbool_t pg, const uint32_t *base) /// LDNF1W Zresult.D, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorUInt32NonFaultingZeroExtendToInt64(Vector mask, uint* address) { throw new PlatformNotSupportedException(); } @@ -7049,7 +6724,6 @@ internal Arm64() { } /// svuint64_t svldnf1uw_u64(svbool_t pg, const uint32_t *base) /// LDNF1W Zresult.D, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorUInt32NonFaultingZeroExtendToUInt64(Vector mask, uint* address) { throw new PlatformNotSupportedException(); } @@ -7059,14 +6733,12 @@ internal Arm64() { } /// svint64_t svldff1uw_s64(svbool_t pg, const uint32_t *base) /// LDFF1W Zresult.D, Pg/Z, [Xbase, XZR, LSL #2] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorUInt32ZeroExtendFirstFaulting(Vector mask, uint* address) { throw new PlatformNotSupportedException(); } /// /// svuint64_t svldff1uw_u64(svbool_t pg, const uint32_t *base) /// LDFF1W Zresult.D, Pg/Z, [Xbase, XZR, LSL #2] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorUInt32ZeroExtendFirstFaulting(Vector mask, uint* address) { throw new PlatformNotSupportedException(); } @@ -7076,7 +6748,6 @@ internal Arm64() { } /// svint64_t svld1uw_s64(svbool_t pg, const uint32_t *base) /// LD1W Zresult.D, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorUInt32ZeroExtendToInt64(Vector mask, uint* address) { throw new PlatformNotSupportedException(); } @@ -7086,7 +6757,6 @@ internal Arm64() { } /// svuint64_t svld1uw_u64(svbool_t pg, const uint32_t *base) /// LD1W Zresult.D, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorUInt32ZeroExtendToUInt64(Vector mask, uint* address) { throw new PlatformNotSupportedException(); } @@ -7096,70 +6766,60 @@ internal Arm64() { } /// svuint8x2_t svld2[_u8](svbool_t pg, const uint8_t *base) /// LD2B {Zresult0.B, Zresult1.B}, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe (Vector, Vector) Load2xVectorAndUnzip(Vector mask, byte* address) { throw new PlatformNotSupportedException(); } /// /// svfloat64x2_t svld2[_f64](svbool_t pg, const float64_t *base) /// LD2D {Zresult0.D, Zresult1.D}, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe (Vector, Vector) Load2xVectorAndUnzip(Vector mask, double* address) { throw new PlatformNotSupportedException(); } /// /// svint16x2_t svld2[_s16](svbool_t pg, const int16_t *base) /// LD2H {Zresult0.H, Zresult1.H}, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe (Vector, Vector) Load2xVectorAndUnzip(Vector mask, short* address) { throw new PlatformNotSupportedException(); } /// /// svint32x2_t svld2[_s32](svbool_t pg, const int32_t *base) /// LD2W {Zresult0.S, Zresult1.S}, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe (Vector, Vector) Load2xVectorAndUnzip(Vector mask, int* address) { throw new PlatformNotSupportedException(); } /// /// svint64x2_t svld2[_s64](svbool_t pg, const int64_t *base) /// LD2D {Zresult0.D, Zresult1.D}, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe (Vector, Vector) Load2xVectorAndUnzip(Vector mask, long* address) { throw new PlatformNotSupportedException(); } /// /// svint8x2_t svld2[_s8](svbool_t pg, const int8_t *base) /// LD2B {Zresult0.B, Zresult1.B}, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe (Vector, Vector) Load2xVectorAndUnzip(Vector mask, sbyte* address) { throw new PlatformNotSupportedException(); } /// /// svfloat32x2_t svld2[_f32](svbool_t pg, const float32_t *base) /// LD2W {Zresult0.S, Zresult1.S}, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe (Vector, Vector) Load2xVectorAndUnzip(Vector mask, float* address) { throw new PlatformNotSupportedException(); } /// /// svuint16x2_t svld2[_u16](svbool_t pg, const uint16_t *base) /// LD2H {Zresult0.H, Zresult1.H}, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe (Vector, Vector) Load2xVectorAndUnzip(Vector mask, ushort* address) { throw new PlatformNotSupportedException(); } /// /// svuint32x2_t svld2[_u32](svbool_t pg, const uint32_t *base) /// LD2W {Zresult0.S, Zresult1.S}, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe (Vector, Vector) Load2xVectorAndUnzip(Vector mask, uint* address) { throw new PlatformNotSupportedException(); } /// /// svuint64x2_t svld2[_u64](svbool_t pg, const uint64_t *base) /// LD2D {Zresult0.D, Zresult1.D}, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe (Vector, Vector) Load2xVectorAndUnzip(Vector mask, ulong* address) { throw new PlatformNotSupportedException(); } @@ -7169,70 +6829,60 @@ internal Arm64() { } /// svuint8x3_t svld3[_u8](svbool_t pg, const uint8_t *base) /// LD3B {Zresult0.B - Zresult2.B}, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe (Vector, Vector, Vector) Load3xVectorAndUnzip(Vector mask, byte* address) { throw new PlatformNotSupportedException(); } /// /// svfloat64x3_t svld3[_f64](svbool_t pg, const float64_t *base) /// LD3D {Zresult0.D - Zresult2.D}, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe (Vector, Vector, Vector) Load3xVectorAndUnzip(Vector mask, double* address) { throw new PlatformNotSupportedException(); } /// /// svint16x3_t svld3[_s16](svbool_t pg, const int16_t *base) /// LD3H {Zresult0.H - Zresult2.H}, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe (Vector, Vector, Vector) Load3xVectorAndUnzip(Vector mask, short* address) { throw new PlatformNotSupportedException(); } /// /// svint32x3_t svld3[_s32](svbool_t pg, const int32_t *base) /// LD3W {Zresult0.S - Zresult2.S}, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe (Vector, Vector, Vector) Load3xVectorAndUnzip(Vector mask, int* address) { throw new PlatformNotSupportedException(); } /// /// svint64x3_t svld3[_s64](svbool_t pg, const int64_t *base) /// LD3D {Zresult0.D - Zresult2.D}, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe (Vector, Vector, Vector) Load3xVectorAndUnzip(Vector mask, long* address) { throw new PlatformNotSupportedException(); } /// /// svint8x3_t svld3[_s8](svbool_t pg, const int8_t *base) /// LD3B {Zresult0.B - Zresult2.B}, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe (Vector, Vector, Vector) Load3xVectorAndUnzip(Vector mask, sbyte* address) { throw new PlatformNotSupportedException(); } /// /// svfloat32x3_t svld3[_f32](svbool_t pg, const float32_t *base) /// LD3W {Zresult0.S - Zresult2.S}, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe (Vector, Vector, Vector) Load3xVectorAndUnzip(Vector mask, float* address) { throw new PlatformNotSupportedException(); } /// /// svuint16x3_t svld3[_u16](svbool_t pg, const uint16_t *base) /// LD3H {Zresult0.H - Zresult2.H}, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe (Vector, Vector, Vector) Load3xVectorAndUnzip(Vector mask, ushort* address) { throw new PlatformNotSupportedException(); } /// /// svuint32x3_t svld3[_u32](svbool_t pg, const uint32_t *base) /// LD3W {Zresult0.S - Zresult2.S}, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe (Vector, Vector, Vector) Load3xVectorAndUnzip(Vector mask, uint* address) { throw new PlatformNotSupportedException(); } /// /// svuint64x3_t svld3[_u64](svbool_t pg, const uint64_t *base) /// LD3D {Zresult0.D - Zresult2.D}, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe (Vector, Vector, Vector) Load3xVectorAndUnzip(Vector mask, ulong* address) { throw new PlatformNotSupportedException(); } @@ -7242,70 +6892,60 @@ internal Arm64() { } /// svuint8x4_t svld4[_u8](svbool_t pg, const uint8_t *base) /// LD4B {Zresult0.B - Zresult3.B}, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe (Vector, Vector, Vector, Vector) Load4xVectorAndUnzip(Vector mask, byte* address) { throw new PlatformNotSupportedException(); } /// /// svfloat64x4_t svld4[_f64](svbool_t pg, const float64_t *base) /// LD4D {Zresult0.D - Zresult3.D}, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe (Vector, Vector, Vector, Vector) Load4xVectorAndUnzip(Vector mask, double* address) { throw new PlatformNotSupportedException(); } /// /// svint16x4_t svld4[_s16](svbool_t pg, const int16_t *base) /// LD4H {Zresult0.H - Zresult3.H}, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe (Vector, Vector, Vector, Vector) Load4xVectorAndUnzip(Vector mask, short* address) { throw new PlatformNotSupportedException(); } /// /// svint32x4_t svld4[_s32](svbool_t pg, const int32_t *base) /// LD4W {Zresult0.S - Zresult3.S}, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe (Vector, Vector, Vector, Vector) Load4xVectorAndUnzip(Vector mask, int* address) { throw new PlatformNotSupportedException(); } /// /// svint64x4_t svld4[_s64](svbool_t pg, const int64_t *base) /// LD4D {Zresult0.D - Zresult3.D}, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe (Vector, Vector, Vector, Vector) Load4xVectorAndUnzip(Vector mask, long* address) { throw new PlatformNotSupportedException(); } /// /// svint8x4_t svld4[_s8](svbool_t pg, const int8_t *base) /// LD4B {Zresult0.B - Zresult3.B}, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe (Vector, Vector, Vector, Vector) Load4xVectorAndUnzip(Vector mask, sbyte* address) { throw new PlatformNotSupportedException(); } /// /// svfloat32x4_t svld4[_f32](svbool_t pg, const float32_t *base) /// LD4W {Zresult0.S - Zresult3.S}, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe (Vector, Vector, Vector, Vector) Load4xVectorAndUnzip(Vector mask, float* address) { throw new PlatformNotSupportedException(); } /// /// svuint16x4_t svld4[_u16](svbool_t pg, const uint16_t *base) /// LD4H {Zresult0.H - Zresult3.H}, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe (Vector, Vector, Vector, Vector) Load4xVectorAndUnzip(Vector mask, ushort* address) { throw new PlatformNotSupportedException(); } /// /// svuint32x4_t svld4[_u32](svbool_t pg, const uint32_t *base) /// LD4W {Zresult0.S - Zresult3.S}, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe (Vector, Vector, Vector, Vector) Load4xVectorAndUnzip(Vector mask, uint* address) { throw new PlatformNotSupportedException(); } /// /// svuint64x4_t svld4[_u64](svbool_t pg, const uint64_t *base) /// LD4D {Zresult0.D - Zresult3.D}, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe (Vector, Vector, Vector, Vector) Load4xVectorAndUnzip(Vector mask, ulong* address) { throw new PlatformNotSupportedException(); } @@ -8317,7 +7957,6 @@ internal Arm64() { } /// void svprfh(svbool_t pg, const void *base, enum svprfop op) /// PRFH op, Pg, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe void Prefetch16Bit(Vector mask, void* address, [ConstantExpected] SvePrefetchType prefetchType) { throw new PlatformNotSupportedException(); } @@ -8327,7 +7966,6 @@ internal Arm64() { } /// void svprfw(svbool_t pg, const void *base, enum svprfop op) /// PRFW op, Pg, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe void Prefetch32Bit(Vector mask, void* address, [ConstantExpected] SvePrefetchType prefetchType) { throw new PlatformNotSupportedException(); } @@ -8337,7 +7975,6 @@ internal Arm64() { } /// void svprfd(svbool_t pg, const void *base, enum svprfop op) /// PRFD op, Pg, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe void Prefetch64Bit(Vector mask, void* address, [ConstantExpected] SvePrefetchType prefetchType) { throw new PlatformNotSupportedException(); } @@ -8347,7 +7984,6 @@ internal Arm64() { } /// void svprfb(svbool_t pg, const void *base, enum svprfop op) /// PRFB op, Pg, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe void Prefetch8Bit(Vector mask, void* address, [ConstantExpected] SvePrefetchType prefetchType) { throw new PlatformNotSupportedException(); } @@ -9343,7 +8979,6 @@ internal Arm64() { } /// void svst1_scatter_[s64]offset[_f64](svbool_t pg, float64_t *base, svint64_t offsets, svfloat64_t data) /// ST1D Zdata.D, Pg, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe void Scatter(Vector mask, double* address, Vector indicies, Vector data) { throw new PlatformNotSupportedException(); } /// @@ -9356,14 +8991,12 @@ internal Arm64() { } /// void svst1_scatter_[u64]offset[_f64](svbool_t pg, float64_t *base, svuint64_t offsets, svfloat64_t data) /// ST1D Zdata.D, Pg, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe void Scatter(Vector mask, double* address, Vector indicies, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svst1_scatter_[s32]offset[_s32](svbool_t pg, int32_t *base, svint32_t offsets, svint32_t data) /// ST1W Zdata.S, Pg, [Xbase, Zoffsets.S, SXTW] /// - [RequiresUnsafe] public static unsafe void Scatter(Vector mask, int* address, Vector indicies, Vector data) { throw new PlatformNotSupportedException(); } // @@ -9377,14 +9010,12 @@ internal Arm64() { } /// void svst1_scatter_[u32]offset[_s32](svbool_t pg, int32_t *base, svuint32_t offsets, svint32_t data) /// ST1W Zdata.S, Pg, [Xbase, Zoffsets.S, UXTW] /// - [RequiresUnsafe] public static unsafe void Scatter(Vector mask, int* address, Vector indicies, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svst1_scatter_[s64]offset[_s64](svbool_t pg, int64_t *base, svint64_t offsets, svint64_t data) /// ST1D Zdata.D, Pg, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe void Scatter(Vector mask, long* address, Vector indicies, Vector data) { throw new PlatformNotSupportedException(); } /// @@ -9397,14 +9028,12 @@ internal Arm64() { } /// void svst1_scatter_[u64]offset[_s64](svbool_t pg, int64_t *base, svuint64_t offsets, svint64_t data) /// ST1D Zdata.D, Pg, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe void Scatter(Vector mask, long* address, Vector indicies, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svst1_scatter_[s32]offset[_f32](svbool_t pg, float32_t *base, svint32_t offsets, svfloat32_t data) /// ST1W Zdata.S, Pg, [Xbase, Zoffsets.S, SXTW] /// - [RequiresUnsafe] public static unsafe void Scatter(Vector mask, float* address, Vector indicies, Vector data) { throw new PlatformNotSupportedException(); } // @@ -9418,14 +9047,12 @@ internal Arm64() { } /// void svst1_scatter_[u32]offset[_f32](svbool_t pg, float32_t *base, svuint32_t offsets, svfloat32_t data) /// ST1W Zdata.S, Pg, [Xbase, Zoffsets.S, UXTW] /// - [RequiresUnsafe] public static unsafe void Scatter(Vector mask, float* address, Vector indicies, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svst1_scatter_[s32]offset[_u32](svbool_t pg, uint32_t *base, svint32_t offsets, svuint32_t data) /// ST1W Zdata.S, Pg, [Xbase, Zoffsets.S, SXTW] /// - [RequiresUnsafe] public static unsafe void Scatter(Vector mask, uint* address, Vector indicies, Vector data) { throw new PlatformNotSupportedException(); } // @@ -9439,14 +9066,12 @@ internal Arm64() { } /// void svst1_scatter_[u32]offset[_u32](svbool_t pg, uint32_t *base, svuint32_t offsets, svuint32_t data) /// ST1W Zdata.S, Pg, [Xbase, Zoffsets.S, UXTW] /// - [RequiresUnsafe] public static unsafe void Scatter(Vector mask, uint* address, Vector indicies, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svst1_scatter_[s64]offset[_u64](svbool_t pg, uint64_t *base, svint64_t offsets, svuint64_t data) /// ST1D Zdata.D, Pg, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe void Scatter(Vector mask, ulong* address, Vector indicies, Vector data) { throw new PlatformNotSupportedException(); } /// @@ -9459,7 +9084,6 @@ internal Arm64() { } /// void svst1_scatter_[u64]offset[_u64](svbool_t pg, uint64_t *base, svuint64_t offsets, svuint64_t data) /// ST1D Zdata.D, Pg, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe void Scatter(Vector mask, ulong* address, Vector indicies, Vector data) { throw new PlatformNotSupportedException(); } @@ -9495,56 +9119,48 @@ internal Arm64() { } /// void svst1h_scatter_[s32]index[_s32](svbool_t pg, int16_t *base, svint32_t indices, svint32_t data) /// ST1H Zdata.S, Pg, [Xbase, Zindices.S, SXTW #1] /// - [RequiresUnsafe] public static unsafe void Scatter16BitNarrowing(Vector mask, short* address, Vector indices, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svst1h_scatter_[u32]index[_s32](svbool_t pg, int16_t *base, svuint32_t indices, svint32_t data) /// ST1H Zdata.S, Pg, [Xbase, Zindices.S, UXTW #1] /// - [RequiresUnsafe] public static unsafe void Scatter16BitNarrowing(Vector mask, short* address, Vector indices, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svst1h_scatter_[s64]index[_s64](svbool_t pg, int16_t *base, svint64_t indices, svint64_t data) /// ST1H Zdata.D, Pg, [Xbase, Zindices.D, LSL #1] /// - [RequiresUnsafe] public static unsafe void Scatter16BitNarrowing(Vector mask, short* address, Vector indices, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svst1h_scatter_[u64]index[_s64](svbool_t pg, int16_t *base, svuint64_t indices, svint64_t data) /// ST1H Zdata.D, Pg, [Xbase, Zindices.D, LSL #1] /// - [RequiresUnsafe] public static unsafe void Scatter16BitNarrowing(Vector mask, short* address, Vector indices, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svst1h_scatter_[s32]index[_u32](svbool_t pg, uint16_t *base, svint32_t indices, svuint32_t data) /// ST1H Zdata.S, Pg, [Xbase, Zindices.S, SXTW #1] /// - [RequiresUnsafe] public static unsafe void Scatter16BitNarrowing(Vector mask, ushort* address, Vector indices, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svst1h_scatter_[u32]index[_u32](svbool_t pg, uint16_t *base, svuint32_t indices, svuint32_t data) /// ST1H Zdata.S, Pg, [Xbase, Zindices.S, UXTW #1] /// - [RequiresUnsafe] public static unsafe void Scatter16BitNarrowing(Vector mask, ushort* address, Vector indices, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svst1h_scatter_[s64]index[_u64](svbool_t pg, uint16_t *base, svint64_t indices, svuint64_t data) /// ST1H Zdata.D, Pg, [Xbase, Zindices.D, LSL #1] /// - [RequiresUnsafe] public static unsafe void Scatter16BitNarrowing(Vector mask, ushort* address, Vector indices, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svst1h_scatter_[u64]index[_u64](svbool_t pg, uint16_t *base, svuint64_t indices, svuint64_t data) /// ST1H Zdata.D, Pg, [Xbase, Zindices.D, LSL #1] /// - [RequiresUnsafe] public static unsafe void Scatter16BitNarrowing(Vector mask, ushort* address, Vector indices, Vector data) { throw new PlatformNotSupportedException(); } @@ -9554,56 +9170,48 @@ internal Arm64() { } /// void svst1h_scatter_[s32]offset[_s32](svbool_t pg, int16_t *base, svint32_t offsets, svint32_t data) /// ST1H Zdata.S, Pg, [Xbase, Zoffsets.S, SXTW] /// - [RequiresUnsafe] public static unsafe void Scatter16BitWithByteOffsetsNarrowing(Vector mask, short* address, Vector offsets, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svst1h_scatter_[u32]offset[_s32](svbool_t pg, int16_t *base, svuint32_t offsets, svint32_t data) /// ST1H Zdata.S, Pg, [Xbase, Zoffsets.S, UXTW] /// - [RequiresUnsafe] public static unsafe void Scatter16BitWithByteOffsetsNarrowing(Vector mask, short* address, Vector offsets, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svst1h_scatter_[s64]offset[_s64](svbool_t pg, int16_t *base, svint64_t offsets, svint64_t data) /// ST1H Zdata.D, Pg, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe void Scatter16BitWithByteOffsetsNarrowing(Vector mask, short* address, Vector offsets, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svst1h_scatter_[u64]offset[_s64](svbool_t pg, int16_t *base, svuint64_t offsets, svint64_t data) /// ST1H Zdata.D, Pg, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe void Scatter16BitWithByteOffsetsNarrowing(Vector mask, short* address, Vector offsets, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svst1h_scatter_[s32]offset[_u32](svbool_t pg, uint16_t *base, svint32_t offsets, svuint32_t data) /// ST1H Zdata.S, Pg, [Xbase, Zoffsets.S, SXTW] /// - [RequiresUnsafe] public static unsafe void Scatter16BitWithByteOffsetsNarrowing(Vector mask, ushort* address, Vector offsets, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svst1h_scatter_[u32]offset[_u32](svbool_t pg, uint16_t *base, svuint32_t offsets, svuint32_t data) /// ST1H Zdata.S, Pg, [Xbase, Zoffsets.S, UXTW] /// - [RequiresUnsafe] public static unsafe void Scatter16BitWithByteOffsetsNarrowing(Vector mask, ushort* address, Vector offsets, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svst1h_scatter_[s64]offset[_u64](svbool_t pg, uint16_t *base, svint64_t offsets, svuint64_t data) /// ST1H Zdata.D, Pg, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe void Scatter16BitWithByteOffsetsNarrowing(Vector mask, ushort* address, Vector offsets, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svst1h_scatter_[u64]offset[_u64](svbool_t pg, uint16_t *base, svuint64_t offsets, svuint64_t data) /// ST1H Zdata.D, Pg, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe void Scatter16BitWithByteOffsetsNarrowing(Vector mask, ushort* address, Vector offsets, Vector data) { throw new PlatformNotSupportedException(); } @@ -9625,28 +9233,24 @@ internal Arm64() { } /// void svst1w_scatter_[s64]index[_s64](svbool_t pg, int32_t *base, svint64_t indices, svint64_t data) /// ST1W Zdata.D, Pg, [Xbase, Zindices.D, LSL #2] /// - [RequiresUnsafe] public static unsafe void Scatter32BitNarrowing(Vector mask, int* address, Vector indices, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svst1w_scatter_[u64]index[_s64](svbool_t pg, int32_t *base, svuint64_t indices, svint64_t data) /// ST1W Zdata.D, Pg, [Xbase, Zindices.D, LSL #2] /// - [RequiresUnsafe] public static unsafe void Scatter32BitNarrowing(Vector mask, int* address, Vector indices, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svst1w_scatter_[s64]index[_u64](svbool_t pg, uint32_t *base, svint64_t indices, svuint64_t data) /// ST1W Zdata.D, Pg, [Xbase, Zindices.D, LSL #2] /// - [RequiresUnsafe] public static unsafe void Scatter32BitNarrowing(Vector mask, uint* address, Vector indices, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svst1w_scatter_[u64]index[_u64](svbool_t pg, uint32_t *base, svuint64_t indices, svuint64_t data) /// ST1W Zdata.D, Pg, [Xbase, Zindices.D, LSL #2] /// - [RequiresUnsafe] public static unsafe void Scatter32BitNarrowing(Vector mask, uint* address, Vector indices, Vector data) { throw new PlatformNotSupportedException(); } @@ -9656,28 +9260,24 @@ internal Arm64() { } /// void svst1w_scatter_[s64]offset[_s64](svbool_t pg, int32_t *base, svint64_t offsets, svint64_t data) /// ST1W Zdata.D, Pg, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe void Scatter32BitWithByteOffsetsNarrowing(Vector mask, int* address, Vector offsets, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svst1w_scatter_[u64]offset[_s64](svbool_t pg, int32_t *base, svuint64_t offsets, svint64_t data) /// ST1W Zdata.D, Pg, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe void Scatter32BitWithByteOffsetsNarrowing(Vector mask, int* address, Vector offsets, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svst1w_scatter_[s64]offset[_u64](svbool_t pg, uint32_t *base, svint64_t offsets, svuint64_t data) /// ST1W Zdata.D, Pg, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe void Scatter32BitWithByteOffsetsNarrowing(Vector mask, uint* address, Vector offsets, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svst1w_scatter_[u64]offset[_u64](svbool_t pg, uint32_t *base, svuint64_t offsets, svuint64_t data) /// ST1W Zdata.D, Pg, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe void Scatter32BitWithByteOffsetsNarrowing(Vector mask, uint* address, Vector offsets, Vector data) { throw new PlatformNotSupportedException(); } @@ -9716,56 +9316,48 @@ internal Arm64() { } /// void svst1b_scatter_[s32]offset[_s32](svbool_t pg, int8_t *base, svint32_t offsets, svint32_t data) /// ST1B Zdata.S, Pg, [Xbase, Zoffsets.S, SXTW] /// - [RequiresUnsafe] public static unsafe void Scatter8BitWithByteOffsetsNarrowing(Vector mask, sbyte* address, Vector offsets, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svst1b_scatter_[u32]offset[_s32](svbool_t pg, int8_t *base, svuint32_t offsets, svint32_t data) /// ST1B Zdata.S, Pg, [Xbase, Zoffsets.S, UXTW] /// - [RequiresUnsafe] public static unsafe void Scatter8BitWithByteOffsetsNarrowing(Vector mask, sbyte* address, Vector offsets, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svst1b_scatter_[s64]offset[_s64](svbool_t pg, int8_t *base, svint64_t offsets, svint64_t data) /// ST1B Zdata.D, Pg, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe void Scatter8BitWithByteOffsetsNarrowing(Vector mask, sbyte* address, Vector offsets, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svst1b_scatter_[u64]offset[_s64](svbool_t pg, int8_t *base, svuint64_t offsets, svint64_t data) /// ST1B Zdata.D, Pg, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe void Scatter8BitWithByteOffsetsNarrowing(Vector mask, sbyte* address, Vector offsets, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svst1b_scatter_[s32]offset[_u32](svbool_t pg, uint8_t *base, svint32_t offsets, svuint32_t data) /// ST1B Zdata.S, Pg, [Xbase, Zoffsets.S, SXTW] /// - [RequiresUnsafe] public static unsafe void Scatter8BitWithByteOffsetsNarrowing(Vector mask, byte* address, Vector offsets, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svst1b_scatter_[u32]offset[_u32](svbool_t pg, uint8_t *base, svuint32_t offsets, svuint32_t data) /// ST1B Zdata.S, Pg, [Xbase, Zoffsets.S, UXTW] /// - [RequiresUnsafe] public static unsafe void Scatter8BitWithByteOffsetsNarrowing(Vector mask, byte* address, Vector offsets, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svst1b_scatter_[s64]offset[_u64](svbool_t pg, uint8_t *base, svint64_t offsets, svuint64_t data) /// ST1B Zdata.D, Pg, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe void Scatter8BitWithByteOffsetsNarrowing(Vector mask, byte* address, Vector offsets, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svst1b_scatter_[u64]offset[_u64](svbool_t pg, uint8_t *base, svuint64_t offsets, svuint64_t data) /// ST1B Zdata.D, Pg, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe void Scatter8BitWithByteOffsetsNarrowing(Vector mask, byte* address, Vector offsets, Vector data) { throw new PlatformNotSupportedException(); } @@ -9775,84 +9367,72 @@ internal Arm64() { } /// void svst1_scatter_[s64]offset[_f64](svbool_t pg, float64_t *base, svint64_t offsets, svfloat64_t data) /// ST1D Zdata.D, Pg, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe void ScatterWithByteOffsets(Vector mask, double* address, Vector offsets, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svst1_scatter_[u64]offset[_f64](svbool_t pg, float64_t *base, svuint64_t offsets, svfloat64_t data) /// ST1D Zdata.D, Pg, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe void ScatterWithByteOffsets(Vector mask, double* address, Vector offsets, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svst1_scatter_[s32]offset[_s32](svbool_t pg, int32_t *base, svint32_t offsets, svint32_t data) /// ST1W Zdata.S, Pg, [Xbase, Zoffsets.S, SXTW] /// - [RequiresUnsafe] public static unsafe void ScatterWithByteOffsets(Vector mask, int* address, Vector offsets, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svst1_scatter_[u32]offset[_s32](svbool_t pg, int32_t *base, svuint32_t offsets, svint32_t data) /// ST1W Zdata.S, Pg, [Xbase, Zoffsets.S, UXTW] /// - [RequiresUnsafe] public static unsafe void ScatterWithByteOffsets(Vector mask, int* address, Vector offsets, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svst1_scatter_[s64]offset[_s64](svbool_t pg, int64_t *base, svint64_t offsets, svint64_t data) /// ST1D Zdata.D, Pg, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe void ScatterWithByteOffsets(Vector mask, long* address, Vector offsets, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svst1_scatter_[u64]offset[_s64](svbool_t pg, int64_t *base, svuint64_t offsets, svint64_t data) /// ST1D Zdata.D, Pg, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe void ScatterWithByteOffsets(Vector mask, long* address, Vector offsets, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svst1_scatter_[s32]offset[_f32](svbool_t pg, float32_t *base, svint32_t offsets, svfloat32_t data) /// ST1W Zdata.S, Pg, [Xbase, Zoffsets.S, SXTW] /// - [RequiresUnsafe] public static unsafe void ScatterWithByteOffsets(Vector mask, float* address, Vector offsets, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svst1_scatter_[u32]offset[_f32](svbool_t pg, float32_t *base, svuint32_t offsets, svfloat32_t data) /// ST1W Zdata.S, Pg, [Xbase, Zoffsets.S, UXTW] /// - [RequiresUnsafe] public static unsafe void ScatterWithByteOffsets(Vector mask, float* address, Vector offsets, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svst1_scatter_[s32]offset[_u32](svbool_t pg, uint32_t *base, svint32_t offsets, svuint32_t data) /// ST1W Zdata.S, Pg, [Xbase, Zoffsets.S, SXTW] /// - [RequiresUnsafe] public static unsafe void ScatterWithByteOffsets(Vector mask, uint* address, Vector offsets, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svst1_scatter_[u32]offset[_u32](svbool_t pg, uint32_t *base, svuint32_t offsets, svuint32_t data) /// ST1W Zdata.S, Pg, [Xbase, Zoffsets.S, UXTW] /// - [RequiresUnsafe] public static unsafe void ScatterWithByteOffsets(Vector mask, uint* address, Vector offsets, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svst1_scatter_[s64]offset[_u64](svbool_t pg, uint64_t *base, svint64_t offsets, svuint64_t data) /// ST1D Zdata.D, Pg, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe void ScatterWithByteOffsets(Vector mask, ulong* address, Vector offsets, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svst1_scatter_[u64]offset[_u64](svbool_t pg, uint64_t *base, svuint64_t offsets, svuint64_t data) /// ST1D Zdata.D, Pg, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe void ScatterWithByteOffsets(Vector mask, ulong* address, Vector offsets, Vector data) { throw new PlatformNotSupportedException(); } @@ -10374,280 +9954,240 @@ internal Arm64() { } /// void svst1[_u8](svbool_t pg, uint8_t *base, svuint8_t data) /// ST1B Zdata.B, Pg, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe void StoreAndZip(Vector mask, byte* address, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svst2[_u8](svbool_t pg, uint8_t *base, svuint8x2_t data) /// ST2B {Zdata0.B, Zdata1.B}, Pg, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe void StoreAndZip(Vector mask, byte* address, (Vector Value1, Vector Value2) data) { throw new PlatformNotSupportedException(); } /// /// void svst3[_u8](svbool_t pg, uint8_t *base, svuint8x3_t data) /// ST3B {Zdata0.B - Zdata2.B}, Pg, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe void StoreAndZip(Vector mask, byte* address, (Vector Value1, Vector Value2, Vector Value3) data) { throw new PlatformNotSupportedException(); } /// /// void svst4[_u8](svbool_t pg, uint8_t *base, svuint8x4_t data) /// ST4B {Zdata0.B - Zdata3.B}, Pg, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe void StoreAndZip(Vector mask, byte* address, (Vector Value1, Vector Value2, Vector Value3, Vector Value4) data) { throw new PlatformNotSupportedException(); } /// /// void svst1[_f64](svbool_t pg, float64_t *base, svfloat64_t data) /// ST1D Zdata.D, Pg, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe void StoreAndZip(Vector mask, double* address, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svst2[_f64](svbool_t pg, float64_t *base, svfloat64x2_t data) /// ST2D {Zdata0.D, Zdata1.D}, Pg, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe void StoreAndZip(Vector mask, double* address, (Vector Value1, Vector Value2) data) { throw new PlatformNotSupportedException(); } /// /// void svst3[_f64](svbool_t pg, float64_t *base, svfloat64x3_t data) /// ST3D {Zdata0.D - Zdata2.D}, Pg, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe void StoreAndZip(Vector mask, double* address, (Vector Value1, Vector Value2, Vector Value3) data) { throw new PlatformNotSupportedException(); } /// /// void svst4[_f64](svbool_t pg, float64_t *base, svfloat64x4_t data) /// ST4D {Zdata0.D - Zdata3.D}, Pg, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe void StoreAndZip(Vector mask, double* address, (Vector Value1, Vector Value2, Vector Value3, Vector Value4) data) { throw new PlatformNotSupportedException(); } /// /// void svst1[_s16](svbool_t pg, int16_t *base, svint16_t data) /// ST1H Zdata.H, Pg, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe void StoreAndZip(Vector mask, short* address, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svst2[_s16](svbool_t pg, int16_t *base, svint16x2_t data) /// ST2H {Zdata0.H, Zdata1.H}, Pg, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe void StoreAndZip(Vector mask, short* address, (Vector Value1, Vector Value2) data) { throw new PlatformNotSupportedException(); } /// /// void svst3[_s16](svbool_t pg, int16_t *base, svint16x3_t data) /// ST3H {Zdata0.H - Zdata2.H}, Pg, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe void StoreAndZip(Vector mask, short* address, (Vector Value1, Vector Value2, Vector Value3) data) { throw new PlatformNotSupportedException(); } /// /// void svst4[_s16](svbool_t pg, int16_t *base, svint16x4_t data) /// ST4H {Zdata0.H - Zdata3.H}, Pg, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe void StoreAndZip(Vector mask, short* address, (Vector Value1, Vector Value2, Vector Value3, Vector Value4) data) { throw new PlatformNotSupportedException(); } /// /// void svst1[_s32](svbool_t pg, int32_t *base, svint32_t data) /// ST1W Zdata.S, Pg, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe void StoreAndZip(Vector mask, int* address, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svst2[_s32](svbool_t pg, int32_t *base, svint32x2_t data) /// ST2W {Zdata0.S, Zdata1.S}, Pg, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe void StoreAndZip(Vector mask, int* address, (Vector Value1, Vector Value2) data) { throw new PlatformNotSupportedException(); } /// /// void svst3[_s32](svbool_t pg, int32_t *base, svint32x3_t data) /// ST3W {Zdata0.S - Zdata2.S}, Pg, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe void StoreAndZip(Vector mask, int* address, (Vector Value1, Vector Value2, Vector Value3) data) { throw new PlatformNotSupportedException(); } /// /// void svst4[_s32](svbool_t pg, int32_t *base, svint32x4_t data) /// ST4W {Zdata0.S - Zdata3.S}, Pg, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe void StoreAndZip(Vector mask, int* address, (Vector Value1, Vector Value2, Vector Value3, Vector Value4) data) { throw new PlatformNotSupportedException(); } /// /// void svst1[_s64](svbool_t pg, int64_t *base, svint64_t data) /// ST1D Zdata.D, Pg, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe void StoreAndZip(Vector mask, long* address, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svst2[_s64](svbool_t pg, int64_t *base, svint64x2_t data) /// ST2D {Zdata0.D, Zdata1.D}, Pg, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe void StoreAndZip(Vector mask, long* address, (Vector Value1, Vector Value2) data) { throw new PlatformNotSupportedException(); } /// /// void svst3[_s64](svbool_t pg, int64_t *base, svint64x3_t data) /// ST3D {Zdata0.D - Zdata2.D}, Pg, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe void StoreAndZip(Vector mask, long* address, (Vector Value1, Vector Value2, Vector Value3) data) { throw new PlatformNotSupportedException(); } /// /// void svst4[_s64](svbool_t pg, int64_t *base, svint64x4_t data) /// ST4D {Zdata0.D - Zdata3.D}, Pg, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe void StoreAndZip(Vector mask, long* address, (Vector Value1, Vector Value2, Vector Value3, Vector Value4) data) { throw new PlatformNotSupportedException(); } /// /// void svst1[_s8](svbool_t pg, int8_t *base, svint8_t data) /// ST1B Zdata.B, Pg, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe void StoreAndZip(Vector mask, sbyte* address, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svst2[_s8](svbool_t pg, int8_t *base, svint8x2_t data) /// ST2B {Zdata0.B, Zdata1.B}, Pg, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe void StoreAndZip(Vector mask, sbyte* address, (Vector Value1, Vector Value2) data) { throw new PlatformNotSupportedException(); } /// /// void svst3[_s8](svbool_t pg, int8_t *base, svint8x3_t data) /// ST3B {Zdata0.B - Zdata2.B}, Pg, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe void StoreAndZip(Vector mask, sbyte* address, (Vector Value1, Vector Value2, Vector Value3) data) { throw new PlatformNotSupportedException(); } /// /// void svst4[_s8](svbool_t pg, int8_t *base, svint8x4_t data) /// ST4B {Zdata0.B - Zdata3.B}, Pg, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe void StoreAndZip(Vector mask, sbyte* address, (Vector Value1, Vector Value2, Vector Value3, Vector Value4) data) { throw new PlatformNotSupportedException(); } /// /// void svst1[_f32](svbool_t pg, float32_t *base, svfloat32_t data) /// ST1W Zdata.S, Pg, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe void StoreAndZip(Vector mask, float* address, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svst2[_f32](svbool_t pg, float32_t *base, svfloat32x2_t data) /// ST2W {Zdata0.S, Zdata1.S}, Pg, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe void StoreAndZip(Vector mask, float* address, (Vector Value1, Vector Value2) data) { throw new PlatformNotSupportedException(); } /// /// void svst3[_f32](svbool_t pg, float32_t *base, svfloat32x3_t data) /// ST3W {Zdata0.S - Zdata2.S}, Pg, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe void StoreAndZip(Vector mask, float* address, (Vector Value1, Vector Value2, Vector Value3) data) { throw new PlatformNotSupportedException(); } /// /// void svst4[_f32](svbool_t pg, float32_t *base, svfloat32x4_t data) /// ST4W {Zdata0.S - Zdata3.S}, Pg, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe void StoreAndZip(Vector mask, float* address, (Vector Value1, Vector Value2, Vector Value3, Vector Value4) data) { throw new PlatformNotSupportedException(); } /// /// void svst1[_u16](svbool_t pg, uint16_t *base, svuint16_t data) /// ST1H Zdata.H, Pg, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe void StoreAndZip(Vector mask, ushort* address, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svst2[_u16](svbool_t pg, uint16_t *base, svuint16x2_t data) /// ST2H {Zdata0.H, Zdata1.H}, Pg, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe void StoreAndZip(Vector mask, ushort* address, (Vector Value1, Vector Value2) data) { throw new PlatformNotSupportedException(); } /// /// void svst3[_u16](svbool_t pg, uint16_t *base, svuint16x3_t data) /// ST3H {Zdata0.H - Zdata2.H}, Pg, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe void StoreAndZip(Vector mask, ushort* address, (Vector Value1, Vector Value2, Vector Value3) data) { throw new PlatformNotSupportedException(); } /// /// void svst4[_u16](svbool_t pg, uint16_t *base, svuint16x4_t data) /// ST4H {Zdata0.H - Zdata3.H}, Pg, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe void StoreAndZip(Vector mask, ushort* address, (Vector Value1, Vector Value2, Vector Value3, Vector Value4) data) { throw new PlatformNotSupportedException(); } /// /// void svst1[_u32](svbool_t pg, uint32_t *base, svuint32_t data) /// ST1W Zdata.S, Pg, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe void StoreAndZip(Vector mask, uint* address, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svst2[_u32](svbool_t pg, uint32_t *base, svuint32x2_t data) /// ST2W {Zdata0.S, Zdata1.S}, Pg, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe void StoreAndZip(Vector mask, uint* address, (Vector Value1, Vector Value2) data) { throw new PlatformNotSupportedException(); } /// /// void svst3[_u32](svbool_t pg, uint32_t *base, svuint32x3_t data) /// ST3W {Zdata0.S - Zdata2.S}, Pg, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe void StoreAndZip(Vector mask, uint* address, (Vector Value1, Vector Value2, Vector Value3) data) { throw new PlatformNotSupportedException(); } /// /// void svst4[_u32](svbool_t pg, uint32_t *base, svuint32x4_t data) /// ST4W {Zdata0.S - Zdata3.S}, Pg, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe void StoreAndZip(Vector mask, uint* address, (Vector Value1, Vector Value2, Vector Value3, Vector Value4) data) { throw new PlatformNotSupportedException(); } /// /// void svst1[_u64](svbool_t pg, uint64_t *base, svuint64_t data) /// ST1D Zdata.D, Pg, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe void StoreAndZip(Vector mask, ulong* address, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svst2[_u64](svbool_t pg, uint64_t *base, svuint64x2_t data) /// ST2D {Zdata0.D, Zdata1.D}, Pg, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe void StoreAndZip(Vector mask, ulong* address, (Vector Value1, Vector Value2) data) { throw new PlatformNotSupportedException(); } /// /// void svst3[_u64](svbool_t pg, uint64_t *base, svuint64x3_t data) /// ST3D {Zdata0.D - Zdata2.D}, Pg, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe void StoreAndZip(Vector mask, ulong* address, (Vector Value1, Vector Value2, Vector Value3) data) { throw new PlatformNotSupportedException(); } /// /// void svst4[_u64](svbool_t pg, uint64_t *base, svuint64x4_t data) /// ST4D {Zdata0.D - Zdata3.D}, Pg, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe void StoreAndZip(Vector mask, ulong* address, (Vector Value1, Vector Value2, Vector Value3, Vector Value4) data) { throw new PlatformNotSupportedException(); } @@ -10657,84 +10197,72 @@ internal Arm64() { } /// void svst1b[_s16](svbool_t pg, int8_t *base, svint16_t data) /// ST1B Zdata.H, Pg, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe void StoreNarrowing(Vector mask, sbyte* address, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svst1b[_s32](svbool_t pg, int8_t *base, svint32_t data) /// ST1B Zdata.S, Pg, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe void StoreNarrowing(Vector mask, sbyte* address, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svst1h[_s32](svbool_t pg, int16_t *base, svint32_t data) /// ST1H Zdata.S, Pg, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe void StoreNarrowing(Vector mask, short* address, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svst1b[_s64](svbool_t pg, int8_t *base, svint64_t data) /// ST1B Zdata.D, Pg, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe void StoreNarrowing(Vector mask, sbyte* address, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svst1h[_s64](svbool_t pg, int16_t *base, svint64_t data) /// ST1H Zdata.D, Pg, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe void StoreNarrowing(Vector mask, short* address, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svst1w[_s64](svbool_t pg, int32_t *base, svint64_t data) /// ST1W Zdata.D, Pg, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe void StoreNarrowing(Vector mask, int* address, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svst1b[_u16](svbool_t pg, uint8_t *base, svuint16_t data) /// ST1B Zdata.H, Pg, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe void StoreNarrowing(Vector mask, byte* address, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svst1b[_u32](svbool_t pg, uint8_t *base, svuint32_t data) /// ST1B Zdata.S, Pg, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe void StoreNarrowing(Vector mask, byte* address, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svst1h[_u32](svbool_t pg, uint16_t *base, svuint32_t data) /// ST1H Zdata.S, Pg, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe void StoreNarrowing(Vector mask, ushort* address, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svst1b[_u64](svbool_t pg, uint8_t *base, svuint64_t data) /// ST1B Zdata.D, Pg, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe void StoreNarrowing(Vector mask, byte* address, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svst1h[_u64](svbool_t pg, uint16_t *base, svuint64_t data) /// ST1H Zdata.D, Pg, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe void StoreNarrowing(Vector mask, ushort* address, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svst1w[_u64](svbool_t pg, uint32_t *base, svuint64_t data) /// ST1W Zdata.D, Pg, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe void StoreNarrowing(Vector mask, uint* address, Vector data) { throw new PlatformNotSupportedException(); } @@ -10744,70 +10272,60 @@ internal Arm64() { } /// void svstnt1[_u8](svbool_t pg, uint8_t *base, svuint8_t data) /// STNT1B Zdata.B, Pg, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe void StoreNonTemporal(Vector mask, byte* address, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svstnt1[_f64](svbool_t pg, float64_t *base, svfloat64_t data) /// STNT1D Zdata.D, Pg, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe void StoreNonTemporal(Vector mask, double* address, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svstnt1[_s16](svbool_t pg, int16_t *base, svint16_t data) /// STNT1H Zdata.H, Pg, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe void StoreNonTemporal(Vector mask, short* address, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svstnt1[_s32](svbool_t pg, int32_t *base, svint32_t data) /// STNT1W Zdata.S, Pg, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe void StoreNonTemporal(Vector mask, int* address, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svstnt1[_s64](svbool_t pg, int64_t *base, svint64_t data) /// STNT1D Zdata.D, Pg, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe void StoreNonTemporal(Vector mask, long* address, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svstnt1[_s8](svbool_t pg, int8_t *base, svint8_t data) /// STNT1B Zdata.B, Pg, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe void StoreNonTemporal(Vector mask, sbyte* address, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svstnt1[_f32](svbool_t pg, float32_t *base, svfloat32_t data) /// STNT1W Zdata.S, Pg, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe void StoreNonTemporal(Vector mask, float* address, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svstnt1[_u16](svbool_t pg, uint16_t *base, svuint16_t data) /// STNT1H Zdata.H, Pg, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe void StoreNonTemporal(Vector mask, ushort* address, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svstnt1[_u32](svbool_t pg, uint32_t *base, svuint32_t data) /// STNT1W Zdata.S, Pg, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe void StoreNonTemporal(Vector mask, uint* address, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svstnt1[_u64](svbool_t pg, uint64_t *base, svuint64_t data) /// STNT1D Zdata.D, Pg, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe void StoreNonTemporal(Vector mask, ulong* address, Vector data) { throw new PlatformNotSupportedException(); } diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Arm/Sve.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Arm/Sve.cs index c85c7a305fa765..3a616204bcad81 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Arm/Sve.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Arm/Sve.cs @@ -3775,14 +3775,12 @@ internal Arm64() { } /// void svprfh_gather_[s32]index(svbool_t pg, const void *base, svint32_t indices, enum svprfop op) /// PRFH op, Pg, [Xbase, Zindices.S, SXTW #1] /// - [RequiresUnsafe] public static unsafe void GatherPrefetch16Bit(Vector mask, void* address, Vector indices, [ConstantExpected] SvePrefetchType prefetchType) => GatherPrefetch16Bit(mask, address, indices, prefetchType); /// /// void svprfh_gather_[s64]index(svbool_t pg, const void *base, svint64_t indices, enum svprfop op) /// PRFH op, Pg, [Xbase, Zindices.D, LSL #1] /// - [RequiresUnsafe] public static unsafe void GatherPrefetch16Bit(Vector mask, void* address, Vector indices, [ConstantExpected] SvePrefetchType prefetchType) => GatherPrefetch16Bit(mask, address, indices, prefetchType); // @@ -3796,7 +3794,6 @@ internal Arm64() { } /// void svprfh_gather_[u32]index(svbool_t pg, const void *base, svuint32_t indices, enum svprfop op) /// PRFH op, Pg, [Xbase, Zindices.S, UXTW #1] /// - [RequiresUnsafe] public static unsafe void GatherPrefetch16Bit(Vector mask, void* address, Vector indices, [ConstantExpected] SvePrefetchType prefetchType) => GatherPrefetch16Bit(mask, address, indices, prefetchType); /// @@ -3809,21 +3806,18 @@ internal Arm64() { } /// void svprfh_gather_[u64]index(svbool_t pg, const void *base, svuint64_t indices, enum svprfop op) /// PRFH op, Pg, [Xbase, Zindices.D, LSL #1] /// - [RequiresUnsafe] public static unsafe void GatherPrefetch16Bit(Vector mask, void* address, Vector indices, [ConstantExpected] SvePrefetchType prefetchType) => GatherPrefetch16Bit(mask, address, indices, prefetchType); /// /// void svprfh_gather_[s32]index(svbool_t pg, const void *base, svint32_t indices, enum svprfop op) /// PRFH op, Pg, [Xbase, Zindices.S, SXTW #1] /// - [RequiresUnsafe] public static unsafe void GatherPrefetch16Bit(Vector mask, void* address, Vector indices, [ConstantExpected] SvePrefetchType prefetchType) => GatherPrefetch16Bit(mask, address, indices, prefetchType); /// /// void svprfh_gather_[s64]index(svbool_t pg, const void *base, svint64_t indices, enum svprfop op) /// PRFH op, Pg, [Xbase, Zindices.D, LSL #1] /// - [RequiresUnsafe] public static unsafe void GatherPrefetch16Bit(Vector mask, void* address, Vector indices, [ConstantExpected] SvePrefetchType prefetchType) => GatherPrefetch16Bit(mask, address, indices, prefetchType); // @@ -3837,7 +3831,6 @@ internal Arm64() { } /// void svprfh_gather_[u32]index(svbool_t pg, const void *base, svuint32_t indices, enum svprfop op) /// PRFH op, Pg, [Xbase, Zindices.S, UXTW #1] /// - [RequiresUnsafe] public static unsafe void GatherPrefetch16Bit(Vector mask, void* address, Vector indices, [ConstantExpected] SvePrefetchType prefetchType) => GatherPrefetch16Bit(mask, address, indices, prefetchType); /// @@ -3850,7 +3843,6 @@ internal Arm64() { } /// void svprfh_gather_[u64]index(svbool_t pg, const void *base, svuint64_t indices, enum svprfop op) /// PRFH op, Pg, [Xbase, Zindices.D, LSL #1] /// - [RequiresUnsafe] public static unsafe void GatherPrefetch16Bit(Vector mask, void* address, Vector indices, [ConstantExpected] SvePrefetchType prefetchType) => GatherPrefetch16Bit(mask, address, indices, prefetchType); @@ -3860,14 +3852,12 @@ internal Arm64() { } /// void svprfw_gather_[s32]index(svbool_t pg, const void *base, svint32_t indices, enum svprfop op) /// PRFW op, Pg, [Xbase, Zindices.S, SXTW #2] /// - [RequiresUnsafe] public static unsafe void GatherPrefetch32Bit(Vector mask, void* address, Vector indices, [ConstantExpected] SvePrefetchType prefetchType) => GatherPrefetch32Bit(mask, address, indices, prefetchType); /// /// void svprfw_gather_[s64]index(svbool_t pg, const void *base, svint64_t indices, enum svprfop op) /// PRFW op, Pg, [Xbase, Zindices.D, LSL #2] /// - [RequiresUnsafe] public static unsafe void GatherPrefetch32Bit(Vector mask, void* address, Vector indices, [ConstantExpected] SvePrefetchType prefetchType) => GatherPrefetch32Bit(mask, address, indices, prefetchType); // @@ -3881,7 +3871,6 @@ internal Arm64() { } /// void svprfw_gather_[u32]index(svbool_t pg, const void *base, svuint32_t indices, enum svprfop op) /// PRFW op, Pg, [Xbase, Zindices.S, UXTW #2] /// - [RequiresUnsafe] public static unsafe void GatherPrefetch32Bit(Vector mask, void* address, Vector indices, [ConstantExpected] SvePrefetchType prefetchType) => GatherPrefetch32Bit(mask, address, indices, prefetchType); /// @@ -3894,21 +3883,18 @@ internal Arm64() { } /// void svprfw_gather_[u64]index(svbool_t pg, const void *base, svuint64_t indices, enum svprfop op) /// PRFW op, Pg, [Xbase, Zindices.D, LSL #2] /// - [RequiresUnsafe] public static unsafe void GatherPrefetch32Bit(Vector mask, void* address, Vector indices, [ConstantExpected] SvePrefetchType prefetchType) => GatherPrefetch32Bit(mask, address, indices, prefetchType); /// /// void svprfw_gather_[s32]index(svbool_t pg, const void *base, svint32_t indices, enum svprfop op) /// PRFW op, Pg, [Xbase, Zindices.S, SXTW #2] /// - [RequiresUnsafe] public static unsafe void GatherPrefetch32Bit(Vector mask, void* address, Vector indices, [ConstantExpected] SvePrefetchType prefetchType) => GatherPrefetch32Bit(mask, address, indices, prefetchType); /// /// void svprfw_gather_[s64]index(svbool_t pg, const void *base, svint64_t indices, enum svprfop op) /// PRFW op, Pg, [Xbase, Zindices.D, LSL #2] /// - [RequiresUnsafe] public static unsafe void GatherPrefetch32Bit(Vector mask, void* address, Vector indices, [ConstantExpected] SvePrefetchType prefetchType) => GatherPrefetch32Bit(mask, address, indices, prefetchType); // @@ -3922,7 +3908,6 @@ internal Arm64() { } /// void svprfw_gather_[u32]index(svbool_t pg, const void *base, svuint32_t indices, enum svprfop op) /// PRFW op, Pg, [Xbase, Zindices.S, UXTW #2] /// - [RequiresUnsafe] public static unsafe void GatherPrefetch32Bit(Vector mask, void* address, Vector indices, [ConstantExpected] SvePrefetchType prefetchType) => GatherPrefetch32Bit(mask, address, indices, prefetchType); /// @@ -3935,7 +3920,6 @@ internal Arm64() { } /// void svprfw_gather_[u64]index(svbool_t pg, const void *base, svuint64_t indices, enum svprfop op) /// PRFW op, Pg, [Xbase, Zindices.D, LSL #2] /// - [RequiresUnsafe] public static unsafe void GatherPrefetch32Bit(Vector mask, void* address, Vector indices, [ConstantExpected] SvePrefetchType prefetchType) => GatherPrefetch32Bit(mask, address, indices, prefetchType); @@ -3945,14 +3929,12 @@ internal Arm64() { } /// void svprfd_gather_[s32]index(svbool_t pg, const void *base, svint32_t indices, enum svprfop op) /// PRFD op, Pg, [Xbase, Zindices.S, SXTW #3] /// - [RequiresUnsafe] public static unsafe void GatherPrefetch64Bit(Vector mask, void* address, Vector indices, [ConstantExpected] SvePrefetchType prefetchType) => GatherPrefetch64Bit(mask, address, indices, prefetchType); /// /// void svprfd_gather_[s64]index(svbool_t pg, const void *base, svint64_t indices, enum svprfop op) /// PRFD op, Pg, [Xbase, Zindices.D, LSL #3] /// - [RequiresUnsafe] public static unsafe void GatherPrefetch64Bit(Vector mask, void* address, Vector indices, [ConstantExpected] SvePrefetchType prefetchType) => GatherPrefetch64Bit(mask, address, indices, prefetchType); // @@ -3966,7 +3948,6 @@ internal Arm64() { } /// void svprfd_gather_[u32]index(svbool_t pg, const void *base, svuint32_t indices, enum svprfop op) /// PRFD op, Pg, [Xbase, Zindices.S, UXTW #3] /// - [RequiresUnsafe] public static unsafe void GatherPrefetch64Bit(Vector mask, void* address, Vector indices, [ConstantExpected] SvePrefetchType prefetchType) => GatherPrefetch64Bit(mask, address, indices, prefetchType); /// @@ -3979,21 +3960,18 @@ internal Arm64() { } /// void svprfd_gather_[u64]index(svbool_t pg, const void *base, svuint64_t indices, enum svprfop op) /// PRFD op, Pg, [Xbase, Zindices.D, LSL #3] /// - [RequiresUnsafe] public static unsafe void GatherPrefetch64Bit(Vector mask, void* address, Vector indices, [ConstantExpected] SvePrefetchType prefetchType) => GatherPrefetch64Bit(mask, address, indices, prefetchType); /// /// void svprfd_gather_[s32]index(svbool_t pg, const void *base, svint32_t indices, enum svprfop op) /// PRFD op, Pg, [Xbase, Zindices.S, SXTW #3] /// - [RequiresUnsafe] public static unsafe void GatherPrefetch64Bit(Vector mask, void* address, Vector indices, [ConstantExpected] SvePrefetchType prefetchType) => GatherPrefetch64Bit(mask, address, indices, prefetchType); /// /// void svprfd_gather_[s64]index(svbool_t pg, const void *base, svint64_t indices, enum svprfop op) /// PRFD op, Pg, [Xbase, Zindices.D, LSL #3] /// - [RequiresUnsafe] public static unsafe void GatherPrefetch64Bit(Vector mask, void* address, Vector indices, [ConstantExpected] SvePrefetchType prefetchType) => GatherPrefetch64Bit(mask, address, indices, prefetchType); // @@ -4007,7 +3985,6 @@ internal Arm64() { } /// void svprfd_gather_[u32]index(svbool_t pg, const void *base, svuint32_t indices, enum svprfop op) /// PRFD op, Pg, [Xbase, Zindices.S, UXTW #3] /// - [RequiresUnsafe] public static unsafe void GatherPrefetch64Bit(Vector mask, void* address, Vector indices, [ConstantExpected] SvePrefetchType prefetchType) => GatherPrefetch64Bit(mask, address, indices, prefetchType); /// @@ -4020,7 +3997,6 @@ internal Arm64() { } /// void svprfd_gather_[u64]index(svbool_t pg, const void *base, svuint64_t indices, enum svprfop op) /// PRFD op, Pg, [Xbase, Zindices.D, LSL #3] /// - [RequiresUnsafe] public static unsafe void GatherPrefetch64Bit(Vector mask, void* address, Vector indices, [ConstantExpected] SvePrefetchType prefetchType) => GatherPrefetch64Bit(mask, address, indices, prefetchType); @@ -4030,14 +4006,12 @@ internal Arm64() { } /// void svprfb_gather_[s32]offset(svbool_t pg, const void *base, svint32_t offsets, enum svprfop op) /// PRFB op, Pg, [Xbase, Zoffsets.S, SXTW] /// - [RequiresUnsafe] public static unsafe void GatherPrefetch8Bit(Vector mask, void* address, Vector offsets, [ConstantExpected] SvePrefetchType prefetchType) => GatherPrefetch8Bit(mask, address, offsets, prefetchType); /// /// void svprfb_gather_[s64]offset(svbool_t pg, const void *base, svint64_t offsets, enum svprfop op) /// PRFB op, Pg, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe void GatherPrefetch8Bit(Vector mask, void* address, Vector offsets, [ConstantExpected] SvePrefetchType prefetchType) => GatherPrefetch8Bit(mask, address, offsets, prefetchType); // @@ -4051,7 +4025,6 @@ internal Arm64() { } /// void svprfb_gather_[u32]offset(svbool_t pg, const void *base, svuint32_t offsets, enum svprfop op) /// PRFB op, Pg, [Xbase, Zoffsets.S, UXTW] /// - [RequiresUnsafe] public static unsafe void GatherPrefetch8Bit(Vector mask, void* address, Vector offsets, [ConstantExpected] SvePrefetchType prefetchType) => GatherPrefetch8Bit(mask, address, offsets, prefetchType); /// @@ -4064,21 +4037,18 @@ internal Arm64() { } /// void svprfb_gather_[u64]offset(svbool_t pg, const void *base, svuint64_t offsets, enum svprfop op) /// PRFB op, Pg, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe void GatherPrefetch8Bit(Vector mask, void* address, Vector offsets, [ConstantExpected] SvePrefetchType prefetchType) => GatherPrefetch8Bit(mask, address, offsets, prefetchType); /// /// void svprfb_gather_[s32]offset(svbool_t pg, const void *base, svint32_t offsets, enum svprfop op) /// PRFB op, Pg, [Xbase, Zoffsets.S, SXTW] /// - [RequiresUnsafe] public static unsafe void GatherPrefetch8Bit(Vector mask, void* address, Vector offsets, [ConstantExpected] SvePrefetchType prefetchType) => GatherPrefetch8Bit(mask, address, offsets, prefetchType); /// /// void svprfb_gather_[s64]offset(svbool_t pg, const void *base, svint64_t offsets, enum svprfop op) /// PRFB op, Pg, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe void GatherPrefetch8Bit(Vector mask, void* address, Vector offsets, [ConstantExpected] SvePrefetchType prefetchType) => GatherPrefetch8Bit(mask, address, offsets, prefetchType); // @@ -4092,7 +4062,6 @@ internal Arm64() { } /// void svprfb_gather_[u32]offset(svbool_t pg, const void *base, svuint32_t offsets, enum svprfop op) /// PRFB op, Pg, [Xbase, Zoffsets.S, UXTW] /// - [RequiresUnsafe] public static unsafe void GatherPrefetch8Bit(Vector mask, void* address, Vector offsets, [ConstantExpected] SvePrefetchType prefetchType) => GatherPrefetch8Bit(mask, address, offsets, prefetchType); /// @@ -4105,7 +4074,6 @@ internal Arm64() { } /// void svprfb_gather_[u64]offset(svbool_t pg, const void *base, svuint64_t offsets, enum svprfop op) /// PRFB op, Pg, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe void GatherPrefetch8Bit(Vector mask, void* address, Vector offsets, [ConstantExpected] SvePrefetchType prefetchType) => GatherPrefetch8Bit(mask, address, offsets, prefetchType); @@ -4115,7 +4083,6 @@ internal Arm64() { } /// svfloat64_t svld1_gather_[s64]index[_f64](svbool_t pg, const float64_t *base, svint64_t indices) /// LD1D Zresult.D, Pg/Z, [Xbase, Zindices.D, LSL #3] /// - [RequiresUnsafe] public static unsafe Vector GatherVector(Vector mask, double* address, Vector indices) => GatherVector(mask, address, indices); /// @@ -4128,14 +4095,12 @@ internal Arm64() { } /// svfloat64_t svld1_gather_[u64]index[_f64](svbool_t pg, const float64_t *base, svuint64_t indices) /// LD1D Zresult.D, Pg/Z, [Xbase, Zindices.D, LSL #3] /// - [RequiresUnsafe] public static unsafe Vector GatherVector(Vector mask, double* address, Vector indices) => GatherVector(mask, address, indices); /// /// svint32_t svld1_gather_[s32]index[_s32](svbool_t pg, const int32_t *base, svint32_t indices) /// LD1W Zresult.S, Pg/Z, [Xbase, Zindices.S, SXTW #2] /// - [RequiresUnsafe] public static unsafe Vector GatherVector(Vector mask, int* address, Vector indices) => GatherVector(mask, address, indices); // @@ -4149,14 +4114,12 @@ internal Arm64() { } /// svint32_t svld1_gather_[u32]index[_s32](svbool_t pg, const int32_t *base, svuint32_t indices) /// LD1W Zresult.S, Pg/Z, [Xbase, Zindices.S, UXTW #2] /// - [RequiresUnsafe] public static unsafe Vector GatherVector(Vector mask, int* address, Vector indices) => GatherVector(mask, address, indices); /// /// svint64_t svld1_gather_[s64]index[_s64](svbool_t pg, const int64_t *base, svint64_t indices) /// LD1D Zresult.D, Pg/Z, [Xbase, Zindices.D, LSL #3] /// - [RequiresUnsafe] public static unsafe Vector GatherVector(Vector mask, long* address, Vector indices) => GatherVector(mask, address, indices); /// @@ -4169,14 +4132,12 @@ internal Arm64() { } /// svint64_t svld1_gather_[u64]index[_s64](svbool_t pg, const int64_t *base, svuint64_t indices) /// LD1D Zresult.D, Pg/Z, [Xbase, Zindices.D, LSL #3] /// - [RequiresUnsafe] public static unsafe Vector GatherVector(Vector mask, long* address, Vector indices) => GatherVector(mask, address, indices); /// /// svfloat32_t svld1_gather_[s32]index[_f32](svbool_t pg, const float32_t *base, svint32_t indices) /// LD1W Zresult.S, Pg/Z, [Xbase, Zindices.S, SXTW #2] /// - [RequiresUnsafe] public static unsafe Vector GatherVector(Vector mask, float* address, Vector indices) => GatherVector(mask, address, indices); // @@ -4190,14 +4151,12 @@ internal Arm64() { } /// svfloat32_t svld1_gather_[u32]index[_f32](svbool_t pg, const float32_t *base, svuint32_t indices) /// LD1W Zresult.S, Pg/Z, [Xbase, Zindices.S, UXTW #2] /// - [RequiresUnsafe] public static unsafe Vector GatherVector(Vector mask, float* address, Vector indices) => GatherVector(mask, address, indices); /// /// svuint32_t svld1_gather_[s32]index[_u32](svbool_t pg, const uint32_t *base, svint32_t indices) /// LD1W Zresult.S, Pg/Z, [Xbase, Zindices.S, SXTW #2] /// - [RequiresUnsafe] public static unsafe Vector GatherVector(Vector mask, uint* address, Vector indices) => GatherVector(mask, address, indices); // @@ -4211,14 +4170,12 @@ internal Arm64() { } /// svuint32_t svld1_gather_[u32]index[_u32](svbool_t pg, const uint32_t *base, svuint32_t indices) /// LD1W Zresult.S, Pg/Z, [Xbase, Zindices.S, UXTW #2] /// - [RequiresUnsafe] public static unsafe Vector GatherVector(Vector mask, uint* address, Vector indices) => GatherVector(mask, address, indices); /// /// svuint64_t svld1_gather_[s64]index[_u64](svbool_t pg, const uint64_t *base, svint64_t indices) /// LD1D Zresult.D, Pg/Z, [Xbase, Zindices.D, LSL #3] /// - [RequiresUnsafe] public static unsafe Vector GatherVector(Vector mask, ulong* address, Vector indices) => GatherVector(mask, address, indices); /// @@ -4231,7 +4188,6 @@ internal Arm64() { } /// svuint64_t svld1_gather_[u64]index[_u64](svbool_t pg, const uint64_t *base, svuint64_t indices) /// LD1D Zresult.D, Pg/Z, [Xbase, Zindices.D, LSL #3] /// - [RequiresUnsafe] public static unsafe Vector GatherVector(Vector mask, ulong* address, Vector indices) => GatherVector(mask, address, indices); @@ -4241,7 +4197,6 @@ internal Arm64() { } /// svint32_t svld1ub_gather_[s32]offset_s32(svbool_t pg, const uint8_t *base, svint32_t offsets) /// LD1B Zresult.S, Pg/Z, [Xbase, Zoffsets.S, SXTW] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorByteZeroExtend(Vector mask, byte* address, Vector indices) => GatherVectorByteZeroExtend(mask, address, indices); // @@ -4255,14 +4210,12 @@ internal Arm64() { } /// svint32_t svld1ub_gather_[u32]offset_s32(svbool_t pg, const uint8_t *base, svuint32_t offsets) /// LD1B Zresult.S, Pg/Z, [Xbase, Zoffsets.S, UXTW] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorByteZeroExtend(Vector mask, byte* address, Vector indices) => GatherVectorByteZeroExtend(mask, address, indices); /// /// svint64_t svld1ub_gather_[s64]offset_s64(svbool_t pg, const uint8_t *base, svint64_t offsets) /// LD1B Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorByteZeroExtend(Vector mask, byte* address, Vector indices) => GatherVectorByteZeroExtend(mask, address, indices); /// @@ -4275,14 +4228,12 @@ internal Arm64() { } /// svint64_t svld1ub_gather_[u64]offset_s64(svbool_t pg, const uint8_t *base, svuint64_t offsets) /// LD1B Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorByteZeroExtend(Vector mask, byte* address, Vector indices) => GatherVectorByteZeroExtend(mask, address, indices); /// /// svuint32_t svld1ub_gather_[s32]offset_u32(svbool_t pg, const uint8_t *base, svint32_t offsets) /// LD1B Zresult.S, Pg/Z, [Xbase, Zoffsets.S, SXTW] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorByteZeroExtend(Vector mask, byte* address, Vector indices) => GatherVectorByteZeroExtend(mask, address, indices); // @@ -4296,14 +4247,12 @@ internal Arm64() { } /// svuint32_t svld1ub_gather_[u32]offset_u32(svbool_t pg, const uint8_t *base, svuint32_t offsets) /// LD1B Zresult.S, Pg/Z, [Xbase, Zoffsets.S, UXTW] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorByteZeroExtend(Vector mask, byte* address, Vector indices) => GatherVectorByteZeroExtend(mask, address, indices); /// /// svuint64_t svld1ub_gather_[s64]offset_u64(svbool_t pg, const uint8_t *base, svint64_t offsets) /// LD1B Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorByteZeroExtend(Vector mask, byte* address, Vector indices) => GatherVectorByteZeroExtend(mask, address, indices); /// @@ -4316,7 +4265,6 @@ internal Arm64() { } /// svuint64_t svld1ub_gather_[u64]offset_u64(svbool_t pg, const uint8_t *base, svuint64_t offsets) /// LD1B Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorByteZeroExtend(Vector mask, byte* address, Vector indices) => GatherVectorByteZeroExtend(mask, address, indices); @@ -4326,7 +4274,6 @@ internal Arm64() { } /// svint32_t svldff1ub_gather_[s32]offset_s32(svbool_t pg, const uint8_t *base, svint32_t offsets) /// LDFF1B Zresult.S, Pg/Z, [Xbase, Zoffsets.S, SXTW] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorByteZeroExtendFirstFaulting(Vector mask, byte* address, Vector offsets) => GatherVectorByteZeroExtendFirstFaulting(mask, address, offsets); // @@ -4340,14 +4287,12 @@ internal Arm64() { } /// svint32_t svldff1ub_gather_[u32]offset_s32(svbool_t pg, const uint8_t *base, svuint32_t offsets) /// LDFF1B Zresult.S, Pg/Z, [Xbase, Zoffsets.S, UXTW] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorByteZeroExtendFirstFaulting(Vector mask, byte* address, Vector offsets) => GatherVectorByteZeroExtendFirstFaulting(mask, address, offsets); /// /// svint64_t svldff1ub_gather_[s64]offset_s64(svbool_t pg, const uint8_t *base, svint64_t offsets) /// LDFF1B Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorByteZeroExtendFirstFaulting(Vector mask, byte* address, Vector offsets) => GatherVectorByteZeroExtendFirstFaulting(mask, address, offsets); /// @@ -4360,14 +4305,12 @@ internal Arm64() { } /// svint64_t svldff1ub_gather_[u64]offset_s64(svbool_t pg, const uint8_t *base, svuint64_t offsets) /// LDFF1B Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorByteZeroExtendFirstFaulting(Vector mask, byte* address, Vector offsets) => GatherVectorByteZeroExtendFirstFaulting(mask, address, offsets); /// /// svuint32_t svldff1ub_gather_[s32]offset_u32(svbool_t pg, const uint8_t *base, svint32_t offsets) /// LDFF1B Zresult.S, Pg/Z, [Xbase, Zoffsets.S, SXTW] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorByteZeroExtendFirstFaulting(Vector mask, byte* address, Vector offsets) => GatherVectorByteZeroExtendFirstFaulting(mask, address, offsets); // @@ -4381,14 +4324,12 @@ internal Arm64() { } /// svuint32_t svldff1ub_gather_[u32]offset_u32(svbool_t pg, const uint8_t *base, svuint32_t offsets) /// LDFF1B Zresult.S, Pg/Z, [Xbase, Zoffsets.S, UXTW] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorByteZeroExtendFirstFaulting(Vector mask, byte* address, Vector offsets) => GatherVectorByteZeroExtendFirstFaulting(mask, address, offsets); /// /// svuint64_t svldff1ub_gather_[s64]offset_u64(svbool_t pg, const uint8_t *base, svint64_t offsets) /// LDFF1B Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorByteZeroExtendFirstFaulting(Vector mask, byte* address, Vector offsets) => GatherVectorByteZeroExtendFirstFaulting(mask, address, offsets); /// @@ -4401,7 +4342,6 @@ internal Arm64() { } /// svuint64_t svldff1ub_gather_[u64]offset_u64(svbool_t pg, const uint8_t *base, svuint64_t offsets) /// LDFF1B Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorByteZeroExtendFirstFaulting(Vector mask, byte* address, Vector offsets) => GatherVectorByteZeroExtendFirstFaulting(mask, address, offsets); @@ -4411,7 +4351,6 @@ internal Arm64() { } /// svfloat64_t svldff1_gather_[s64]index[_f64](svbool_t pg, const float64_t *base, svint64_t indices) /// LDFF1D Zresult.D, Pg/Z, [Xbase, Zindices.D, LSL #3] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorFirstFaulting(Vector mask, double* address, Vector indices) => GatherVectorFirstFaulting(mask, address, indices); /// @@ -4424,7 +4363,6 @@ internal Arm64() { } /// svfloat64_t svldff1_gather_[u64]index[_f64](svbool_t pg, const float64_t *base, svuint64_t indices) /// LDFF1D Zresult.D, Pg/Z, [Xbase, Zindices.D, LSL #3] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorFirstFaulting(Vector mask, double* address, Vector indices) => GatherVectorFirstFaulting(mask, address, indices); // @@ -4438,14 +4376,12 @@ internal Arm64() { } /// svint32_t svldff1_gather_[s32]index[_s32](svbool_t pg, const int32_t *base, svint32_t indices) /// LDFF1W Zresult.S, Pg/Z, [Xbase, Zindices.S, SXTW #2] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorFirstFaulting(Vector mask, int* address, Vector indices) => GatherVectorFirstFaulting(mask, address, indices); /// /// svint32_t svldff1_gather_[u32]index[_s32](svbool_t pg, const int32_t *base, svuint32_t indices) /// LDFF1W Zresult.S, Pg/Z, [Xbase, Zindices.S, UXTW #2] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorFirstFaulting(Vector mask, int* address, Vector indices) => GatherVectorFirstFaulting(mask, address, indices); /// @@ -4458,21 +4394,18 @@ internal Arm64() { } /// svint64_t svldff1_gather_[s64]index[_s64](svbool_t pg, const int64_t *base, svint64_t indices) /// LDFF1D Zresult.D, Pg/Z, [Xbase, Zindices.D, LSL #3] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorFirstFaulting(Vector mask, long* address, Vector indices) => GatherVectorFirstFaulting(mask, address, indices); /// /// svint64_t svldff1_gather_[u64]index[_s64](svbool_t pg, const int64_t *base, svuint64_t indices) /// LDFF1D Zresult.D, Pg/Z, [Xbase, Zindices.D, LSL #3] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorFirstFaulting(Vector mask, long* address, Vector indices) => GatherVectorFirstFaulting(mask, address, indices); /// /// svfloat32_t svldff1_gather_[s32]index[_f32](svbool_t pg, const float32_t *base, svint32_t indices) /// LDFF1W Zresult.S, Pg/Z, [Xbase, Zindices.S, SXTW #2] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorFirstFaulting(Vector mask, float* address, Vector indices) => GatherVectorFirstFaulting(mask, address, indices); // @@ -4486,7 +4419,6 @@ internal Arm64() { } /// svfloat32_t svldff1_gather_[u32]index[_f32](svbool_t pg, const float32_t *base, svuint32_t indices) /// LDFF1W Zresult.S, Pg/Z, [Xbase, Zindices.S, UXTW #2] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorFirstFaulting(Vector mask, float* address, Vector indices) => GatherVectorFirstFaulting(mask, address, indices); // @@ -4500,14 +4432,12 @@ internal Arm64() { } /// svuint32_t svldff1_gather_[s32]index[_u32](svbool_t pg, const uint32_t *base, svint32_t indices) /// LDFF1W Zresult.S, Pg/Z, [Xbase, Zindices.S, SXTW #2] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorFirstFaulting(Vector mask, uint* address, Vector indices) => GatherVectorFirstFaulting(mask, address, indices); /// /// svuint32_t svldff1_gather_[u32]index[_u32](svbool_t pg, const uint32_t *base, svuint32_t indices) /// LDFF1W Zresult.S, Pg/Z, [Xbase, Zindices.S, UXTW #2] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorFirstFaulting(Vector mask, uint* address, Vector indices) => GatherVectorFirstFaulting(mask, address, indices); /// @@ -4520,14 +4450,12 @@ internal Arm64() { } /// svuint64_t svldff1_gather_[s64]index[_u64](svbool_t pg, const uint64_t *base, svint64_t indices) /// LDFF1D Zresult.D, Pg/Z, [Xbase, Zindices.D, LSL #3] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorFirstFaulting(Vector mask, ulong* address, Vector indices) => GatherVectorFirstFaulting(mask, address, indices); /// /// svuint64_t svldff1_gather_[u64]index[_u64](svbool_t pg, const uint64_t *base, svuint64_t indices) /// LDFF1D Zresult.D, Pg/Z, [Xbase, Zindices.D, LSL #3] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorFirstFaulting(Vector mask, ulong* address, Vector indices) => GatherVectorFirstFaulting(mask, address, indices); @@ -4537,7 +4465,6 @@ internal Arm64() { } /// svint32_t svld1sh_gather_[s32]index_s32(svbool_t pg, const int16_t *base, svint32_t indices) /// LD1SH Zresult.S, Pg/Z, [Xbase, Zindices.S, SXTW #1] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorInt16SignExtend(Vector mask, short* address, Vector indices) => GatherVectorInt16SignExtend(mask, address, indices); // @@ -4551,14 +4478,12 @@ internal Arm64() { } /// svint32_t svld1sh_gather_[u32]index_s32(svbool_t pg, const int16_t *base, svuint32_t indices) /// LD1SH Zresult.S, Pg/Z, [Xbase, Zindices.S, UXTW #1] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorInt16SignExtend(Vector mask, short* address, Vector indices) => GatherVectorInt16SignExtend(mask, address, indices); /// /// svint64_t svld1sh_gather_[s64]index_s64(svbool_t pg, const int16_t *base, svint64_t indices) /// LD1SH Zresult.D, Pg/Z, [Xbase, Zindices.D, LSL #1] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorInt16SignExtend(Vector mask, short* address, Vector indices) => GatherVectorInt16SignExtend(mask, address, indices); /// @@ -4571,14 +4496,12 @@ internal Arm64() { } /// svint64_t svld1sh_gather_[u64]index_s64(svbool_t pg, const int16_t *base, svuint64_t indices) /// LD1SH Zresult.D, Pg/Z, [Xbase, Zindices.D, LSL #1] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorInt16SignExtend(Vector mask, short* address, Vector indices) => GatherVectorInt16SignExtend(mask, address, indices); /// /// svuint32_t svld1sh_gather_[s32]index_u32(svbool_t pg, const int16_t *base, svint32_t indices) /// LD1SH Zresult.S, Pg/Z, [Xbase, Zindices.S, SXTW #1] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorInt16SignExtend(Vector mask, short* address, Vector indices) => GatherVectorInt16SignExtend(mask, address, indices); // @@ -4592,14 +4515,12 @@ internal Arm64() { } /// svuint32_t svld1sh_gather_[u32]index_u32(svbool_t pg, const int16_t *base, svuint32_t indices) /// LD1SH Zresult.S, Pg/Z, [Xbase, Zindices.S, UXTW #1] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorInt16SignExtend(Vector mask, short* address, Vector indices) => GatherVectorInt16SignExtend(mask, address, indices); /// /// svuint64_t svld1sh_gather_[s64]index_u64(svbool_t pg, const int16_t *base, svint64_t indices) /// LD1SH Zresult.D, Pg/Z, [Xbase, Zindices.D, LSL #1] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorInt16SignExtend(Vector mask, short* address, Vector indices) => GatherVectorInt16SignExtend(mask, address, indices); /// @@ -4612,7 +4533,6 @@ internal Arm64() { } /// svuint64_t svld1sh_gather_[u64]index_u64(svbool_t pg, const int16_t *base, svuint64_t indices) /// LD1SH Zresult.D, Pg/Z, [Xbase, Zindices.D, LSL #1] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorInt16SignExtend(Vector mask, short* address, Vector indices) => GatherVectorInt16SignExtend(mask, address, indices); @@ -4622,7 +4542,6 @@ internal Arm64() { } /// svint32_t svldff1sh_gather_[s32]index_s32(svbool_t pg, const int16_t *base, svint32_t indices) /// LDFF1SH Zresult.S, Pg/Z, [Xbase, Zindices.S, SXTW #1] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorInt16SignExtendFirstFaulting(Vector mask, short* address, Vector indices) => GatherVectorInt16SignExtendFirstFaulting(mask, address, indices); // @@ -4636,14 +4555,12 @@ internal Arm64() { } /// svint32_t svldff1sh_gather_[u32]index_s32(svbool_t pg, const int16_t *base, svuint32_t indices) /// LDFF1SH Zresult.S, Pg/Z, [Xbase, Zindices.S, UXTW #1] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorInt16SignExtendFirstFaulting(Vector mask, short* address, Vector indices) => GatherVectorInt16SignExtendFirstFaulting(mask, address, indices); /// /// svint64_t svldff1sh_gather_[s64]index_s64(svbool_t pg, const int16_t *base, svint64_t indices) /// LDFF1SH Zresult.D, Pg/Z, [Xbase, Zindices.D, LSL #1] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorInt16SignExtendFirstFaulting(Vector mask, short* address, Vector indices) => GatherVectorInt16SignExtendFirstFaulting(mask, address, indices); /// @@ -4656,14 +4573,12 @@ internal Arm64() { } /// svint64_t svldff1sh_gather_[u64]index_s64(svbool_t pg, const int16_t *base, svuint64_t indices) /// LDFF1SH Zresult.D, Pg/Z, [Xbase, Zindices.D, LSL #1] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorInt16SignExtendFirstFaulting(Vector mask, short* address, Vector indices) => GatherVectorInt16SignExtendFirstFaulting(mask, address, indices); /// /// svuint32_t svldff1sh_gather_[s32]index_u32(svbool_t pg, const int16_t *base, svint32_t indices) /// LDFF1SH Zresult.S, Pg/Z, [Xbase, Zindices.S, SXTW #1] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorInt16SignExtendFirstFaulting(Vector mask, short* address, Vector indices) => GatherVectorInt16SignExtendFirstFaulting(mask, address, indices); // @@ -4677,14 +4592,12 @@ internal Arm64() { } /// svuint32_t svldff1sh_gather_[u32]index_u32(svbool_t pg, const int16_t *base, svuint32_t indices) /// LDFF1SH Zresult.S, Pg/Z, [Xbase, Zindices.S, UXTW #1] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorInt16SignExtendFirstFaulting(Vector mask, short* address, Vector indices) => GatherVectorInt16SignExtendFirstFaulting(mask, address, indices); /// /// svuint64_t svldff1sh_gather_[s64]index_u64(svbool_t pg, const int16_t *base, svint64_t indices) /// LDFF1SH Zresult.D, Pg/Z, [Xbase, Zindices.D, LSL #1] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorInt16SignExtendFirstFaulting(Vector mask, short* address, Vector indices) => GatherVectorInt16SignExtendFirstFaulting(mask, address, indices); /// @@ -4697,7 +4610,6 @@ internal Arm64() { } /// svuint64_t svldff1sh_gather_[u64]index_u64(svbool_t pg, const int16_t *base, svuint64_t indices) /// LDFF1SH Zresult.D, Pg/Z, [Xbase, Zindices.D, LSL #1] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorInt16SignExtendFirstFaulting(Vector mask, short* address, Vector indices) => GatherVectorInt16SignExtendFirstFaulting(mask, address, indices); @@ -4707,56 +4619,48 @@ internal Arm64() { } /// svint32_t svld1sh_gather_[s32]offset_s32(svbool_t pg, const int16_t *base, svint32_t offsets) /// LD1SH Zresult.S, Pg/Z, [Xbase, Zoffsets.S, SXTW] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorInt16WithByteOffsetsSignExtend(Vector mask, short* address, Vector offsets) => GatherVectorInt16WithByteOffsetsSignExtend(mask, address, offsets); /// /// svint32_t svld1sh_gather_[u32]offset_s32(svbool_t pg, const int16_t *base, svuint32_t offsets) /// LD1SH Zresult.S, Pg/Z, [Xbase, Zoffsets.S, UXTW] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorInt16WithByteOffsetsSignExtend(Vector mask, short* address, Vector offsets) => GatherVectorInt16WithByteOffsetsSignExtend(mask, address, offsets); /// /// svint64_t svld1sh_gather_[s64]offset_s64(svbool_t pg, const int16_t *base, svint64_t offsets) /// LD1SH Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorInt16WithByteOffsetsSignExtend(Vector mask, short* address, Vector offsets) => GatherVectorInt16WithByteOffsetsSignExtend(mask, address, offsets); /// /// svint64_t svld1sh_gather_[u64]offset_s64(svbool_t pg, const int16_t *base, svuint64_t offsets) /// LD1SH Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorInt16WithByteOffsetsSignExtend(Vector mask, short* address, Vector offsets) => GatherVectorInt16WithByteOffsetsSignExtend(mask, address, offsets); /// /// svuint32_t svld1sh_gather_[s32]offset_u32(svbool_t pg, const int16_t *base, svint32_t offsets) /// LD1SH Zresult.S, Pg/Z, [Xbase, Zoffsets.S, SXTW] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorInt16WithByteOffsetsSignExtend(Vector mask, short* address, Vector offsets) => GatherVectorInt16WithByteOffsetsSignExtend(mask, address, offsets); /// /// svuint32_t svld1sh_gather_[u32]offset_u32(svbool_t pg, const int16_t *base, svuint32_t offsets) /// LD1SH Zresult.S, Pg/Z, [Xbase, Zoffsets.S, UXTW] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorInt16WithByteOffsetsSignExtend(Vector mask, short* address, Vector offsets) => GatherVectorInt16WithByteOffsetsSignExtend(mask, address, offsets); /// /// svuint64_t svld1sh_gather_[s64]offset_u64(svbool_t pg, const int16_t *base, svint64_t offsets) /// LD1SH Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorInt16WithByteOffsetsSignExtend(Vector mask, short* address, Vector offsets) => GatherVectorInt16WithByteOffsetsSignExtend(mask, address, offsets); /// /// svuint64_t svld1sh_gather_[u64]offset_u64(svbool_t pg, const int16_t *base, svuint64_t offsets) /// LD1SH Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorInt16WithByteOffsetsSignExtend(Vector mask, short* address, Vector offsets) => GatherVectorInt16WithByteOffsetsSignExtend(mask, address, offsets); @@ -4766,56 +4670,48 @@ internal Arm64() { } /// svint32_t svldff1sh_gather_[s32]offset_s32(svbool_t pg, const int16_t *base, svint32_t offsets) /// LDFF1SH Zresult.S, Pg/Z, [Xbase, Zoffsets.S, SXTW] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorInt16WithByteOffsetsSignExtendFirstFaulting(Vector mask, short* address, Vector offsets) => GatherVectorInt16WithByteOffsetsSignExtendFirstFaulting(mask, address, offsets); /// /// svint32_t svldff1sh_gather_[u32]offset_s32(svbool_t pg, const int16_t *base, svuint32_t offsets) /// LDFF1SH Zresult.S, Pg/Z, [Xbase, Zoffsets.S, UXTW] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorInt16WithByteOffsetsSignExtendFirstFaulting(Vector mask, short* address, Vector offsets) => GatherVectorInt16WithByteOffsetsSignExtendFirstFaulting(mask, address, offsets); /// /// svint64_t svldff1sh_gather_[s64]offset_s64(svbool_t pg, const int16_t *base, svint64_t offsets) /// LDFF1SH Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorInt16WithByteOffsetsSignExtendFirstFaulting(Vector mask, short* address, Vector offsets) => GatherVectorInt16WithByteOffsetsSignExtendFirstFaulting(mask, address, offsets); /// /// svint64_t svldff1sh_gather_[u64]offset_s64(svbool_t pg, const int16_t *base, svuint64_t offsets) /// LDFF1SH Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorInt16WithByteOffsetsSignExtendFirstFaulting(Vector mask, short* address, Vector offsets) => GatherVectorInt16WithByteOffsetsSignExtendFirstFaulting(mask, address, offsets); /// /// svuint32_t svldff1sh_gather_[s32]offset_u32(svbool_t pg, const int16_t *base, svint32_t offsets) /// LDFF1SH Zresult.S, Pg/Z, [Xbase, Zoffsets.S, SXTW] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorInt16WithByteOffsetsSignExtendFirstFaulting(Vector mask, short* address, Vector offsets) => GatherVectorInt16WithByteOffsetsSignExtendFirstFaulting(mask, address, offsets); /// /// svuint32_t svldff1sh_gather_[u32]offset_u32(svbool_t pg, const int16_t *base, svuint32_t offsets) /// LDFF1SH Zresult.S, Pg/Z, [Xbase, Zoffsets.S, UXTW] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorInt16WithByteOffsetsSignExtendFirstFaulting(Vector mask, short* address, Vector offsets) => GatherVectorInt16WithByteOffsetsSignExtendFirstFaulting(mask, address, offsets); /// /// svuint64_t svldff1sh_gather_[s64]offset_u64(svbool_t pg, const int16_t *base, svint64_t offsets) /// LDFF1SH Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorInt16WithByteOffsetsSignExtendFirstFaulting(Vector mask, short* address, Vector offsets) => GatherVectorInt16WithByteOffsetsSignExtendFirstFaulting(mask, address, offsets); /// /// svuint64_t svldff1sh_gather_[u64]offset_u64(svbool_t pg, const int16_t *base, svuint64_t offsets) /// LDFF1SH Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorInt16WithByteOffsetsSignExtendFirstFaulting(Vector mask, short* address, Vector offsets) => GatherVectorInt16WithByteOffsetsSignExtendFirstFaulting(mask, address, offsets); @@ -4825,7 +4721,6 @@ internal Arm64() { } /// svint64_t svld1sw_gather_[s64]index_s64(svbool_t pg, const int32_t *base, svint64_t indices) /// LD1SW Zresult.D, Pg/Z, [Xbase, Zindices.D, LSL #2] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorInt32SignExtend(Vector mask, int* address, Vector indices) => GatherVectorInt32SignExtend(mask, address, indices); /// @@ -4838,14 +4733,12 @@ internal Arm64() { } /// svint64_t svld1sw_gather_[u64]index_s64(svbool_t pg, const int32_t *base, svuint64_t indices) /// LD1SW Zresult.D, Pg/Z, [Xbase, Zindices.D, LSL #2] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorInt32SignExtend(Vector mask, int* address, Vector indices) => GatherVectorInt32SignExtend(mask, address, indices); /// /// svuint64_t svld1sw_gather_[s64]index_u64(svbool_t pg, const int32_t *base, svint64_t indices) /// LD1SW Zresult.D, Pg/Z, [Xbase, Zindices.D, LSL #2] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorInt32SignExtend(Vector mask, int* address, Vector indices) => GatherVectorInt32SignExtend(mask, address, indices); /// @@ -4858,7 +4751,6 @@ internal Arm64() { } /// svuint64_t svld1sw_gather_[u64]index_u64(svbool_t pg, const int32_t *base, svuint64_t indices) /// LD1SW Zresult.D, Pg/Z, [Xbase, Zindices.D, LSL #2] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorInt32SignExtend(Vector mask, int* address, Vector indices) => GatherVectorInt32SignExtend(mask, address, indices); @@ -4868,7 +4760,6 @@ internal Arm64() { } /// svint64_t svldff1sw_gather_[s64]index_s64(svbool_t pg, const int32_t *base, svint64_t indices) /// LDFF1SW Zresult.D, Pg/Z, [Xbase, Zindices.D, LSL #2] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorInt32SignExtendFirstFaulting(Vector mask, int* address, Vector indices) => GatherVectorInt32SignExtendFirstFaulting(mask, address, indices); /// @@ -4881,14 +4772,12 @@ internal Arm64() { } /// svint64_t svldff1sw_gather_[u64]index_s64(svbool_t pg, const int32_t *base, svuint64_t indices) /// LDFF1SW Zresult.D, Pg/Z, [Xbase, Zindices.D, LSL #2] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorInt32SignExtendFirstFaulting(Vector mask, int* address, Vector indices) => GatherVectorInt32SignExtendFirstFaulting(mask, address, indices); /// /// svuint64_t svldff1sw_gather_[s64]index_u64(svbool_t pg, const int32_t *base, svint64_t indices) /// LDFF1SW Zresult.D, Pg/Z, [Xbase, Zindices.D, LSL #2] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorInt32SignExtendFirstFaulting(Vector mask, int* address, Vector indices) => GatherVectorInt32SignExtendFirstFaulting(mask, address, indices); /// @@ -4901,7 +4790,6 @@ internal Arm64() { } /// svuint64_t svldff1sw_gather_[u64]index_u64(svbool_t pg, const int32_t *base, svuint64_t indices) /// LDFF1SW Zresult.D, Pg/Z, [Xbase, Zindices.D, LSL #2] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorInt32SignExtendFirstFaulting(Vector mask, int* address, Vector indices) => GatherVectorInt32SignExtendFirstFaulting(mask, address, indices); @@ -4911,28 +4799,24 @@ internal Arm64() { } /// svint64_t svld1sw_gather_[s64]offset_s64(svbool_t pg, const int32_t *base, svint64_t offsets) /// LD1SW Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorInt32WithByteOffsetsSignExtend(Vector mask, int* address, Vector offsets) => GatherVectorInt32WithByteOffsetsSignExtend(mask, address, offsets); /// /// svint64_t svld1sw_gather_[u64]offset_s64(svbool_t pg, const int32_t *base, svuint64_t offsets) /// LD1SW Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorInt32WithByteOffsetsSignExtend(Vector mask, int* address, Vector offsets) => GatherVectorInt32WithByteOffsetsSignExtend(mask, address, offsets); /// /// svuint64_t svld1sw_gather_[s64]offset_u64(svbool_t pg, const int32_t *base, svint64_t offsets) /// LD1SW Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorInt32WithByteOffsetsSignExtend(Vector mask, int* address, Vector offsets) => GatherVectorInt32WithByteOffsetsSignExtend(mask, address, offsets); /// /// svuint64_t svld1sw_gather_[u64]offset_u64(svbool_t pg, const int32_t *base, svuint64_t offsets) /// LD1SW Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorInt32WithByteOffsetsSignExtend(Vector mask, int* address, Vector offsets) => GatherVectorInt32WithByteOffsetsSignExtend(mask, address, offsets); @@ -4942,28 +4826,24 @@ internal Arm64() { } /// svint64_t svldff1sw_gather_[s64]offset_s64(svbool_t pg, const int32_t *base, svint64_t offsets) /// LDFF1SW Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorInt32WithByteOffsetsSignExtendFirstFaulting(Vector mask, int* address, Vector offsets) => GatherVectorInt32WithByteOffsetsSignExtendFirstFaulting(mask, address, offsets); /// /// svint64_t svldff1sw_gather_[u64]offset_s64(svbool_t pg, const int32_t *base, svuint64_t offsets) /// LDFF1SW Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorInt32WithByteOffsetsSignExtendFirstFaulting(Vector mask, int* address, Vector offsets) => GatherVectorInt32WithByteOffsetsSignExtendFirstFaulting(mask, address, offsets); /// /// svuint64_t svldff1sw_gather_[s64]offset_u64(svbool_t pg, const int32_t *base, svint64_t offsets) /// LDFF1SW Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorInt32WithByteOffsetsSignExtendFirstFaulting(Vector mask, int* address, Vector offsets) => GatherVectorInt32WithByteOffsetsSignExtendFirstFaulting(mask, address, offsets); /// /// svuint64_t svldff1sw_gather_[u64]offset_u64(svbool_t pg, const int32_t *base, svuint64_t offsets) /// LDFF1SW Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorInt32WithByteOffsetsSignExtendFirstFaulting(Vector mask, int* address, Vector offsets) => GatherVectorInt32WithByteOffsetsSignExtendFirstFaulting(mask, address, offsets); @@ -4973,7 +4853,6 @@ internal Arm64() { } /// svint32_t svld1sb_gather_[s32]offset_s32(svbool_t pg, const int8_t *base, svint32_t offsets) /// LD1SB Zresult.S, Pg/Z, [Xbase, Zoffsets.S, SXTW] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorSByteSignExtend(Vector mask, sbyte* address, Vector indices) => GatherVectorSByteSignExtend(mask, address, indices); // @@ -4987,14 +4866,12 @@ internal Arm64() { } /// svint32_t svld1sb_gather_[u32]offset_s32(svbool_t pg, const int8_t *base, svuint32_t offsets) /// LD1SB Zresult.S, Pg/Z, [Xbase, Zoffsets.S, UXTW] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorSByteSignExtend(Vector mask, sbyte* address, Vector indices) => GatherVectorSByteSignExtend(mask, address, indices); /// /// svint64_t svld1sb_gather_[s64]offset_s64(svbool_t pg, const int8_t *base, svint64_t offsets) /// LD1SB Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorSByteSignExtend(Vector mask, sbyte* address, Vector indices) => GatherVectorSByteSignExtend(mask, address, indices); /// @@ -5007,14 +4884,12 @@ internal Arm64() { } /// svint64_t svld1sb_gather_[u64]offset_s64(svbool_t pg, const int8_t *base, svuint64_t offsets) /// LD1SB Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorSByteSignExtend(Vector mask, sbyte* address, Vector indices) => GatherVectorSByteSignExtend(mask, address, indices); /// /// svuint32_t svld1sb_gather_[s32]offset_u32(svbool_t pg, const int8_t *base, svint32_t offsets) /// LD1SB Zresult.S, Pg/Z, [Xbase, Zoffsets.S, SXTW] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorSByteSignExtend(Vector mask, sbyte* address, Vector indices) => GatherVectorSByteSignExtend(mask, address, indices); // @@ -5028,14 +4903,12 @@ internal Arm64() { } /// svuint32_t svld1sb_gather_[u32]offset_u32(svbool_t pg, const int8_t *base, svuint32_t offsets) /// LD1SB Zresult.S, Pg/Z, [Xbase, Zoffsets.S, UXTW] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorSByteSignExtend(Vector mask, sbyte* address, Vector indices) => GatherVectorSByteSignExtend(mask, address, indices); /// /// svuint64_t svld1sb_gather_[s64]offset_u64(svbool_t pg, const int8_t *base, svint64_t offsets) /// LD1SB Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorSByteSignExtend(Vector mask, sbyte* address, Vector indices) => GatherVectorSByteSignExtend(mask, address, indices); /// @@ -5048,7 +4921,6 @@ internal Arm64() { } /// svuint64_t svld1sb_gather_[u64]offset_u64(svbool_t pg, const int8_t *base, svuint64_t offsets) /// LD1SB Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorSByteSignExtend(Vector mask, sbyte* address, Vector indices) => GatherVectorSByteSignExtend(mask, address, indices); @@ -5058,7 +4930,6 @@ internal Arm64() { } /// svint32_t svldff1sb_gather_[s32]offset_s32(svbool_t pg, const int8_t *base, svint32_t offsets) /// LDFF1SB Zresult.S, Pg/Z, [Xbase, Zoffsets.S, SXTW] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorSByteSignExtendFirstFaulting(Vector mask, sbyte* address, Vector offsets) => GatherVectorSByteSignExtendFirstFaulting(mask, address, offsets); // @@ -5072,14 +4943,12 @@ internal Arm64() { } /// svint32_t svldff1sb_gather_[u32]offset_s32(svbool_t pg, const int8_t *base, svuint32_t offsets) /// LDFF1SB Zresult.S, Pg/Z, [Xbase, Zoffsets.S, UXTW] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorSByteSignExtendFirstFaulting(Vector mask, sbyte* address, Vector offsets) => GatherVectorSByteSignExtendFirstFaulting(mask, address, offsets); /// /// svint64_t svldff1sb_gather_[s64]offset_s64(svbool_t pg, const int8_t *base, svint64_t offsets) /// LDFF1SB Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorSByteSignExtendFirstFaulting(Vector mask, sbyte* address, Vector offsets) => GatherVectorSByteSignExtendFirstFaulting(mask, address, offsets); /// @@ -5092,14 +4961,12 @@ internal Arm64() { } /// svint64_t svldff1sb_gather_[u64]offset_s64(svbool_t pg, const int8_t *base, svuint64_t offsets) /// LDFF1SB Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorSByteSignExtendFirstFaulting(Vector mask, sbyte* address, Vector offsets) => GatherVectorSByteSignExtendFirstFaulting(mask, address, offsets); /// /// svuint32_t svldff1sb_gather_[s32]offset_u32(svbool_t pg, const int8_t *base, svint32_t offsets) /// LDFF1SB Zresult.S, Pg/Z, [Xbase, Zoffsets.S, SXTW] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorSByteSignExtendFirstFaulting(Vector mask, sbyte* address, Vector offsets) => GatherVectorSByteSignExtendFirstFaulting(mask, address, offsets); // @@ -5113,14 +4980,12 @@ internal Arm64() { } /// svuint32_t svldff1sb_gather_[u32]offset_u32(svbool_t pg, const int8_t *base, svuint32_t offsets) /// LDFF1SB Zresult.S, Pg/Z, [Xbase, Zoffsets.S, UXTW] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorSByteSignExtendFirstFaulting(Vector mask, sbyte* address, Vector offsets) => GatherVectorSByteSignExtendFirstFaulting(mask, address, offsets); /// /// svuint64_t svldff1sb_gather_[s64]offset_u64(svbool_t pg, const int8_t *base, svint64_t offsets) /// LDFF1SB Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorSByteSignExtendFirstFaulting(Vector mask, sbyte* address, Vector offsets) => GatherVectorSByteSignExtendFirstFaulting(mask, address, offsets); /// @@ -5133,7 +4998,6 @@ internal Arm64() { } /// svuint64_t svldff1sb_gather_[u64]offset_u64(svbool_t pg, const int8_t *base, svuint64_t offsets) /// LDFF1SB Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorSByteSignExtendFirstFaulting(Vector mask, sbyte* address, Vector offsets) => GatherVectorSByteSignExtendFirstFaulting(mask, address, offsets); @@ -5143,56 +5007,48 @@ internal Arm64() { } /// svint32_t svld1uh_gather_[s32]offset_s32(svbool_t pg, const uint16_t *base, svint32_t offsets) /// LD1H Zresult.S, Pg/Z, [Xbase, Zoffsets.S, SXTW] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorUInt16WithByteOffsetsZeroExtend(Vector mask, ushort* address, Vector offsets) => GatherVectorUInt16WithByteOffsetsZeroExtend(mask, address, offsets); /// /// svint32_t svld1uh_gather_[u32]offset_s32(svbool_t pg, const uint16_t *base, svuint32_t offsets) /// LD1H Zresult.S, Pg/Z, [Xbase, Zoffsets.S, UXTW] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorUInt16WithByteOffsetsZeroExtend(Vector mask, ushort* address, Vector offsets) => GatherVectorUInt16WithByteOffsetsZeroExtend(mask, address, offsets); /// /// svint64_t svld1uh_gather_[s64]offset_s64(svbool_t pg, const uint16_t *base, svint64_t offsets) /// LD1H Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorUInt16WithByteOffsetsZeroExtend(Vector mask, ushort* address, Vector offsets) => GatherVectorUInt16WithByteOffsetsZeroExtend(mask, address, offsets); /// /// svint64_t svld1uh_gather_[u64]offset_s64(svbool_t pg, const uint16_t *base, svuint64_t offsets) /// LD1H Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorUInt16WithByteOffsetsZeroExtend(Vector mask, ushort* address, Vector offsets) => GatherVectorUInt16WithByteOffsetsZeroExtend(mask, address, offsets); /// /// svuint32_t svld1uh_gather_[s32]offset_u32(svbool_t pg, const uint16_t *base, svint32_t offsets) /// LD1H Zresult.S, Pg/Z, [Xbase, Zoffsets.S, SXTW] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorUInt16WithByteOffsetsZeroExtend(Vector mask, ushort* address, Vector offsets) => GatherVectorUInt16WithByteOffsetsZeroExtend(mask, address, offsets); /// /// svuint32_t svld1uh_gather_[u32]offset_u32(svbool_t pg, const uint16_t *base, svuint32_t offsets) /// LD1H Zresult.S, Pg/Z, [Xbase, Zoffsets.S, UXTW] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorUInt16WithByteOffsetsZeroExtend(Vector mask, ushort* address, Vector offsets) => GatherVectorUInt16WithByteOffsetsZeroExtend(mask, address, offsets); /// /// svuint64_t svld1uh_gather_[s64]offset_u64(svbool_t pg, const uint16_t *base, svint64_t offsets) /// LD1H Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorUInt16WithByteOffsetsZeroExtend(Vector mask, ushort* address, Vector offsets) => GatherVectorUInt16WithByteOffsetsZeroExtend(mask, address, offsets); /// /// svuint64_t svld1uh_gather_[u64]offset_u64(svbool_t pg, const uint16_t *base, svuint64_t offsets) /// LD1H Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorUInt16WithByteOffsetsZeroExtend(Vector mask, ushort* address, Vector offsets) => GatherVectorUInt16WithByteOffsetsZeroExtend(mask, address, offsets); @@ -5202,56 +5058,48 @@ internal Arm64() { } /// svint32_t svldff1uh_gather_[s32]offset_s32(svbool_t pg, const uint16_t *base, svint32_t offsets) /// LDFF1H Zresult.S, Pg/Z, [Xbase, Zoffsets.S, SXTW] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorUInt16WithByteOffsetsZeroExtendFirstFaulting(Vector mask, ushort* address, Vector offsets) => GatherVectorUInt16WithByteOffsetsZeroExtendFirstFaulting(mask, address, offsets); /// /// svint32_t svldff1uh_gather_[u32]offset_s32(svbool_t pg, const uint16_t *base, svuint32_t offsets) /// LDFF1H Zresult.S, Pg/Z, [Xbase, Zoffsets.S, UXTW] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorUInt16WithByteOffsetsZeroExtendFirstFaulting(Vector mask, ushort* address, Vector offsets) => GatherVectorUInt16WithByteOffsetsZeroExtendFirstFaulting(mask, address, offsets); /// /// svint64_t svldff1uh_gather_[s64]offset_s64(svbool_t pg, const uint16_t *base, svint64_t offsets) /// LDFF1H Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorUInt16WithByteOffsetsZeroExtendFirstFaulting(Vector mask, ushort* address, Vector offsets) => GatherVectorUInt16WithByteOffsetsZeroExtendFirstFaulting(mask, address, offsets); /// /// svint64_t svldff1uh_gather_[u64]offset_s64(svbool_t pg, const uint16_t *base, svuint64_t offsets) /// LDFF1H Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorUInt16WithByteOffsetsZeroExtendFirstFaulting(Vector mask, ushort* address, Vector offsets) => GatherVectorUInt16WithByteOffsetsZeroExtendFirstFaulting(mask, address, offsets); /// /// svuint32_t svldff1uh_gather_[s32]offset_u32(svbool_t pg, const uint16_t *base, svint32_t offsets) /// LDFF1H Zresult.S, Pg/Z, [Xbase, Zoffsets.S, SXTW] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorUInt16WithByteOffsetsZeroExtendFirstFaulting(Vector mask, ushort* address, Vector offsets) => GatherVectorUInt16WithByteOffsetsZeroExtendFirstFaulting(mask, address, offsets); /// /// svuint32_t svldff1uh_gather_[u32]offset_u32(svbool_t pg, const uint16_t *base, svuint32_t offsets) /// LDFF1H Zresult.S, Pg/Z, [Xbase, Zoffsets.S, UXTW] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorUInt16WithByteOffsetsZeroExtendFirstFaulting(Vector mask, ushort* address, Vector offsets) => GatherVectorUInt16WithByteOffsetsZeroExtendFirstFaulting(mask, address, offsets); /// /// svuint64_t svldff1uh_gather_[s64]offset_u64(svbool_t pg, const uint16_t *base, svint64_t offsets) /// LDFF1H Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorUInt16WithByteOffsetsZeroExtendFirstFaulting(Vector mask, ushort* address, Vector offsets) => GatherVectorUInt16WithByteOffsetsZeroExtendFirstFaulting(mask, address, offsets); /// /// svuint64_t svldff1uh_gather_[u64]offset_u64(svbool_t pg, const uint16_t *base, svuint64_t offsets) /// LDFF1H Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorUInt16WithByteOffsetsZeroExtendFirstFaulting(Vector mask, ushort* address, Vector offsets) => GatherVectorUInt16WithByteOffsetsZeroExtendFirstFaulting(mask, address, offsets); @@ -5261,7 +5109,6 @@ internal Arm64() { } /// svint32_t svld1uh_gather_[s32]index_s32(svbool_t pg, const uint16_t *base, svint32_t indices) /// LD1H Zresult.S, Pg/Z, [Xbase, Zindices.S, SXTW #1] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorUInt16ZeroExtend(Vector mask, ushort* address, Vector indices) => GatherVectorUInt16ZeroExtend(mask, address, indices); // @@ -5275,14 +5122,12 @@ internal Arm64() { } /// svint32_t svld1uh_gather_[u32]index_s32(svbool_t pg, const uint16_t *base, svuint32_t indices) /// LD1H Zresult.S, Pg/Z, [Xbase, Zindices.S, UXTW #1] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorUInt16ZeroExtend(Vector mask, ushort* address, Vector indices) => GatherVectorUInt16ZeroExtend(mask, address, indices); /// /// svint64_t svld1uh_gather_[s64]index_s64(svbool_t pg, const uint16_t *base, svint64_t indices) /// LD1H Zresult.D, Pg/Z, [Xbase, Zindices.D, LSL #1] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorUInt16ZeroExtend(Vector mask, ushort* address, Vector indices) => GatherVectorUInt16ZeroExtend(mask, address, indices); /// @@ -5295,14 +5140,12 @@ internal Arm64() { } /// svint64_t svld1uh_gather_[u64]index_s64(svbool_t pg, const uint16_t *base, svuint64_t indices) /// LD1H Zresult.D, Pg/Z, [Xbase, Zindices.D, LSL #1] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorUInt16ZeroExtend(Vector mask, ushort* address, Vector indices) => GatherVectorUInt16ZeroExtend(mask, address, indices); /// /// svuint32_t svld1uh_gather_[s32]index_u32(svbool_t pg, const uint16_t *base, svint32_t indices) /// LD1H Zresult.S, Pg/Z, [Xbase, Zindices.S, SXTW #1] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorUInt16ZeroExtend(Vector mask, ushort* address, Vector indices) => GatherVectorUInt16ZeroExtend(mask, address, indices); // @@ -5316,14 +5159,12 @@ internal Arm64() { } /// svuint32_t svld1uh_gather_[u32]index_u32(svbool_t pg, const uint16_t *base, svuint32_t indices) /// LD1H Zresult.S, Pg/Z, [Xbase, Zindices.S, UXTW #1] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorUInt16ZeroExtend(Vector mask, ushort* address, Vector indices) => GatherVectorUInt16ZeroExtend(mask, address, indices); /// /// svuint64_t svld1uh_gather_[s64]index_u64(svbool_t pg, const uint16_t *base, svint64_t indices) /// LD1H Zresult.D, Pg/Z, [Xbase, Zindices.D, LSL #1] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorUInt16ZeroExtend(Vector mask, ushort* address, Vector indices) => GatherVectorUInt16ZeroExtend(mask, address, indices); /// @@ -5336,7 +5177,6 @@ internal Arm64() { } /// svuint64_t svld1uh_gather_[u64]index_u64(svbool_t pg, const uint16_t *base, svuint64_t indices) /// LD1H Zresult.D, Pg/Z, [Xbase, Zindices.D, LSL #1] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorUInt16ZeroExtend(Vector mask, ushort* address, Vector indices) => GatherVectorUInt16ZeroExtend(mask, address, indices); @@ -5346,7 +5186,6 @@ internal Arm64() { } /// svint32_t svldff1uh_gather_[s32]index_s32(svbool_t pg, const uint16_t *base, svint32_t indices) /// LDFF1H Zresult.S, Pg/Z, [Xbase, Zindices.S, SXTW #1] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorUInt16ZeroExtendFirstFaulting(Vector mask, ushort* address, Vector indices) => GatherVectorUInt16ZeroExtendFirstFaulting(mask, address, indices); // @@ -5360,14 +5199,12 @@ internal Arm64() { } /// svint32_t svldff1uh_gather_[u32]index_s32(svbool_t pg, const uint16_t *base, svuint32_t indices) /// LDFF1H Zresult.S, Pg/Z, [Xbase, Zindices.S, UXTW #1] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorUInt16ZeroExtendFirstFaulting(Vector mask, ushort* address, Vector indices) => GatherVectorUInt16ZeroExtendFirstFaulting(mask, address, indices); /// /// svint64_t svldff1uh_gather_[s64]index_s64(svbool_t pg, const uint16_t *base, svint64_t indices) /// LDFF1H Zresult.D, Pg/Z, [Xbase, Zindices.D, LSL #1] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorUInt16ZeroExtendFirstFaulting(Vector mask, ushort* address, Vector indices) => GatherVectorUInt16ZeroExtendFirstFaulting(mask, address, indices); /// @@ -5380,14 +5217,12 @@ internal Arm64() { } /// svint64_t svldff1uh_gather_[u64]index_s64(svbool_t pg, const uint16_t *base, svuint64_t indices) /// LDFF1H Zresult.D, Pg/Z, [Xbase, Zindices.D, LSL #1] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorUInt16ZeroExtendFirstFaulting(Vector mask, ushort* address, Vector indices) => GatherVectorUInt16ZeroExtendFirstFaulting(mask, address, indices); /// /// svuint32_t svldff1uh_gather_[s32]index_u32(svbool_t pg, const uint16_t *base, svint32_t indices) /// LDFF1H Zresult.S, Pg/Z, [Xbase, Zindices.S, SXTW #1] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorUInt16ZeroExtendFirstFaulting(Vector mask, ushort* address, Vector indices) => GatherVectorUInt16ZeroExtendFirstFaulting(mask, address, indices); // @@ -5401,14 +5236,12 @@ internal Arm64() { } /// svuint32_t svldff1uh_gather_[u32]index_u32(svbool_t pg, const uint16_t *base, svuint32_t indices) /// LDFF1H Zresult.S, Pg/Z, [Xbase, Zindices.S, UXTW #1] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorUInt16ZeroExtendFirstFaulting(Vector mask, ushort* address, Vector indices) => GatherVectorUInt16ZeroExtendFirstFaulting(mask, address, indices); /// /// svuint64_t svldff1uh_gather_[s64]index_u64(svbool_t pg, const uint16_t *base, svint64_t indices) /// LDFF1H Zresult.D, Pg/Z, [Xbase, Zindices.D, LSL #1] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorUInt16ZeroExtendFirstFaulting(Vector mask, ushort* address, Vector indices) => GatherVectorUInt16ZeroExtendFirstFaulting(mask, address, indices); /// @@ -5421,7 +5254,6 @@ internal Arm64() { } /// svuint64_t svldff1uh_gather_[u64]index_u64(svbool_t pg, const uint16_t *base, svuint64_t indices) /// LDFF1H Zresult.D, Pg/Z, [Xbase, Zindices.D, LSL #1] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorUInt16ZeroExtendFirstFaulting(Vector mask, ushort* address, Vector indices) => GatherVectorUInt16ZeroExtendFirstFaulting(mask, address, indices); @@ -5431,28 +5263,24 @@ internal Arm64() { } /// svint64_t svld1uw_gather_[s64]offset_s64(svbool_t pg, const uint32_t *base, svint64_t offsets) /// LD1W Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorUInt32WithByteOffsetsZeroExtend(Vector mask, uint* address, Vector offsets) => GatherVectorUInt32WithByteOffsetsZeroExtend(mask, address, offsets); /// /// svint64_t svld1uw_gather_[u64]offset_s64(svbool_t pg, const uint32_t *base, svuint64_t offsets) /// LD1W Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorUInt32WithByteOffsetsZeroExtend(Vector mask, uint* address, Vector offsets) => GatherVectorUInt32WithByteOffsetsZeroExtend(mask, address, offsets); /// /// svuint64_t svld1uw_gather_[s64]offset_u64(svbool_t pg, const uint32_t *base, svint64_t offsets) /// LD1W Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorUInt32WithByteOffsetsZeroExtend(Vector mask, uint* address, Vector offsets) => GatherVectorUInt32WithByteOffsetsZeroExtend(mask, address, offsets); /// /// svuint64_t svld1uw_gather_[u64]offset_u64(svbool_t pg, const uint32_t *base, svuint64_t offsets) /// LD1W Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorUInt32WithByteOffsetsZeroExtend(Vector mask, uint* address, Vector offsets) => GatherVectorUInt32WithByteOffsetsZeroExtend(mask, address, offsets); @@ -5462,28 +5290,24 @@ internal Arm64() { } /// svint64_t svldff1uw_gather_[s64]offset_s64(svbool_t pg, const uint32_t *base, svint64_t offsets) /// LDFF1W Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorUInt32WithByteOffsetsZeroExtendFirstFaulting(Vector mask, uint* address, Vector offsets) => GatherVectorUInt32WithByteOffsetsZeroExtendFirstFaulting(mask, address, offsets); /// /// svint64_t svldff1uw_gather_[u64]offset_s64(svbool_t pg, const uint32_t *base, svuint64_t offsets) /// LDFF1W Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorUInt32WithByteOffsetsZeroExtendFirstFaulting(Vector mask, uint* address, Vector offsets) => GatherVectorUInt32WithByteOffsetsZeroExtendFirstFaulting(mask, address, offsets); /// /// svuint64_t svldff1uw_gather_[s64]offset_u64(svbool_t pg, const uint32_t *base, svint64_t offsets) /// LDFF1W Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorUInt32WithByteOffsetsZeroExtendFirstFaulting(Vector mask, uint* address, Vector offsets) => GatherVectorUInt32WithByteOffsetsZeroExtendFirstFaulting(mask, address, offsets); /// /// svuint64_t svldff1uw_gather_[u64]offset_u64(svbool_t pg, const uint32_t *base, svuint64_t offsets) /// LDFF1W Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorUInt32WithByteOffsetsZeroExtendFirstFaulting(Vector mask, uint* address, Vector offsets) => GatherVectorUInt32WithByteOffsetsZeroExtendFirstFaulting(mask, address, offsets); @@ -5493,7 +5317,6 @@ internal Arm64() { } /// svint64_t svld1uw_gather_[s64]index_s64(svbool_t pg, const uint32_t *base, svint64_t indices) /// LD1W Zresult.D, Pg/Z, [Xbase, Zindices.D, LSL #2] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorUInt32ZeroExtend(Vector mask, uint* address, Vector indices) => GatherVectorUInt32ZeroExtend(mask, address, indices); /// @@ -5506,14 +5329,12 @@ internal Arm64() { } /// svint64_t svld1uw_gather_[u64]index_s64(svbool_t pg, const uint32_t *base, svuint64_t indices) /// LD1W Zresult.D, Pg/Z, [Xbase, Zindices.D, LSL #2] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorUInt32ZeroExtend(Vector mask, uint* address, Vector indices) => GatherVectorUInt32ZeroExtend(mask, address, indices); /// /// svuint64_t svld1uw_gather_[s64]index_u64(svbool_t pg, const uint32_t *base, svint64_t indices) /// LD1W Zresult.D, Pg/Z, [Xbase, Zindices.D, LSL #2] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorUInt32ZeroExtend(Vector mask, uint* address, Vector indices) => GatherVectorUInt32ZeroExtend(mask, address, indices); /// @@ -5526,7 +5347,6 @@ internal Arm64() { } /// svuint64_t svld1uw_gather_[u64]index_u64(svbool_t pg, const uint32_t *base, svuint64_t indices) /// LD1W Zresult.D, Pg/Z, [Xbase, Zindices.D, LSL #2] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorUInt32ZeroExtend(Vector mask, uint* address, Vector indices) => GatherVectorUInt32ZeroExtend(mask, address, indices); @@ -5536,7 +5356,6 @@ internal Arm64() { } /// svint64_t svldff1uw_gather_[s64]index_s64(svbool_t pg, const uint32_t *base, svint64_t indices) /// LDFF1W Zresult.D, Pg/Z, [Xbase, Zindices.D, LSL #2] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorUInt32ZeroExtendFirstFaulting(Vector mask, uint* address, Vector indices) => GatherVectorUInt32ZeroExtendFirstFaulting(mask, address, indices); /// @@ -5549,14 +5368,12 @@ internal Arm64() { } /// svint64_t svldff1uw_gather_[u64]index_s64(svbool_t pg, const uint32_t *base, svuint64_t indices) /// LDFF1W Zresult.D, Pg/Z, [Xbase, Zindices.D, LSL #2] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorUInt32ZeroExtendFirstFaulting(Vector mask, uint* address, Vector indices) => GatherVectorUInt32ZeroExtendFirstFaulting(mask, address, indices); /// /// svuint64_t svldff1uw_gather_[s64]index_u64(svbool_t pg, const uint32_t *base, svint64_t indices) /// LDFF1W Zresult.D, Pg/Z, [Xbase, Zindices.D, LSL #2] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorUInt32ZeroExtendFirstFaulting(Vector mask, uint* address, Vector indices) => GatherVectorUInt32ZeroExtendFirstFaulting(mask, address, indices); /// @@ -5569,7 +5386,6 @@ internal Arm64() { } /// svuint64_t svldff1uw_gather_[u64]index_u64(svbool_t pg, const uint32_t *base, svuint64_t indices) /// LDFF1W Zresult.D, Pg/Z, [Xbase, Zindices.D, LSL #2] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorUInt32ZeroExtendFirstFaulting(Vector mask, uint* address, Vector indices) => GatherVectorUInt32ZeroExtendFirstFaulting(mask, address, indices); @@ -5579,84 +5395,72 @@ internal Arm64() { } /// svfloat64_t svldff1_gather_[s64]offset[_f64](svbool_t pg, const float64_t *base, svint64_t offsets) /// LDFF1D Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorWithByteOffsetFirstFaulting(Vector mask, double* address, Vector offsets) => GatherVectorWithByteOffsetFirstFaulting(mask, address, offsets); /// /// svfloat64_t svldff1_gather_[u64]offset[_f64](svbool_t pg, const float64_t *base, svuint64_t offsets) /// LDFF1D Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorWithByteOffsetFirstFaulting(Vector mask, double* address, Vector offsets) => GatherVectorWithByteOffsetFirstFaulting(mask, address, offsets); /// /// svint32_t svldff1_gather_[s32]offset[_s32](svbool_t pg, const int32_t *base, svint32_t offsets) /// LDFF1W Zresult.S, Pg/Z, [Xbase, Zoffsets.S, SXTW] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorWithByteOffsetFirstFaulting(Vector mask, int* address, Vector offsets) => GatherVectorWithByteOffsetFirstFaulting(mask, address, offsets); /// /// svint32_t svldff1_gather_[u32]offset[_s32](svbool_t pg, const int32_t *base, svuint32_t offsets) /// LDFF1W Zresult.S, Pg/Z, [Xbase, Zoffsets.S, UXTW] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorWithByteOffsetFirstFaulting(Vector mask, int* address, Vector offsets) => GatherVectorWithByteOffsetFirstFaulting(mask, address, offsets); /// /// svint64_t svldff1_gather_[s64]offset[_s64](svbool_t pg, const int64_t *base, svint64_t offsets) /// LDFF1D Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorWithByteOffsetFirstFaulting(Vector mask, long* address, Vector offsets) => GatherVectorWithByteOffsetFirstFaulting(mask, address, offsets); /// /// svint64_t svldff1_gather_[u64]offset[_s64](svbool_t pg, const int64_t *base, svuint64_t offsets) /// LDFF1D Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorWithByteOffsetFirstFaulting(Vector mask, long* address, Vector offsets) => GatherVectorWithByteOffsetFirstFaulting(mask, address, offsets); /// /// svfloat32_t svldff1_gather_[s32]offset[_f32](svbool_t pg, const float32_t *base, svint32_t offsets) /// LDFF1W Zresult.S, Pg/Z, [Xbase, Zoffsets.S, SXTW] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorWithByteOffsetFirstFaulting(Vector mask, float* address, Vector offsets) => GatherVectorWithByteOffsetFirstFaulting(mask, address, offsets); /// /// svfloat32_t svldff1_gather_[u32]offset[_f32](svbool_t pg, const float32_t *base, svuint32_t offsets) /// LDFF1W Zresult.S, Pg/Z, [Xbase, Zoffsets.S, UXTW] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorWithByteOffsetFirstFaulting(Vector mask, float* address, Vector offsets) => GatherVectorWithByteOffsetFirstFaulting(mask, address, offsets); /// /// svuint32_t svldff1_gather_[s32]offset[_u32](svbool_t pg, const uint32_t *base, svint32_t offsets) /// LDFF1W Zresult.S, Pg/Z, [Xbase, Zoffsets.S, SXTW] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorWithByteOffsetFirstFaulting(Vector mask, uint* address, Vector offsets) => GatherVectorWithByteOffsetFirstFaulting(mask, address, offsets); /// /// svuint32_t svldff1_gather_[u32]offset[_u32](svbool_t pg, const uint32_t *base, svuint32_t offsets) /// LDFF1W Zresult.S, Pg/Z, [Xbase, Zoffsets.S, UXTW] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorWithByteOffsetFirstFaulting(Vector mask, uint* address, Vector offsets) => GatherVectorWithByteOffsetFirstFaulting(mask, address, offsets); /// /// svuint64_t svldff1_gather_[s64]offset[_u64](svbool_t pg, const uint64_t *base, svint64_t offsets) /// LDFF1D Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorWithByteOffsetFirstFaulting(Vector mask, ulong* address, Vector offsets) => GatherVectorWithByteOffsetFirstFaulting(mask, address, offsets); /// /// svuint64_t svldff1_gather_[u64]offset[_u64](svbool_t pg, const uint64_t *base, svuint64_t offsets) /// LDFF1D Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorWithByteOffsetFirstFaulting(Vector mask, ulong* address, Vector offsets) => GatherVectorWithByteOffsetFirstFaulting(mask, address, offsets); @@ -5666,84 +5470,72 @@ internal Arm64() { } /// svfloat64_t svld1_gather_[s64]offset[_f64](svbool_t pg, const float64_t *base, svint64_t offsets) /// LD1D Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorWithByteOffsets(Vector mask, double* address, Vector offsets) => GatherVectorWithByteOffsets(mask, address, offsets); /// /// svfloat64_t svld1_gather_[u64]offset[_f64](svbool_t pg, const float64_t *base, svuint64_t offsets) /// LD1D Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorWithByteOffsets(Vector mask, double* address, Vector offsets) => GatherVectorWithByteOffsets(mask, address, offsets); /// /// svint32_t svld1_gather_[s32]offset[_s32](svbool_t pg, const int32_t *base, svint32_t offsets) /// LD1W Zresult.S, Pg/Z, [Xbase, Zoffsets.S, SXTW] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorWithByteOffsets(Vector mask, int* address, Vector offsets) => GatherVectorWithByteOffsets(mask, address, offsets); /// /// svint32_t svld1_gather_[u32]offset[_s32](svbool_t pg, const int32_t *base, svuint32_t offsets) /// LD1W Zresult.S, Pg/Z, [Xbase, Zoffsets.S, UXTW] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorWithByteOffsets(Vector mask, int* address, Vector offsets) => GatherVectorWithByteOffsets(mask, address, offsets); /// /// svint64_t svld1_gather_[s64]offset[_s64](svbool_t pg, const int64_t *base, svint64_t offsets) /// LD1D Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorWithByteOffsets(Vector mask, long* address, Vector offsets) => GatherVectorWithByteOffsets(mask, address, offsets); /// /// svint64_t svld1_gather_[u64]offset[_s64](svbool_t pg, const int64_t *base, svuint64_t offsets) /// LD1D Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorWithByteOffsets(Vector mask, long* address, Vector offsets) => GatherVectorWithByteOffsets(mask, address, offsets); /// /// svfloat32_t svld1_gather_[s32]offset[_f32](svbool_t pg, const float32_t *base, svint32_t offsets) /// LD1W Zresult.S, Pg/Z, [Xbase, Zoffsets.S, SXTW] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorWithByteOffsets(Vector mask, float* address, Vector offsets) => GatherVectorWithByteOffsets(mask, address, offsets); /// /// svfloat32_t svld1_gather_[u32]offset[_f32](svbool_t pg, const float32_t *base, svuint32_t offsets) /// LD1W Zresult.S, Pg/Z, [Xbase, Zoffsets.S, UXTW] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorWithByteOffsets(Vector mask, float* address, Vector offsets) => GatherVectorWithByteOffsets(mask, address, offsets); /// /// svuint32_t svld1_gather_[s32]offset[_u32](svbool_t pg, const uint32_t *base, svint32_t offsets) /// LD1W Zresult.S, Pg/Z, [Xbase, Zoffsets.S, SXTW] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorWithByteOffsets(Vector mask, uint* address, Vector offsets) => GatherVectorWithByteOffsets(mask, address, offsets); /// /// svuint32_t svld1_gather_[u32]offset[_u32](svbool_t pg, const uint32_t *base, svuint32_t offsets) /// LD1W Zresult.S, Pg/Z, [Xbase, Zoffsets.S, UXTW] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorWithByteOffsets(Vector mask, uint* address, Vector offsets) => GatherVectorWithByteOffsets(mask, address, offsets); /// /// svuint64_t svld1_gather_[s64]offset[_u64](svbool_t pg, const uint64_t *base, svint64_t offsets) /// LD1D Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorWithByteOffsets(Vector mask, ulong* address, Vector offsets) => GatherVectorWithByteOffsets(mask, address, offsets); /// /// svuint64_t svld1_gather_[u64]offset[_u64](svbool_t pg, const uint64_t *base, svuint64_t offsets) /// LD1D Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe Vector GatherVectorWithByteOffsets(Vector mask, ulong* address, Vector offsets) => GatherVectorWithByteOffsets(mask, address, offsets); @@ -6055,7 +5847,6 @@ internal Arm64() { } /// LD1B Zresult.B, Pg/Z, [Xarray, Xindex] /// LD1B Zresult.B, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe Vector LoadVector(Vector mask, byte* address) => LoadVector(mask, address); /// @@ -6063,7 +5854,6 @@ internal Arm64() { } /// LD1D Zresult.D, Pg/Z, [Xarray, Xindex, LSL #3] /// LD1D Zresult.D, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe Vector LoadVector(Vector mask, double* address) => LoadVector(mask, address); /// @@ -6071,7 +5861,6 @@ internal Arm64() { } /// LD1H Zresult.H, Pg/Z, [Xarray, Xindex, LSL #1] /// LD1H Zresult.H, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe Vector LoadVector(Vector mask, short* address) => LoadVector(mask, address); /// @@ -6079,7 +5868,6 @@ internal Arm64() { } /// LD1W Zresult.S, Pg/Z, [Xarray, Xindex, LSL #2] /// LD1W Zresult.S, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe Vector LoadVector(Vector mask, int* address) => LoadVector(mask, address); /// @@ -6087,7 +5875,6 @@ internal Arm64() { } /// LD1D Zresult.D, Pg/Z, [Xarray, Xindex, LSL #3] /// LD1D Zresult.D, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe Vector LoadVector(Vector mask, long* address) => LoadVector(mask, address); /// @@ -6095,7 +5882,6 @@ internal Arm64() { } /// LD1B Zresult.B, Pg/Z, [Xarray, Xindex] /// LD1B Zresult.B, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe Vector LoadVector(Vector mask, sbyte* address) => LoadVector(mask, address); /// @@ -6103,7 +5889,6 @@ internal Arm64() { } /// LD1W Zresult.S, Pg/Z, [Xarray, Xindex, LSL #2] /// LD1W Zresult.S, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe Vector LoadVector(Vector mask, float* address) => LoadVector(mask, address); /// @@ -6111,7 +5896,6 @@ internal Arm64() { } /// LD1H Zresult.H, Pg/Z, [Xarray, Xindex, LSL #1] /// LD1H Zresult.H, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe Vector LoadVector(Vector mask, ushort* address) => LoadVector(mask, address); /// @@ -6119,7 +5903,6 @@ internal Arm64() { } /// LD1W Zresult.S, Pg/Z, [Xarray, Xindex, LSL #2] /// LD1W Zresult.S, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe Vector LoadVector(Vector mask, uint* address) => LoadVector(mask, address); /// @@ -6127,7 +5910,6 @@ internal Arm64() { } /// LD1D Zresult.D, Pg/Z, [Xarray, Xindex, LSL #3] /// LD1D Zresult.D, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe Vector LoadVector(Vector mask, ulong* address) => LoadVector(mask, address); @@ -6137,70 +5919,60 @@ internal Arm64() { } /// svuint8_t svld1rq[_u8](svbool_t pg, const uint8_t *base) /// LD1RQB Zresult.B, Pg/Z, [Xbase, #0] /// - [RequiresUnsafe] public static unsafe Vector LoadVector128AndReplicateToVector(Vector mask, byte* address) => LoadVector128AndReplicateToVector(mask, address); /// /// svfloat64_t svld1rq[_f64](svbool_t pg, const float64_t *base) /// LD1RQD Zresult.D, Pg/Z, [Xbase, #0] /// - [RequiresUnsafe] public static unsafe Vector LoadVector128AndReplicateToVector(Vector mask, double* address) => LoadVector128AndReplicateToVector(mask, address); /// /// svint16_t svld1rq[_s16](svbool_t pg, const int16_t *base) /// LD1RQH Zresult.H, Pg/Z, [Xbase, #0] /// - [RequiresUnsafe] public static unsafe Vector LoadVector128AndReplicateToVector(Vector mask, short* address) => LoadVector128AndReplicateToVector(mask, address); /// /// svint32_t svld1rq[_s32](svbool_t pg, const int32_t *base) /// LD1RQW Zresult.S, Pg/Z, [Xbase, #0] /// - [RequiresUnsafe] public static unsafe Vector LoadVector128AndReplicateToVector(Vector mask, int* address) => LoadVector128AndReplicateToVector(mask, address); /// /// svint64_t svld1rq[_s64](svbool_t pg, const int64_t *base) /// LD1RQD Zresult.D, Pg/Z, [Xbase, #0] /// - [RequiresUnsafe] public static unsafe Vector LoadVector128AndReplicateToVector(Vector mask, long* address) => LoadVector128AndReplicateToVector(mask, address); /// /// svint8_t svld1rq[_s8](svbool_t pg, const int8_t *base) /// LD1RQB Zresult.B, Pg/Z, [Xbase, #0] /// - [RequiresUnsafe] public static unsafe Vector LoadVector128AndReplicateToVector(Vector mask, sbyte* address) => LoadVector128AndReplicateToVector(mask, address); /// /// svfloat32_t svld1rq[_f32](svbool_t pg, const float32_t *base) /// LD1RQW Zresult.S, Pg/Z, [Xbase, #0] /// - [RequiresUnsafe] public static unsafe Vector LoadVector128AndReplicateToVector(Vector mask, float* address) => LoadVector128AndReplicateToVector(mask, address); /// /// svuint16_t svld1rq[_u16](svbool_t pg, const uint16_t *base) /// LD1RQH Zresult.H, Pg/Z, [Xbase, #0] /// - [RequiresUnsafe] public static unsafe Vector LoadVector128AndReplicateToVector(Vector mask, ushort* address) => LoadVector128AndReplicateToVector(mask, address); /// /// svuint32_t svld1rq[_u32](svbool_t pg, const uint32_t *base) /// LD1RQW Zresult.S, Pg/Z, [Xbase, #0] /// - [RequiresUnsafe] public static unsafe Vector LoadVector128AndReplicateToVector(Vector mask, uint* address) => LoadVector128AndReplicateToVector(mask, address); /// /// svuint64_t svld1rq[_u64](svbool_t pg, const uint64_t *base) /// LD1RQD Zresult.D, Pg/Z, [Xbase, #0] /// - [RequiresUnsafe] public static unsafe Vector LoadVector128AndReplicateToVector(Vector mask, ulong* address) => LoadVector128AndReplicateToVector(mask, address); @@ -6210,7 +5982,6 @@ internal Arm64() { } /// svint16_t svldnf1ub_s16(svbool_t pg, const uint8_t *base) /// LDNF1B Zresult.H, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorByteNonFaultingZeroExtendToInt16(Vector mask, byte* address) => LoadVectorByteNonFaultingZeroExtendToInt16(mask, address); @@ -6220,7 +5991,6 @@ internal Arm64() { } /// svint32_t svldnf1ub_s32(svbool_t pg, const uint8_t *base) /// LDNF1B Zresult.S, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorByteNonFaultingZeroExtendToInt32(Vector mask, byte* address) => LoadVectorByteNonFaultingZeroExtendToInt32(mask, address); @@ -6230,7 +6000,6 @@ internal Arm64() { } /// svint64_t svldnf1ub_s64(svbool_t pg, const uint8_t *base) /// LDNF1B Zresult.D, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorByteNonFaultingZeroExtendToInt64(Vector mask, byte* address) => LoadVectorByteNonFaultingZeroExtendToInt64(mask, address); @@ -6240,7 +6009,6 @@ internal Arm64() { } /// svuint16_t svldnf1ub_u16(svbool_t pg, const uint8_t *base) /// LDNF1B Zresult.H, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorByteNonFaultingZeroExtendToUInt16(Vector mask, byte* address) => LoadVectorByteNonFaultingZeroExtendToUInt16(mask, address); @@ -6250,7 +6018,6 @@ internal Arm64() { } /// svuint32_t svldnf1ub_u32(svbool_t pg, const uint8_t *base) /// LDNF1B Zresult.S, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorByteNonFaultingZeroExtendToUInt32(Vector mask, byte* address) => LoadVectorByteNonFaultingZeroExtendToUInt32(mask, address); @@ -6260,7 +6027,6 @@ internal Arm64() { } /// svuint64_t svldnf1ub_u64(svbool_t pg, const uint8_t *base) /// LDNF1B Zresult.D, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorByteNonFaultingZeroExtendToUInt64(Vector mask, byte* address) => LoadVectorByteNonFaultingZeroExtendToUInt64(mask, address); @@ -6268,42 +6034,36 @@ internal Arm64() { } /// svint16_t svldff1ub_s16(svbool_t pg, const uint8_t *base) /// LDFF1B Zresult.H, Pg/Z, [Xbase, XZR] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorByteZeroExtendFirstFaulting(Vector mask, byte* address) => LoadVectorByteZeroExtendFirstFaulting(mask, address); /// /// svint32_t svldff1ub_s32(svbool_t pg, const uint8_t *base) /// LDFF1B Zresult.S, Pg/Z, [Xbase, XZR] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorByteZeroExtendFirstFaulting(Vector mask, byte* address) => LoadVectorByteZeroExtendFirstFaulting(mask, address); /// /// svint64_t svldff1ub_s64(svbool_t pg, const uint8_t *base) /// LDFF1B Zresult.D, Pg/Z, [Xbase, XZR] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorByteZeroExtendFirstFaulting(Vector mask, byte* address) => LoadVectorByteZeroExtendFirstFaulting(mask, address); /// /// svuint16_t svldff1ub_u16(svbool_t pg, const uint8_t *base) /// LDFF1B Zresult.H, Pg/Z, [Xbase, XZR] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorByteZeroExtendFirstFaulting(Vector mask, byte* address) => LoadVectorByteZeroExtendFirstFaulting(mask, address); /// /// svuint32_t svldff1ub_u32(svbool_t pg, const uint8_t *base) /// LDFF1B Zresult.S, Pg/Z, [Xbase, XZR] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorByteZeroExtendFirstFaulting(Vector mask, byte* address) => LoadVectorByteZeroExtendFirstFaulting(mask, address); /// /// svuint64_t svldff1ub_u64(svbool_t pg, const uint8_t *base) /// LDFF1B Zresult.D, Pg/Z, [Xbase, XZR] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorByteZeroExtendFirstFaulting(Vector mask, byte* address) => LoadVectorByteZeroExtendFirstFaulting(mask, address); @@ -6313,7 +6073,6 @@ internal Arm64() { } /// svint16_t svld1ub_s16(svbool_t pg, const uint8_t *base) /// LD1B Zresult.H, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorByteZeroExtendToInt16(Vector mask, byte* address) => LoadVectorByteZeroExtendToInt16(mask, address); @@ -6323,7 +6082,6 @@ internal Arm64() { } /// svint32_t svld1ub_s32(svbool_t pg, const uint8_t *base) /// LD1B Zresult.S, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorByteZeroExtendToInt32(Vector mask, byte* address) => LoadVectorByteZeroExtendToInt32(mask, address); @@ -6333,7 +6091,6 @@ internal Arm64() { } /// svint64_t svld1ub_s64(svbool_t pg, const uint8_t *base) /// LD1B Zresult.D, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorByteZeroExtendToInt64(Vector mask, byte* address) => LoadVectorByteZeroExtendToInt64(mask, address); @@ -6343,7 +6100,6 @@ internal Arm64() { } /// svuint16_t svld1ub_u16(svbool_t pg, const uint8_t *base) /// LD1B Zresult.H, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorByteZeroExtendToUInt16(Vector mask, byte* address) => LoadVectorByteZeroExtendToUInt16(mask, address); @@ -6353,7 +6109,6 @@ internal Arm64() { } /// svuint32_t svld1ub_u32(svbool_t pg, const uint8_t *base) /// LD1B Zresult.S, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorByteZeroExtendToUInt32(Vector mask, byte* address) => LoadVectorByteZeroExtendToUInt32(mask, address); @@ -6363,7 +6118,6 @@ internal Arm64() { } /// svuint64_t svld1ub_u64(svbool_t pg, const uint8_t *base) /// LD1B Zresult.D, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorByteZeroExtendToUInt64(Vector mask, byte* address) => LoadVectorByteZeroExtendToUInt64(mask, address); @@ -6373,70 +6127,60 @@ internal Arm64() { } /// svuint8_t svldff1[_u8](svbool_t pg, const uint8_t *base) /// LDFF1B Zresult.B, Pg/Z, [Xbase, XZR] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorFirstFaulting(Vector mask, byte* address) => LoadVectorFirstFaulting(mask, address); /// /// svfloat64_t svldff1[_f64](svbool_t pg, const float64_t *base) /// LDFF1D Zresult.D, Pg/Z, [Xbase, XZR, LSL #3] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorFirstFaulting(Vector mask, double* address) => LoadVectorFirstFaulting(mask, address); /// /// svint16_t svldff1[_s16](svbool_t pg, const int16_t *base) /// LDFF1H Zresult.H, Pg/Z, [Xbase, XZR, LSL #1] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorFirstFaulting(Vector mask, short* address) => LoadVectorFirstFaulting(mask, address); /// /// svint32_t svldff1[_s32](svbool_t pg, const int32_t *base) /// LDFF1W Zresult.S, Pg/Z, [Xbase, XZR, LSL #2] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorFirstFaulting(Vector mask, int* address) => LoadVectorFirstFaulting(mask, address); /// /// svint64_t svldff1[_s64](svbool_t pg, const int64_t *base) /// LDFF1D Zresult.D, Pg/Z, [Xbase, XZR, LSL #3] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorFirstFaulting(Vector mask, long* address) => LoadVectorFirstFaulting(mask, address); /// /// svint8_t svldff1[_s8](svbool_t pg, const int8_t *base) /// LDFF1B Zresult.B, Pg/Z, [Xbase, XZR] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorFirstFaulting(Vector mask, sbyte* address) => LoadVectorFirstFaulting(mask, address); /// /// svfloat32_t svldff1[_f32](svbool_t pg, const float32_t *base) /// LDFF1W Zresult.S, Pg/Z, [Xbase, XZR, LSL #2] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorFirstFaulting(Vector mask, float* address) => LoadVectorFirstFaulting(mask, address); /// /// svuint16_t svldff1[_u16](svbool_t pg, const uint16_t *base) /// LDFF1H Zresult.H, Pg/Z, [Xbase, XZR, LSL #1] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorFirstFaulting(Vector mask, ushort* address) => LoadVectorFirstFaulting(mask, address); /// /// svuint32_t svldff1[_u32](svbool_t pg, const uint32_t *base) /// LDFF1W Zresult.S, Pg/Z, [Xbase, XZR, LSL #2] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorFirstFaulting(Vector mask, uint* address) => LoadVectorFirstFaulting(mask, address); /// /// svuint64_t svldff1[_u64](svbool_t pg, const uint64_t *base) /// LDFF1D Zresult.D, Pg/Z, [Xbase, XZR, LSL #3] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorFirstFaulting(Vector mask, ulong* address) => LoadVectorFirstFaulting(mask, address); // Load 16-bit data and sign-extend, non-faulting @@ -6444,7 +6188,6 @@ internal Arm64() { } /// svint32_t svldnf1sh_s32(svbool_t pg, const int16_t *base) /// LDNF1SH Zresult.S, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorInt16NonFaultingSignExtendToInt32(Vector mask, short* address) => LoadVectorInt16NonFaultingSignExtendToInt32(mask, address); @@ -6454,7 +6197,6 @@ internal Arm64() { } /// svint64_t svldnf1sh_s64(svbool_t pg, const int16_t *base) /// LDNF1SH Zresult.D, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorInt16NonFaultingSignExtendToInt64(Vector mask, short* address) => LoadVectorInt16NonFaultingSignExtendToInt64(mask, address); @@ -6464,7 +6206,6 @@ internal Arm64() { } /// svuint32_t svldnf1sh_u32(svbool_t pg, const int16_t *base) /// LDNF1SH Zresult.S, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorInt16NonFaultingSignExtendToUInt32(Vector mask, short* address) => LoadVectorInt16NonFaultingSignExtendToUInt32(mask, address); @@ -6474,7 +6215,6 @@ internal Arm64() { } /// svuint64_t svldnf1sh_u64(svbool_t pg, const int16_t *base) /// LDNF1SH Zresult.D, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorInt16NonFaultingSignExtendToUInt64(Vector mask, short* address) => LoadVectorInt16NonFaultingSignExtendToUInt64(mask, address); @@ -6484,28 +6224,24 @@ internal Arm64() { } /// svint32_t svldff1sh_s32(svbool_t pg, const int16_t *base) /// LDFF1SH Zresult.S, Pg/Z, [Xbase, XZR, LSL #1] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorInt16SignExtendFirstFaulting(Vector mask, short* address) => LoadVectorInt16SignExtendFirstFaulting(mask, address); /// /// svint64_t svldff1sh_s64(svbool_t pg, const int16_t *base) /// LDFF1SH Zresult.D, Pg/Z, [Xbase, XZR, LSL #1] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorInt16SignExtendFirstFaulting(Vector mask, short* address) => LoadVectorInt16SignExtendFirstFaulting(mask, address); /// /// svuint32_t svldff1sh_u32(svbool_t pg, const int16_t *base) /// LDFF1SH Zresult.S, Pg/Z, [Xbase, XZR, LSL #1] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorInt16SignExtendFirstFaulting(Vector mask, short* address) => LoadVectorInt16SignExtendFirstFaulting(mask, address); /// /// svuint64_t svldff1sh_u64(svbool_t pg, const int16_t *base) /// LDFF1SH Zresult.D, Pg/Z, [Xbase, XZR, LSL #1] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorInt16SignExtendFirstFaulting(Vector mask, short* address) => LoadVectorInt16SignExtendFirstFaulting(mask, address); @@ -6515,7 +6251,6 @@ internal Arm64() { } /// svint32_t svld1sh_s32(svbool_t pg, const int16_t *base) /// LD1SH Zresult.S, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorInt16SignExtendToInt32(Vector mask, short* address) => LoadVectorInt16SignExtendToInt32(mask, address); @@ -6525,7 +6260,6 @@ internal Arm64() { } /// svint64_t svld1sh_s64(svbool_t pg, const int16_t *base) /// LD1SH Zresult.D, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorInt16SignExtendToInt64(Vector mask, short* address) => LoadVectorInt16SignExtendToInt64(mask, address); @@ -6535,7 +6269,6 @@ internal Arm64() { } /// svuint32_t svld1sh_u32(svbool_t pg, const int16_t *base) /// LD1SH Zresult.S, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorInt16SignExtendToUInt32(Vector mask, short* address) => LoadVectorInt16SignExtendToUInt32(mask, address); @@ -6545,7 +6278,6 @@ internal Arm64() { } /// svuint64_t svld1sh_u64(svbool_t pg, const int16_t *base) /// LD1SH Zresult.D, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorInt16SignExtendToUInt64(Vector mask, short* address) => LoadVectorInt16SignExtendToUInt64(mask, address); @@ -6555,7 +6287,6 @@ internal Arm64() { } /// svint64_t svldnf1sw_s64(svbool_t pg, const int32_t *base) /// LDNF1SW Zresult.D, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorInt32NonFaultingSignExtendToInt64(Vector mask, int* address) => LoadVectorInt32NonFaultingSignExtendToInt64(mask, address); @@ -6565,7 +6296,6 @@ internal Arm64() { } /// svuint64_t svldnf1sw_u64(svbool_t pg, const int32_t *base) /// LDNF1SW Zresult.D, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorInt32NonFaultingSignExtendToUInt64(Vector mask, int* address) => LoadVectorInt32NonFaultingSignExtendToUInt64(mask, address); @@ -6575,14 +6305,12 @@ internal Arm64() { } /// svint64_t svldff1sw_s64(svbool_t pg, const int32_t *base) /// LDFF1SW Zresult.D, Pg/Z, [Xbase, XZR, LSL #2] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorInt32SignExtendFirstFaulting(Vector mask, int* address) => LoadVectorInt32SignExtendFirstFaulting(mask, address); /// /// svuint64_t svldff1sw_u64(svbool_t pg, const int32_t *base) /// LDFF1SW Zresult.D, Pg/Z, [Xbase, XZR, LSL #2] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorInt32SignExtendFirstFaulting(Vector mask, int* address) => LoadVectorInt32SignExtendFirstFaulting(mask, address); @@ -6592,7 +6320,6 @@ internal Arm64() { } /// svint64_t svld1sw_s64(svbool_t pg, const int32_t *base) /// LD1SW Zresult.D, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorInt32SignExtendToInt64(Vector mask, int* address) => LoadVectorInt32SignExtendToInt64(mask, address); @@ -6602,7 +6329,6 @@ internal Arm64() { } /// svuint64_t svld1sw_u64(svbool_t pg, const int32_t *base) /// LD1SW Zresult.D, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorInt32SignExtendToUInt64(Vector mask, int* address) => LoadVectorInt32SignExtendToUInt64(mask, address); @@ -6612,70 +6338,60 @@ internal Arm64() { } /// svuint8_t svldnf1[_u8](svbool_t pg, const uint8_t *base) /// LDNF1B Zresult.B, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorNonFaulting(Vector mask, byte* address) => LoadVectorNonFaulting(mask, address); /// /// svfloat64_t svldnf1[_f64](svbool_t pg, const float64_t *base) /// LDNF1D Zresult.D, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorNonFaulting(Vector mask, double* address) => LoadVectorNonFaulting(mask, address); /// /// svint16_t svldnf1[_s16](svbool_t pg, const int16_t *base) /// LDNF1H Zresult.H, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorNonFaulting(Vector mask, short* address) => LoadVectorNonFaulting(mask, address); /// /// svint32_t svldnf1[_s32](svbool_t pg, const int32_t *base) /// LDNF1W Zresult.S, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorNonFaulting(Vector mask, int* address) => LoadVectorNonFaulting(mask, address); /// /// svint64_t svldnf1[_s64](svbool_t pg, const int64_t *base) /// LDNF1D Zresult.D, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorNonFaulting(Vector mask, long* address) => LoadVectorNonFaulting(mask, address); /// /// svint8_t svldnf1[_s8](svbool_t pg, const int8_t *base) /// LDNF1B Zresult.B, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorNonFaulting(Vector mask, sbyte* address) => LoadVectorNonFaulting(mask, address); /// /// svfloat32_t svldnf1[_f32](svbool_t pg, const float32_t *base) /// LDNF1W Zresult.S, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorNonFaulting(Vector mask, float* address) => LoadVectorNonFaulting(mask, address); /// /// svuint16_t svldnf1[_u16](svbool_t pg, const uint16_t *base) /// LDNF1H Zresult.H, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorNonFaulting(Vector mask, ushort* address) => LoadVectorNonFaulting(mask, address); /// /// svuint32_t svldnf1[_u32](svbool_t pg, const uint32_t *base) /// LDNF1W Zresult.S, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorNonFaulting(Vector mask, uint* address) => LoadVectorNonFaulting(mask, address); /// /// svuint64_t svldnf1[_u64](svbool_t pg, const uint64_t *base) /// LDNF1D Zresult.D, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorNonFaulting(Vector mask, ulong* address) => LoadVectorNonFaulting(mask, address); @@ -6685,70 +6401,60 @@ internal Arm64() { } /// svuint8_t svldnt1[_u8](svbool_t pg, const uint8_t *base) /// LDNT1B Zresult.B, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorNonTemporal(Vector mask, byte* address) => LoadVectorNonTemporal(mask, address); /// /// svfloat64_t svldnt1[_f64](svbool_t pg, const float64_t *base) /// LDNT1D Zresult.D, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorNonTemporal(Vector mask, double* address) => LoadVectorNonTemporal(mask, address); /// /// svint16_t svldnt1[_s16](svbool_t pg, const int16_t *base) /// LDNT1H Zresult.H, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorNonTemporal(Vector mask, short* address) => LoadVectorNonTemporal(mask, address); /// /// svint32_t svldnt1[_s32](svbool_t pg, const int32_t *base) /// LDNT1W Zresult.S, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorNonTemporal(Vector mask, int* address) => LoadVectorNonTemporal(mask, address); /// /// svint64_t svldnt1[_s64](svbool_t pg, const int64_t *base) /// LDNT1D Zresult.D, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorNonTemporal(Vector mask, long* address) => LoadVectorNonTemporal(mask, address); /// /// svint8_t svldnt1[_s8](svbool_t pg, const int8_t *base) /// LDNT1B Zresult.B, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorNonTemporal(Vector mask, sbyte* address) => LoadVectorNonTemporal(mask, address); /// /// svfloat32_t svldnt1[_f32](svbool_t pg, const float32_t *base) /// LDNT1W Zresult.S, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorNonTemporal(Vector mask, float* address) => LoadVectorNonTemporal(mask, address); /// /// svuint16_t svldnt1[_u16](svbool_t pg, const uint16_t *base) /// LDNT1H Zresult.H, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorNonTemporal(Vector mask, ushort* address) => LoadVectorNonTemporal(mask, address); /// /// svuint32_t svldnt1[_u32](svbool_t pg, const uint32_t *base) /// LDNT1W Zresult.S, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorNonTemporal(Vector mask, uint* address) => LoadVectorNonTemporal(mask, address); /// /// svuint64_t svldnt1[_u64](svbool_t pg, const uint64_t *base) /// LDNT1D Zresult.D, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorNonTemporal(Vector mask, ulong* address) => LoadVectorNonTemporal(mask, address); @@ -6758,7 +6464,6 @@ internal Arm64() { } /// svint16_t svldnf1sb_s16(svbool_t pg, const int8_t *base) /// LDNF1SB Zresult.H, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorSByteNonFaultingSignExtendToInt16(Vector mask, sbyte* address) => LoadVectorSByteNonFaultingSignExtendToInt16(mask, address); @@ -6768,7 +6473,6 @@ internal Arm64() { } /// svint32_t svldnf1sb_s32(svbool_t pg, const int8_t *base) /// LDNF1SB Zresult.S, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorSByteNonFaultingSignExtendToInt32(Vector mask, sbyte* address) => LoadVectorSByteNonFaultingSignExtendToInt32(mask, address); @@ -6778,7 +6482,6 @@ internal Arm64() { } /// svint64_t svldnf1sb_s64(svbool_t pg, const int8_t *base) /// LDNF1SB Zresult.D, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorSByteNonFaultingSignExtendToInt64(Vector mask, sbyte* address) => LoadVectorSByteNonFaultingSignExtendToInt64(mask, address); @@ -6788,7 +6491,6 @@ internal Arm64() { } /// svuint16_t svldnf1sb_u16(svbool_t pg, const int8_t *base) /// LDNF1SB Zresult.H, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorSByteNonFaultingSignExtendToUInt16(Vector mask, sbyte* address) => LoadVectorSByteNonFaultingSignExtendToUInt16(mask, address); @@ -6798,7 +6500,6 @@ internal Arm64() { } /// svuint32_t svldnf1sb_u32(svbool_t pg, const int8_t *base) /// LDNF1SB Zresult.S, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorSByteNonFaultingSignExtendToUInt32(Vector mask, sbyte* address) => LoadVectorSByteNonFaultingSignExtendToUInt32(mask, address); @@ -6808,7 +6509,6 @@ internal Arm64() { } /// svuint64_t svldnf1sb_u64(svbool_t pg, const int8_t *base) /// LDNF1SB Zresult.D, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorSByteNonFaultingSignExtendToUInt64(Vector mask, sbyte* address) => LoadVectorSByteNonFaultingSignExtendToUInt64(mask, address); @@ -6818,42 +6518,36 @@ internal Arm64() { } /// svint16_t svldff1sb_s16(svbool_t pg, const int8_t *base) /// LDFF1SB Zresult.H, Pg/Z, [Xbase, XZR] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorSByteSignExtendFirstFaulting(Vector mask, sbyte* address) => LoadVectorSByteSignExtendFirstFaulting(mask, address); /// /// svint32_t svldff1sb_s32(svbool_t pg, const int8_t *base) /// LDFF1SB Zresult.S, Pg/Z, [Xbase, XZR] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorSByteSignExtendFirstFaulting(Vector mask, sbyte* address) => LoadVectorSByteSignExtendFirstFaulting(mask, address); /// /// svint64_t svldff1sb_s64(svbool_t pg, const int8_t *base) /// LDFF1SB Zresult.D, Pg/Z, [Xbase, XZR] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorSByteSignExtendFirstFaulting(Vector mask, sbyte* address) => LoadVectorSByteSignExtendFirstFaulting(mask, address); /// /// svuint16_t svldff1sb_u16(svbool_t pg, const int8_t *base) /// LDFF1SB Zresult.H, Pg/Z, [Xbase, XZR] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorSByteSignExtendFirstFaulting(Vector mask, sbyte* address) => LoadVectorSByteSignExtendFirstFaulting(mask, address); /// /// svuint32_t svldff1sb_u32(svbool_t pg, const int8_t *base) /// LDFF1SB Zresult.S, Pg/Z, [Xbase, XZR] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorSByteSignExtendFirstFaulting(Vector mask, sbyte* address) => LoadVectorSByteSignExtendFirstFaulting(mask, address); /// /// svuint64_t svldff1sb_u64(svbool_t pg, const int8_t *base) /// LDFF1SB Zresult.D, Pg/Z, [Xbase, XZR] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorSByteSignExtendFirstFaulting(Vector mask, sbyte* address) => LoadVectorSByteSignExtendFirstFaulting(mask, address); @@ -6863,7 +6557,6 @@ internal Arm64() { } /// svint16_t svld1sb_s16(svbool_t pg, const int8_t *base) /// LD1SB Zresult.H, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorSByteSignExtendToInt16(Vector mask, sbyte* address) => LoadVectorSByteSignExtendToInt16(mask, address); @@ -6873,7 +6566,6 @@ internal Arm64() { } /// svint32_t svld1sb_s32(svbool_t pg, const int8_t *base) /// LD1SB Zresult.S, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorSByteSignExtendToInt32(Vector mask, sbyte* address) => LoadVectorSByteSignExtendToInt32(mask, address); @@ -6883,7 +6575,6 @@ internal Arm64() { } /// svint64_t svld1sb_s64(svbool_t pg, const int8_t *base) /// LD1SB Zresult.D, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorSByteSignExtendToInt64(Vector mask, sbyte* address) => LoadVectorSByteSignExtendToInt64(mask, address); @@ -6893,7 +6584,6 @@ internal Arm64() { } /// svuint16_t svld1sb_u16(svbool_t pg, const int8_t *base) /// LD1SB Zresult.H, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorSByteSignExtendToUInt16(Vector mask, sbyte* address) => LoadVectorSByteSignExtendToUInt16(mask, address); @@ -6903,7 +6593,6 @@ internal Arm64() { } /// svuint32_t svld1sb_u32(svbool_t pg, const int8_t *base) /// LD1SB Zresult.S, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorSByteSignExtendToUInt32(Vector mask, sbyte* address) => LoadVectorSByteSignExtendToUInt32(mask, address); @@ -6913,7 +6602,6 @@ internal Arm64() { } /// svuint64_t svld1sb_u64(svbool_t pg, const int8_t *base) /// LD1SB Zresult.D, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorSByteSignExtendToUInt64(Vector mask, sbyte* address) => LoadVectorSByteSignExtendToUInt64(mask, address); @@ -6923,7 +6611,6 @@ internal Arm64() { } /// svint32_t svldnf1uh_s32(svbool_t pg, const uint16_t *base) /// LDNF1H Zresult.S, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorUInt16NonFaultingZeroExtendToInt32(Vector mask, ushort* address) => LoadVectorUInt16NonFaultingZeroExtendToInt32(mask, address); @@ -6933,7 +6620,6 @@ internal Arm64() { } /// svint64_t svldnf1uh_s64(svbool_t pg, const uint16_t *base) /// LDNF1H Zresult.D, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorUInt16NonFaultingZeroExtendToInt64(Vector mask, ushort* address) => LoadVectorUInt16NonFaultingZeroExtendToInt64(mask, address); @@ -6943,7 +6629,6 @@ internal Arm64() { } /// svuint32_t svldnf1uh_u32(svbool_t pg, const uint16_t *base) /// LDNF1H Zresult.S, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorUInt16NonFaultingZeroExtendToUInt32(Vector mask, ushort* address) => LoadVectorUInt16NonFaultingZeroExtendToUInt32(mask, address); @@ -6953,7 +6638,6 @@ internal Arm64() { } /// svuint64_t svldnf1uh_u64(svbool_t pg, const uint16_t *base) /// LDNF1H Zresult.D, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorUInt16NonFaultingZeroExtendToUInt64(Vector mask, ushort* address) => LoadVectorUInt16NonFaultingZeroExtendToUInt64(mask, address); @@ -6961,28 +6645,24 @@ internal Arm64() { } /// svint32_t svldff1uh_s32(svbool_t pg, const uint16_t *base) /// LDFF1H Zresult.S, Pg/Z, [Xbase, XZR, LSL #1] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorUInt16ZeroExtendFirstFaulting(Vector mask, ushort* address) => LoadVectorUInt16ZeroExtendFirstFaulting(mask, address); /// /// svint64_t svldff1uh_s64(svbool_t pg, const uint16_t *base) /// LDFF1H Zresult.D, Pg/Z, [Xbase, XZR, LSL #1] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorUInt16ZeroExtendFirstFaulting(Vector mask, ushort* address) => LoadVectorUInt16ZeroExtendFirstFaulting(mask, address); /// /// svuint32_t svldff1uh_u32(svbool_t pg, const uint16_t *base) /// LDFF1H Zresult.S, Pg/Z, [Xbase, XZR, LSL #1] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorUInt16ZeroExtendFirstFaulting(Vector mask, ushort* address) => LoadVectorUInt16ZeroExtendFirstFaulting(mask, address); /// /// svuint64_t svldff1uh_u64(svbool_t pg, const uint16_t *base) /// LDFF1H Zresult.D, Pg/Z, [Xbase, XZR, LSL #1] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorUInt16ZeroExtendFirstFaulting(Vector mask, ushort* address) => LoadVectorUInt16ZeroExtendFirstFaulting(mask, address); @@ -6992,7 +6672,6 @@ internal Arm64() { } /// svint32_t svld1uh_s32(svbool_t pg, const uint16_t *base) /// LD1H Zresult.S, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorUInt16ZeroExtendToInt32(Vector mask, ushort* address) => LoadVectorUInt16ZeroExtendToInt32(mask, address); @@ -7002,7 +6681,6 @@ internal Arm64() { } /// svint64_t svld1uh_s64(svbool_t pg, const uint16_t *base) /// LD1H Zresult.D, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorUInt16ZeroExtendToInt64(Vector mask, ushort* address) => LoadVectorUInt16ZeroExtendToInt64(mask, address); @@ -7012,7 +6690,6 @@ internal Arm64() { } /// svuint32_t svld1uh_u32(svbool_t pg, const uint16_t *base) /// LD1H Zresult.S, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorUInt16ZeroExtendToUInt32(Vector mask, ushort* address) => LoadVectorUInt16ZeroExtendToUInt32(mask, address); @@ -7022,7 +6699,6 @@ internal Arm64() { } /// svuint64_t svld1uh_u64(svbool_t pg, const uint16_t *base) /// LD1H Zresult.D, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorUInt16ZeroExtendToUInt64(Vector mask, ushort* address) => LoadVectorUInt16ZeroExtendToUInt64(mask, address); @@ -7032,7 +6708,6 @@ internal Arm64() { } /// svint64_t svldnf1uw_s64(svbool_t pg, const uint32_t *base) /// LDNF1W Zresult.D, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorUInt32NonFaultingZeroExtendToInt64(Vector mask, uint* address) => LoadVectorUInt32NonFaultingZeroExtendToInt64(mask, address); @@ -7042,7 +6717,6 @@ internal Arm64() { } /// svuint64_t svldnf1uw_u64(svbool_t pg, const uint32_t *base) /// LDNF1W Zresult.D, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorUInt32NonFaultingZeroExtendToUInt64(Vector mask, uint* address) => LoadVectorUInt32NonFaultingZeroExtendToUInt64(mask, address); @@ -7050,14 +6724,12 @@ internal Arm64() { } /// svint64_t svldff1uw_s64(svbool_t pg, const uint32_t *base) /// LDFF1W Zresult.D, Pg/Z, [Xbase, XZR, LSL #2] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorUInt32ZeroExtendFirstFaulting(Vector mask, uint* address) => LoadVectorUInt32ZeroExtendFirstFaulting(mask, address); /// /// svuint64_t svldff1uw_u64(svbool_t pg, const uint32_t *base) /// LDFF1W Zresult.D, Pg/Z, [Xbase, XZR, LSL #2] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorUInt32ZeroExtendFirstFaulting(Vector mask, uint* address) => LoadVectorUInt32ZeroExtendFirstFaulting(mask, address); @@ -7067,7 +6739,6 @@ internal Arm64() { } /// svint64_t svld1uw_s64(svbool_t pg, const uint32_t *base) /// LD1W Zresult.D, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorUInt32ZeroExtendToInt64(Vector mask, uint* address) => LoadVectorUInt32ZeroExtendToInt64(mask, address); @@ -7077,7 +6748,6 @@ internal Arm64() { } /// svuint64_t svld1uw_u64(svbool_t pg, const uint32_t *base) /// LD1W Zresult.D, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe Vector LoadVectorUInt32ZeroExtendToUInt64(Vector mask, uint* address) => LoadVectorUInt32ZeroExtendToUInt64(mask, address); @@ -7087,70 +6757,60 @@ internal Arm64() { } /// svuint8x2_t svld2[_u8](svbool_t pg, const uint8_t *base) /// LD2B {Zresult0.B, Zresult1.B}, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe (Vector, Vector) Load2xVectorAndUnzip(Vector mask, byte* address) => Load2xVectorAndUnzip(mask, address); /// /// svfloat64x2_t svld2[_f64](svbool_t pg, const float64_t *base) /// LD2D {Zresult0.D, Zresult1.D}, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe (Vector, Vector) Load2xVectorAndUnzip(Vector mask, double* address) => Load2xVectorAndUnzip(mask, address); /// /// svint16x2_t svld2[_s16](svbool_t pg, const int16_t *base) /// LD2H {Zresult0.H, Zresult1.H}, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe (Vector, Vector) Load2xVectorAndUnzip(Vector mask, short* address) => Load2xVectorAndUnzip(mask, address); /// /// svint32x2_t svld2[_s32](svbool_t pg, const int32_t *base) /// LD2W {Zresult0.S, Zresult1.S}, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe (Vector, Vector) Load2xVectorAndUnzip(Vector mask, int* address) => Load2xVectorAndUnzip(mask, address); /// /// svint64x2_t svld2[_s64](svbool_t pg, const int64_t *base) /// LD2D {Zresult0.D, Zresult1.D}, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe (Vector, Vector) Load2xVectorAndUnzip(Vector mask, long* address) => Load2xVectorAndUnzip(mask, address); /// /// svint8x2_t svld2[_s8](svbool_t pg, const int8_t *base) /// LD2B {Zresult0.B, Zresult1.B}, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe (Vector, Vector) Load2xVectorAndUnzip(Vector mask, sbyte* address) => Load2xVectorAndUnzip(mask, address); /// /// svfloat32x2_t svld2[_f32](svbool_t pg, const float32_t *base) /// LD2W {Zresult0.S, Zresult1.S}, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe (Vector, Vector) Load2xVectorAndUnzip(Vector mask, float* address) => Load2xVectorAndUnzip(mask, address); /// /// svuint16x2_t svld2[_u16](svbool_t pg, const uint16_t *base) /// LD2H {Zresult0.H, Zresult1.H}, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe (Vector, Vector) Load2xVectorAndUnzip(Vector mask, ushort* address) => Load2xVectorAndUnzip(mask, address); /// /// svuint32x2_t svld2[_u32](svbool_t pg, const uint32_t *base) /// LD2W {Zresult0.S, Zresult1.S}, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe (Vector, Vector) Load2xVectorAndUnzip(Vector mask, uint* address) => Load2xVectorAndUnzip(mask, address); /// /// svuint64x2_t svld2[_u64](svbool_t pg, const uint64_t *base) /// LD2D {Zresult0.D, Zresult1.D}, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe (Vector, Vector) Load2xVectorAndUnzip(Vector mask, ulong* address) => Load2xVectorAndUnzip(mask, address); @@ -7160,70 +6820,60 @@ internal Arm64() { } /// svuint8x3_t svld3[_u8](svbool_t pg, const uint8_t *base) /// LD3B {Zresult0.B - Zresult2.B}, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe (Vector, Vector, Vector) Load3xVectorAndUnzip(Vector mask, byte* address) => Load3xVectorAndUnzip(mask, address); /// /// svfloat64x3_t svld3[_f64](svbool_t pg, const float64_t *base) /// LD3D {Zresult0.D - Zresult2.D}, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe (Vector, Vector, Vector) Load3xVectorAndUnzip(Vector mask, double* address) => Load3xVectorAndUnzip(mask, address); /// /// svint16x3_t svld3[_s16](svbool_t pg, const int16_t *base) /// LD3H {Zresult0.H - Zresult2.H}, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe (Vector, Vector, Vector) Load3xVectorAndUnzip(Vector mask, short* address) => Load3xVectorAndUnzip(mask, address); /// /// svint32x3_t svld3[_s32](svbool_t pg, const int32_t *base) /// LD3W {Zresult0.S - Zresult2.S}, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe (Vector, Vector, Vector) Load3xVectorAndUnzip(Vector mask, int* address) => Load3xVectorAndUnzip(mask, address); /// /// svint64x3_t svld3[_s64](svbool_t pg, const int64_t *base) /// LD3D {Zresult0.D - Zresult2.D}, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe (Vector, Vector, Vector) Load3xVectorAndUnzip(Vector mask, long* address) => Load3xVectorAndUnzip(mask, address); /// /// svint8x3_t svld3[_s8](svbool_t pg, const int8_t *base) /// LD3B {Zresult0.B - Zresult2.B}, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe (Vector, Vector, Vector) Load3xVectorAndUnzip(Vector mask, sbyte* address) => Load3xVectorAndUnzip(mask, address); /// /// svfloat32x3_t svld3[_f32](svbool_t pg, const float32_t *base) /// LD3W {Zresult0.S - Zresult2.S}, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe (Vector, Vector, Vector) Load3xVectorAndUnzip(Vector mask, float* address) => Load3xVectorAndUnzip(mask, address); /// /// svuint16x3_t svld3[_u16](svbool_t pg, const uint16_t *base) /// LD3H {Zresult0.H - Zresult2.H}, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe (Vector, Vector, Vector) Load3xVectorAndUnzip(Vector mask, ushort* address) => Load3xVectorAndUnzip(mask, address); /// /// svuint32x3_t svld3[_u32](svbool_t pg, const uint32_t *base) /// LD3W {Zresult0.S - Zresult2.S}, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe (Vector, Vector, Vector) Load3xVectorAndUnzip(Vector mask, uint* address) => Load3xVectorAndUnzip(mask, address); /// /// svuint64x3_t svld3[_u64](svbool_t pg, const uint64_t *base) /// LD3D {Zresult0.D - Zresult2.D}, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe (Vector, Vector, Vector) Load3xVectorAndUnzip(Vector mask, ulong* address) => Load3xVectorAndUnzip(mask, address); @@ -7233,70 +6883,60 @@ internal Arm64() { } /// svuint8x4_t svld4[_u8](svbool_t pg, const uint8_t *base) /// LD4B {Zresult0.B - Zresult3.B}, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe (Vector, Vector, Vector, Vector) Load4xVectorAndUnzip(Vector mask, byte* address) => Load4xVectorAndUnzip(mask, address); /// /// svfloat64x4_t svld4[_f64](svbool_t pg, const float64_t *base) /// LD4D {Zresult0.D - Zresult3.D}, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe (Vector, Vector, Vector, Vector) Load4xVectorAndUnzip(Vector mask, double* address) => Load4xVectorAndUnzip(mask, address); /// /// svint16x4_t svld4[_s16](svbool_t pg, const int16_t *base) /// LD4H {Zresult0.H - Zresult3.H}, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe (Vector, Vector, Vector, Vector) Load4xVectorAndUnzip(Vector mask, short* address) => Load4xVectorAndUnzip(mask, address); /// /// svint32x4_t svld4[_s32](svbool_t pg, const int32_t *base) /// LD4W {Zresult0.S - Zresult3.S}, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe (Vector, Vector, Vector, Vector) Load4xVectorAndUnzip(Vector mask, int* address) => Load4xVectorAndUnzip(mask, address); /// /// svint64x4_t svld4[_s64](svbool_t pg, const int64_t *base) /// LD4D {Zresult0.D - Zresult3.D}, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe (Vector, Vector, Vector, Vector) Load4xVectorAndUnzip(Vector mask, long* address) => Load4xVectorAndUnzip(mask, address); /// /// svint8x4_t svld4[_s8](svbool_t pg, const int8_t *base) /// LD4B {Zresult0.B - Zresult3.B}, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe (Vector, Vector, Vector, Vector) Load4xVectorAndUnzip(Vector mask, sbyte* address) => Load4xVectorAndUnzip(mask, address); /// /// svfloat32x4_t svld4[_f32](svbool_t pg, const float32_t *base) /// LD4W {Zresult0.S - Zresult3.S}, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe (Vector, Vector, Vector, Vector) Load4xVectorAndUnzip(Vector mask, float* address) => Load4xVectorAndUnzip(mask, address); /// /// svuint16x4_t svld4[_u16](svbool_t pg, const uint16_t *base) /// LD4H {Zresult0.H - Zresult3.H}, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe (Vector, Vector, Vector, Vector) Load4xVectorAndUnzip(Vector mask, ushort* address) => Load4xVectorAndUnzip(mask, address); /// /// svuint32x4_t svld4[_u32](svbool_t pg, const uint32_t *base) /// LD4W {Zresult0.S - Zresult3.S}, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe (Vector, Vector, Vector, Vector) Load4xVectorAndUnzip(Vector mask, uint* address) => Load4xVectorAndUnzip(mask, address); /// /// svuint64x4_t svld4[_u64](svbool_t pg, const uint64_t *base) /// LD4D {Zresult0.D - Zresult3.D}, Pg/Z, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe (Vector, Vector, Vector, Vector) Load4xVectorAndUnzip(Vector mask, ulong* address) => Load4xVectorAndUnzip(mask, address); @@ -8308,7 +7948,6 @@ internal Arm64() { } /// void svprfh(svbool_t pg, const void *base, enum svprfop op) /// PRFH op, Pg, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe void Prefetch16Bit(Vector mask, void* address, [ConstantExpected] SvePrefetchType prefetchType) => Prefetch16Bit(mask, address, prefetchType); @@ -8318,7 +7957,6 @@ internal Arm64() { } /// void svprfw(svbool_t pg, const void *base, enum svprfop op) /// PRFW op, Pg, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe void Prefetch32Bit(Vector mask, void* address, [ConstantExpected] SvePrefetchType prefetchType) => Prefetch32Bit(mask, address, prefetchType); @@ -8328,7 +7966,6 @@ internal Arm64() { } /// void svprfd(svbool_t pg, const void *base, enum svprfop op) /// PRFD op, Pg, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe void Prefetch64Bit(Vector mask, void* address, [ConstantExpected] SvePrefetchType prefetchType) => Prefetch64Bit(mask, address, prefetchType); @@ -8338,7 +7975,6 @@ internal Arm64() { } /// void svprfb(svbool_t pg, const void *base, enum svprfop op) /// PRFB op, Pg, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe void Prefetch8Bit(Vector mask, void* address, [ConstantExpected] SvePrefetchType prefetchType) => Prefetch8Bit(mask, address, prefetchType); @@ -9334,7 +8970,6 @@ internal Arm64() { } /// void svst1_scatter_[s64]offset[_f64](svbool_t pg, float64_t *base, svint64_t offsets, svfloat64_t data) /// ST1D Zdata.D, Pg, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe void Scatter(Vector mask, double* address, Vector indicies, Vector data) => Scatter(mask, address, indicies, data); /// @@ -9347,14 +8982,12 @@ internal Arm64() { } /// void svst1_scatter_[u64]offset[_f64](svbool_t pg, float64_t *base, svuint64_t offsets, svfloat64_t data) /// ST1D Zdata.D, Pg, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe void Scatter(Vector mask, double* address, Vector indicies, Vector data) => Scatter(mask, address, indicies, data); /// /// void svst1_scatter_[s32]offset[_s32](svbool_t pg, int32_t *base, svint32_t offsets, svint32_t data) /// ST1W Zdata.S, Pg, [Xbase, Zoffsets.S, SXTW] /// - [RequiresUnsafe] public static unsafe void Scatter(Vector mask, int* address, Vector indicies, Vector data) => Scatter(mask, address, indicies, data); // @@ -9368,14 +9001,12 @@ internal Arm64() { } /// void svst1_scatter_[u32]offset[_s32](svbool_t pg, int32_t *base, svuint32_t offsets, svint32_t data) /// ST1W Zdata.S, Pg, [Xbase, Zoffsets.S, UXTW] /// - [RequiresUnsafe] public static unsafe void Scatter(Vector mask, int* address, Vector indicies, Vector data) => Scatter(mask, address, indicies, data); /// /// void svst1_scatter_[s64]offset[_s64](svbool_t pg, int64_t *base, svint64_t offsets, svint64_t data) /// ST1D Zdata.D, Pg, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe void Scatter(Vector mask, long* address, Vector indicies, Vector data) => Scatter(mask, address, indicies, data); /// @@ -9388,14 +9019,12 @@ internal Arm64() { } /// void svst1_scatter_[u64]offset[_s64](svbool_t pg, int64_t *base, svuint64_t offsets, svint64_t data) /// ST1D Zdata.D, Pg, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe void Scatter(Vector mask, long* address, Vector indicies, Vector data) => Scatter(mask, address, indicies, data); /// /// void svst1_scatter_[s32]offset[_f32](svbool_t pg, float32_t *base, svint32_t offsets, svfloat32_t data) /// ST1W Zdata.S, Pg, [Xbase, Zoffsets.S, SXTW] /// - [RequiresUnsafe] public static unsafe void Scatter(Vector mask, float* address, Vector indicies, Vector data) => Scatter(mask, address, indicies, data); // @@ -9409,14 +9038,12 @@ internal Arm64() { } /// void svst1_scatter_[u32]offset[_f32](svbool_t pg, float32_t *base, svuint32_t offsets, svfloat32_t data) /// ST1W Zdata.S, Pg, [Xbase, Zoffsets.S, UXTW] /// - [RequiresUnsafe] public static unsafe void Scatter(Vector mask, float* address, Vector indicies, Vector data) => Scatter(mask, address, indicies, data); /// /// void svst1_scatter_[s32]offset[_u32](svbool_t pg, uint32_t *base, svint32_t offsets, svuint32_t data) /// ST1W Zdata.S, Pg, [Xbase, Zoffsets.S, SXTW] /// - [RequiresUnsafe] public static unsafe void Scatter(Vector mask, uint* address, Vector indicies, Vector data) => Scatter(mask, address, indicies, data); // @@ -9430,14 +9057,12 @@ internal Arm64() { } /// void svst1_scatter_[u32]offset[_u32](svbool_t pg, uint32_t *base, svuint32_t offsets, svuint32_t data) /// ST1W Zdata.S, Pg, [Xbase, Zoffsets.S, UXTW] /// - [RequiresUnsafe] public static unsafe void Scatter(Vector mask, uint* address, Vector indicies, Vector data) => Scatter(mask, address, indicies, data); /// /// void svst1_scatter_[s64]offset[_u64](svbool_t pg, uint64_t *base, svint64_t offsets, svuint64_t data) /// ST1D Zdata.D, Pg, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe void Scatter(Vector mask, ulong* address, Vector indicies, Vector data) => Scatter(mask, address, indicies, data); /// @@ -9450,7 +9075,6 @@ internal Arm64() { } /// void svst1_scatter_[u64]offset[_u64](svbool_t pg, uint64_t *base, svuint64_t offsets, svuint64_t data) /// ST1D Zdata.D, Pg, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe void Scatter(Vector mask, ulong* address, Vector indicies, Vector data) => Scatter(mask, address, indicies, data); @@ -9486,56 +9110,48 @@ internal Arm64() { } /// void svst1h_scatter_[s32]index[_s32](svbool_t pg, int16_t *base, svint32_t indices, svint32_t data) /// ST1H Zdata.S, Pg, [Xbase, Zindices.S, SXTW #1] /// - [RequiresUnsafe] public static unsafe void Scatter16BitNarrowing(Vector mask, short* address, Vector indices, Vector data) => Scatter16BitNarrowing(mask, address, indices, data); /// /// void svst1h_scatter_[u32]index[_s32](svbool_t pg, int16_t *base, svuint32_t indices, svint32_t data) /// ST1H Zdata.S, Pg, [Xbase, Zindices.S, UXTW #1] /// - [RequiresUnsafe] public static unsafe void Scatter16BitNarrowing(Vector mask, short* address, Vector indices, Vector data) => Scatter16BitNarrowing(mask, address, indices, data); /// /// void svst1h_scatter_[s64]index[_s64](svbool_t pg, int16_t *base, svint64_t indices, svint64_t data) /// ST1H Zdata.D, Pg, [Xbase, Zindices.D, LSL #1] /// - [RequiresUnsafe] public static unsafe void Scatter16BitNarrowing(Vector mask, short* address, Vector indices, Vector data) => Scatter16BitNarrowing(mask, address, indices, data); /// /// void svst1h_scatter_[u64]index[_s64](svbool_t pg, int16_t *base, svuint64_t indices, svint64_t data) /// ST1H Zdata.D, Pg, [Xbase, Zindices.D, LSL #1] /// - [RequiresUnsafe] public static unsafe void Scatter16BitNarrowing(Vector mask, short* address, Vector indices, Vector data) => Scatter16BitNarrowing(mask, address, indices, data); /// /// void svst1h_scatter_[s32]index[_u32](svbool_t pg, uint16_t *base, svint32_t indices, svuint32_t data) /// ST1H Zdata.S, Pg, [Xbase, Zindices.S, SXTW #1] /// - [RequiresUnsafe] public static unsafe void Scatter16BitNarrowing(Vector mask, ushort* address, Vector indices, Vector data) => Scatter16BitNarrowing(mask, address, indices, data); /// /// void svst1h_scatter_[u32]index[_u32](svbool_t pg, uint16_t *base, svuint32_t indices, svuint32_t data) /// ST1H Zdata.S, Pg, [Xbase, Zindices.S, UXTW #1] /// - [RequiresUnsafe] public static unsafe void Scatter16BitNarrowing(Vector mask, ushort* address, Vector indices, Vector data) => Scatter16BitNarrowing(mask, address, indices, data); /// /// void svst1h_scatter_[s64]index[_u64](svbool_t pg, uint16_t *base, svint64_t indices, svuint64_t data) /// ST1H Zdata.D, Pg, [Xbase, Zindices.D, LSL #1] /// - [RequiresUnsafe] public static unsafe void Scatter16BitNarrowing(Vector mask, ushort* address, Vector indices, Vector data) => Scatter16BitNarrowing(mask, address, indices, data); /// /// void svst1h_scatter_[u64]index[_u64](svbool_t pg, uint16_t *base, svuint64_t indices, svuint64_t data) /// ST1H Zdata.D, Pg, [Xbase, Zindices.D, LSL #1] /// - [RequiresUnsafe] public static unsafe void Scatter16BitNarrowing(Vector mask, ushort* address, Vector indices, Vector data) => Scatter16BitNarrowing(mask, address, indices, data); @@ -9545,56 +9161,48 @@ internal Arm64() { } /// void svst1h_scatter_[s32]offset[_s32](svbool_t pg, int16_t *base, svint32_t offsets, svint32_t data) /// ST1H Zdata.S, Pg, [Xbase, Zoffsets.S, SXTW] /// - [RequiresUnsafe] public static unsafe void Scatter16BitWithByteOffsetsNarrowing(Vector mask, short* address, Vector offsets, Vector data) => Scatter16BitWithByteOffsetsNarrowing(mask, address, offsets, data); /// /// void svst1h_scatter_[u32]offset[_s32](svbool_t pg, int16_t *base, svuint32_t offsets, svint32_t data) /// ST1H Zdata.S, Pg, [Xbase, Zoffsets.S, UXTW] /// - [RequiresUnsafe] public static unsafe void Scatter16BitWithByteOffsetsNarrowing(Vector mask, short* address, Vector offsets, Vector data) => Scatter16BitWithByteOffsetsNarrowing(mask, address, offsets, data); /// /// void svst1h_scatter_[s64]offset[_s64](svbool_t pg, int16_t *base, svint64_t offsets, svint64_t data) /// ST1H Zdata.D, Pg, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe void Scatter16BitWithByteOffsetsNarrowing(Vector mask, short* address, Vector offsets, Vector data) => Scatter16BitWithByteOffsetsNarrowing(mask, address, offsets, data); /// /// void svst1h_scatter_[u64]offset[_s64](svbool_t pg, int16_t *base, svuint64_t offsets, svint64_t data) /// ST1H Zdata.D, Pg, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe void Scatter16BitWithByteOffsetsNarrowing(Vector mask, short* address, Vector offsets, Vector data) => Scatter16BitWithByteOffsetsNarrowing(mask, address, offsets, data); /// /// void svst1h_scatter_[s32]offset[_u32](svbool_t pg, uint16_t *base, svint32_t offsets, svuint32_t data) /// ST1H Zdata.S, Pg, [Xbase, Zoffsets.S, SXTW] /// - [RequiresUnsafe] public static unsafe void Scatter16BitWithByteOffsetsNarrowing(Vector mask, ushort* address, Vector offsets, Vector data) => Scatter16BitWithByteOffsetsNarrowing(mask, address, offsets, data); /// /// void svst1h_scatter_[u32]offset[_u32](svbool_t pg, uint16_t *base, svuint32_t offsets, svuint32_t data) /// ST1H Zdata.S, Pg, [Xbase, Zoffsets.S, UXTW] /// - [RequiresUnsafe] public static unsafe void Scatter16BitWithByteOffsetsNarrowing(Vector mask, ushort* address, Vector offsets, Vector data) => Scatter16BitWithByteOffsetsNarrowing(mask, address, offsets, data); /// /// void svst1h_scatter_[s64]offset[_u64](svbool_t pg, uint16_t *base, svint64_t offsets, svuint64_t data) /// ST1H Zdata.D, Pg, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe void Scatter16BitWithByteOffsetsNarrowing(Vector mask, ushort* address, Vector offsets, Vector data) => Scatter16BitWithByteOffsetsNarrowing(mask, address, offsets, data); /// /// void svst1h_scatter_[u64]offset[_u64](svbool_t pg, uint16_t *base, svuint64_t offsets, svuint64_t data) /// ST1H Zdata.D, Pg, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe void Scatter16BitWithByteOffsetsNarrowing(Vector mask, ushort* address, Vector offsets, Vector data) => Scatter16BitWithByteOffsetsNarrowing(mask, address, offsets, data); @@ -9616,28 +9224,24 @@ internal Arm64() { } /// void svst1w_scatter_[s64]index[_s64](svbool_t pg, int32_t *base, svint64_t indices, svint64_t data) /// ST1W Zdata.D, Pg, [Xbase, Zindices.D, LSL #2] /// - [RequiresUnsafe] public static unsafe void Scatter32BitNarrowing(Vector mask, int* address, Vector indices, Vector data) => Scatter32BitNarrowing(mask, address, indices, data); /// /// void svst1w_scatter_[u64]index[_s64](svbool_t pg, int32_t *base, svuint64_t indices, svint64_t data) /// ST1W Zdata.D, Pg, [Xbase, Zindices.D, LSL #2] /// - [RequiresUnsafe] public static unsafe void Scatter32BitNarrowing(Vector mask, int* address, Vector indices, Vector data) => Scatter32BitNarrowing(mask, address, indices, data); /// /// void svst1w_scatter_[s64]index[_u64](svbool_t pg, uint32_t *base, svint64_t indices, svuint64_t data) /// ST1W Zdata.D, Pg, [Xbase, Zindices.D, LSL #2] /// - [RequiresUnsafe] public static unsafe void Scatter32BitNarrowing(Vector mask, uint* address, Vector indices, Vector data) => Scatter32BitNarrowing(mask, address, indices, data); /// /// void svst1w_scatter_[u64]index[_u64](svbool_t pg, uint32_t *base, svuint64_t indices, svuint64_t data) /// ST1W Zdata.D, Pg, [Xbase, Zindices.D, LSL #2] /// - [RequiresUnsafe] public static unsafe void Scatter32BitNarrowing(Vector mask, uint* address, Vector indices, Vector data) => Scatter32BitNarrowing(mask, address, indices, data); @@ -9647,28 +9251,24 @@ internal Arm64() { } /// void svst1w_scatter_[s64]offset[_s64](svbool_t pg, int32_t *base, svint64_t offsets, svint64_t data) /// ST1W Zdata.D, Pg, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe void Scatter32BitWithByteOffsetsNarrowing(Vector mask, int* address, Vector offsets, Vector data) => Scatter32BitWithByteOffsetsNarrowing(mask, address, offsets, data); /// /// void svst1w_scatter_[u64]offset[_s64](svbool_t pg, int32_t *base, svuint64_t offsets, svint64_t data) /// ST1W Zdata.D, Pg, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe void Scatter32BitWithByteOffsetsNarrowing(Vector mask, int* address, Vector offsets, Vector data) => Scatter32BitWithByteOffsetsNarrowing(mask, address, offsets, data); /// /// void svst1w_scatter_[s64]offset[_u64](svbool_t pg, uint32_t *base, svint64_t offsets, svuint64_t data) /// ST1W Zdata.D, Pg, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe void Scatter32BitWithByteOffsetsNarrowing(Vector mask, uint* address, Vector offsets, Vector data) => Scatter32BitWithByteOffsetsNarrowing(mask, address, offsets, data); /// /// void svst1w_scatter_[u64]offset[_u64](svbool_t pg, uint32_t *base, svuint64_t offsets, svuint64_t data) /// ST1W Zdata.D, Pg, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe void Scatter32BitWithByteOffsetsNarrowing(Vector mask, uint* address, Vector offsets, Vector data) => Scatter32BitWithByteOffsetsNarrowing(mask, address, offsets, data); @@ -9707,56 +9307,48 @@ internal Arm64() { } /// void svst1b_scatter_[s32]offset[_s32](svbool_t pg, int8_t *base, svint32_t offsets, svint32_t data) /// ST1B Zdata.S, Pg, [Xbase, Zoffsets.S, SXTW] /// - [RequiresUnsafe] public static unsafe void Scatter8BitWithByteOffsetsNarrowing(Vector mask, sbyte* address, Vector offsets, Vector data) => Scatter8BitWithByteOffsetsNarrowing(mask, address, offsets, data); /// /// void svst1b_scatter_[u32]offset[_s32](svbool_t pg, int8_t *base, svuint32_t offsets, svint32_t data) /// ST1B Zdata.S, Pg, [Xbase, Zoffsets.S, UXTW] /// - [RequiresUnsafe] public static unsafe void Scatter8BitWithByteOffsetsNarrowing(Vector mask, sbyte* address, Vector offsets, Vector data) => Scatter8BitWithByteOffsetsNarrowing(mask, address, offsets, data); /// /// void svst1b_scatter_[s64]offset[_s64](svbool_t pg, int8_t *base, svint64_t offsets, svint64_t data) /// ST1B Zdata.D, Pg, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe void Scatter8BitWithByteOffsetsNarrowing(Vector mask, sbyte* address, Vector offsets, Vector data) => Scatter8BitWithByteOffsetsNarrowing(mask, address, offsets, data); /// /// void svst1b_scatter_[u64]offset[_s64](svbool_t pg, int8_t *base, svuint64_t offsets, svint64_t data) /// ST1B Zdata.D, Pg, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe void Scatter8BitWithByteOffsetsNarrowing(Vector mask, sbyte* address, Vector offsets, Vector data) => Scatter8BitWithByteOffsetsNarrowing(mask, address, offsets, data); /// /// void svst1b_scatter_[s32]offset[_u32](svbool_t pg, uint8_t *base, svint32_t offsets, svuint32_t data) /// ST1B Zdata.S, Pg, [Xbase, Zoffsets.S, SXTW] /// - [RequiresUnsafe] public static unsafe void Scatter8BitWithByteOffsetsNarrowing(Vector mask, byte* address, Vector offsets, Vector data) => Scatter8BitWithByteOffsetsNarrowing(mask, address, offsets, data); /// /// void svst1b_scatter_[u32]offset[_u32](svbool_t pg, uint8_t *base, svuint32_t offsets, svuint32_t data) /// ST1B Zdata.S, Pg, [Xbase, Zoffsets.S, UXTW] /// - [RequiresUnsafe] public static unsafe void Scatter8BitWithByteOffsetsNarrowing(Vector mask, byte* address, Vector offsets, Vector data) => Scatter8BitWithByteOffsetsNarrowing(mask, address, offsets, data); /// /// void svst1b_scatter_[s64]offset[_u64](svbool_t pg, uint8_t *base, svint64_t offsets, svuint64_t data) /// ST1B Zdata.D, Pg, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe void Scatter8BitWithByteOffsetsNarrowing(Vector mask, byte* address, Vector offsets, Vector data) => Scatter8BitWithByteOffsetsNarrowing(mask, address, offsets, data); /// /// void svst1b_scatter_[u64]offset[_u64](svbool_t pg, uint8_t *base, svuint64_t offsets, svuint64_t data) /// ST1B Zdata.D, Pg, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe void Scatter8BitWithByteOffsetsNarrowing(Vector mask, byte* address, Vector offsets, Vector data) => Scatter8BitWithByteOffsetsNarrowing(mask, address, offsets, data); @@ -9766,84 +9358,72 @@ internal Arm64() { } /// void svst1_scatter_[s64]offset[_f64](svbool_t pg, float64_t *base, svint64_t offsets, svfloat64_t data) /// ST1D Zdata.D, Pg, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe void ScatterWithByteOffsets(Vector mask, double* address, Vector offsets, Vector data) => ScatterWithByteOffsets(mask, address, offsets, data); /// /// void svst1_scatter_[u64]offset[_f64](svbool_t pg, float64_t *base, svuint64_t offsets, svfloat64_t data) /// ST1D Zdata.D, Pg, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe void ScatterWithByteOffsets(Vector mask, double* address, Vector offsets, Vector data) => ScatterWithByteOffsets(mask, address, offsets, data); /// /// void svst1_scatter_[s32]offset[_s32](svbool_t pg, int32_t *base, svint32_t offsets, svint32_t data) /// ST1W Zdata.S, Pg, [Xbase, Zoffsets.S, SXTW] /// - [RequiresUnsafe] public static unsafe void ScatterWithByteOffsets(Vector mask, int* address, Vector offsets, Vector data) => ScatterWithByteOffsets(mask, address, offsets, data); /// /// void svst1_scatter_[u32]offset[_s32](svbool_t pg, int32_t *base, svuint32_t offsets, svint32_t data) /// ST1W Zdata.S, Pg, [Xbase, Zoffsets.S, UXTW] /// - [RequiresUnsafe] public static unsafe void ScatterWithByteOffsets(Vector mask, int* address, Vector offsets, Vector data) => ScatterWithByteOffsets(mask, address, offsets, data); /// /// void svst1_scatter_[s64]offset[_s64](svbool_t pg, int64_t *base, svint64_t offsets, svint64_t data) /// ST1D Zdata.D, Pg, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe void ScatterWithByteOffsets(Vector mask, long* address, Vector offsets, Vector data) => ScatterWithByteOffsets(mask, address, offsets, data); /// /// void svst1_scatter_[u64]offset[_s64](svbool_t pg, int64_t *base, svuint64_t offsets, svint64_t data) /// ST1D Zdata.D, Pg, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe void ScatterWithByteOffsets(Vector mask, long* address, Vector offsets, Vector data) => ScatterWithByteOffsets(mask, address, offsets, data); /// /// void svst1_scatter_[s32]offset[_f32](svbool_t pg, float32_t *base, svint32_t offsets, svfloat32_t data) /// ST1W Zdata.S, Pg, [Xbase, Zoffsets.S, SXTW] /// - [RequiresUnsafe] public static unsafe void ScatterWithByteOffsets(Vector mask, float* address, Vector offsets, Vector data) => ScatterWithByteOffsets(mask, address, offsets, data); /// /// void svst1_scatter_[u32]offset[_f32](svbool_t pg, float32_t *base, svuint32_t offsets, svfloat32_t data) /// ST1W Zdata.S, Pg, [Xbase, Zoffsets.S, UXTW] /// - [RequiresUnsafe] public static unsafe void ScatterWithByteOffsets(Vector mask, float* address, Vector offsets, Vector data) => ScatterWithByteOffsets(mask, address, offsets, data); /// /// void svst1_scatter_[s32]offset[_u32](svbool_t pg, uint32_t *base, svint32_t offsets, svuint32_t data) /// ST1W Zdata.S, Pg, [Xbase, Zoffsets.S, SXTW] /// - [RequiresUnsafe] public static unsafe void ScatterWithByteOffsets(Vector mask, uint* address, Vector offsets, Vector data) => ScatterWithByteOffsets(mask, address, offsets, data); /// /// void svst1_scatter_[u32]offset[_u32](svbool_t pg, uint32_t *base, svuint32_t offsets, svuint32_t data) /// ST1W Zdata.S, Pg, [Xbase, Zoffsets.S, UXTW] /// - [RequiresUnsafe] public static unsafe void ScatterWithByteOffsets(Vector mask, uint* address, Vector offsets, Vector data) => ScatterWithByteOffsets(mask, address, offsets, data); /// /// void svst1_scatter_[s64]offset[_u64](svbool_t pg, uint64_t *base, svint64_t offsets, svuint64_t data) /// ST1D Zdata.D, Pg, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe void ScatterWithByteOffsets(Vector mask, ulong* address, Vector offsets, Vector data) => ScatterWithByteOffsets(mask, address, offsets, data); /// /// void svst1_scatter_[u64]offset[_u64](svbool_t pg, uint64_t *base, svuint64_t offsets, svuint64_t data) /// ST1D Zdata.D, Pg, [Xbase, Zoffsets.D] /// - [RequiresUnsafe] public static unsafe void ScatterWithByteOffsets(Vector mask, ulong* address, Vector offsets, Vector data) => ScatterWithByteOffsets(mask, address, offsets, data); @@ -10365,280 +9945,240 @@ internal Arm64() { } /// void svst1[_u8](svbool_t pg, uint8_t *base, svuint8_t data) /// ST1B Zdata.B, Pg, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe void StoreAndZip(Vector mask, byte* address, Vector data) => StoreAndZip(mask, address, data); /// /// void svst2[_u8](svbool_t pg, uint8_t *base, svuint8x2_t data) /// ST2B {Zdata0.B, Zdata1.B}, Pg, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe void StoreAndZip(Vector mask, byte* address, (Vector Value1, Vector Value2) data) => StoreAndZip(mask, address, data); /// /// void svst3[_u8](svbool_t pg, uint8_t *base, svuint8x3_t data) /// ST3B {Zdata0.B - Zdata2.B}, Pg, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe void StoreAndZip(Vector mask, byte* address, (Vector Value1, Vector Value2, Vector Value3) data) => StoreAndZip(mask, address, data); /// /// void svst4[_u8](svbool_t pg, uint8_t *base, svuint8x4_t data) /// ST4B {Zdata0.B - Zdata3.B}, Pg, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe void StoreAndZip(Vector mask, byte* address, (Vector Value1, Vector Value2, Vector Value3, Vector Value4) data) => StoreAndZip(mask, address, data); /// /// void svst1[_f64](svbool_t pg, float64_t *base, svfloat64_t data) /// ST1D Zdata.D, Pg, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe void StoreAndZip(Vector mask, double* address, Vector data) => StoreAndZip(mask, address, data); /// /// void svst2[_f64](svbool_t pg, float64_t *base, svfloat64x2_t data) /// ST2D {Zdata0.D, Zdata1.D}, Pg, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe void StoreAndZip(Vector mask, double* address, (Vector Value1, Vector Value2) data) => StoreAndZip(mask, address, data); /// /// void svst3[_f64](svbool_t pg, float64_t *base, svfloat64x3_t data) /// ST3D {Zdata0.D - Zdata2.D}, Pg, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe void StoreAndZip(Vector mask, double* address, (Vector Value1, Vector Value2, Vector Value3) data) => StoreAndZip(mask, address, data); /// /// void svst4[_f64](svbool_t pg, float64_t *base, svfloat64x4_t data) /// ST4D {Zdata0.D - Zdata3.D}, Pg, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe void StoreAndZip(Vector mask, double* address, (Vector Value1, Vector Value2, Vector Value3, Vector Value4) data) => StoreAndZip(mask, address, data); /// /// void svst1[_s16](svbool_t pg, int16_t *base, svint16_t data) /// ST1H Zdata.H, Pg, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe void StoreAndZip(Vector mask, short* address, Vector data) => StoreAndZip(mask, address, data); /// /// void svst2[_s16](svbool_t pg, int16_t *base, svint16x2_t data) /// ST2H {Zdata0.H, Zdata1.H}, Pg, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe void StoreAndZip(Vector mask, short* address, (Vector Value1, Vector Value2) data) => StoreAndZip(mask, address, data); /// /// void svst3[_s16](svbool_t pg, int16_t *base, svint16x3_t data) /// ST3H {Zdata0.H - Zdata2.H}, Pg, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe void StoreAndZip(Vector mask, short* address, (Vector Value1, Vector Value2, Vector Value3) data) => StoreAndZip(mask, address, data); /// /// void svst4[_s16](svbool_t pg, int16_t *base, svint16x4_t data) /// ST4H {Zdata0.H - Zdata3.H}, Pg, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe void StoreAndZip(Vector mask, short* address, (Vector Value1, Vector Value2, Vector Value3, Vector Value4) data) => StoreAndZip(mask, address, data); /// /// void svst1[_s32](svbool_t pg, int32_t *base, svint32_t data) /// ST1W Zdata.S, Pg, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe void StoreAndZip(Vector mask, int* address, Vector data) => StoreAndZip(mask, address, data); /// /// void svst2[_s32](svbool_t pg, int32_t *base, svint32x2_t data) /// ST2W {Zdata0.S, Zdata1.S}, Pg, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe void StoreAndZip(Vector mask, int* address, (Vector Value1, Vector Value2) data) => StoreAndZip(mask, address, data); /// /// void svst3[_s32](svbool_t pg, int32_t *base, svint32x3_t data) /// ST3W {Zdata0.S - Zdata2.S}, Pg, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe void StoreAndZip(Vector mask, int* address, (Vector Value1, Vector Value2, Vector Value3) data) => StoreAndZip(mask, address, data); /// /// void svst4[_s32](svbool_t pg, int32_t *base, svint32x4_t data) /// ST4W {Zdata0.S - Zdata3.S}, Pg, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe void StoreAndZip(Vector mask, int* address, (Vector Value1, Vector Value2, Vector Value3, Vector Value4) data) => StoreAndZip(mask, address, data); /// /// void svst1[_s64](svbool_t pg, int64_t *base, svint64_t data) /// ST1D Zdata.D, Pg, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe void StoreAndZip(Vector mask, long* address, Vector data) => StoreAndZip(mask, address, data); /// /// void svst2[_s64](svbool_t pg, int64_t *base, svint64x2_t data) /// ST2D {Zdata0.D, Zdata1.D}, Pg, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe void StoreAndZip(Vector mask, long* address, (Vector Value1, Vector Value2) data) => StoreAndZip(mask, address, data); /// /// void svst3[_s64](svbool_t pg, int64_t *base, svint64x3_t data) /// ST3D {Zdata0.D - Zdata2.D}, Pg, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe void StoreAndZip(Vector mask, long* address, (Vector Value1, Vector Value2, Vector Value3) data) => StoreAndZip(mask, address, data); /// /// void svst4[_s64](svbool_t pg, int64_t *base, svint64x4_t data) /// ST4D {Zdata0.D - Zdata3.D}, Pg, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe void StoreAndZip(Vector mask, long* address, (Vector Value1, Vector Value2, Vector Value3, Vector Value4) data) => StoreAndZip(mask, address, data); /// /// void svst1[_s8](svbool_t pg, int8_t *base, svint8_t data) /// ST1B Zdata.B, Pg, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe void StoreAndZip(Vector mask, sbyte* address, Vector data) => StoreAndZip(mask, address, data); /// /// void svst2[_s8](svbool_t pg, int8_t *base, svint8x2_t data) /// ST2B {Zdata0.B, Zdata1.B}, Pg, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe void StoreAndZip(Vector mask, sbyte* address, (Vector Value1, Vector Value2) data) => StoreAndZip(mask, address, data); /// /// void svst3[_s8](svbool_t pg, int8_t *base, svint8x3_t data) /// ST3B {Zdata0.B - Zdata2.B}, Pg, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe void StoreAndZip(Vector mask, sbyte* address, (Vector Value1, Vector Value2, Vector Value3) data) => StoreAndZip(mask, address, data); /// /// void svst4[_s8](svbool_t pg, int8_t *base, svint8x4_t data) /// ST4B {Zdata0.B - Zdata3.B}, Pg, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe void StoreAndZip(Vector mask, sbyte* address, (Vector Value1, Vector Value2, Vector Value3, Vector Value4) data) => StoreAndZip(mask, address, data); /// /// void svst1[_f32](svbool_t pg, float32_t *base, svfloat32_t data) /// ST1W Zdata.S, Pg, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe void StoreAndZip(Vector mask, float* address, Vector data) => StoreAndZip(mask, address, data); /// /// void svst2[_f32](svbool_t pg, float32_t *base, svfloat32x2_t data) /// ST2W {Zdata0.S, Zdata1.S}, Pg, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe void StoreAndZip(Vector mask, float* address, (Vector Value1, Vector Value2) data) => StoreAndZip(mask, address, data); /// /// void svst3[_f32](svbool_t pg, float32_t *base, svfloat32x3_t data) /// ST3W {Zdata0.S - Zdata2.S}, Pg, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe void StoreAndZip(Vector mask, float* address, (Vector Value1, Vector Value2, Vector Value3) data) => StoreAndZip(mask, address, data); /// /// void svst4[_f32](svbool_t pg, float32_t *base, svfloat32x4_t data) /// ST4W {Zdata0.S - Zdata3.S}, Pg, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe void StoreAndZip(Vector mask, float* address, (Vector Value1, Vector Value2, Vector Value3, Vector Value4) data) => StoreAndZip(mask, address, data); /// /// void svst1[_u16](svbool_t pg, uint16_t *base, svuint16_t data) /// ST1H Zdata.H, Pg, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe void StoreAndZip(Vector mask, ushort* address, Vector data) => StoreAndZip(mask, address, data); /// /// void svst2[_u16](svbool_t pg, uint16_t *base, svuint16x2_t data) /// ST2H {Zdata0.H, Zdata1.H}, Pg, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe void StoreAndZip(Vector mask, ushort* address, (Vector Value1, Vector Value2) data) => StoreAndZip(mask, address, data); /// /// void svst3[_u16](svbool_t pg, uint16_t *base, svuint16x3_t data) /// ST3H {Zdata0.H - Zdata2.H}, Pg, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe void StoreAndZip(Vector mask, ushort* address, (Vector Value1, Vector Value2, Vector Value3) data) => StoreAndZip(mask, address, data); /// /// void svst4[_u16](svbool_t pg, uint16_t *base, svuint16x4_t data) /// ST4H {Zdata0.H - Zdata3.H}, Pg, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe void StoreAndZip(Vector mask, ushort* address, (Vector Value1, Vector Value2, Vector Value3, Vector Value4) data) => StoreAndZip(mask, address, data); /// /// void svst1[_u32](svbool_t pg, uint32_t *base, svuint32_t data) /// ST1W Zdata.S, Pg, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe void StoreAndZip(Vector mask, uint* address, Vector data) => StoreAndZip(mask, address, data); /// /// void svst2[_u32](svbool_t pg, uint32_t *base, svuint32x2_t data) /// ST2W {Zdata0.S, Zdata1.S}, Pg, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe void StoreAndZip(Vector mask, uint* address, (Vector Value1, Vector Value2) data) => StoreAndZip(mask, address, data); /// /// void svst3[_u32](svbool_t pg, uint32_t *base, svuint32x3_t data) /// ST3W {Zdata0.S - Zdata2.S}, Pg, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe void StoreAndZip(Vector mask, uint* address, (Vector Value1, Vector Value2, Vector Value3) data) => StoreAndZip(mask, address, data); /// /// void svst4[_u32](svbool_t pg, uint32_t *base, svuint32x4_t data) /// ST4W {Zdata0.S - Zdata3.S}, Pg, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe void StoreAndZip(Vector mask, uint* address, (Vector Value1, Vector Value2, Vector Value3, Vector Value4) data) => StoreAndZip(mask, address, data); /// /// void svst1[_u64](svbool_t pg, uint64_t *base, svuint64_t data) /// ST1D Zdata.D, Pg, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe void StoreAndZip(Vector mask, ulong* address, Vector data) => StoreAndZip(mask, address, data); /// /// void svst2[_u64](svbool_t pg, uint64_t *base, svuint64x2_t data) /// ST2D {Zdata0.D, Zdata1.D}, Pg, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe void StoreAndZip(Vector mask, ulong* address, (Vector Value1, Vector Value2) data) => StoreAndZip(mask, address, data); /// /// void svst3[_u64](svbool_t pg, uint64_t *base, svuint64x3_t data) /// ST3D {Zdata0.D - Zdata2.D}, Pg, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe void StoreAndZip(Vector mask, ulong* address, (Vector Value1, Vector Value2, Vector Value3) data) => StoreAndZip(mask, address, data); /// /// void svst4[_u64](svbool_t pg, uint64_t *base, svuint64x4_t data) /// ST4D {Zdata0.D - Zdata3.D}, Pg, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe void StoreAndZip(Vector mask, ulong* address, (Vector Value1, Vector Value2, Vector Value3, Vector Value4) data) => StoreAndZip(mask, address, data); @@ -10648,84 +10188,72 @@ internal Arm64() { } /// void svst1b[_s16](svbool_t pg, int8_t *base, svint16_t data) /// ST1B Zdata.H, Pg, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe void StoreNarrowing(Vector mask, sbyte* address, Vector data) => StoreNarrowing(mask, address, data); /// /// void svst1b[_s32](svbool_t pg, int8_t *base, svint32_t data) /// ST1B Zdata.S, Pg, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe void StoreNarrowing(Vector mask, sbyte* address, Vector data) => StoreNarrowing(mask, address, data); /// /// void svst1h[_s32](svbool_t pg, int16_t *base, svint32_t data) /// ST1H Zdata.S, Pg, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe void StoreNarrowing(Vector mask, short* address, Vector data) => StoreNarrowing(mask, address, data); /// /// void svst1b[_s64](svbool_t pg, int8_t *base, svint64_t data) /// ST1B Zdata.D, Pg, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe void StoreNarrowing(Vector mask, sbyte* address, Vector data) => StoreNarrowing(mask, address, data); /// /// void svst1h[_s64](svbool_t pg, int16_t *base, svint64_t data) /// ST1H Zdata.D, Pg, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe void StoreNarrowing(Vector mask, short* address, Vector data) => StoreNarrowing(mask, address, data); /// /// void svst1w[_s64](svbool_t pg, int32_t *base, svint64_t data) /// ST1W Zdata.D, Pg, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe void StoreNarrowing(Vector mask, int* address, Vector data) => StoreNarrowing(mask, address, data); /// /// void svst1b[_u16](svbool_t pg, uint8_t *base, svuint16_t data) /// ST1B Zdata.H, Pg, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe void StoreNarrowing(Vector mask, byte* address, Vector data) => StoreNarrowing(mask, address, data); /// /// void svst1b[_u32](svbool_t pg, uint8_t *base, svuint32_t data) /// ST1B Zdata.S, Pg, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe void StoreNarrowing(Vector mask, byte* address, Vector data) => StoreNarrowing(mask, address, data); /// /// void svst1h[_u32](svbool_t pg, uint16_t *base, svuint32_t data) /// ST1H Zdata.S, Pg, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe void StoreNarrowing(Vector mask, ushort* address, Vector data) => StoreNarrowing(mask, address, data); /// /// void svst1b[_u64](svbool_t pg, uint8_t *base, svuint64_t data) /// ST1B Zdata.D, Pg, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe void StoreNarrowing(Vector mask, byte* address, Vector data) => StoreNarrowing(mask, address, data); /// /// void svst1h[_u64](svbool_t pg, uint16_t *base, svuint64_t data) /// ST1H Zdata.D, Pg, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe void StoreNarrowing(Vector mask, ushort* address, Vector data) => StoreNarrowing(mask, address, data); /// /// void svst1w[_u64](svbool_t pg, uint32_t *base, svuint64_t data) /// ST1W Zdata.D, Pg, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe void StoreNarrowing(Vector mask, uint* address, Vector data) => StoreNarrowing(mask, address, data); @@ -10735,70 +10263,60 @@ internal Arm64() { } /// void svstnt1[_u8](svbool_t pg, uint8_t *base, svuint8_t data) /// STNT1B Zdata.B, Pg, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe void StoreNonTemporal(Vector mask, byte* address, Vector data) => StoreNonTemporal(mask, address, data); /// /// void svstnt1[_f64](svbool_t pg, float64_t *base, svfloat64_t data) /// STNT1D Zdata.D, Pg, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe void StoreNonTemporal(Vector mask, double* address, Vector data) => StoreNonTemporal(mask, address, data); /// /// void svstnt1[_s16](svbool_t pg, int16_t *base, svint16_t data) /// STNT1H Zdata.H, Pg, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe void StoreNonTemporal(Vector mask, short* address, Vector data) => StoreNonTemporal(mask, address, data); /// /// void svstnt1[_s32](svbool_t pg, int32_t *base, svint32_t data) /// STNT1W Zdata.S, Pg, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe void StoreNonTemporal(Vector mask, int* address, Vector data) => StoreNonTemporal(mask, address, data); /// /// void svstnt1[_s64](svbool_t pg, int64_t *base, svint64_t data) /// STNT1D Zdata.D, Pg, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe void StoreNonTemporal(Vector mask, long* address, Vector data) => StoreNonTemporal(mask, address, data); /// /// void svstnt1[_s8](svbool_t pg, int8_t *base, svint8_t data) /// STNT1B Zdata.B, Pg, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe void StoreNonTemporal(Vector mask, sbyte* address, Vector data) => StoreNonTemporal(mask, address, data); /// /// void svstnt1[_f32](svbool_t pg, float32_t *base, svfloat32_t data) /// STNT1W Zdata.S, Pg, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe void StoreNonTemporal(Vector mask, float* address, Vector data) => StoreNonTemporal(mask, address, data); /// /// void svstnt1[_u16](svbool_t pg, uint16_t *base, svuint16_t data) /// STNT1H Zdata.H, Pg, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe void StoreNonTemporal(Vector mask, ushort* address, Vector data) => StoreNonTemporal(mask, address, data); /// /// void svstnt1[_u32](svbool_t pg, uint32_t *base, svuint32_t data) /// STNT1W Zdata.S, Pg, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe void StoreNonTemporal(Vector mask, uint* address, Vector data) => StoreNonTemporal(mask, address, data); /// /// void svstnt1[_u64](svbool_t pg, uint64_t *base, svuint64_t data) /// STNT1D Zdata.D, Pg, [Xbase, #0, MUL VL] /// - [RequiresUnsafe] public static unsafe void StoreNonTemporal(Vector mask, ulong* address, Vector data) => StoreNonTemporal(mask, address, data); diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Arm/Sve2.PlatformNotSupported.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Arm/Sve2.PlatformNotSupported.cs index 1c127f42f7597a..1eb32eba2be1ca 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Arm/Sve2.PlatformNotSupported.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Arm/Sve2.PlatformNotSupported.cs @@ -3601,28 +3601,24 @@ internal Arm64() { } /// void svstnt1h_scatter_[s64]index[_s64](svbool_t pg, int16_t *base, svint64_t indices, svint64_t data) /// STNT1H Zdata.D, Pg, [Zoffsets.D, Xbase] /// - [RequiresUnsafe] public static unsafe void Scatter16BitNarrowingNonTemporal(Vector mask, short* address, Vector indices, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svstnt1h_scatter_[u64]index[_s64](svbool_t pg, int16_t *base, svuint64_t indices, svint64_t data) /// STNT1H Zdata.D, Pg, [Zoffsets.D, Xbase] /// - [RequiresUnsafe] public static unsafe void Scatter16BitNarrowingNonTemporal(Vector mask, short* address, Vector indices, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svstnt1h_scatter_[s64]index[_u64](svbool_t pg, uint16_t *base, svint64_t indices, svuint64_t data) /// STNT1H Zdata.D, Pg, [Zoffsets.D, Xbase] /// - [RequiresUnsafe] public static unsafe void Scatter16BitNarrowingNonTemporal(Vector mask, ushort* address, Vector indices, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svstnt1h_scatter_[u64]index[_u64](svbool_t pg, uint16_t *base, svuint64_t indices, svuint64_t data) /// STNT1H Zdata.D, Pg, [Zoffsets.D, Xbase] /// - [RequiresUnsafe] public static unsafe void Scatter16BitNarrowingNonTemporal(Vector mask, ushort* address, Vector indices, Vector data) { throw new PlatformNotSupportedException(); } @@ -3632,42 +3628,36 @@ internal Arm64() { } /// void svstnt1h_scatter_[u32]offset[_s32](svbool_t pg, int16_t *base, svuint32_t offsets, svint32_t data) /// STNT1H Zdata.S, Pg, [Zoffsets.S, Xbase] /// - [RequiresUnsafe] public static unsafe void Scatter16BitWithByteOffsetsNarrowingNonTemporal(Vector mask, short* address, Vector offsets, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svstnt1h_scatter_[s64]offset[_s64](svbool_t pg, int16_t *base, svint64_t offsets, svint64_t data) /// STNT1H Zdata.D, Pg, [Zoffsets.D, Xbase] /// - [RequiresUnsafe] public static unsafe void Scatter16BitWithByteOffsetsNarrowingNonTemporal(Vector mask, short* address, Vector offsets, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svstnt1h_scatter_[u64]offset[_s64](svbool_t pg, int16_t *base, svuint64_t offsets, svint64_t data) /// STNT1H Zdata.D, Pg, [Zoffsets.D, Xbase] /// - [RequiresUnsafe] public static unsafe void Scatter16BitWithByteOffsetsNarrowingNonTemporal(Vector mask, short* address, Vector offsets, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svstnt1h_scatter_[u32]offset[_u32](svbool_t pg, uint16_t *base, svuint32_t offsets, svuint32_t data) /// STNT1H Zdata.S, Pg, [Zoffsets.S, Xbase] /// - [RequiresUnsafe] public static unsafe void Scatter16BitWithByteOffsetsNarrowingNonTemporal(Vector mask, ushort* address, Vector offsets, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svstnt1h_scatter_[s64]offset[_u64](svbool_t pg, uint16_t *base, svint64_t offsets, svuint64_t data) /// STNT1H Zdata.D, Pg, [Zoffsets.D, Xbase] /// - [RequiresUnsafe] public static unsafe void Scatter16BitWithByteOffsetsNarrowingNonTemporal(Vector mask, ushort* address, Vector offsets, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svstnt1h_scatter_[u64]offset[_u64](svbool_t pg, uint16_t *base, svuint64_t offsets, svuint64_t data) /// STNT1H Zdata.D, Pg, [Zoffsets.D, Xbase] /// - [RequiresUnsafe] public static unsafe void Scatter16BitWithByteOffsetsNarrowingNonTemporal(Vector mask, ushort* address, Vector offsets, Vector data) { throw new PlatformNotSupportedException(); } @@ -3689,28 +3679,24 @@ internal Arm64() { } /// void svstnt1w_scatter_[s64]index[_s64](svbool_t pg, int32_t *base, svint64_t indices, svint64_t data) /// STNT1W Zdata.D, Pg, [Zoffsets.D, Xbase] /// - [RequiresUnsafe] public static unsafe void Scatter32BitNarrowingNonTemporal(Vector mask, int* address, Vector indices, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svstnt1w_scatter_[u64]index[_s64](svbool_t pg, int32_t *base, svuint64_t indices, svint64_t data) /// STNT1W Zdata.D, Pg, [Zoffsets.D, Xbase] /// - [RequiresUnsafe] public static unsafe void Scatter32BitNarrowingNonTemporal(Vector mask, int* address, Vector indices, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svstnt1w_scatter_[s64]index[_u64](svbool_t pg, uint32_t *base, svint64_t indices, svuint64_t data) /// STNT1W Zdata.D, Pg, [Zoffsets.D, Xbase] /// - [RequiresUnsafe] public static unsafe void Scatter32BitNarrowingNonTemporal(Vector mask, uint* address, Vector indices, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svstnt1w_scatter_[u64]index[_u64](svbool_t pg, uint32_t *base, svuint64_t indices, svuint64_t data) /// STNT1W Zdata.D, Pg, [Zoffsets.D, Xbase] /// - [RequiresUnsafe] public static unsafe void Scatter32BitNarrowingNonTemporal(Vector mask, uint* address, Vector indices, Vector data) { throw new PlatformNotSupportedException(); } @@ -3720,28 +3706,24 @@ internal Arm64() { } /// void svstnt1w_scatter_[s64]offset[_s64](svbool_t pg, int32_t *base, svint64_t offsets, svint64_t data) /// STNT1W Zdata.D, Pg, [Zoffsets.D, Xbase] /// - [RequiresUnsafe] public static unsafe void Scatter32BitWithByteOffsetsNarrowingNonTemporal(Vector mask, int* address, Vector offsets, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svstnt1w_scatter_[u64]offset[_s64](svbool_t pg, int32_t *base, svuint64_t offsets, svint64_t data) /// STNT1W Zdata.D, Pg, [Zoffsets.D, Xbase] /// - [RequiresUnsafe] public static unsafe void Scatter32BitWithByteOffsetsNarrowingNonTemporal(Vector mask, int* address, Vector offsets, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svstnt1w_scatter_[s64]offset[_u64](svbool_t pg, uint32_t *base, svint64_t offsets, svuint64_t data) /// STNT1W Zdata.D, Pg, [Zoffsets.D, Xbase] /// - [RequiresUnsafe] public static unsafe void Scatter32BitWithByteOffsetsNarrowingNonTemporal(Vector mask, uint* address, Vector offsets, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svstnt1w_scatter_[u64]offset[_u64](svbool_t pg, uint32_t *base, svuint64_t offsets, svuint64_t data) /// STNT1W Zdata.D, Pg, [Zoffsets.D, Xbase] /// - [RequiresUnsafe] public static unsafe void Scatter32BitWithByteOffsetsNarrowingNonTemporal(Vector mask, uint* address, Vector offsets, Vector data) { throw new PlatformNotSupportedException(); } @@ -3780,42 +3762,36 @@ internal Arm64() { } /// void svstnt1b_scatter_[u32]offset[_s32](svbool_t pg, int8_t *base, svuint32_t offsets, svint32_t data) /// STNT1B Zdata.S, Pg, [Zoffsets.S, Xbase] /// - [RequiresUnsafe] public static unsafe void Scatter8BitWithByteOffsetsNarrowingNonTemporal(Vector mask, sbyte* address, Vector offsets, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svstnt1b_scatter_[s64]offset[_s64](svbool_t pg, int8_t *base, svint64_t offsets, svint64_t data) /// STNT1B Zdata.D, Pg, [Zoffsets.D, Xbase] /// - [RequiresUnsafe] public static unsafe void Scatter8BitWithByteOffsetsNarrowingNonTemporal(Vector mask, sbyte* address, Vector offsets, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svstnt1b_scatter_[u64]offset[_s64](svbool_t pg, int8_t *base, svuint64_t offsets, svint64_t data) /// STNT1B Zdata.D, Pg, [Zoffsets.D, Xbase] /// - [RequiresUnsafe] public static unsafe void Scatter8BitWithByteOffsetsNarrowingNonTemporal(Vector mask, sbyte* address, Vector offsets, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svstnt1b_scatter_[u32]offset[_u32](svbool_t pg, uint8_t *base, svuint32_t offsets, svuint32_t data) /// STNT1B Zdata.S, Pg, [Zoffsets.S, Xbase] /// - [RequiresUnsafe] public static unsafe void Scatter8BitWithByteOffsetsNarrowingNonTemporal(Vector mask, byte* address, Vector offsets, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svstnt1b_scatter_[s64]offset[_u64](svbool_t pg, uint8_t *base, svint64_t offsets, svuint64_t data) /// STNT1B Zdata.D, Pg, [Zoffsets.D, Xbase] /// - [RequiresUnsafe] public static unsafe void Scatter8BitWithByteOffsetsNarrowingNonTemporal(Vector mask, byte* address, Vector offsets, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svstnt1b_scatter_[u64]offset[_u64](svbool_t pg, uint8_t *base, svuint64_t offsets, svuint64_t data) /// STNT1B Zdata.D, Pg, [Zoffsets.D, Xbase] /// - [RequiresUnsafe] public static unsafe void Scatter8BitWithByteOffsetsNarrowingNonTemporal(Vector mask, byte* address, Vector offsets, Vector data) { throw new PlatformNotSupportedException(); } @@ -3864,42 +3840,36 @@ internal Arm64() { } /// void svstnt1_scatter_[s64]index[_f64](svbool_t pg, float64_t *base, svint64_t indices, svfloat64_t data) /// STNT1D Zdata.D, Pg, [Zoffsets.D, Xbase] /// - [RequiresUnsafe] public static unsafe void ScatterNonTemporal(Vector mask, double* address, Vector indices, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svstnt1_scatter_[u64]index[_f64](svbool_t pg, float64_t *base, svuint64_t indices, svfloat64_t data) /// STNT1D Zdata.D, Pg, [Zoffsets.D, Xbase] /// - [RequiresUnsafe] public static unsafe void ScatterNonTemporal(Vector mask, double* address, Vector indices, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svstnt1_scatter_[s64]index[_s64](svbool_t pg, int64_t *base, svint64_t indices, svint64_t data) /// STNT1D Zdata.D, Pg, [Zoffsets.D, Xbase] /// - [RequiresUnsafe] public static unsafe void ScatterNonTemporal(Vector mask, long* address, Vector indices, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svstnt1_scatter_[u64]index[_s64](svbool_t pg, int64_t *base, svuint64_t indices, svint64_t data) /// STNT1D Zdata.D, Pg, [Zoffsets.D, Xbase] /// - [RequiresUnsafe] public static unsafe void ScatterNonTemporal(Vector mask, long* address, Vector indices, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svstnt1_scatter_[s64]index[_u64](svbool_t pg, uint64_t *base, svint64_t indices, svuint64_t data) /// STNT1D Zdata.D, Pg, [Zoffsets.D, Xbase] /// - [RequiresUnsafe] public static unsafe void ScatterNonTemporal(Vector mask, ulong* address, Vector indices, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svstnt1_scatter_[u64]index[_u64](svbool_t pg, uint64_t *base, svuint64_t indices, svuint64_t data) /// STNT1D Zdata.D, Pg, [Zoffsets.D, Xbase] /// - [RequiresUnsafe] public static unsafe void ScatterNonTemporal(Vector mask, ulong* address, Vector indices, Vector data) { throw new PlatformNotSupportedException(); } @@ -3909,63 +3879,54 @@ internal Arm64() { } /// void svstnt1_scatter_[s64]offset[_f64](svbool_t pg, float64_t *base, svint64_t offsets, svfloat64_t data) /// STNT1D Zdata.D, Pg, [Zoffsets.D, Xbase] /// - [RequiresUnsafe] public static unsafe void ScatterWithByteOffsetsNonTemporal(Vector mask, double* address, Vector offsets, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svstnt1_scatter_[u64]offset[_f64](svbool_t pg, float64_t *base, svuint64_t offsets, svfloat64_t data) /// STNT1D Zdata.D, Pg, [Zoffsets.D, Xbase] /// - [RequiresUnsafe] public static unsafe void ScatterWithByteOffsetsNonTemporal(Vector mask, double* address, Vector offsets, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svstnt1_scatter_[u32]offset[_s32](svbool_t pg, int32_t *base, svuint32_t offsets, svint32_t data) /// STNT1W Zdata.S, Pg, [Zoffsets.S, Xbase] /// - [RequiresUnsafe] public static unsafe void ScatterWithByteOffsetsNonTemporal(Vector mask, int* address, Vector offsets, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svstnt1_scatter_[s64]offset[_s64](svbool_t pg, int64_t *base, svint64_t offsets, svint64_t data) /// STNT1D Zdata.D, Pg, [Zoffsets.D, Xbase] /// - [RequiresUnsafe] public static unsafe void ScatterWithByteOffsetsNonTemporal(Vector mask, long* address, Vector offsets, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svstnt1_scatter_[u64]offset[_s64](svbool_t pg, int64_t *base, svuint64_t offsets, svint64_t data) /// STNT1D Zdata.D, Pg, [Zoffsets.D, Xbase] /// - [RequiresUnsafe] public static unsafe void ScatterWithByteOffsetsNonTemporal(Vector mask, long* address, Vector offsets, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svstnt1_scatter_[u32]offset[_f32](svbool_t pg, float32_t *base, svuint32_t offsets, svfloat32_t data) /// STNT1W Zdata.S, Pg, [Zoffsets.S, Xbase] /// - [RequiresUnsafe] public static unsafe void ScatterWithByteOffsetsNonTemporal(Vector mask, float* address, Vector offsets, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svstnt1_scatter_[u32]offset[_u32](svbool_t pg, uint32_t *base, svuint32_t offsets, svuint32_t data) /// STNT1W Zdata.S, Pg, [Zoffsets.S, Xbase] /// - [RequiresUnsafe] public static unsafe void ScatterWithByteOffsetsNonTemporal(Vector mask, uint* address, Vector offsets, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svstnt1_scatter_[s64]offset[_u64](svbool_t pg, uint64_t *base, svint64_t offsets, svuint64_t data) /// STNT1D Zdata.D, Pg, [Zoffsets.D, Xbase] /// - [RequiresUnsafe] public static unsafe void ScatterWithByteOffsetsNonTemporal(Vector mask, ulong* address, Vector offsets, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svstnt1_scatter_[u64]offset[_u64](svbool_t pg, uint64_t *base, svuint64_t offsets, svuint64_t data) /// STNT1D Zdata.D, Pg, [Zoffsets.D, Xbase] /// - [RequiresUnsafe] public static unsafe void ScatterWithByteOffsetsNonTemporal(Vector mask, ulong* address, Vector offsets, Vector data) { throw new PlatformNotSupportedException(); } diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Arm/Sve2.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Arm/Sve2.cs index 18d5abcc2b5746..a3860a8bb0ecbd 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Arm/Sve2.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Arm/Sve2.cs @@ -3603,28 +3603,24 @@ internal Arm64() { } /// void svstnt1h_scatter_[s64]index[_s64](svbool_t pg, int16_t *base, svint64_t indices, svint64_t data) /// STNT1H Zdata.D, Pg, [Zoffsets.D, Xbase] /// - [RequiresUnsafe] public static unsafe void Scatter16BitNarrowingNonTemporal(Vector mask, short* address, Vector indices, Vector data) => Scatter16BitNarrowingNonTemporal(mask, address, indices, data); /// /// void svstnt1h_scatter_[u64]index[_s64](svbool_t pg, int16_t *base, svuint64_t indices, svint64_t data) /// STNT1H Zdata.D, Pg, [Zoffsets.D, Xbase] /// - [RequiresUnsafe] public static unsafe void Scatter16BitNarrowingNonTemporal(Vector mask, short* address, Vector indices, Vector data) => Scatter16BitNarrowingNonTemporal(mask, address, indices, data); /// /// void svstnt1h_scatter_[s64]index[_u64](svbool_t pg, uint16_t *base, svint64_t indices, svuint64_t data) /// STNT1H Zdata.D, Pg, [Zoffsets.D, Xbase] /// - [RequiresUnsafe] public static unsafe void Scatter16BitNarrowingNonTemporal(Vector mask, ushort* address, Vector indices, Vector data) => Scatter16BitNarrowingNonTemporal(mask, address, indices, data); /// /// void svstnt1h_scatter_[u64]index[_u64](svbool_t pg, uint16_t *base, svuint64_t indices, svuint64_t data) /// STNT1H Zdata.D, Pg, [Zoffsets.D, Xbase] /// - [RequiresUnsafe] public static unsafe void Scatter16BitNarrowingNonTemporal(Vector mask, ushort* address, Vector indices, Vector data) => Scatter16BitNarrowingNonTemporal(mask, address, indices, data); @@ -3634,42 +3630,36 @@ internal Arm64() { } /// void svstnt1h_scatter_[u32]offset[_s32](svbool_t pg, int16_t *base, svuint32_t offsets, svint32_t data) /// STNT1H Zdata.S, Pg, [Zoffsets.S, Xbase] /// - [RequiresUnsafe] public static unsafe void Scatter16BitWithByteOffsetsNarrowingNonTemporal(Vector mask, short* address, Vector offsets, Vector data) => Scatter16BitWithByteOffsetsNarrowingNonTemporal(mask, address, offsets, data); /// /// void svstnt1h_scatter_[s64]offset[_s64](svbool_t pg, int16_t *base, svint64_t offsets, svint64_t data) /// STNT1H Zdata.D, Pg, [Zoffsets.D, Xbase] /// - [RequiresUnsafe] public static unsafe void Scatter16BitWithByteOffsetsNarrowingNonTemporal(Vector mask, short* address, Vector offsets, Vector data) => Scatter16BitWithByteOffsetsNarrowingNonTemporal(mask, address, offsets, data); /// /// void svstnt1h_scatter_[u64]offset[_s64](svbool_t pg, int16_t *base, svuint64_t offsets, svint64_t data) /// STNT1H Zdata.D, Pg, [Zoffsets.D, Xbase] /// - [RequiresUnsafe] public static unsafe void Scatter16BitWithByteOffsetsNarrowingNonTemporal(Vector mask, short* address, Vector offsets, Vector data) => Scatter16BitWithByteOffsetsNarrowingNonTemporal(mask, address, offsets, data); /// /// void svstnt1h_scatter_[u32]offset[_u32](svbool_t pg, uint16_t *base, svuint32_t offsets, svuint32_t data) /// STNT1H Zdata.S, Pg, [Zoffsets.S, Xbase] /// - [RequiresUnsafe] public static unsafe void Scatter16BitWithByteOffsetsNarrowingNonTemporal(Vector mask, ushort* address, Vector offsets, Vector data) => Scatter16BitWithByteOffsetsNarrowingNonTemporal(mask, address, offsets, data); /// /// void svstnt1h_scatter_[s64]offset[_u64](svbool_t pg, uint16_t *base, svint64_t offsets, svuint64_t data) /// STNT1H Zdata.D, Pg, [Zoffsets.D, Xbase] /// - [RequiresUnsafe] public static unsafe void Scatter16BitWithByteOffsetsNarrowingNonTemporal(Vector mask, ushort* address, Vector offsets, Vector data) => Scatter16BitWithByteOffsetsNarrowingNonTemporal(mask, address, offsets, data); /// /// void svstnt1h_scatter_[u64]offset[_u64](svbool_t pg, uint16_t *base, svuint64_t offsets, svuint64_t data) /// STNT1H Zdata.D, Pg, [Zoffsets.D, Xbase] /// - [RequiresUnsafe] public static unsafe void Scatter16BitWithByteOffsetsNarrowingNonTemporal(Vector mask, ushort* address, Vector offsets, Vector data) => Scatter16BitWithByteOffsetsNarrowingNonTemporal(mask, address, offsets, data); @@ -3691,28 +3681,24 @@ internal Arm64() { } /// void svstnt1w_scatter_[s64]index[_s64](svbool_t pg, int32_t *base, svint64_t indices, svint64_t data) /// STNT1W Zdata.D, Pg, [Zoffsets.D, Xbase] /// - [RequiresUnsafe] public static unsafe void Scatter32BitNarrowingNonTemporal(Vector mask, int* address, Vector indices, Vector data) => Scatter32BitNarrowingNonTemporal(mask, address, indices, data); /// /// void svstnt1w_scatter_[u64]index[_s64](svbool_t pg, int32_t *base, svuint64_t indices, svint64_t data) /// STNT1W Zdata.D, Pg, [Zoffsets.D, Xbase] /// - [RequiresUnsafe] public static unsafe void Scatter32BitNarrowingNonTemporal(Vector mask, int* address, Vector indices, Vector data) => Scatter32BitNarrowingNonTemporal(mask, address, indices, data); /// /// void svstnt1w_scatter_[s64]index[_u64](svbool_t pg, uint32_t *base, svint64_t indices, svuint64_t data) /// STNT1W Zdata.D, Pg, [Zoffsets.D, Xbase] /// - [RequiresUnsafe] public static unsafe void Scatter32BitNarrowingNonTemporal(Vector mask, uint* address, Vector indices, Vector data) => Scatter32BitNarrowingNonTemporal(mask, address, indices, data); /// /// void svstnt1w_scatter_[u64]index[_u64](svbool_t pg, uint32_t *base, svuint64_t indices, svuint64_t data) /// STNT1W Zdata.D, Pg, [Zoffsets.D, Xbase] /// - [RequiresUnsafe] public static unsafe void Scatter32BitNarrowingNonTemporal(Vector mask, uint* address, Vector indices, Vector data) => Scatter32BitNarrowingNonTemporal(mask, address, indices, data); @@ -3722,28 +3708,24 @@ internal Arm64() { } /// void svstnt1w_scatter_[s64]offset[_s64](svbool_t pg, int32_t *base, svint64_t offsets, svint64_t data) /// STNT1W Zdata.D, Pg, [Zoffsets.D, Xbase] /// - [RequiresUnsafe] public static unsafe void Scatter32BitWithByteOffsetsNarrowingNonTemporal(Vector mask, int* address, Vector offsets, Vector data) => Scatter32BitWithByteOffsetsNarrowingNonTemporal(mask, address, offsets, data); /// /// void svstnt1w_scatter_[u64]offset[_s64](svbool_t pg, int32_t *base, svuint64_t offsets, svint64_t data) /// STNT1W Zdata.D, Pg, [Zoffsets.D, Xbase] /// - [RequiresUnsafe] public static unsafe void Scatter32BitWithByteOffsetsNarrowingNonTemporal(Vector mask, int* address, Vector offsets, Vector data) => Scatter32BitWithByteOffsetsNarrowingNonTemporal(mask, address, offsets, data); /// /// void svstnt1w_scatter_[s64]offset[_u64](svbool_t pg, uint32_t *base, svint64_t offsets, svuint64_t data) /// STNT1W Zdata.D, Pg, [Zoffsets.D, Xbase] /// - [RequiresUnsafe] public static unsafe void Scatter32BitWithByteOffsetsNarrowingNonTemporal(Vector mask, uint* address, Vector offsets, Vector data) => Scatter32BitWithByteOffsetsNarrowingNonTemporal(mask, address, offsets, data); /// /// void svstnt1w_scatter_[u64]offset[_u64](svbool_t pg, uint32_t *base, svuint64_t offsets, svuint64_t data) /// STNT1W Zdata.D, Pg, [Zoffsets.D, Xbase] /// - [RequiresUnsafe] public static unsafe void Scatter32BitWithByteOffsetsNarrowingNonTemporal(Vector mask, uint* address, Vector offsets, Vector data) => Scatter32BitWithByteOffsetsNarrowingNonTemporal(mask, address, offsets, data); @@ -3782,42 +3764,36 @@ internal Arm64() { } /// void svstnt1b_scatter_[u32]offset[_s32](svbool_t pg, int8_t *base, svuint32_t offsets, svint32_t data) /// STNT1B Zdata.S, Pg, [Zoffsets.S, Xbase] /// - [RequiresUnsafe] public static unsafe void Scatter8BitWithByteOffsetsNarrowingNonTemporal(Vector mask, sbyte* address, Vector offsets, Vector data) => Scatter8BitWithByteOffsetsNarrowingNonTemporal(mask, address, offsets, data); /// /// void svstnt1b_scatter_[s64]offset[_s64](svbool_t pg, int8_t *base, svint64_t offsets, svint64_t data) /// STNT1B Zdata.D, Pg, [Zoffsets.D, Xbase] /// - [RequiresUnsafe] public static unsafe void Scatter8BitWithByteOffsetsNarrowingNonTemporal(Vector mask, sbyte* address, Vector offsets, Vector data) => Scatter8BitWithByteOffsetsNarrowingNonTemporal(mask, address, offsets, data); /// /// void svstnt1b_scatter_[u64]offset[_s64](svbool_t pg, int8_t *base, svuint64_t offsets, svint64_t data) /// STNT1B Zdata.D, Pg, [Zoffsets.D, Xbase] /// - [RequiresUnsafe] public static unsafe void Scatter8BitWithByteOffsetsNarrowingNonTemporal(Vector mask, sbyte* address, Vector offsets, Vector data) => Scatter8BitWithByteOffsetsNarrowingNonTemporal(mask, address, offsets, data); /// /// void svstnt1b_scatter_[u32]offset[_u32](svbool_t pg, uint8_t *base, svuint32_t offsets, svuint32_t data) /// STNT1B Zdata.S, Pg, [Zoffsets.S, Xbase] /// - [RequiresUnsafe] public static unsafe void Scatter8BitWithByteOffsetsNarrowingNonTemporal(Vector mask, byte* address, Vector offsets, Vector data) => Scatter8BitWithByteOffsetsNarrowingNonTemporal(mask, address, offsets, data); /// /// void svstnt1b_scatter_[s64]offset[_u64](svbool_t pg, uint8_t *base, svint64_t offsets, svuint64_t data) /// STNT1B Zdata.D, Pg, [Zoffsets.D, Xbase] /// - [RequiresUnsafe] public static unsafe void Scatter8BitWithByteOffsetsNarrowingNonTemporal(Vector mask, byte* address, Vector offsets, Vector data) => Scatter8BitWithByteOffsetsNarrowingNonTemporal(mask, address, offsets, data); /// /// void svstnt1b_scatter_[u64]offset[_u64](svbool_t pg, uint8_t *base, svuint64_t offsets, svuint64_t data) /// STNT1B Zdata.D, Pg, [Zoffsets.D, Xbase] /// - [RequiresUnsafe] public static unsafe void Scatter8BitWithByteOffsetsNarrowingNonTemporal(Vector mask, byte* address, Vector offsets, Vector data) => Scatter8BitWithByteOffsetsNarrowingNonTemporal(mask, address, offsets, data); @@ -3866,42 +3842,36 @@ internal Arm64() { } /// void svstnt1_scatter_[s64]index[_f64](svbool_t pg, float64_t *base, svint64_t indices, svfloat64_t data) /// STNT1D Zdata.D, Pg, [Zoffsets.D, Xbase] /// - [RequiresUnsafe] public static unsafe void ScatterNonTemporal(Vector mask, double* address, Vector indices, Vector data) => ScatterNonTemporal(mask, address, indices, data); /// /// void svstnt1_scatter_[u64]index[_f64](svbool_t pg, float64_t *base, svuint64_t indices, svfloat64_t data) /// STNT1D Zdata.D, Pg, [Zoffsets.D, Xbase] /// - [RequiresUnsafe] public static unsafe void ScatterNonTemporal(Vector mask, double* address, Vector indices, Vector data) => ScatterNonTemporal(mask, address, indices, data); /// /// void svstnt1_scatter_[s64]index[_s64](svbool_t pg, int64_t *base, svint64_t indices, svint64_t data) /// STNT1D Zdata.D, Pg, [Zoffsets.D, Xbase] /// - [RequiresUnsafe] public static unsafe void ScatterNonTemporal(Vector mask, long* address, Vector indices, Vector data) => ScatterNonTemporal(mask, address, indices, data); /// /// void svstnt1_scatter_[u64]index[_s64](svbool_t pg, int64_t *base, svuint64_t indices, svint64_t data) /// STNT1D Zdata.D, Pg, [Zoffsets.D, Xbase] /// - [RequiresUnsafe] public static unsafe void ScatterNonTemporal(Vector mask, long* address, Vector indices, Vector data) => ScatterNonTemporal(mask, address, indices, data); /// /// void svstnt1_scatter_[s64]index[_u64](svbool_t pg, uint64_t *base, svint64_t indices, svuint64_t data) /// STNT1D Zdata.D, Pg, [Zoffsets.D, Xbase] /// - [RequiresUnsafe] public static unsafe void ScatterNonTemporal(Vector mask, ulong* address, Vector indices, Vector data) => ScatterNonTemporal(mask, address, indices, data); /// /// void svstnt1_scatter_[u64]index[_u64](svbool_t pg, uint64_t *base, svuint64_t indices, svuint64_t data) /// STNT1D Zdata.D, Pg, [Zoffsets.D, Xbase] /// - [RequiresUnsafe] public static unsafe void ScatterNonTemporal(Vector mask, ulong* address, Vector indices, Vector data) => ScatterNonTemporal(mask, address, indices, data); @@ -3911,63 +3881,54 @@ internal Arm64() { } /// void svstnt1_scatter_[s64]offset[_f64](svbool_t pg, float64_t *base, svint64_t offsets, svfloat64_t data) /// STNT1D Zdata.D, Pg, [Zoffsets.D, Xbase] /// - [RequiresUnsafe] public static unsafe void ScatterWithByteOffsetsNonTemporal(Vector mask, double* address, Vector offsets, Vector data) => ScatterWithByteOffsetsNonTemporal(mask, address, offsets, data); /// /// void svstnt1_scatter_[u64]offset[_f64](svbool_t pg, float64_t *base, svuint64_t offsets, svfloat64_t data) /// STNT1D Zdata.D, Pg, [Zoffsets.D, Xbase] /// - [RequiresUnsafe] public static unsafe void ScatterWithByteOffsetsNonTemporal(Vector mask, double* address, Vector offsets, Vector data) => ScatterWithByteOffsetsNonTemporal(mask, address, offsets, data); /// /// void svstnt1_scatter_[u32]offset[_s32](svbool_t pg, int32_t *base, svuint32_t offsets, svint32_t data) /// STNT1W Zdata.S, Pg, [Zoffsets.S, Xbase] /// - [RequiresUnsafe] public static unsafe void ScatterWithByteOffsetsNonTemporal(Vector mask, int* address, Vector offsets, Vector data) => ScatterWithByteOffsetsNonTemporal(mask, address, offsets, data); /// /// void svstnt1_scatter_[s64]offset[_s64](svbool_t pg, int64_t *base, svint64_t offsets, svint64_t data) /// STNT1D Zdata.D, Pg, [Zoffsets.D, Xbase] /// - [RequiresUnsafe] public static unsafe void ScatterWithByteOffsetsNonTemporal(Vector mask, long* address, Vector offsets, Vector data) => ScatterWithByteOffsetsNonTemporal(mask, address, offsets, data); /// /// void svstnt1_scatter_[u64]offset[_s64](svbool_t pg, int64_t *base, svuint64_t offsets, svint64_t data) /// STNT1D Zdata.D, Pg, [Zoffsets.D, Xbase] /// - [RequiresUnsafe] public static unsafe void ScatterWithByteOffsetsNonTemporal(Vector mask, long* address, Vector offsets, Vector data) => ScatterWithByteOffsetsNonTemporal(mask, address, offsets, data); /// /// void svstnt1_scatter_[u32]offset[_f32](svbool_t pg, float32_t *base, svuint32_t offsets, svfloat32_t data) /// STNT1W Zdata.S, Pg, [Zoffsets.S, Xbase] /// - [RequiresUnsafe] public static unsafe void ScatterWithByteOffsetsNonTemporal(Vector mask, float* address, Vector offsets, Vector data) => ScatterWithByteOffsetsNonTemporal(mask, address, offsets, data); /// /// void svstnt1_scatter_[u32]offset[_u32](svbool_t pg, uint32_t *base, svuint32_t offsets, svuint32_t data) /// STNT1W Zdata.S, Pg, [Zoffsets.S, Xbase] /// - [RequiresUnsafe] public static unsafe void ScatterWithByteOffsetsNonTemporal(Vector mask, uint* address, Vector offsets, Vector data) => ScatterWithByteOffsetsNonTemporal(mask, address, offsets, data); /// /// void svstnt1_scatter_[s64]offset[_u64](svbool_t pg, uint64_t *base, svint64_t offsets, svuint64_t data) /// STNT1D Zdata.D, Pg, [Zoffsets.D, Xbase] /// - [RequiresUnsafe] public static unsafe void ScatterWithByteOffsetsNonTemporal(Vector mask, ulong* address, Vector offsets, Vector data) => ScatterWithByteOffsetsNonTemporal(mask, address, offsets, data); /// /// void svstnt1_scatter_[u64]offset[_u64](svbool_t pg, uint64_t *base, svuint64_t offsets, svuint64_t data) /// STNT1D Zdata.D, Pg, [Zoffsets.D, Xbase] /// - [RequiresUnsafe] public static unsafe void ScatterWithByteOffsetsNonTemporal(Vector mask, ulong* address, Vector offsets, Vector data) => ScatterWithByteOffsetsNonTemporal(mask, address, offsets, data); diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/ISimdVector_2.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/ISimdVector_2.cs index 10e1bf0bd2b1d4..be291362b84fad 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/ISimdVector_2.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/ISimdVector_2.cs @@ -523,14 +523,12 @@ static virtual TSelf CreateScalarUnsafe(T value) /// The source from which the vector will be loaded. /// The vector loaded from . /// The type of () is not supported. - [RequiresUnsafe] static virtual TSelf Load(T* source) => TSelf.LoadUnsafe(ref *source); /// Loads a vector from the given aligned source. /// The aligned source from which the vector will be loaded. /// The vector loaded from . /// The type of () is not supported. - [RequiresUnsafe] static virtual TSelf LoadAligned(T* source) { if (((nuint)(source) % (uint)(TSelf.Alignment)) != 0) @@ -545,7 +543,6 @@ static virtual TSelf LoadAligned(T* source) /// The vector loaded from . /// This method may bypass the cache on certain platforms. /// The type of () is not supported. - [RequiresUnsafe] static virtual TSelf LoadAlignedNonTemporal(T* source) => TSelf.LoadAligned(source); /// Loads a vector from the given source. @@ -722,14 +719,12 @@ static virtual TSelf LoadAligned(T* source) /// The vector that will be stored. /// The destination at which will be stored. /// The type of () is not supported. - [RequiresUnsafe] static virtual void Store(TSelf source, T* destination) => TSelf.StoreUnsafe(source, ref *destination); /// Stores a vector at the given aligned destination. /// The vector that will be stored. /// The aligned destination at which will be stored. /// The type of () is not supported. - [RequiresUnsafe] static virtual void StoreAligned(TSelf source, T* destination) { if (((nuint)(destination) % (uint)(TSelf.Alignment)) != 0) @@ -744,7 +739,6 @@ static virtual void StoreAligned(TSelf source, T* destination) /// The aligned destination at which will be stored. /// This method may bypass the cache on certain platforms. /// The type of () is not supported. - [RequiresUnsafe] static virtual void StoreAlignedNonTemporal(TSelf source, T* destination) => TSelf.StoreAligned(source, destination); /// Stores a vector at the given destination. diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/SimdVectorExtensions.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/SimdVectorExtensions.cs index 1b74541a0df34a..2b517455988d75 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/SimdVectorExtensions.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/SimdVectorExtensions.cs @@ -73,7 +73,6 @@ public static T GetElement(this TVector vector, int index) /// The vector that will be stored. /// The destination at which will be stored. /// The type of () is not supported. - [RequiresUnsafe] public static void Store(this TVector source, T* destination) where TVector : ISimdVector { @@ -86,7 +85,6 @@ public static void Store(this TVector source, T* destination) /// The vector that will be stored. /// The aligned destination at which will be stored. /// The type of () is not supported. - [RequiresUnsafe] public static void StoreAligned(this TVector source, T* destination) where TVector : ISimdVector { @@ -100,7 +98,6 @@ public static void StoreAligned(this TVector source, T* destination) /// The aligned destination at which will be stored. /// This method may bypass the cache on certain platforms. /// The type of () is not supported. - [RequiresUnsafe] public static void StoreAlignedNonTemporal(this TVector source, T* destination) where TVector : ISimdVector { diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector128.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector128.cs index 1cebc6f55a6b81..a7722fa8beffe4 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector128.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector128.cs @@ -2361,7 +2361,6 @@ public static bool LessThanOrEqualAny(Vector128 left, Vector128 right) /// The type of () is not supported. [Intrinsic] [CLSCompliant(false)] - [RequiresUnsafe] public static unsafe Vector128 Load(T* source) => LoadUnsafe(ref *source); /// Loads a vector from the given aligned source. @@ -2372,7 +2371,6 @@ public static bool LessThanOrEqualAny(Vector128 left, Vector128 right) [Intrinsic] [CLSCompliant(false)] [MethodImpl(MethodImplOptions.AggressiveInlining)] - [RequiresUnsafe] public static unsafe Vector128 LoadAligned(T* source) { ThrowHelper.ThrowForUnsupportedIntrinsicsVector128BaseType(); @@ -2393,7 +2391,6 @@ public static unsafe Vector128 LoadAligned(T* source) /// The type of () is not supported. [Intrinsic] [CLSCompliant(false)] - [RequiresUnsafe] public static unsafe Vector128 LoadAlignedNonTemporal(T* source) => LoadAligned(source); /// Loads a vector from the given source. @@ -3941,7 +3938,6 @@ public static Vector128 Sqrt(Vector128 vector) /// The type of () is not supported. [Intrinsic] [CLSCompliant(false)] - [RequiresUnsafe] public static unsafe void Store(this Vector128 source, T* destination) => source.StoreUnsafe(ref *destination); /// Stores a vector at the given aligned destination. @@ -3952,7 +3948,6 @@ public static Vector128 Sqrt(Vector128 vector) [Intrinsic] [CLSCompliant(false)] [MethodImpl(MethodImplOptions.AggressiveInlining)] - [RequiresUnsafe] public static unsafe void StoreAligned(this Vector128 source, T* destination) { ThrowHelper.ThrowForUnsupportedIntrinsicsVector128BaseType(); @@ -3973,7 +3968,6 @@ public static unsafe void StoreAligned(this Vector128 source, T* destinati /// The type of () is not supported. [Intrinsic] [CLSCompliant(false)] - [RequiresUnsafe] public static unsafe void StoreAlignedNonTemporal(this Vector128 source, T* destination) => source.StoreAligned(destination); /// diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector128_1.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector128_1.cs index e00dbbe7258076..7c8e8a8a75073d 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector128_1.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector128_1.cs @@ -725,17 +725,14 @@ static bool ISimdVector, T>.IsHardwareAccelerated /// [Intrinsic] - [RequiresUnsafe] static Vector128 ISimdVector, T>.Load(T* source) => Vector128.Load(source); /// [Intrinsic] - [RequiresUnsafe] static Vector128 ISimdVector, T>.LoadAligned(T* source) => Vector128.LoadAligned(source); /// [Intrinsic] - [RequiresUnsafe] static Vector128 ISimdVector, T>.LoadAlignedNonTemporal(T* source) => Vector128.LoadAlignedNonTemporal(source); /// @@ -836,17 +833,14 @@ static bool ISimdVector, T>.IsHardwareAccelerated /// [Intrinsic] - [RequiresUnsafe] static void ISimdVector, T>.Store(Vector128 source, T* destination) => source.Store(destination); /// [Intrinsic] - [RequiresUnsafe] static void ISimdVector, T>.StoreAligned(Vector128 source, T* destination) => source.StoreAligned(destination); /// [Intrinsic] - [RequiresUnsafe] static void ISimdVector, T>.StoreAlignedNonTemporal(Vector128 source, T* destination) => source.StoreAlignedNonTemporal(destination); /// diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector256.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector256.cs index cd446c7646ac03..da0b8bc061f5ec 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector256.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector256.cs @@ -2439,7 +2439,6 @@ public static bool LessThanOrEqualAny(Vector256 left, Vector256 right) /// The type of () is not supported. [Intrinsic] [CLSCompliant(false)] - [RequiresUnsafe] public static unsafe Vector256 Load(T* source) => LoadUnsafe(ref *source); /// Loads a vector from the given aligned source. @@ -2450,7 +2449,6 @@ public static bool LessThanOrEqualAny(Vector256 left, Vector256 right) [Intrinsic] [CLSCompliant(false)] [MethodImpl(MethodImplOptions.AggressiveInlining)] - [RequiresUnsafe] public static unsafe Vector256 LoadAligned(T* source) { ThrowHelper.ThrowForUnsupportedIntrinsicsVector256BaseType(); @@ -2471,7 +2469,6 @@ public static unsafe Vector256 LoadAligned(T* source) /// This method may bypass the cache on certain platforms. [Intrinsic] [CLSCompliant(false)] - [RequiresUnsafe] public static unsafe Vector256 LoadAlignedNonTemporal(T* source) => LoadAligned(source); /// Loads a vector from the given source. @@ -3919,7 +3916,6 @@ public static Vector256 Sqrt(Vector256 vector) /// The type of and () is not supported. [Intrinsic] [CLSCompliant(false)] - [RequiresUnsafe] public static unsafe void Store(this Vector256 source, T* destination) => source.StoreUnsafe(ref *destination); /// Stores a vector at the given aligned destination. @@ -3930,7 +3926,6 @@ public static Vector256 Sqrt(Vector256 vector) [Intrinsic] [CLSCompliant(false)] [MethodImpl(MethodImplOptions.AggressiveInlining)] - [RequiresUnsafe] public static unsafe void StoreAligned(this Vector256 source, T* destination) { ThrowHelper.ThrowForUnsupportedIntrinsicsVector256BaseType(); @@ -3951,7 +3946,6 @@ public static unsafe void StoreAligned(this Vector256 source, T* destinati /// This method may bypass the cache on certain platforms. [Intrinsic] [CLSCompliant(false)] - [RequiresUnsafe] public static unsafe void StoreAlignedNonTemporal(this Vector256 source, T* destination) => source.StoreAligned(destination); /// Stores a vector at the given destination. diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector256_1.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector256_1.cs index 0418b0d01a79bc..1e1e4e713a59d0 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector256_1.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector256_1.cs @@ -713,17 +713,14 @@ static bool ISimdVector, T>.IsHardwareAccelerated /// [Intrinsic] - [RequiresUnsafe] static Vector256 ISimdVector, T>.Load(T* source) => Vector256.Load(source); /// [Intrinsic] - [RequiresUnsafe] static Vector256 ISimdVector, T>.LoadAligned(T* source) => Vector256.LoadAligned(source); /// [Intrinsic] - [RequiresUnsafe] static Vector256 ISimdVector, T>.LoadAlignedNonTemporal(T* source) => Vector256.LoadAlignedNonTemporal(source); /// @@ -824,17 +821,14 @@ static bool ISimdVector, T>.IsHardwareAccelerated /// [Intrinsic] - [RequiresUnsafe] static void ISimdVector, T>.Store(Vector256 source, T* destination) => source.Store(destination); /// [Intrinsic] - [RequiresUnsafe] static void ISimdVector, T>.StoreAligned(Vector256 source, T* destination) => source.StoreAligned(destination); /// [Intrinsic] - [RequiresUnsafe] static void ISimdVector, T>.StoreAlignedNonTemporal(Vector256 source, T* destination) => source.StoreAlignedNonTemporal(destination); /// diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector512.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector512.cs index 6e71109c3ab9c5..c3b4e2ee371f55 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector512.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector512.cs @@ -2458,7 +2458,6 @@ public static bool LessThanOrEqualAny(Vector512 left, Vector512 right) /// The type of () is not supported. [Intrinsic] [CLSCompliant(false)] - [RequiresUnsafe] public static unsafe Vector512 Load(T* source) => LoadUnsafe(ref *source); /// Loads a vector from the given aligned source. @@ -2469,7 +2468,6 @@ public static bool LessThanOrEqualAny(Vector512 left, Vector512 right) [Intrinsic] [CLSCompliant(false)] [MethodImpl(MethodImplOptions.AggressiveInlining)] - [RequiresUnsafe] public static unsafe Vector512 LoadAligned(T* source) { ThrowHelper.ThrowForUnsupportedIntrinsicsVector512BaseType(); @@ -2490,7 +2488,6 @@ public static unsafe Vector512 LoadAligned(T* source) /// This method may bypass the cache on certain platforms. [Intrinsic] [CLSCompliant(false)] - [RequiresUnsafe] public static unsafe Vector512 LoadAlignedNonTemporal(T* source) => LoadAligned(source); /// Loads a vector from the given source. @@ -3923,7 +3920,6 @@ public static Vector512 Sqrt(Vector512 vector) /// The type of and () is not supported. [Intrinsic] [CLSCompliant(false)] - [RequiresUnsafe] public static unsafe void Store(this Vector512 source, T* destination) => source.StoreUnsafe(ref *destination); /// Stores a vector at the given aligned destination. @@ -3934,7 +3930,6 @@ public static Vector512 Sqrt(Vector512 vector) [Intrinsic] [CLSCompliant(false)] [MethodImpl(MethodImplOptions.AggressiveInlining)] - [RequiresUnsafe] public static unsafe void StoreAligned(this Vector512 source, T* destination) { ThrowHelper.ThrowForUnsupportedIntrinsicsVector512BaseType(); @@ -3955,7 +3950,6 @@ public static unsafe void StoreAligned(this Vector512 source, T* destinati /// This method may bypass the cache on certain platforms. [Intrinsic] [CLSCompliant(false)] - [RequiresUnsafe] public static unsafe void StoreAlignedNonTemporal(this Vector512 source, T* destination) => source.StoreAligned(destination); /// Stores a vector at the given destination. diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector512_1.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector512_1.cs index 3841113a21ec11..eec2be8a3f79fb 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector512_1.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector512_1.cs @@ -713,17 +713,14 @@ static bool ISimdVector, T>.IsHardwareAccelerated /// [Intrinsic] - [RequiresUnsafe] static Vector512 ISimdVector, T>.Load(T* source) => Vector512.Load(source); /// [Intrinsic] - [RequiresUnsafe] static Vector512 ISimdVector, T>.LoadAligned(T* source) => Vector512.LoadAligned(source); /// [Intrinsic] - [RequiresUnsafe] static Vector512 ISimdVector, T>.LoadAlignedNonTemporal(T* source) => Vector512.LoadAlignedNonTemporal(source); /// @@ -824,17 +821,14 @@ static bool ISimdVector, T>.IsHardwareAccelerated /// [Intrinsic] - [RequiresUnsafe] static void ISimdVector, T>.Store(Vector512 source, T* destination) => source.Store(destination); /// [Intrinsic] - [RequiresUnsafe] static void ISimdVector, T>.StoreAligned(Vector512 source, T* destination) => source.StoreAligned(destination); /// [Intrinsic] - [RequiresUnsafe] static void ISimdVector, T>.StoreAlignedNonTemporal(Vector512 source, T* destination) => source.StoreAlignedNonTemporal(destination); /// diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector64.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector64.cs index 8655d9778f0529..625c96d231e7af 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector64.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector64.cs @@ -2339,7 +2339,6 @@ public static bool LessThanOrEqualAny(Vector64 left, Vector64 right) /// The type of () is not supported. [Intrinsic] [CLSCompliant(false)] - [RequiresUnsafe] public static unsafe Vector64 Load(T* source) => LoadUnsafe(ref *source); /// Loads a vector from the given aligned source. @@ -2350,7 +2349,6 @@ public static bool LessThanOrEqualAny(Vector64 left, Vector64 right) [Intrinsic] [CLSCompliant(false)] [MethodImpl(MethodImplOptions.AggressiveInlining)] - [RequiresUnsafe] public static unsafe Vector64 LoadAligned(T* source) { ThrowHelper.ThrowForUnsupportedIntrinsicsVector64BaseType(); @@ -2371,7 +2369,6 @@ public static unsafe Vector64 LoadAligned(T* source) /// The type of () is not supported. [Intrinsic] [CLSCompliant(false)] - [RequiresUnsafe] public static unsafe Vector64 LoadAlignedNonTemporal(T* source) => LoadAligned(source); /// Loads a vector from the given source. @@ -3845,7 +3842,6 @@ public static Vector64 Sqrt(Vector64 vector) /// The type of () is not supported. [Intrinsic] [CLSCompliant(false)] - [RequiresUnsafe] public static unsafe void Store(this Vector64 source, T* destination) => source.StoreUnsafe(ref *destination); /// Stores a vector at the given aligned destination. @@ -3856,7 +3852,6 @@ public static Vector64 Sqrt(Vector64 vector) [Intrinsic] [CLSCompliant(false)] [MethodImpl(MethodImplOptions.AggressiveInlining)] - [RequiresUnsafe] public static unsafe void StoreAligned(this Vector64 source, T* destination) { ThrowHelper.ThrowForUnsupportedIntrinsicsVector64BaseType(); @@ -3877,7 +3872,6 @@ public static unsafe void StoreAligned(this Vector64 source, T* destinatio /// The type of () is not supported. [Intrinsic] [CLSCompliant(false)] - [RequiresUnsafe] public static unsafe void StoreAlignedNonTemporal(this Vector64 source, T* destination) => source.StoreAligned(destination); /// Stores a vector at the given destination. diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector64_1.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector64_1.cs index df7a7dafddd0f2..e06b50891fba28 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector64_1.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector64_1.cs @@ -782,17 +782,14 @@ static bool ISimdVector, T>.IsHardwareAccelerated /// [Intrinsic] - [RequiresUnsafe] static Vector64 ISimdVector, T>.Load(T* source) => Vector64.Load(source); /// [Intrinsic] - [RequiresUnsafe] static Vector64 ISimdVector, T>.LoadAligned(T* source) => Vector64.LoadAligned(source); /// [Intrinsic] - [RequiresUnsafe] static Vector64 ISimdVector, T>.LoadAlignedNonTemporal(T* source) => Vector64.LoadAlignedNonTemporal(source); /// @@ -893,17 +890,14 @@ static bool ISimdVector, T>.IsHardwareAccelerated /// [Intrinsic] - [RequiresUnsafe] static void ISimdVector, T>.Store(Vector64 source, T* destination) => source.Store(destination); /// [Intrinsic] - [RequiresUnsafe] static void ISimdVector, T>.StoreAligned(Vector64 source, T* destination) => source.StoreAligned(destination); /// [Intrinsic] - [RequiresUnsafe] static void ISimdVector, T>.StoreAlignedNonTemporal(Vector64 source, T* destination) => source.StoreAlignedNonTemporal(destination); /// diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Wasm/PackedSimd.PlatformNotSupported.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Wasm/PackedSimd.PlatformNotSupported.cs index 8157d1bc2c619e..e6dcdc0afb935d 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Wasm/PackedSimd.PlatformNotSupported.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Wasm/PackedSimd.PlatformNotSupported.cs @@ -395,228 +395,154 @@ public abstract class PackedSimd // Load - [RequiresUnsafe] public static unsafe Vector128 LoadVector128(sbyte* address) { throw new PlatformNotSupportedException(); } - [RequiresUnsafe] public static unsafe Vector128 LoadVector128(byte* address) { throw new PlatformNotSupportedException(); } - [RequiresUnsafe] public static unsafe Vector128 LoadVector128(short* address) { throw new PlatformNotSupportedException(); } - [RequiresUnsafe] public static unsafe Vector128 LoadVector128(ushort* address) { throw new PlatformNotSupportedException(); } - [RequiresUnsafe] public static unsafe Vector128 LoadVector128(int* address) { throw new PlatformNotSupportedException(); } - [RequiresUnsafe] public static unsafe Vector128 LoadVector128(uint* address) { throw new PlatformNotSupportedException(); } - [RequiresUnsafe] public static unsafe Vector128 LoadVector128(long* address) { throw new PlatformNotSupportedException(); } - [RequiresUnsafe] public static unsafe Vector128 LoadVector128(ulong* address) { throw new PlatformNotSupportedException(); } - [RequiresUnsafe] public static unsafe Vector128 LoadVector128(float* address) { throw new PlatformNotSupportedException(); } - [RequiresUnsafe] public static unsafe Vector128 LoadVector128(double* address) { throw new PlatformNotSupportedException(); } - [RequiresUnsafe] public static unsafe Vector128 LoadVector128(nint* address) { throw new PlatformNotSupportedException(); } - [RequiresUnsafe] public static unsafe Vector128 LoadVector128(nuint* address) { throw new PlatformNotSupportedException(); } - [RequiresUnsafe] public static unsafe Vector128 LoadScalarVector128(int* address) { throw new PlatformNotSupportedException(); } - [RequiresUnsafe] public static unsafe Vector128 LoadScalarVector128(uint* address) { throw new PlatformNotSupportedException(); } - [RequiresUnsafe] public static unsafe Vector128 LoadScalarVector128(long* address) { throw new PlatformNotSupportedException(); } - [RequiresUnsafe] public static unsafe Vector128 LoadScalarVector128(ulong* address) { throw new PlatformNotSupportedException(); } - [RequiresUnsafe] public static unsafe Vector128 LoadScalarVector128(float* address) { throw new PlatformNotSupportedException(); } - [RequiresUnsafe] public static unsafe Vector128 LoadScalarVector128(double* address) { throw new PlatformNotSupportedException(); } - [RequiresUnsafe] public static unsafe Vector128 LoadScalarVector128(nint* address) { throw new PlatformNotSupportedException(); } - [RequiresUnsafe] public static unsafe Vector128 LoadScalarVector128(nuint* address) { throw new PlatformNotSupportedException(); } - [RequiresUnsafe] public static unsafe Vector128 LoadScalarAndSplatVector128(sbyte* address) { throw new PlatformNotSupportedException(); } - [RequiresUnsafe] public static unsafe Vector128 LoadScalarAndSplatVector128(byte* address) { throw new PlatformNotSupportedException(); } - [RequiresUnsafe] public static unsafe Vector128 LoadScalarAndSplatVector128(short* address) { throw new PlatformNotSupportedException(); } - [RequiresUnsafe] public static unsafe Vector128 LoadScalarAndSplatVector128(ushort* address) { throw new PlatformNotSupportedException(); } - [RequiresUnsafe] public static unsafe Vector128 LoadScalarAndSplatVector128(int* address) { throw new PlatformNotSupportedException(); } - [RequiresUnsafe] public static unsafe Vector128 LoadScalarAndSplatVector128(uint* address) { throw new PlatformNotSupportedException(); } - [RequiresUnsafe] public static unsafe Vector128 LoadScalarAndSplatVector128(long* address) { throw new PlatformNotSupportedException(); } - [RequiresUnsafe] public static unsafe Vector128 LoadScalarAndSplatVector128(ulong* address) { throw new PlatformNotSupportedException(); } - [RequiresUnsafe] public static unsafe Vector128 LoadScalarAndSplatVector128(float* address) { throw new PlatformNotSupportedException(); } - [RequiresUnsafe] public static unsafe Vector128 LoadScalarAndSplatVector128(double* address) { throw new PlatformNotSupportedException(); } - [RequiresUnsafe] public static unsafe Vector128 LoadScalarAndSplatVector128(nint* address) { throw new PlatformNotSupportedException(); } - [RequiresUnsafe] public static unsafe Vector128 LoadScalarAndSplatVector128(nuint* address) { throw new PlatformNotSupportedException(); } - [RequiresUnsafe] public static unsafe Vector128 LoadScalarAndInsert(sbyte* address, Vector128 vector, [ConstantExpected(Max = (byte)(15))] byte index) { throw new PlatformNotSupportedException(); } - [RequiresUnsafe] public static unsafe Vector128 LoadScalarAndInsert(byte* address, Vector128 vector, [ConstantExpected(Max = (byte)(15))] byte index) { throw new PlatformNotSupportedException(); } - [RequiresUnsafe] public static unsafe Vector128 LoadScalarAndInsert(short* address, Vector128 vector, [ConstantExpected(Max = (byte)(7))] byte index) { throw new PlatformNotSupportedException(); } - [RequiresUnsafe] public static unsafe Vector128 LoadScalarAndInsert(ushort* address, Vector128 vector, [ConstantExpected(Max = (byte)(7))] byte index) { throw new PlatformNotSupportedException(); } - [RequiresUnsafe] public static unsafe Vector128 LoadScalarAndInsert(int* address, Vector128 vector, [ConstantExpected(Max = (byte)(3))] byte index) { throw new PlatformNotSupportedException(); } - [RequiresUnsafe] public static unsafe Vector128 LoadScalarAndInsert(uint* address, Vector128 vector, [ConstantExpected(Max = (byte)(3))] byte index) { throw new PlatformNotSupportedException(); } - [RequiresUnsafe] public static unsafe Vector128 LoadScalarAndInsert(long* address, Vector128 vector, [ConstantExpected(Max = (byte)(1))] byte index) { throw new PlatformNotSupportedException(); } - [RequiresUnsafe] public static unsafe Vector128 LoadScalarAndInsert(ulong* address, Vector128 vector, [ConstantExpected(Max = (byte)(1))] byte index) { throw new PlatformNotSupportedException(); } - [RequiresUnsafe] public static unsafe Vector128 LoadScalarAndInsert(float* address, Vector128 vector, [ConstantExpected(Max = (byte)(3))] byte index) { throw new PlatformNotSupportedException(); } - [RequiresUnsafe] public static unsafe Vector128 LoadScalarAndInsert(double* address, Vector128 vector, [ConstantExpected(Max = (byte)(1))] byte index) { throw new PlatformNotSupportedException(); } - [RequiresUnsafe] public static unsafe Vector128 LoadScalarAndInsert(nint* address, Vector128 vector, [ConstantExpected(Max = (byte)(3))] byte index) { throw new PlatformNotSupportedException(); } - [RequiresUnsafe] public static unsafe Vector128 LoadScalarAndInsert(nuint* address, Vector128 vector, [ConstantExpected(Max = (byte)(3))] byte index) { throw new PlatformNotSupportedException(); } - [RequiresUnsafe] public static unsafe Vector128 LoadWideningVector128(sbyte* address) { throw new PlatformNotSupportedException(); } - [RequiresUnsafe] public static unsafe Vector128 LoadWideningVector128(byte* address) { throw new PlatformNotSupportedException(); } - [RequiresUnsafe] public static unsafe Vector128 LoadWideningVector128(short* address) { throw new PlatformNotSupportedException(); } - [RequiresUnsafe] public static unsafe Vector128 LoadWideningVector128(ushort* address) { throw new PlatformNotSupportedException(); } - [RequiresUnsafe] public static unsafe Vector128 LoadWideningVector128(int* address) { throw new PlatformNotSupportedException(); } - [RequiresUnsafe] public static unsafe Vector128 LoadWideningVector128(uint* address) { throw new PlatformNotSupportedException(); } // Store - [RequiresUnsafe] public static unsafe void Store(sbyte* address, Vector128 source) { throw new PlatformNotSupportedException(); } - [RequiresUnsafe] public static unsafe void Store(byte* address, Vector128 source) { throw new PlatformNotSupportedException(); } - [RequiresUnsafe] public static unsafe void Store(short* address, Vector128 source) { throw new PlatformNotSupportedException(); } - [RequiresUnsafe] public static unsafe void Store(ushort* address, Vector128 source) { throw new PlatformNotSupportedException(); } - [RequiresUnsafe] public static unsafe void Store(int* address, Vector128 source) { throw new PlatformNotSupportedException(); } - [RequiresUnsafe] public static unsafe void Store(uint* address, Vector128 source) { throw new PlatformNotSupportedException(); } - [RequiresUnsafe] public static unsafe void Store(long* address, Vector128 source) { throw new PlatformNotSupportedException(); } - [RequiresUnsafe] public static unsafe void Store(ulong* address, Vector128 source) { throw new PlatformNotSupportedException(); } - [RequiresUnsafe] public static unsafe void Store(float* address, Vector128 source) { throw new PlatformNotSupportedException(); } - [RequiresUnsafe] public static unsafe void Store(double* address, Vector128 source) { throw new PlatformNotSupportedException(); } - [RequiresUnsafe] public static unsafe void Store(nint* address, Vector128 source) { throw new PlatformNotSupportedException(); } - [RequiresUnsafe] public static unsafe void Store(nuint* address, Vector128 source) { throw new PlatformNotSupportedException(); } - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(sbyte* address, Vector128 source, [ConstantExpected(Max = (byte)(15))] byte index) { throw new PlatformNotSupportedException(); } // takes ImmLaneIdx16 - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(byte* address, Vector128 source, [ConstantExpected(Max = (byte)(15))] byte index) { throw new PlatformNotSupportedException(); } // takes ImmLaneIdx16 - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(short* address, Vector128 source, [ConstantExpected(Max = (byte)(7))] byte index) { throw new PlatformNotSupportedException(); } // takes ImmLaneIdx8 - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(ushort* address, Vector128 source, [ConstantExpected(Max = (byte)(7))] byte index) { throw new PlatformNotSupportedException(); } // takes ImmLaneIdx8 - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(int* address, Vector128 source, [ConstantExpected(Max = (byte)(3))] byte index) { throw new PlatformNotSupportedException(); } // takes ImmLaneIdx4 - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(uint* address, Vector128 source, [ConstantExpected(Max = (byte)(3))] byte index) { throw new PlatformNotSupportedException(); } // takes ImmLaneIdx4 - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(long* address, Vector128 source, [ConstantExpected(Max = (byte)(1))] byte index) { throw new PlatformNotSupportedException(); } // takes ImmLaneIdx2 - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(ulong* address, Vector128 source, [ConstantExpected(Max = (byte)(1))] byte index) { throw new PlatformNotSupportedException(); } // takes ImmLaneIdx2 - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(float* address, Vector128 source, [ConstantExpected(Max = (byte)(3))] byte index) { throw new PlatformNotSupportedException(); } // takes ImmLaneIdx4 - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(double* address, Vector128 source, [ConstantExpected(Max = (byte)(1))] byte index) { throw new PlatformNotSupportedException(); } // takes ImmLaneIdx2 - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(nint* address, Vector128 source, [ConstantExpected(Max = (byte)(3))] byte index) { throw new PlatformNotSupportedException(); } - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(nuint* address, Vector128 source, [ConstantExpected(Max = (byte)(3))] byte index) { throw new PlatformNotSupportedException(); } // Floating-point sign bit operations diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Wasm/PackedSimd.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Wasm/PackedSimd.cs index 86263058b08299..278d8a94a5fc33 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Wasm/PackedSimd.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Wasm/PackedSimd.cs @@ -1044,307 +1044,233 @@ public abstract class PackedSimd /// v128.load [Intrinsic] - [RequiresUnsafe] public static unsafe Vector128 LoadVector128(sbyte* address) => LoadVector128(address); /// v128.load [Intrinsic] - [RequiresUnsafe] public static unsafe Vector128 LoadVector128(byte* address) => LoadVector128(address); /// v128.load [Intrinsic] - [RequiresUnsafe] public static unsafe Vector128 LoadVector128(short* address) => LoadVector128(address); /// v128.load [Intrinsic] - [RequiresUnsafe] public static unsafe Vector128 LoadVector128(ushort* address) => LoadVector128(address); /// v128.load [Intrinsic] - [RequiresUnsafe] public static unsafe Vector128 LoadVector128(int* address) => LoadVector128(address); /// v128.load [Intrinsic] - [RequiresUnsafe] public static unsafe Vector128 LoadVector128(uint* address) => LoadVector128(address); /// v128.load [Intrinsic] - [RequiresUnsafe] public static unsafe Vector128 LoadVector128(long* address) => LoadVector128(address); /// v128.load [Intrinsic] - [RequiresUnsafe] public static unsafe Vector128 LoadVector128(ulong* address) => LoadVector128(address); /// v128.load [Intrinsic] - [RequiresUnsafe] public static unsafe Vector128 LoadVector128(float* address) => LoadVector128(address); /// v128.load [Intrinsic] - [RequiresUnsafe] public static unsafe Vector128 LoadVector128(double* address) => LoadVector128(address); /// v128.load [Intrinsic] - [RequiresUnsafe] public static unsafe Vector128 LoadVector128(nint* address) => LoadVector128(address); /// v128.load [Intrinsic] - [RequiresUnsafe] public static unsafe Vector128 LoadVector128(nuint* address) => LoadVector128(address); /// v128.load32.zero [Intrinsic] - [RequiresUnsafe] public static unsafe Vector128 LoadScalarVector128(int* address) => LoadScalarVector128(address); /// v128.load32.zero [Intrinsic] - [RequiresUnsafe] public static unsafe Vector128 LoadScalarVector128(uint* address) => LoadScalarVector128(address); /// v128.load64.zero [Intrinsic] - [RequiresUnsafe] public static unsafe Vector128 LoadScalarVector128(long* address) => LoadScalarVector128(address); /// v128.load64.zero [Intrinsic] - [RequiresUnsafe] public static unsafe Vector128 LoadScalarVector128(ulong* address) => LoadScalarVector128(address); /// v128.load32.zero [Intrinsic] - [RequiresUnsafe] public static unsafe Vector128 LoadScalarVector128(float* address) => LoadScalarVector128(address); /// v128.load64.zero [Intrinsic] - [RequiresUnsafe] public static unsafe Vector128 LoadScalarVector128(double* address) => LoadScalarVector128(address); /// v128.load32.zero [Intrinsic] - [RequiresUnsafe] public static unsafe Vector128 LoadScalarVector128(nint* address) => LoadScalarVector128(address); /// v128.load32.zero [Intrinsic] - [RequiresUnsafe] public static unsafe Vector128 LoadScalarVector128(nuint* address) => LoadScalarVector128(address); /// v128.load8_splat [Intrinsic] - [RequiresUnsafe] public static unsafe Vector128 LoadScalarAndSplatVector128(sbyte* address) => LoadScalarAndSplatVector128(address); /// v128.load8_splat [Intrinsic] - [RequiresUnsafe] public static unsafe Vector128 LoadScalarAndSplatVector128(byte* address) => LoadScalarAndSplatVector128(address); /// v128.load16_splat [Intrinsic] - [RequiresUnsafe] public static unsafe Vector128 LoadScalarAndSplatVector128(short* address) => LoadScalarAndSplatVector128(address); /// v128.load16_splat [Intrinsic] - [RequiresUnsafe] public static unsafe Vector128 LoadScalarAndSplatVector128(ushort* address) => LoadScalarAndSplatVector128(address); /// v128.load32_splat [Intrinsic] - [RequiresUnsafe] public static unsafe Vector128 LoadScalarAndSplatVector128(int* address) => LoadScalarAndSplatVector128(address); /// v128.load32_splat [Intrinsic] - [RequiresUnsafe] public static unsafe Vector128 LoadScalarAndSplatVector128(uint* address) => LoadScalarAndSplatVector128(address); /// v128.load64_splat [Intrinsic] - [RequiresUnsafe] public static unsafe Vector128 LoadScalarAndSplatVector128(long* address) => LoadScalarAndSplatVector128(address); /// v128.load64_splat [Intrinsic] - [RequiresUnsafe] public static unsafe Vector128 LoadScalarAndSplatVector128(ulong* address) => LoadScalarAndSplatVector128(address); /// v128.load64_splat [Intrinsic] - [RequiresUnsafe] public static unsafe Vector128 LoadScalarAndSplatVector128(float* address) => LoadScalarAndSplatVector128(address); /// v128.load64_splat [Intrinsic] - [RequiresUnsafe] public static unsafe Vector128 LoadScalarAndSplatVector128(double* address) => LoadScalarAndSplatVector128(address); /// v128.load64_splat [Intrinsic] - [RequiresUnsafe] public static unsafe Vector128 LoadScalarAndSplatVector128(nint* address) => LoadScalarAndSplatVector128(address); /// v128.load64_splat [Intrinsic] - [RequiresUnsafe] public static unsafe Vector128 LoadScalarAndSplatVector128(nuint* address) => LoadScalarAndSplatVector128(address); /// v128.load8_lane [Intrinsic] - [RequiresUnsafe] public static unsafe Vector128 LoadScalarAndInsert(sbyte* address, Vector128 vector, [ConstantExpected(Max = (byte)(15))] byte index) => LoadScalarAndInsert(address, vector, index); // takes ImmLaneIdx16 /// v128.load8_lane [Intrinsic] - [RequiresUnsafe] public static unsafe Vector128 LoadScalarAndInsert(byte* address, Vector128 vector, [ConstantExpected(Max = (byte)(15))] byte index) => LoadScalarAndInsert(address, vector, index); // takes ImmLaneIdx16 /// v128.load16_lane [Intrinsic] - [RequiresUnsafe] public static unsafe Vector128 LoadScalarAndInsert(short* address, Vector128 vector, [ConstantExpected(Max = (byte)(7))] byte index) => LoadScalarAndInsert(address, vector, index); // takes ImmLaneIdx8 /// v128.load16_lane [Intrinsic] - [RequiresUnsafe] public static unsafe Vector128 LoadScalarAndInsert(ushort* address, Vector128 vector, [ConstantExpected(Max = (byte)(7))] byte index) => LoadScalarAndInsert(address, vector, index); // takes ImmLaneIdx8 /// v128.load32_lane [Intrinsic] - [RequiresUnsafe] public static unsafe Vector128 LoadScalarAndInsert(int* address, Vector128 vector, [ConstantExpected(Max = (byte)(3))] byte index) => LoadScalarAndInsert(address, vector, index); // takes ImmLaneIdx4 /// v128.load32_lane [Intrinsic] - [RequiresUnsafe] public static unsafe Vector128 LoadScalarAndInsert(uint* address, Vector128 vector, [ConstantExpected(Max = (byte)(3))] byte index) => LoadScalarAndInsert(address, vector, index); // takes ImmLaneIdx4 /// v128.load64_lane [Intrinsic] - [RequiresUnsafe] public static unsafe Vector128 LoadScalarAndInsert(long* address, Vector128 vector, [ConstantExpected(Max = (byte)(1))] byte index) => LoadScalarAndInsert(address, vector, index); // takes ImmLaneIdx2 /// v128.load64_lane [Intrinsic] - [RequiresUnsafe] public static unsafe Vector128 LoadScalarAndInsert(ulong* address, Vector128 vector, [ConstantExpected(Max = (byte)(1))] byte index) => LoadScalarAndInsert(address, vector, index); // takes ImmLaneIdx2 /// v128.load32_lane [Intrinsic] - [RequiresUnsafe] public static unsafe Vector128 LoadScalarAndInsert(float* address, Vector128 vector, [ConstantExpected(Max = (byte)(3))] byte index) => LoadScalarAndInsert(address, vector, index); // takes ImmLaneIdx4 /// v128.load64_lane [Intrinsic] - [RequiresUnsafe] public static unsafe Vector128 LoadScalarAndInsert(double* address, Vector128 vector, [ConstantExpected(Max = (byte)(1))] byte index) => LoadScalarAndInsert(address, vector, index); // takes ImmLaneIdx2 /// v128.load32_lane [Intrinsic] - [RequiresUnsafe] public static unsafe Vector128 LoadScalarAndInsert(nint* address, Vector128 vector, [ConstantExpected(Max = (byte)(3))] byte index) => LoadScalarAndInsert(address, vector, index); // takes ImmLaneIdx4 /// v128.load32_lane [Intrinsic] - [RequiresUnsafe] public static unsafe Vector128 LoadScalarAndInsert(nuint* address, Vector128 vector, [ConstantExpected(Max = (byte)(3))] byte index) => LoadScalarAndInsert(address, vector, index); // takes ImmLaneIdx4 // Store /// v128.store [Intrinsic] - [RequiresUnsafe] public static unsafe void Store(sbyte* address, Vector128 source) => Store(address, source); /// v128.store [Intrinsic] - [RequiresUnsafe] public static unsafe void Store(byte* address, Vector128 source) => Store(address, source); /// v128.store [Intrinsic] - [RequiresUnsafe] public static unsafe void Store(short* address, Vector128 source) => Store(address, source); /// v128.store [Intrinsic] - [RequiresUnsafe] public static unsafe void Store(ushort* address, Vector128 source) => Store(address, source); /// v128.store [Intrinsic] - [RequiresUnsafe] public static unsafe void Store(int* address, Vector128 source) => Store(address, source); /// v128.store [Intrinsic] - [RequiresUnsafe] public static unsafe void Store(uint* address, Vector128 source) => Store(address, source); /// v128.store [Intrinsic] - [RequiresUnsafe] public static unsafe void Store(long* address, Vector128 source) => Store(address, source); /// v128.store [Intrinsic] - [RequiresUnsafe] public static unsafe void Store(ulong* address, Vector128 source) => Store(address, source); /// v128.store [Intrinsic] - [RequiresUnsafe] public static unsafe void Store(float* address, Vector128 source) => Store(address, source); /// v128.store [Intrinsic] - [RequiresUnsafe] public static unsafe void Store(double* address, Vector128 source) => Store(address, source); /// v128.store [Intrinsic] - [RequiresUnsafe] public static unsafe void Store(nint* address, Vector128 source) => Store(address, source); /// v128.store [Intrinsic] - [RequiresUnsafe] public static unsafe void Store(nuint* address, Vector128 source) => Store(address, source); /// v128.store8_lane [Intrinsic] - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(sbyte* address, Vector128 source, [ConstantExpected(Max = (byte)(15))] byte index) => StoreSelectedScalar(address, source, index); // takes ImmLaneIdx16 /// v128.store8_lane [Intrinsic] - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(byte* address, Vector128 source, [ConstantExpected(Max = (byte)(15))] byte index) => StoreSelectedScalar(address, source, index); // takes ImmLaneIdx16 /// v128.store16_lane [Intrinsic] - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(short* address, Vector128 source, [ConstantExpected(Max = (byte)(7))] byte index) => StoreSelectedScalar(address, source, index); // takes ImmLaneIdx8 /// v128.store16_lane [Intrinsic] - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(ushort* address, Vector128 source, [ConstantExpected(Max = (byte)(7))] byte index) => StoreSelectedScalar(address, source, index); // takes ImmLaneIdx8 /// v128.store32_lane [Intrinsic] - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(int* address, Vector128 source, [ConstantExpected(Max = (byte)(3))] byte index) => StoreSelectedScalar(address, source, index); // takes ImmLaneIdx4 /// v128.store32_lane [Intrinsic] - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(uint* address, Vector128 source, [ConstantExpected(Max = (byte)(3))] byte index) => StoreSelectedScalar(address, source, index); // takes ImmLaneIdx4 /// v128.store64_lane [Intrinsic] - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(long* address, Vector128 source, [ConstantExpected(Max = (byte)(1))] byte index) => StoreSelectedScalar(address, source, index); // takes ImmLaneIdx2 /// v128.store64_lane [Intrinsic] - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(ulong* address, Vector128 source, [ConstantExpected(Max = (byte)(1))] byte index) => StoreSelectedScalar(address, source, index); // takes ImmLaneIdx2 /// v128.store32_lane [Intrinsic] - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(float* address, Vector128 source, [ConstantExpected(Max = (byte)(3))] byte index) => StoreSelectedScalar(address, source, index); // takes ImmLaneIdx4 /// v128.store64_lane [Intrinsic] - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(double* address, Vector128 source, [ConstantExpected(Max = (byte)(1))] byte index) => StoreSelectedScalar(address, source, index); // takes ImmLaneIdx2 /// v128.store32_lane [Intrinsic] - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(nint* address, Vector128 source, [ConstantExpected(Max = (byte)(3))] byte index) => StoreSelectedScalar(address, source, index); /// v128.store32_lane [Intrinsic] - [RequiresUnsafe] public static unsafe void StoreSelectedScalar(nuint* address, Vector128 source, [ConstantExpected(Max = (byte)(3))] byte index) => StoreSelectedScalar(address, source, index); /// v128.load8x8_s [Intrinsic] - [RequiresUnsafe] public static unsafe Vector128 LoadWideningVector128(sbyte* address) => LoadWideningVector128(address); /// v128.load8x8_u [Intrinsic] - [RequiresUnsafe] public static unsafe Vector128 LoadWideningVector128(byte* address) => LoadWideningVector128(address); /// v128.load16x4_s [Intrinsic] - [RequiresUnsafe] public static unsafe Vector128 LoadWideningVector128(short* address) => LoadWideningVector128(address); /// v128.load16x4_u [Intrinsic] - [RequiresUnsafe] public static unsafe Vector128 LoadWideningVector128(ushort* address) => LoadWideningVector128(address); /// v128.load32x2_s [Intrinsic] - [RequiresUnsafe] public static unsafe Vector128 LoadWideningVector128(int* address) => LoadWideningVector128(address); /// v128.load32x2_u [Intrinsic] - [RequiresUnsafe] public static unsafe Vector128 LoadWideningVector128(uint* address) => LoadWideningVector128(address); // Floating-point sign bit operations diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Avx.PlatformNotSupported.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Avx.PlatformNotSupported.cs index 1ae15eeb3857c0..e16db173888f17 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Avx.PlatformNotSupported.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Avx.PlatformNotSupported.cs @@ -107,7 +107,6 @@ internal X64() { } /// VBROADCASTSS xmm1, m32 /// VBROADCASTSS xmm1 {k1}{z}, m32 /// - [RequiresUnsafe] public static unsafe Vector128 BroadcastScalarToVector128(float* source) { throw new PlatformNotSupportedException(); } /// @@ -115,14 +114,12 @@ internal X64() { } /// VBROADCASTSS ymm1, m32 /// VBROADCASTSS ymm1 {k1}{z}, m32 /// - [RequiresUnsafe] public static unsafe Vector256 BroadcastScalarToVector256(float* source) { throw new PlatformNotSupportedException(); } /// /// __m256d _mm256_broadcast_sd (double const * mem_addr) /// VBROADCASTSD ymm1, m64 /// VBROADCASTSD ymm1 {k1}{z}, m64 /// - [RequiresUnsafe] public static unsafe Vector256 BroadcastScalarToVector256(double* source) { throw new PlatformNotSupportedException(); } /// @@ -130,14 +127,12 @@ internal X64() { } /// VBROADCASTF128 ymm1, m128 /// VBROADCASTF32x4 ymm1 {k1}{z}, m128 /// - [RequiresUnsafe] public static unsafe Vector256 BroadcastVector128ToVector256(float* address) { throw new PlatformNotSupportedException(); } /// /// __m256d _mm256_broadcast_pd (__m128d const * mem_addr) /// VBROADCASTF128 ymm1, m128 /// VBROADCASTF64x2 ymm1 {k1}{z}, m128 /// - [RequiresUnsafe] public static unsafe Vector256 BroadcastVector128ToVector256(double* address) { throw new PlatformNotSupportedException(); } /// @@ -578,119 +573,101 @@ internal X64() { } /// VMOVDQA ymm1, m256 /// VMOVDQA32 ymm1 {k1}{z}, m256 /// - [RequiresUnsafe] public static unsafe Vector256 LoadAlignedVector256(sbyte* address) { throw new PlatformNotSupportedException(); } /// /// __m256i _mm256_load_si256 (__m256i const * mem_addr) /// VMOVDQA ymm1, m256 /// VMOVDQA32 ymm1 {k1}{z}, m256 /// - [RequiresUnsafe] public static unsafe Vector256 LoadAlignedVector256(byte* address) { throw new PlatformNotSupportedException(); } /// /// __m256i _mm256_load_si256 (__m256i const * mem_addr) /// VMOVDQA ymm1, m256 /// VMOVDQA32 ymm1 {k1}{z}, m256 /// - [RequiresUnsafe] public static unsafe Vector256 LoadAlignedVector256(short* address) { throw new PlatformNotSupportedException(); } /// /// __m256i _mm256_load_si256 (__m256i const * mem_addr) /// VMOVDQA ymm1, m256 /// VMOVDQA32 ymm1 {k1}{z}, m256 /// - [RequiresUnsafe] public static unsafe Vector256 LoadAlignedVector256(ushort* address) { throw new PlatformNotSupportedException(); } /// /// __m256i _mm256_load_si256 (__m256i const * mem_addr) /// VMOVDQA ymm1, m256 /// VMOVDQA32 ymm1 {k1}{z}, m256 /// - [RequiresUnsafe] public static unsafe Vector256 LoadAlignedVector256(int* address) { throw new PlatformNotSupportedException(); } /// /// __m256i _mm256_load_si256 (__m256i const * mem_addr) /// VMOVDQA ymm1, m256 /// VMOVDQA32 ymm1 {k1}{z}, m256 /// - [RequiresUnsafe] public static unsafe Vector256 LoadAlignedVector256(uint* address) { throw new PlatformNotSupportedException(); } /// /// __m256i _mm256_load_si256 (__m256i const * mem_addr) /// VMOVDQA ymm1, m256 /// VMOVDQA64 ymm1 {k1}{z}, m256 /// - [RequiresUnsafe] public static unsafe Vector256 LoadAlignedVector256(long* address) { throw new PlatformNotSupportedException(); } /// /// __m256i _mm256_load_si256 (__m256i const * mem_addr) /// VMOVDQA ymm1, m256 /// VMOVDQA64 ymm1 {k1}{z}, m256 /// - [RequiresUnsafe] public static unsafe Vector256 LoadAlignedVector256(ulong* address) { throw new PlatformNotSupportedException(); } /// /// __m256 _mm256_load_ps (float const * mem_addr) /// VMOVAPS ymm1, m256 /// VMOVAPS ymm1 {k1}{z}, m256 /// - [RequiresUnsafe] public static unsafe Vector256 LoadAlignedVector256(float* address) { throw new PlatformNotSupportedException(); } /// /// __m256d _mm256_load_pd (double const * mem_addr) /// VMOVAPD ymm1, m256 /// VMOVAPD ymm1 {k1}{z}, m256 /// - [RequiresUnsafe] public static unsafe Vector256 LoadAlignedVector256(double* address) { throw new PlatformNotSupportedException(); } /// /// __m256i _mm256_lddqu_si256 (__m256i const * mem_addr) /// VLDDQU ymm1, m256 /// - [RequiresUnsafe] public static unsafe Vector256 LoadDquVector256(sbyte* address) { throw new PlatformNotSupportedException(); } /// /// __m256i _mm256_lddqu_si256 (__m256i const * mem_addr) /// VLDDQU ymm1, m256 /// - [RequiresUnsafe] public static unsafe Vector256 LoadDquVector256(byte* address) { throw new PlatformNotSupportedException(); } /// /// __m256i _mm256_lddqu_si256 (__m256i const * mem_addr) /// VLDDQU ymm1, m256 /// - [RequiresUnsafe] public static unsafe Vector256 LoadDquVector256(short* address) { throw new PlatformNotSupportedException(); } /// /// __m256i _mm256_lddqu_si256 (__m256i const * mem_addr) /// VLDDQU ymm1, m256 /// - [RequiresUnsafe] public static unsafe Vector256 LoadDquVector256(ushort* address) { throw new PlatformNotSupportedException(); } /// /// __m256i _mm256_lddqu_si256 (__m256i const * mem_addr) /// VLDDQU ymm1, m256 /// - [RequiresUnsafe] public static unsafe Vector256 LoadDquVector256(int* address) { throw new PlatformNotSupportedException(); } /// /// __m256i _mm256_lddqu_si256 (__m256i const * mem_addr) /// VLDDQU ymm1, m256 /// - [RequiresUnsafe] public static unsafe Vector256 LoadDquVector256(uint* address) { throw new PlatformNotSupportedException(); } /// /// __m256i _mm256_lddqu_si256 (__m256i const * mem_addr) /// VLDDQU ymm1, m256 /// - [RequiresUnsafe] public static unsafe Vector256 LoadDquVector256(long* address) { throw new PlatformNotSupportedException(); } /// /// __m256i _mm256_lddqu_si256 (__m256i const * mem_addr) /// VLDDQU ymm1, m256 /// - [RequiresUnsafe] public static unsafe Vector256 LoadDquVector256(ulong* address) { throw new PlatformNotSupportedException(); } /// @@ -698,120 +675,102 @@ internal X64() { } /// VMOVDQU ymm1, m256 /// VMOVDQU8 ymm1 {k1}{z}, m256 /// - [RequiresUnsafe] public static unsafe Vector256 LoadVector256(sbyte* address) { throw new PlatformNotSupportedException(); } /// /// __m256i _mm256_loadu_si256 (__m256i const * mem_addr) /// VMOVDQU ymm1, m256 /// VMOVDQU8 ymm1 {k1}{z}, m256 /// - [RequiresUnsafe] public static unsafe Vector256 LoadVector256(byte* address) { throw new PlatformNotSupportedException(); } /// /// __m256i _mm256_loadu_si256 (__m256i const * mem_addr) /// VMOVDQU ymm1, m256 /// VMOVDQU16 ymm1 {k1}{z}, m256 /// - [RequiresUnsafe] public static unsafe Vector256 LoadVector256(short* address) { throw new PlatformNotSupportedException(); } /// /// __m256i _mm256_loadu_si256 (__m256i const * mem_addr) /// VMOVDQU ymm1, m256 /// VMOVDQU16 ymm1 {k1}{z}, m256 /// - [RequiresUnsafe] public static unsafe Vector256 LoadVector256(ushort* address) { throw new PlatformNotSupportedException(); } /// /// __m256i _mm256_loadu_si256 (__m256i const * mem_addr) /// VMOVDQU ymm1, m256 /// VMOVDQU32 ymm1 {k1}{z}, m256 /// - [RequiresUnsafe] public static unsafe Vector256 LoadVector256(int* address) { throw new PlatformNotSupportedException(); } /// /// __m256i _mm256_loadu_si256 (__m256i const * mem_addr) /// VMOVDQU ymm1, m256 /// VMOVDQU32 ymm1 {k1}{z}, m256 /// - [RequiresUnsafe] public static unsafe Vector256 LoadVector256(uint* address) { throw new PlatformNotSupportedException(); } /// /// __m256i _mm256_loadu_si256 (__m256i const * mem_addr) /// VMOVDQU ymm1, m256 /// VMOVDQU64 ymm1 {k1}{z}, m256 /// - [RequiresUnsafe] public static unsafe Vector256 LoadVector256(long* address) { throw new PlatformNotSupportedException(); } /// /// __m256i _mm256_loadu_si256 (__m256i const * mem_addr) /// VMOVDQU ymm1, m256 /// VMOVDQU64 ymm1 {k1}{z}, m256 /// - [RequiresUnsafe] public static unsafe Vector256 LoadVector256(ulong* address) { throw new PlatformNotSupportedException(); } /// /// __m256 _mm256_loadu_ps (float const * mem_addr) /// VMOVUPS ymm1, m256 /// VMOVUPS ymm1 {k1}{z}, m256 /// - [RequiresUnsafe] public static unsafe Vector256 LoadVector256(float* address) { throw new PlatformNotSupportedException(); } /// /// __m256d _mm256_loadu_pd (double const * mem_addr) /// VMOVUPD ymm1, m256 /// VMOVUPD ymm1 {k1}{z}, m256 /// - [RequiresUnsafe] public static unsafe Vector256 LoadVector256(double* address) { throw new PlatformNotSupportedException(); } /// /// __m128 _mm_maskload_ps (float const * mem_addr, __m128i mask) /// VMASKMOVPS xmm1, xmm2, m128 /// - [RequiresUnsafe] public static unsafe Vector128 MaskLoad(float* address, Vector128 mask) { throw new PlatformNotSupportedException(); } /// /// __m128d _mm_maskload_pd (double const * mem_addr, __m128i mask) /// VMASKMOVPD xmm1, xmm2, m128 /// - [RequiresUnsafe] public static unsafe Vector128 MaskLoad(double* address, Vector128 mask) { throw new PlatformNotSupportedException(); } /// /// __m256 _mm256_maskload_ps (float const * mem_addr, __m256i mask) /// VMASKMOVPS ymm1, ymm2, m256 /// - [RequiresUnsafe] public static unsafe Vector256 MaskLoad(float* address, Vector256 mask) { throw new PlatformNotSupportedException(); } /// /// __m256d _mm256_maskload_pd (double const * mem_addr, __m256i mask) /// VMASKMOVPD ymm1, ymm2, m256 /// - [RequiresUnsafe] public static unsafe Vector256 MaskLoad(double* address, Vector256 mask) { throw new PlatformNotSupportedException(); } /// /// void _mm_maskstore_ps (float * mem_addr, __m128i mask, __m128 a) /// VMASKMOVPS m128, xmm1, xmm2 /// - [RequiresUnsafe] public static unsafe void MaskStore(float* address, Vector128 mask, Vector128 source) { throw new PlatformNotSupportedException(); } /// /// void _mm_maskstore_pd (double * mem_addr, __m128i mask, __m128d a) /// VMASKMOVPD m128, xmm1, xmm2 /// - [RequiresUnsafe] public static unsafe void MaskStore(double* address, Vector128 mask, Vector128 source) { throw new PlatformNotSupportedException(); } /// /// void _mm256_maskstore_ps (float * mem_addr, __m256i mask, __m256 a) /// VMASKMOVPS m256, ymm1, ymm2 /// - [RequiresUnsafe] public static unsafe void MaskStore(float* address, Vector256 mask, Vector256 source) { throw new PlatformNotSupportedException(); } /// /// void _mm256_maskstore_pd (double * mem_addr, __m256i mask, __m256d a) /// VMASKMOVPD m256, ymm1, ymm2 /// - [RequiresUnsafe] public static unsafe void MaskStore(double* address, Vector256 mask, Vector256 source) { throw new PlatformNotSupportedException(); } /// @@ -1087,70 +1046,60 @@ internal X64() { } /// VMOVDQU m256, ymm1 /// VMOVDQU8 m256 {k1}{z}, ymm1 /// - [RequiresUnsafe] public static unsafe void Store(sbyte* address, Vector256 source) { throw new PlatformNotSupportedException(); } /// /// void _mm256_storeu_si256 (__m256i * mem_addr, __m256i a) /// VMOVDQU m256, ymm1 /// VMOVDQU8 m256 {k1}{z}, ymm1 /// - [RequiresUnsafe] public static unsafe void Store(byte* address, Vector256 source) { throw new PlatformNotSupportedException(); } /// /// void _mm256_storeu_si256 (__m256i * mem_addr, __m256i a) /// VMOVDQU m256, ymm1 /// VMOVDQU16 m256 {k1}{z}, ymm1 /// - [RequiresUnsafe] public static unsafe void Store(short* address, Vector256 source) { throw new PlatformNotSupportedException(); } /// /// void _mm256_storeu_si256 (__m256i * mem_addr, __m256i a) /// VMOVDQU m256, ymm1 /// VMOVDQU16 m256 {k1}{z}, ymm1 /// - [RequiresUnsafe] public static unsafe void Store(ushort* address, Vector256 source) { throw new PlatformNotSupportedException(); } /// /// void _mm256_storeu_si256 (__m256i * mem_addr, __m256i a) /// VMOVDQU m256, ymm1 /// VMOVDQU32 m256 {k1}{z}, ymm1 /// - [RequiresUnsafe] public static unsafe void Store(int* address, Vector256 source) { throw new PlatformNotSupportedException(); } /// /// void _mm256_storeu_si256 (__m256i * mem_addr, __m256i a) /// VMOVDQU m256, ymm1 /// VMOVDQU32 m256 {k1}{z}, ymm1 /// - [RequiresUnsafe] public static unsafe void Store(uint* address, Vector256 source) { throw new PlatformNotSupportedException(); } /// /// void _mm256_storeu_si256 (__m256i * mem_addr, __m256i a) /// VMOVDQU m256, ymm1 /// VMOVDQU64 m256 {k1}{z}, ymm1 /// - [RequiresUnsafe] public static unsafe void Store(long* address, Vector256 source) { throw new PlatformNotSupportedException(); } /// /// void _mm256_storeu_si256 (__m256i * mem_addr, __m256i a) /// VMOVDQU m256, ymm1 /// VMOVDQU64 m256 {k1}{z}, ymm1 /// - [RequiresUnsafe] public static unsafe void Store(ulong* address, Vector256 source) { throw new PlatformNotSupportedException(); } /// /// void _mm256_storeu_ps (float * mem_addr, __m256 a) /// VMOVUPS m256, ymm1 /// VMOVUPS m256 {k1}{z}, ymm1 /// - [RequiresUnsafe] public static unsafe void Store(float* address, Vector256 source) { throw new PlatformNotSupportedException(); } /// /// void _mm256_storeu_pd (double * mem_addr, __m256d a) /// VMOVUPD m256, ymm1 /// VMOVUPD m256 {k1}{z}, ymm1 /// - [RequiresUnsafe] public static unsafe void Store(double* address, Vector256 source) { throw new PlatformNotSupportedException(); } /// @@ -1158,131 +1107,111 @@ internal X64() { } /// VMOVDQA m256, ymm1 /// VMOVDQA32 m256 {k1}{z}, ymm1 /// - [RequiresUnsafe] public static unsafe void StoreAligned(sbyte* address, Vector256 source) { throw new PlatformNotSupportedException(); } /// /// void _mm256_store_si256 (__m256i * mem_addr, __m256i a) /// VMOVDQA m256, ymm1 /// VMOVDQA32 m256 {k1}{z}, ymm1 /// - [RequiresUnsafe] public static unsafe void StoreAligned(byte* address, Vector256 source) { throw new PlatformNotSupportedException(); } /// /// void _mm256_store_si256 (__m256i * mem_addr, __m256i a) /// VMOVDQA m256, ymm1 /// VMOVDQA32 m256 {k1}{z}, ymm1 /// - [RequiresUnsafe] public static unsafe void StoreAligned(short* address, Vector256 source) { throw new PlatformNotSupportedException(); } /// /// void _mm256_store_si256 (__m256i * mem_addr, __m256i a) /// VMOVDQA m256, ymm1 /// VMOVDQA32 m256 {k1}{z}, ymm1 /// - [RequiresUnsafe] public static unsafe void StoreAligned(ushort* address, Vector256 source) { throw new PlatformNotSupportedException(); } /// /// void _mm256_store_si256 (__m256i * mem_addr, __m256i a) /// VMOVDQA m256, ymm1 /// VMOVDQA32 m256 {k1}{z}, ymm1 /// - [RequiresUnsafe] public static unsafe void StoreAligned(int* address, Vector256 source) { throw new PlatformNotSupportedException(); } /// /// void _mm256_store_si256 (__m256i * mem_addr, __m256i a) /// VMOVDQA m256, ymm1 /// VMOVDQA32 m256 {k1}{z}, ymm1 /// - [RequiresUnsafe] public static unsafe void StoreAligned(uint* address, Vector256 source) { throw new PlatformNotSupportedException(); } /// /// void _mm256_store_si256 (__m256i * mem_addr, __m256i a) /// VMOVDQA m256, ymm1 /// VMOVDQA64 m256 {k1}{z}, ymm1 /// - [RequiresUnsafe] public static unsafe void StoreAligned(long* address, Vector256 source) { throw new PlatformNotSupportedException(); } /// /// void _mm256_store_si256 (__m256i * mem_addr, __m256i a) /// VMOVDQA m256, ymm1 /// VMOVDQA64 m256 {k1}{z}, ymm1 /// - [RequiresUnsafe] public static unsafe void StoreAligned(ulong* address, Vector256 source) { throw new PlatformNotSupportedException(); } /// /// void _mm256_store_ps (float * mem_addr, __m256 a) /// VMOVAPS m256, ymm1 /// VMOVAPS m256 {k1}{z}, ymm1 /// - [RequiresUnsafe] public static unsafe void StoreAligned(float* address, Vector256 source) { throw new PlatformNotSupportedException(); } /// /// void _mm256_store_pd (double * mem_addr, __m256d a) /// VMOVAPD m256, ymm1 /// VMOVAPD m256 {k1}{z}, ymm1 /// - [RequiresUnsafe] public static unsafe void StoreAligned(double* address, Vector256 source) { throw new PlatformNotSupportedException(); } /// /// void _mm256_stream_si256 (__m256i * mem_addr, __m256i a) /// VMOVNTDQ m256, ymm1 /// - [RequiresUnsafe] public static unsafe void StoreAlignedNonTemporal(sbyte* address, Vector256 source) { throw new PlatformNotSupportedException(); } /// /// void _mm256_stream_si256 (__m256i * mem_addr, __m256i a) /// VMOVNTDQ m256, ymm1 /// - [RequiresUnsafe] public static unsafe void StoreAlignedNonTemporal(byte* address, Vector256 source) { throw new PlatformNotSupportedException(); } /// /// void _mm256_stream_si256 (__m256i * mem_addr, __m256i a) /// VMOVNTDQ m256, ymm1 /// - [RequiresUnsafe] public static unsafe void StoreAlignedNonTemporal(short* address, Vector256 source) { throw new PlatformNotSupportedException(); } /// /// void _mm256_stream_si256 (__m256i * mem_addr, __m256i a) /// VMOVNTDQ m256, ymm1 /// - [RequiresUnsafe] public static unsafe void StoreAlignedNonTemporal(ushort* address, Vector256 source) { throw new PlatformNotSupportedException(); } /// /// void _mm256_stream_si256 (__m256i * mem_addr, __m256i a) /// VMOVNTDQ m256, ymm1 /// - [RequiresUnsafe] public static unsafe void StoreAlignedNonTemporal(int* address, Vector256 source) { throw new PlatformNotSupportedException(); } /// /// void _mm256_stream_si256 (__m256i * mem_addr, __m256i a) /// VMOVNTDQ m256, ymm1 /// - [RequiresUnsafe] public static unsafe void StoreAlignedNonTemporal(uint* address, Vector256 source) { throw new PlatformNotSupportedException(); } /// /// void _mm256_stream_si256 (__m256i * mem_addr, __m256i a) /// VMOVNTDQ m256, ymm1 /// - [RequiresUnsafe] public static unsafe void StoreAlignedNonTemporal(long* address, Vector256 source) { throw new PlatformNotSupportedException(); } /// /// void _mm256_stream_si256 (__m256i * mem_addr, __m256i a) /// VMOVNTDQ m256, ymm1 /// - [RequiresUnsafe] public static unsafe void StoreAlignedNonTemporal(ulong* address, Vector256 source) { throw new PlatformNotSupportedException(); } /// /// void _mm256_stream_ps (float * mem_addr, __m256 a) /// VMOVNTPS m256, ymm1 /// - [RequiresUnsafe] public static unsafe void StoreAlignedNonTemporal(float* address, Vector256 source) { throw new PlatformNotSupportedException(); } /// /// void _mm256_stream_pd (double * mem_addr, __m256d a) /// VMOVNTPD m256, ymm1 /// - [RequiresUnsafe] public static unsafe void StoreAlignedNonTemporal(double* address, Vector256 source) { throw new PlatformNotSupportedException(); } /// diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Avx.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Avx.cs index fd89d3dfd859a2..9bf1a8cda9a3b5 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Avx.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Avx.cs @@ -108,7 +108,6 @@ internal X64() { } /// VBROADCASTSS xmm1, m32 /// VBROADCASTSS xmm1 {k1}{z}, m32 /// - [RequiresUnsafe] public static unsafe Vector128 BroadcastScalarToVector128(float* source) => BroadcastScalarToVector128(source); /// @@ -116,7 +115,6 @@ internal X64() { } /// VBROADCASTSS ymm1, m32 /// VBROADCASTSS ymm1 {k1}{z}, m32 /// - [RequiresUnsafe] public static unsafe Vector256 BroadcastScalarToVector256(float* source) => BroadcastScalarToVector256(source); /// @@ -124,7 +122,6 @@ internal X64() { } /// VBROADCASTSD ymm1, m64 /// VBROADCASTSD ymm1 {k1}{z}, m64 /// - [RequiresUnsafe] public static unsafe Vector256 BroadcastScalarToVector256(double* source) => BroadcastScalarToVector256(source); /// @@ -132,7 +129,6 @@ internal X64() { } /// VBROADCASTF128 ymm1, m128 /// VBROADCASTF32x4 ymm1 {k1}{z}, m128 /// - [RequiresUnsafe] public static unsafe Vector256 BroadcastVector128ToVector256(float* address) => BroadcastVector128ToVector256(address); /// @@ -140,7 +136,6 @@ internal X64() { } /// VBROADCASTF128 ymm1, m128 /// VBROADCASTF64x2 ymm1 {k1}{z}, m128 /// - [RequiresUnsafe] public static unsafe Vector256 BroadcastVector128ToVector256(double* address) => BroadcastVector128ToVector256(address); /// @@ -581,7 +576,6 @@ internal X64() { } /// VMOVDQA ymm1, m256 /// VMOVDQA32 ymm1 {k1}{z}, m256 /// - [RequiresUnsafe] public static unsafe Vector256 LoadAlignedVector256(sbyte* address) => LoadAlignedVector256(address); /// @@ -589,7 +583,6 @@ internal X64() { } /// VMOVDQA ymm1, m256 /// VMOVDQA32 ymm1 {k1}{z}, m256 /// - [RequiresUnsafe] public static unsafe Vector256 LoadAlignedVector256(byte* address) => LoadAlignedVector256(address); /// @@ -597,7 +590,6 @@ internal X64() { } /// VMOVDQA ymm1, m256 /// VMOVDQA32 ymm1 {k1}{z}, m256 /// - [RequiresUnsafe] public static unsafe Vector256 LoadAlignedVector256(short* address) => LoadAlignedVector256(address); /// @@ -605,7 +597,6 @@ internal X64() { } /// VMOVDQA ymm1, m256 /// VMOVDQA32 ymm1 {k1}{z}, m256 /// - [RequiresUnsafe] public static unsafe Vector256 LoadAlignedVector256(ushort* address) => LoadAlignedVector256(address); /// @@ -613,7 +604,6 @@ internal X64() { } /// VMOVDQA ymm1, m256 /// VMOVDQA32 ymm1 {k1}{z}, m256 /// - [RequiresUnsafe] public static unsafe Vector256 LoadAlignedVector256(int* address) => LoadAlignedVector256(address); /// @@ -621,7 +611,6 @@ internal X64() { } /// VMOVDQA ymm1, m256 /// VMOVDQA32 ymm1 {k1}{z}, m256 /// - [RequiresUnsafe] public static unsafe Vector256 LoadAlignedVector256(uint* address) => LoadAlignedVector256(address); /// @@ -629,7 +618,6 @@ internal X64() { } /// VMOVDQA ymm1, m256 /// VMOVDQA64 ymm1 {k1}{z}, m256 /// - [RequiresUnsafe] public static unsafe Vector256 LoadAlignedVector256(long* address) => LoadAlignedVector256(address); /// @@ -637,7 +625,6 @@ internal X64() { } /// VMOVDQA ymm1, m256 /// VMOVDQA64 ymm1 {k1}{z}, m256 /// - [RequiresUnsafe] public static unsafe Vector256 LoadAlignedVector256(ulong* address) => LoadAlignedVector256(address); /// @@ -645,7 +632,6 @@ internal X64() { } /// VMOVAPS ymm1, m256 /// VMOVAPS ymm1 {k1}{z}, m256 /// - [RequiresUnsafe] public static unsafe Vector256 LoadAlignedVector256(float* address) => LoadAlignedVector256(address); /// @@ -653,63 +639,54 @@ internal X64() { } /// VMOVAPD ymm1, m256 /// VMOVAPD ymm1 {k1}{z}, m256 /// - [RequiresUnsafe] public static unsafe Vector256 LoadAlignedVector256(double* address) => LoadAlignedVector256(address); /// /// __m256i _mm256_lddqu_si256 (__m256i const * mem_addr) /// VLDDQU ymm1, m256 /// - [RequiresUnsafe] public static unsafe Vector256 LoadDquVector256(sbyte* address) => LoadDquVector256(address); /// /// __m256i _mm256_lddqu_si256 (__m256i const * mem_addr) /// VLDDQU ymm1, m256 /// - [RequiresUnsafe] public static unsafe Vector256 LoadDquVector256(byte* address) => LoadDquVector256(address); /// /// __m256i _mm256_lddqu_si256 (__m256i const * mem_addr) /// VLDDQU ymm1, m256 /// - [RequiresUnsafe] public static unsafe Vector256 LoadDquVector256(short* address) => LoadDquVector256(address); /// /// __m256i _mm256_lddqu_si256 (__m256i const * mem_addr) /// VLDDQU ymm1, m256 /// - [RequiresUnsafe] public static unsafe Vector256 LoadDquVector256(ushort* address) => LoadDquVector256(address); /// /// __m256i _mm256_lddqu_si256 (__m256i const * mem_addr) /// VLDDQU ymm1, m256 /// - [RequiresUnsafe] public static unsafe Vector256 LoadDquVector256(int* address) => LoadDquVector256(address); /// /// __m256i _mm256_lddqu_si256 (__m256i const * mem_addr) /// VLDDQU ymm1, m256 /// - [RequiresUnsafe] public static unsafe Vector256 LoadDquVector256(uint* address) => LoadDquVector256(address); /// /// __m256i _mm256_lddqu_si256 (__m256i const * mem_addr) /// VLDDQU ymm1, m256 /// - [RequiresUnsafe] public static unsafe Vector256 LoadDquVector256(long* address) => LoadDquVector256(address); /// /// __m256i _mm256_lddqu_si256 (__m256i const * mem_addr) /// VLDDQU ymm1, m256 /// - [RequiresUnsafe] public static unsafe Vector256 LoadDquVector256(ulong* address) => LoadDquVector256(address); /// @@ -717,7 +694,6 @@ internal X64() { } /// VMOVDQU ymm1, m256 /// VMOVDQU8 ymm1 {k1}{z}, m256 /// - [RequiresUnsafe] public static unsafe Vector256 LoadVector256(sbyte* address) => LoadVector256(address); /// @@ -725,7 +701,6 @@ internal X64() { } /// VMOVDQU ymm1, m256 /// VMOVDQU8 ymm1 {k1}{z}, m256 /// - [RequiresUnsafe] public static unsafe Vector256 LoadVector256(byte* address) => LoadVector256(address); /// @@ -733,7 +708,6 @@ internal X64() { } /// VMOVDQU ymm1, m256 /// VMOVDQU16 ymm1 {k1}{z}, m256 /// - [RequiresUnsafe] public static unsafe Vector256 LoadVector256(short* address) => LoadVector256(address); /// @@ -741,7 +715,6 @@ internal X64() { } /// VMOVDQU ymm1, m256 /// VMOVDQU16 ymm1 {k1}{z}, m256 /// - [RequiresUnsafe] public static unsafe Vector256 LoadVector256(ushort* address) => LoadVector256(address); /// @@ -749,7 +722,6 @@ internal X64() { } /// VMOVDQU ymm1, m256 /// VMOVDQU32 ymm1 {k1}{z}, m256 /// - [RequiresUnsafe] public static unsafe Vector256 LoadVector256(int* address) => LoadVector256(address); /// @@ -757,7 +729,6 @@ internal X64() { } /// VMOVDQU ymm1, m256 /// VMOVDQU32 ymm1 {k1}{z}, m256 /// - [RequiresUnsafe] public static unsafe Vector256 LoadVector256(uint* address) => LoadVector256(address); /// @@ -765,7 +736,6 @@ internal X64() { } /// VMOVDQU ymm1, m256 /// VMOVDQU64 ymm1 {k1}{z}, m256 /// - [RequiresUnsafe] public static unsafe Vector256 LoadVector256(long* address) => LoadVector256(address); /// @@ -773,7 +743,6 @@ internal X64() { } /// VMOVDQU ymm1, m256 /// VMOVDQU64 ymm1 {k1}{z}, m256 /// - [RequiresUnsafe] public static unsafe Vector256 LoadVector256(ulong* address) => LoadVector256(address); /// @@ -781,7 +750,6 @@ internal X64() { } /// VMOVUPS ymm1, m256 /// VMOVUPS ymm1 {k1}{z}, m256 /// - [RequiresUnsafe] public static unsafe Vector256 LoadVector256(float* address) => LoadVector256(address); /// @@ -789,63 +757,54 @@ internal X64() { } /// VMOVUPD ymm1, m256 /// VMOVUPD ymm1 {k1}{z}, m256 /// - [RequiresUnsafe] public static unsafe Vector256 LoadVector256(double* address) => LoadVector256(address); /// /// __m128 _mm_maskload_ps (float const * mem_addr, __m128i mask) /// VMASKMOVPS xmm1, xmm2, m128 /// - [RequiresUnsafe] public static unsafe Vector128 MaskLoad(float* address, Vector128 mask) => MaskLoad(address, mask); /// /// __m128d _mm_maskload_pd (double const * mem_addr, __m128i mask) /// VMASKMOVPD xmm1, xmm2, m128 /// - [RequiresUnsafe] public static unsafe Vector128 MaskLoad(double* address, Vector128 mask) => MaskLoad(address, mask); /// /// __m256 _mm256_maskload_ps (float const * mem_addr, __m256i mask) /// VMASKMOVPS ymm1, ymm2, m256 /// - [RequiresUnsafe] public static unsafe Vector256 MaskLoad(float* address, Vector256 mask) => MaskLoad(address, mask); /// /// __m256d _mm256_maskload_pd (double const * mem_addr, __m256i mask) /// VMASKMOVPD ymm1, ymm2, m256 /// - [RequiresUnsafe] public static unsafe Vector256 MaskLoad(double* address, Vector256 mask) => MaskLoad(address, mask); /// /// void _mm_maskstore_ps (float * mem_addr, __m128i mask, __m128 a) /// VMASKMOVPS m128, xmm1, xmm2 /// - [RequiresUnsafe] public static unsafe void MaskStore(float* address, Vector128 mask, Vector128 source) => MaskStore(address, mask, source); /// /// void _mm_maskstore_pd (double * mem_addr, __m128i mask, __m128d a) /// VMASKMOVPD m128, xmm1, xmm2 /// - [RequiresUnsafe] public static unsafe void MaskStore(double* address, Vector128 mask, Vector128 source) => MaskStore(address, mask, source); /// /// void _mm256_maskstore_ps (float * mem_addr, __m256i mask, __m256 a) /// VMASKMOVPS m256, ymm1, ymm2 /// - [RequiresUnsafe] public static unsafe void MaskStore(float* address, Vector256 mask, Vector256 source) => MaskStore(address, mask, source); /// /// void _mm256_maskstore_pd (double * mem_addr, __m256i mask, __m256d a) /// VMASKMOVPD m256, ymm1, ymm2 /// - [RequiresUnsafe] public static unsafe void MaskStore(double* address, Vector256 mask, Vector256 source) => MaskStore(address, mask, source); /// @@ -1120,7 +1079,6 @@ internal X64() { } /// VMOVDQU m256, ymm1 /// VMOVDQU8 m256 {k1}{z}, ymm1 /// - [RequiresUnsafe] public static unsafe void Store(sbyte* address, Vector256 source) => Store(address, source); /// @@ -1128,7 +1086,6 @@ internal X64() { } /// VMOVDQU m256, ymm1 /// VMOVDQU8 m256 {k1}{z}, ymm1 /// - [RequiresUnsafe] public static unsafe void Store(byte* address, Vector256 source) => Store(address, source); /// @@ -1136,7 +1093,6 @@ internal X64() { } /// VMOVDQU m256, ymm1 /// VMOVDQU16 m256 {k1}{z}, ymm1 /// - [RequiresUnsafe] public static unsafe void Store(short* address, Vector256 source) => Store(address, source); /// @@ -1144,7 +1100,6 @@ internal X64() { } /// VMOVDQU m256, ymm1 /// VMOVDQU16 m256 {k1}{z}, ymm1 /// - [RequiresUnsafe] public static unsafe void Store(ushort* address, Vector256 source) => Store(address, source); /// @@ -1152,7 +1107,6 @@ internal X64() { } /// VMOVDQU m256, ymm1 /// VMOVDQU32 m256 {k1}{z}, ymm1 /// - [RequiresUnsafe] public static unsafe void Store(int* address, Vector256 source) => Store(address, source); /// @@ -1160,7 +1114,6 @@ internal X64() { } /// VMOVDQU m256, ymm1 /// VMOVDQU32 m256 {k1}{z}, ymm1 /// - [RequiresUnsafe] public static unsafe void Store(uint* address, Vector256 source) => Store(address, source); /// @@ -1168,7 +1121,6 @@ internal X64() { } /// VMOVDQU m256, ymm1 /// VMOVDQU64 m256 {k1}{z}, ymm1 /// - [RequiresUnsafe] public static unsafe void Store(long* address, Vector256 source) => Store(address, source); /// @@ -1176,7 +1128,6 @@ internal X64() { } /// VMOVDQU m256, ymm1 /// VMOVDQU64 m256 {k1}{z}, ymm1 /// - [RequiresUnsafe] public static unsafe void Store(ulong* address, Vector256 source) => Store(address, source); /// @@ -1184,7 +1135,6 @@ internal X64() { } /// VMOVUPS m256, ymm1 /// VMOVUPS m256 {k1}{z}, ymm1 /// - [RequiresUnsafe] public static unsafe void Store(float* address, Vector256 source) => Store(address, source); /// @@ -1192,7 +1142,6 @@ internal X64() { } /// VMOVUPD m256, ymm1 /// VMOVUPD m256 {k1}{z}, ymm1 /// - [RequiresUnsafe] public static unsafe void Store(double* address, Vector256 source) => Store(address, source); /// @@ -1200,7 +1149,6 @@ internal X64() { } /// VMOVDQA m256, ymm1 /// VMOVDQA32 m256 {k1}{z}, ymm1 /// - [RequiresUnsafe] public static unsafe void StoreAligned(sbyte* address, Vector256 source) => StoreAligned(address, source); /// @@ -1208,7 +1156,6 @@ internal X64() { } /// VMOVDQA m256, ymm1 /// VMOVDQA32 m256 {k1}{z}, ymm1 /// - [RequiresUnsafe] public static unsafe void StoreAligned(byte* address, Vector256 source) => StoreAligned(address, source); /// @@ -1216,7 +1163,6 @@ internal X64() { } /// VMOVDQA m256, ymm1 /// VMOVDQA32 m256 {k1}{z}, ymm1 /// - [RequiresUnsafe] public static unsafe void StoreAligned(short* address, Vector256 source) => StoreAligned(address, source); /// @@ -1224,7 +1170,6 @@ internal X64() { } /// VMOVDQA m256, ymm1 /// VMOVDQA32 m256 {k1}{z}, ymm1 /// - [RequiresUnsafe] public static unsafe void StoreAligned(ushort* address, Vector256 source) => StoreAligned(address, source); /// @@ -1232,7 +1177,6 @@ internal X64() { } /// VMOVDQA m256, ymm1 /// VMOVDQA32 m256 {k1}{z}, ymm1 /// - [RequiresUnsafe] public static unsafe void StoreAligned(int* address, Vector256 source) => StoreAligned(address, source); /// @@ -1240,7 +1184,6 @@ internal X64() { } /// VMOVDQA m256, ymm1 /// VMOVDQA32 m256 {k1}{z}, ymm1 /// - [RequiresUnsafe] public static unsafe void StoreAligned(uint* address, Vector256 source) => StoreAligned(address, source); /// @@ -1248,7 +1191,6 @@ internal X64() { } /// VMOVDQA m256, ymm1 /// VMOVDQA64 m256 {k1}{z}, ymm1 /// - [RequiresUnsafe] public static unsafe void StoreAligned(long* address, Vector256 source) => StoreAligned(address, source); /// @@ -1256,7 +1198,6 @@ internal X64() { } /// VMOVDQA m256, ymm1 /// VMOVDQA64 m256 {k1}{z}, ymm1 /// - [RequiresUnsafe] public static unsafe void StoreAligned(ulong* address, Vector256 source) => StoreAligned(address, source); /// @@ -1264,7 +1205,6 @@ internal X64() { } /// VMOVAPS m256, ymm1 /// VMOVAPS m256 {k1}{z}, ymm1 /// - [RequiresUnsafe] public static unsafe void StoreAligned(float* address, Vector256 source) => StoreAligned(address, source); /// @@ -1272,77 +1212,66 @@ internal X64() { } /// VMOVAPD m256, ymm1 /// VMOVAPD m256 {k1}{z}, ymm1 /// - [RequiresUnsafe] public static unsafe void StoreAligned(double* address, Vector256 source) => StoreAligned(address, source); /// /// void _mm256_stream_si256 (__m256i * mem_addr, __m256i a) /// VMOVNTDQ m256, ymm1 /// - [RequiresUnsafe] public static unsafe void StoreAlignedNonTemporal(sbyte* address, Vector256 source) => StoreAlignedNonTemporal(address, source); /// /// void _mm256_stream_si256 (__m256i * mem_addr, __m256i a) /// VMOVNTDQ m256, ymm1 /// - [RequiresUnsafe] public static unsafe void StoreAlignedNonTemporal(byte* address, Vector256 source) => StoreAlignedNonTemporal(address, source); /// /// void _mm256_stream_si256 (__m256i * mem_addr, __m256i a) /// VMOVNTDQ m256, ymm1 /// - [RequiresUnsafe] public static unsafe void StoreAlignedNonTemporal(short* address, Vector256 source) => StoreAlignedNonTemporal(address, source); /// /// void _mm256_stream_si256 (__m256i * mem_addr, __m256i a) /// VMOVNTDQ m256, ymm1 /// - [RequiresUnsafe] public static unsafe void StoreAlignedNonTemporal(ushort* address, Vector256 source) => StoreAlignedNonTemporal(address, source); /// /// void _mm256_stream_si256 (__m256i * mem_addr, __m256i a) /// VMOVNTDQ m256, ymm1 /// - [RequiresUnsafe] public static unsafe void StoreAlignedNonTemporal(int* address, Vector256 source) => StoreAlignedNonTemporal(address, source); /// /// void _mm256_stream_si256 (__m256i * mem_addr, __m256i a) /// VMOVNTDQ m256, ymm1 /// - [RequiresUnsafe] public static unsafe void StoreAlignedNonTemporal(uint* address, Vector256 source) => StoreAlignedNonTemporal(address, source); /// /// void _mm256_stream_si256 (__m256i * mem_addr, __m256i a) /// VMOVNTDQ m256, ymm1 /// - [RequiresUnsafe] public static unsafe void StoreAlignedNonTemporal(long* address, Vector256 source) => StoreAlignedNonTemporal(address, source); /// /// void _mm256_stream_si256 (__m256i * mem_addr, __m256i a) /// VMOVNTDQ m256, ymm1 /// - [RequiresUnsafe] public static unsafe void StoreAlignedNonTemporal(ulong* address, Vector256 source) => StoreAlignedNonTemporal(address, source); /// /// void _mm256_stream_ps (float * mem_addr, __m256 a) /// VMOVNTPS m256, ymm1 /// - [RequiresUnsafe] public static unsafe void StoreAlignedNonTemporal(float* address, Vector256 source) => StoreAlignedNonTemporal(address, source); /// /// void _mm256_stream_pd (double * mem_addr, __m256d a) /// VMOVNTPD m256, ymm1 /// - [RequiresUnsafe] public static unsafe void StoreAlignedNonTemporal(double* address, Vector256 source) => StoreAlignedNonTemporal(address, source); /// diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Avx10v1.PlatformNotSupported.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Avx10v1.PlatformNotSupported.cs index b3d56634a8cb3f..4cdd8230ccf9f5 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Avx10v1.PlatformNotSupported.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Avx10v1.PlatformNotSupported.cs @@ -1180,122 +1180,102 @@ internal Avx10v1() { } /// __m128i _mm_mask_compressstoreu_epi8 (void * s, __mmask16 k, __m128i a) /// VPCOMPRESSB m128 {k1}{z}, xmm2 /// - [RequiresUnsafe] public static unsafe void CompressStore(byte* address, Vector128 mask, Vector128 source) { throw new PlatformNotSupportedException(); } /// /// __m128d _mm_mask_compressstoreu_pd (void * a, __mmask8 k, __m128d a) /// VCOMPRESSPD m128 {k1}{z}, xmm2 /// - [RequiresUnsafe] public static unsafe void CompressStore(double* address, Vector128 mask, Vector128 source) { throw new PlatformNotSupportedException(); } /// /// __m128i _mm_mask_compressstoreu_epi16 (void * s, __mmask8 k, __m128i a) /// VPCOMPRESSW m128 {k1}{z}, xmm2 /// - [RequiresUnsafe] public static unsafe void CompressStore(short* address, Vector128 mask, Vector128 source) { throw new PlatformNotSupportedException(); } /// /// __m128i _mm_mask_compressstoreu_epi32 (void * a, __mask8 k, __m128i a) /// VPCOMPRESSD m128 {k1}{z}, xmm2 /// - [RequiresUnsafe] public static unsafe void CompressStore(int* address, Vector128 mask, Vector128 source) { throw new PlatformNotSupportedException(); } /// /// __m128i _mm_mask_compressstoreu_epi64 (void * a, __mask8 k, __m128i a) /// VPCOMPRESSQ m128 {k1}{z}, xmm2 /// - [RequiresUnsafe] public static unsafe void CompressStore(long* address, Vector128 mask, Vector128 source) { throw new PlatformNotSupportedException(); } /// /// __m128i _mm_mask_compressstoreu_epi8 (void * s, __mmask16 k, __m128i a) /// VPCOMPRESSB m128 {k1}{z}, xmm2 /// - [RequiresUnsafe] public static unsafe void CompressStore(sbyte* address, Vector128 mask, Vector128 source) { throw new PlatformNotSupportedException(); } /// /// __m128 _mm_mask_compressstoreu_ps (void * a, __mmask8 k, __m128 a) /// VCOMPRESSPS m128 {k1}{z}, xmm2 /// - [RequiresUnsafe] public static unsafe void CompressStore(float* address, Vector128 mask, Vector128 source) { throw new PlatformNotSupportedException(); } /// /// __m128i _mm_mask_compressstoreu_epi16 (void * s, __mmask8 k, __m128i a) /// VPCOMPRESSW m128 {k1}{z}, xmm2 /// - [RequiresUnsafe] public static unsafe void CompressStore(ushort* address, Vector128 mask, Vector128 source) { throw new PlatformNotSupportedException(); } /// /// __m128i _mm_mask_compressstoreu_epi32 (void * a, __mask8 k, __m128i a) /// VPCOMPRESSD m128 {k1}{z}, xmm2 /// - [RequiresUnsafe] public static unsafe void CompressStore(uint* address, Vector128 mask, Vector128 source) { throw new PlatformNotSupportedException(); } /// /// __m128i _mm_mask_compressstoreu_epi64 (void * a, __mask8 k, __m128i a) /// VPCOMPRESSQ m128 {k1}{z}, xmm2 /// - [RequiresUnsafe] public static unsafe void CompressStore(ulong* address, Vector128 mask, Vector128 source) { throw new PlatformNotSupportedException(); } /// /// void _mm256_mask_compressstoreu_epi8 (void * s, __mmask32 k, __m256i a) /// VPCOMPRESSB m256 {k1}{z}, ymm2 /// - [RequiresUnsafe] public static unsafe void CompressStore(byte* address, Vector256 mask, Vector256 source) { throw new PlatformNotSupportedException(); } /// /// __m256d _mm256_mask_compressstoreu_pd (void * a, __mmask8 k, __m256d a) /// VCOMPRESSPD m256 {k1}{z}, ymm2 /// - [RequiresUnsafe] public static unsafe void CompressStore(double* address, Vector256 mask, Vector256 source) { throw new PlatformNotSupportedException(); } /// /// void _mm256_mask_compressstoreu_epi16 (void * s, __mmask16 k, __m256i a) /// VPCOMPRESSW m256 {k1}{z}, ymm2 /// - [RequiresUnsafe] public static unsafe void CompressStore(short* address, Vector256 mask, Vector256 source) { throw new PlatformNotSupportedException(); } /// /// void _mm256_mask_compressstoreu_epi32 (void * a, __mmask8 k, __m256i a) /// VPCOMPRESSD m256 {k1}{z}, ymm2 /// - [RequiresUnsafe] public static unsafe void CompressStore(int* address, Vector256 mask, Vector256 source) { throw new PlatformNotSupportedException(); } /// /// void _mm256_mask_compressstoreu_epi64 (void * a, __mmask8 k, __m256i a) /// VPCOMPRESSQ m256 {k1}{z}, ymm2 /// - [RequiresUnsafe] public static unsafe void CompressStore(long* address, Vector256 mask, Vector256 source) { throw new PlatformNotSupportedException(); } /// /// void _mm256_mask_compressstoreu_epi8 (void * s, __mmask32 k, __m256i a) /// VPCOMPRESSB m256 {k1}{z}, ymm2 /// - [RequiresUnsafe] public static unsafe void CompressStore(sbyte* address, Vector256 mask, Vector256 source) { throw new PlatformNotSupportedException(); } /// /// __m256 _mm256_mask_compressstoreu_ps (void * a, __mmask8 k, __m256 a) /// VCOMPRESSPS m256 {k1}{z}, ymm2 /// - [RequiresUnsafe] public static unsafe void CompressStore(float* address, Vector256 mask, Vector256 source) { throw new PlatformNotSupportedException(); } /// /// void _mm256_mask_compressstoreu_epi16 (void * s, __mmask16 k, __m256i a) /// VPCOMPRESSW m256 {k1}{z}, ymm2 /// - [RequiresUnsafe] public static unsafe void CompressStore(ushort* address, Vector256 mask, Vector256 source) { throw new PlatformNotSupportedException(); } /// /// void _mm256_mask_compressstoreu_epi32 (void * a, __mmask8 k, __m256i a) /// VPCOMPRESSD m256 {k1}{z}, ymm2 /// - [RequiresUnsafe] public static unsafe void CompressStore(uint* address, Vector256 mask, Vector256 source) { throw new PlatformNotSupportedException(); } /// /// void _mm256_mask_compressstoreu_epi64 (void * a, __mmask8 k, __m256i a) /// VPCOMPRESSQ m256 {k1}{z}, ymm2 /// - [RequiresUnsafe] public static unsafe void CompressStore(ulong* address, Vector256 mask, Vector256 source) { throw new PlatformNotSupportedException(); } /// @@ -2095,70 +2075,60 @@ internal Avx10v1() { } /// VPEXPANDB xmm1 {k1}{z}, m128 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector128 ExpandLoad(byte* address, Vector128 mask, Vector128 merge) { throw new PlatformNotSupportedException(); } /// /// __m128d _mm_mask_expandloadu_pd (__m128d s, __mmask8 k, void const * a) /// VEXPANDPD xmm1 {k1}{z}, m128 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector128 ExpandLoad(double* address, Vector128 mask, Vector128 merge) { throw new PlatformNotSupportedException(); } /// /// __m128i _mm_mask_expandloadu_epi16 (__m128i s, __mmask8 k, void const * a) /// VPEXPANDW xmm1 {k1}{z}, m128 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector128 ExpandLoad(short* address, Vector128 mask, Vector128 merge) { throw new PlatformNotSupportedException(); } /// /// __m128i _mm_mask_expandloadu_epi32 (__m128i s, __mmask8 k, void const * a) /// VPEXPANDD xmm1 {k1}{z}, m128 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector128 ExpandLoad(int* address, Vector128 mask, Vector128 merge) { throw new PlatformNotSupportedException(); } /// /// __m128i _mm_mask_expandloadu_epi64 (__m128i s, __mmask8 k, void const * a) /// VPEXPANDQ xmm1 {k1}{z}, m128 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector128 ExpandLoad(long* address, Vector128 mask, Vector128 merge) { throw new PlatformNotSupportedException(); } /// /// __m128i _mm_mask_expandloadu_epi8 (__m128i s, __mmask16 k, void const * a) /// VPEXPANDB xmm1 {k1}{z}, m128 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector128 ExpandLoad(sbyte* address, Vector128 mask, Vector128 merge) { throw new PlatformNotSupportedException(); } /// /// __m128 _mm_mask_expandloadu_ps (__m128 s, __mmask8 k, void const * a) /// VEXPANDPS xmm1 {k1}{z}, m128 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector128 ExpandLoad(float* address, Vector128 mask, Vector128 merge) { throw new PlatformNotSupportedException(); } /// /// __m128i _mm_mask_expandloadu_epi16 (__m128i s, __mmask8 k, void const * a) /// VPEXPANDW xmm1 {k1}{z}, m128 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector128 ExpandLoad(ushort* address, Vector128 mask, Vector128 merge) { throw new PlatformNotSupportedException(); } /// /// __m128i _mm_mask_expandloadu_epi32 (__m128i s, __mmask8 k, void const * a) /// VPEXPANDD xmm1 {k1}{z}, m128 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector128 ExpandLoad(uint* address, Vector128 mask, Vector128 merge) { throw new PlatformNotSupportedException(); } /// /// __m128i _mm_mask_expandloadu_epi64 (__m128i s, __mmask8 k, void const * a) /// VPEXPANDQ xmm1 {k1}{z}, m128 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector128 ExpandLoad(ulong* address, Vector128 mask, Vector128 merge) { throw new PlatformNotSupportedException(); } /// @@ -2166,70 +2136,60 @@ internal Avx10v1() { } /// VPEXPANDB ymm1 {k1}{z}, m256 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector256 ExpandLoad(byte* address, Vector256 mask, Vector256 merge) { throw new PlatformNotSupportedException(); } /// /// __m256d _mm256_address_expandloadu_pd (__m256d s, __mmask8 k, void const * a) /// VEXPANDPD ymm1 {k1}{z}, m256 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector256 ExpandLoad(double* address, Vector256 mask, Vector256 merge) { throw new PlatformNotSupportedException(); } /// /// __m256i _mm256_mask_expandloadu_epi16 (__m256i s, __mmask16 k, void const * a) /// VPEXPANDW ymm1 {k1}{z}, m256 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector256 ExpandLoad(short* address, Vector256 mask, Vector256 merge) { throw new PlatformNotSupportedException(); } /// /// __m256i _mm256_address_expandloadu_epi32 (__m256i s, __mmask8 k, void const * a) /// VPEXPANDD ymm1 {k1}{z}, m256 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector256 ExpandLoad(int* address, Vector256 mask, Vector256 merge) { throw new PlatformNotSupportedException(); } /// /// __m256i _mm256_address_expandloadu_epi64 (__m256i s, __mmask8 k, void const * a) /// VPEXPANDQ ymm1 {k1}{z}, m256 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector256 ExpandLoad(long* address, Vector256 mask, Vector256 merge) { throw new PlatformNotSupportedException(); } /// /// __m256i _mm256_mask_expandloadu_epi8 (__m256i s, __mmask32 k, void const * a) /// VPEXPANDB ymm1 {k1}{z}, m256 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector256 ExpandLoad(sbyte* address, Vector256 mask, Vector256 merge) { throw new PlatformNotSupportedException(); } /// /// __m256 _mm256_address_expandloadu_ps (__m256 s, __mmask8 k, void const * a) /// VEXPANDPS ymm1 {k1}{z}, m256 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector256 ExpandLoad(float* address, Vector256 mask, Vector256 merge) { throw new PlatformNotSupportedException(); } /// /// __m256i _mm256_mask_expandloadu_epi16 (__m256i s, __mmask16 k, void const * a) /// VPEXPANDW ymm1 {k1}{z}, m256 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector256 ExpandLoad(ushort* address, Vector256 mask, Vector256 merge) { throw new PlatformNotSupportedException(); } /// /// __m256i _mm256_address_expandloadu_epi32 (__m256i s, __mmask8 k, void const * a) /// VPEXPANDD ymm1 {k1}{z}, m256 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector256 ExpandLoad(uint* address, Vector256 mask, Vector256 merge) { throw new PlatformNotSupportedException(); } /// /// __m256i _mm256_address_expandloadu_epi64 (__m256i s, __mmask8 k, void const * a) /// VPEXPANDQ ymm1 {k1}{z}, m256 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector256 ExpandLoad(ulong* address, Vector256 mask, Vector256 merge) { throw new PlatformNotSupportedException(); } /// @@ -2444,70 +2404,60 @@ internal Avx10v1() { } /// VMOVDQU8 xmm1 {k1}{z}, m128 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector128 MaskLoad(byte* address, Vector128 mask, Vector128 merge) { throw new PlatformNotSupportedException(); } /// /// __m128d _mm_mask_loadu_pd (__m128d s, __mmask8 k, void const * mem_addr) /// VMOVUPD xmm1 {k1}{z}, m128 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector128 MaskLoad(double* address, Vector128 mask, Vector128 merge) { throw new PlatformNotSupportedException(); } /// /// __m128i _mm_mask_loadu_epi16 (__m128i s, __mmask8 k, void const * mem_addr) /// VMOVDQU32 xmm1 {k1}{z}, m128 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector128 MaskLoad(short* address, Vector128 mask, Vector128 merge) { throw new PlatformNotSupportedException(); } /// /// __m128i _mm_mask_loadu_epi32 (__m128i s, __mmask8 k, void const * mem_addr) /// VMOVDQU32 xmm1 {k1}{z}, m128 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector128 MaskLoad(int* address, Vector128 mask, Vector128 merge) { throw new PlatformNotSupportedException(); } /// /// __m128i _mm_mask_loadu_epi64 (__m128i s, __mmask8 k, void const * mem_addr) /// VMOVDQU64 xmm1 {k1}{z}, m128 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector128 MaskLoad(long* address, Vector128 mask, Vector128 merge) { throw new PlatformNotSupportedException(); } /// /// __m128i _mm_mask_loadu_epi8 (__m128i s, __mmask16 k, void const * mem_addr) /// VMOVDQU8 xmm1 {k1}{z}, m128 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector128 MaskLoad(sbyte* address, Vector128 mask, Vector128 merge) { throw new PlatformNotSupportedException(); } /// /// __m128 _mm_mask_loadu_ps (__m128 s, __mmask8 k, void const * mem_addr) /// VMOVUPS xmm1 {k1}{z}, m128 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector128 MaskLoad(float* address, Vector128 mask, Vector128 merge) { throw new PlatformNotSupportedException(); } /// /// __m128i _mm_mask_loadu_epi16 (__m128i s, __mmask8 k, void const * mem_addr) /// VMOVDQU32 xmm1 {k1}{z}, m128 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector128 MaskLoad(ushort* address, Vector128 mask, Vector128 merge) { throw new PlatformNotSupportedException(); } /// /// __m128i _mm_mask_loadu_epi32 (__m128i s, __mmask8 k, void const * mem_addr) /// VMOVDQU32 xmm1 {k1}{z}, m128 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector128 MaskLoad(uint* address, Vector128 mask, Vector128 merge) { throw new PlatformNotSupportedException(); } /// /// __m128i _mm_mask_loadu_epi64 (__m128i s, __mmask8 k, void const * mem_addr) /// VMOVDQU64 xmm1 {k1}{z}, m128 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector128 MaskLoad(ulong* address, Vector128 mask, Vector128 merge) { throw new PlatformNotSupportedException(); } /// @@ -2515,69 +2465,59 @@ internal Avx10v1() { } /// VMOVDQU8 ymm1 {k1}{z}, m256 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector256 MaskLoad(byte* address, Vector256 mask, Vector256 merge) { throw new PlatformNotSupportedException(); } /// /// __m256d _mm256_mask_loadu_pd (__m256d s, __mmask8 k, void const * mem_addr) /// VMOVUPD ymm1 {k1}{z}, m256 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector256 MaskLoad(double* address, Vector256 mask, Vector256 merge) { throw new PlatformNotSupportedException(); } /// /// __m256i _mm256_mask_loadu_epi16 (__m256i s, __mmask16 k, void const * mem_addr) /// VMOVDQU32 ymm1 {k1}{z}, m256 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector256 MaskLoad(short* address, Vector256 mask, Vector256 merge) { throw new PlatformNotSupportedException(); } /// /// __m256i _mm256_mask_loadu_epi32 (__m256i s, __mmask8 k, void const * mem_addr) /// VMOVDQU32 ymm1 {k1}{z}, m256 /// - [RequiresUnsafe] public static unsafe Vector256 MaskLoad(int* address, Vector256 mask, Vector256 merge) { throw new PlatformNotSupportedException(); } /// /// __m256i _mm256_mask_loadu_epi64 (__m256i s, __mmask8 k, void const * mem_addr) /// VMOVDQU64 ymm1 {k1}{z}, m256 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector256 MaskLoad(long* address, Vector256 mask, Vector256 merge) { throw new PlatformNotSupportedException(); } /// /// __m256i _mm256_mask_loadu_epi8 (__m256i s, __mmask32 k, void const * mem_addr) /// VMOVDQU8 ymm1 {k1}{z}, m256 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector256 MaskLoad(sbyte* address, Vector256 mask, Vector256 merge) { throw new PlatformNotSupportedException(); } /// /// __m256 _mm256_mask_loadu_ps (__m256 s, __mmask8 k, void const * mem_addr) /// VMOVUPS ymm1 {k1}{z}, m256 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector256 MaskLoad(float* address, Vector256 mask, Vector256 merge) { throw new PlatformNotSupportedException(); } /// /// __m256i _mm256_mask_loadu_epi16 (__m256i s, __mmask16 k, void const * mem_addr) /// VMOVDQU32 ymm1 {k1}{z}, m256 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector256 MaskLoad(ushort* address, Vector256 mask, Vector256 merge) { throw new PlatformNotSupportedException(); } /// /// __m256i _mm256_mask_loadu_epi32 (__m256i s, __mmask8 k, void const * mem_addr) /// VMOVDQU32 ymm1 {k1}{z}, m256 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector256 MaskLoad(uint* address, Vector256 mask, Vector256 merge) { throw new PlatformNotSupportedException(); } /// /// __m256i _mm256_mask_loadu_epi64 (__m256i s, __mmask8 k, void const * mem_addr) /// VMOVDQU64 ymm1 {k1}{z}, m256 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector256 MaskLoad(ulong* address, Vector256 mask, Vector256 merge) { throw new PlatformNotSupportedException(); } /// @@ -2585,42 +2525,36 @@ internal Avx10v1() { } /// VMOVAPD xmm1 {k1}{z}, m128 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector128 MaskLoadAligned(double* address, Vector128 mask, Vector128 merge) { throw new PlatformNotSupportedException(); } /// /// __m128i _mm_mask_load_epi32 (__m128i s, __mmask8 k, void const * mem_addr) /// VMOVDQA32 xmm1 {k1}{z}, m128 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector128 MaskLoadAligned(int* address, Vector128 mask, Vector128 merge) { throw new PlatformNotSupportedException(); } /// /// __m128i _mm_mask_load_epi64 (__m128i s, __mmask8 k, void const * mem_addr) /// VMOVDQA64 xmm1 {k1}{z}, m128 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector128 MaskLoadAligned(long* address, Vector128 mask, Vector128 merge) { throw new PlatformNotSupportedException(); } /// /// __m128 _mm_mask_load_ps (__m128 s, __mmask8 k, void const * mem_addr) /// VMOVAPS xmm1 {k1}{z}, m128 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector128 MaskLoadAligned(float* address, Vector128 mask, Vector128 merge) { throw new PlatformNotSupportedException(); } /// /// __m128i _mm_mask_load_epi32 (__m128i s, __mmask8 k, void const * mem_addr) /// VMOVDQA32 xmm1 {k1}{z}, m128 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector128 MaskLoadAligned(uint* address, Vector128 mask, Vector128 merge) { throw new PlatformNotSupportedException(); } /// /// __m128i _mm_mask_load_epi64 (__m128i s, __mmask8 k, void const * mem_addr) /// VMOVDQA64 xmm1 {k1}{z}, m128 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector128 MaskLoadAligned(ulong* address, Vector128 mask, Vector128 merge) { throw new PlatformNotSupportedException(); } /// @@ -2628,238 +2562,200 @@ internal Avx10v1() { } /// VMOVAPD ymm1 {k1}{z}, m256 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector256 MaskLoadAligned(double* address, Vector256 mask, Vector256 merge) { throw new PlatformNotSupportedException(); } /// /// __m256i _mm256_mask_load_epi32 (__m256i s, __mmask8 k, void const * mem_addr) /// VMOVDQA32 ymm1 {k1}{z}, m256 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector256 MaskLoadAligned(int* address, Vector256 mask, Vector256 merge) { throw new PlatformNotSupportedException(); } /// /// __m256i _mm256_mask_load_epi64 (__m256i s, __mmask8 k, void const * mem_addr) /// VMOVDQA64 ymm1 {k1}{z}, m256 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector256 MaskLoadAligned(long* address, Vector256 mask, Vector256 merge) { throw new PlatformNotSupportedException(); } /// /// __m256 _mm256_mask_load_ps (__m256 s, __mmask8 k, void const * mem_addr) /// VMOVAPS ymm1 {k1}{z}, m256 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector256 MaskLoadAligned(float* address, Vector256 mask, Vector256 merge) { throw new PlatformNotSupportedException(); } /// /// __m256i _mm256_mask_load_epi32 (__m256i s, __mmask8 k, void const * mem_addr) /// VMOVDQA32 ymm1 {k1}{z}, m256 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector256 MaskLoadAligned(uint* address, Vector256 mask, Vector256 merge) { throw new PlatformNotSupportedException(); } /// /// __m256i _mm256_mask_load_epi64 (__m256i s, __mmask8 k, void const * mem_addr) /// VMOVDQA64 ymm1 {k1}{z}, m256 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector256 MaskLoadAligned(ulong* address, Vector256 mask, Vector256 merge) { throw new PlatformNotSupportedException(); } /// /// void _mm_mask_storeu_si128 (void * mem_addr, __mmask16 k, __m128i a) /// VMOVDQU8 m128 {k1}{z}, xmm1 /// - [RequiresUnsafe] public static unsafe void MaskStore(byte* address, Vector128 mask, Vector128 source) { throw new PlatformNotSupportedException(); } /// /// void _mm_mask_storeu_pd (void * mem_addr, __mmask8 k, __m128d a) /// VMOVUPD m128 {k1}{z}, xmm1 /// - [RequiresUnsafe] public static new unsafe void MaskStore(double* address, Vector128 mask, Vector128 source) { throw new PlatformNotSupportedException(); } /// /// void _mm_mask_storeu_si128 (void * mem_addr, __mmask8 k, __m128i a) /// VMOVDQU16 m128 {k1}{z}, xmm1 /// - [RequiresUnsafe] public static unsafe void MaskStore(short* address, Vector128 mask, Vector128 source) { throw new PlatformNotSupportedException(); } /// /// void _mm_mask_storeu_epi32 (void * mem_addr, __mmask8 k, __m128i a) /// VMOVDQU32 m128 {k1}{z}, xmm1 /// - [RequiresUnsafe] public static new unsafe void MaskStore(int* address, Vector128 mask, Vector128 source) { throw new PlatformNotSupportedException(); } /// /// void _mm_mask_storeu_epi64 (void * mem_addr, __mmask8 k, __m128i a) /// VMOVDQU64 m128 {k1}{z}, xmm1 /// - [RequiresUnsafe] public static new unsafe void MaskStore(long* address, Vector128 mask, Vector128 source) { throw new PlatformNotSupportedException(); } /// /// void _mm_mask_storeu_si128 (void * mem_addr, __mmask16 k, __m128i a) /// VMOVDQU8 m128 {k1}{z}, xmm1 /// - [RequiresUnsafe] public static unsafe void MaskStore(sbyte* address, Vector128 mask, Vector128 source) { throw new PlatformNotSupportedException(); } /// /// void _mm_mask_storeu_ps (void * mem_addr, __mmask8 k, __m128 a) /// VMOVUPS m128 {k1}{z}, xmm1 /// - [RequiresUnsafe] public static new unsafe void MaskStore(float* address, Vector128 mask, Vector128 source) { throw new PlatformNotSupportedException(); } /// /// void _mm_mask_storeu_si128 (void * mem_addr, __mmask8 k, __m128i a) /// VMOVDQU16 m128 {k1}{z}, xmm1 /// - [RequiresUnsafe] public static unsafe void MaskStore(ushort* address, Vector128 mask, Vector128 source) { throw new PlatformNotSupportedException(); } /// /// void _mm_mask_storeu_epi32 (void * mem_addr, __mmask8 k, __m128i a) /// VMOVDQU32 m128 {k1}{z}, xmm1 /// - [RequiresUnsafe] public static new unsafe void MaskStore(uint* address, Vector128 mask, Vector128 source) { throw new PlatformNotSupportedException(); } /// /// void _mm_mask_storeu_epi64 (void * mem_addr, __mmask8 k, __m128i a) /// VMOVDQU64 m128 {k1}{z}, xmm1 /// - [RequiresUnsafe] public static new unsafe void MaskStore(ulong* address, Vector128 mask, Vector128 source) { throw new PlatformNotSupportedException(); } /// /// void _mm256_mask_storeu_si256 (void * mem_addr, __mmask32 k, __m256i a) /// VMOVDQU8 m256 {k1}{z}, ymm1 /// - [RequiresUnsafe] public static unsafe void MaskStore(byte* address, Vector256 mask, Vector256 source) { throw new PlatformNotSupportedException(); } /// /// void _mm256_mask_storeu_pd (void * mem_addr, __mmask8 k, __m256d a) /// VMOVUPD m256 {k1}{z}, ymm1 /// - [RequiresUnsafe] public static new unsafe void MaskStore(double* address, Vector256 mask, Vector256 source) { throw new PlatformNotSupportedException(); } /// /// void _mm256_mask_storeu_si256 (void * mem_addr, __mmask16 k, __m256i a) /// VMOVDQU16 m256 {k1}{z}, ymm1 /// - [RequiresUnsafe] public static unsafe void MaskStore(short* address, Vector256 mask, Vector256 source) { throw new PlatformNotSupportedException(); } /// /// void _mm256_mask_storeu_epi32 (void * mem_addr, __mmask8 k, __m256i a) /// VMOVDQU32 m256 {k1}{z}, ymm1 /// - [RequiresUnsafe] public static new unsafe void MaskStore(int* address, Vector256 mask, Vector256 source) { throw new PlatformNotSupportedException(); } /// /// void _mm256_mask_storeu_epi64 (void * mem_addr, __mmask8 k, __m256i a) /// VMOVDQU64 m256 {k1}{z}, ymm1 /// - [RequiresUnsafe] public static new unsafe void MaskStore(long* address, Vector256 mask, Vector256 source) { throw new PlatformNotSupportedException(); } /// /// void _mm256_mask_storeu_si256 (void * mem_addr, __mmask32 k, __m256i a) /// VMOVDQU8 m256 {k1}{z}, ymm1 /// - [RequiresUnsafe] public static unsafe void MaskStore(sbyte* address, Vector256 mask, Vector256 source) { throw new PlatformNotSupportedException(); } /// /// void _mm256_mask_storeu_ps (void * mem_addr, __mmask8 k, __m256 a) /// VMOVUPS m256 {k1}{z}, ymm1 /// - [RequiresUnsafe] public static new unsafe void MaskStore(float* address, Vector256 mask, Vector256 source) { throw new PlatformNotSupportedException(); } /// /// void _mm256_mask_storeu_si256 (void * mem_addr, __mmask16 k, __m256i a) /// VMOVDQU16 m256 {k1}{z}, ymm1 /// - [RequiresUnsafe] public static unsafe void MaskStore(ushort* address, Vector256 mask, Vector256 source) { throw new PlatformNotSupportedException(); } /// /// void _mm256_mask_storeu_epi32 (void * mem_addr, __mmask8 k, __m256i a) /// VMOVDQU32 m256 {k1}{z}, ymm1 /// - [RequiresUnsafe] public static new unsafe void MaskStore(uint* address, Vector256 mask, Vector256 source) { throw new PlatformNotSupportedException(); } /// /// void _mm256_mask_storeu_epi64 (void * mem_addr, __mmask8 k, __m256i a) /// VMOVDQU64 m256 {k1}{z}, ymm1 /// - [RequiresUnsafe] public static new unsafe void MaskStore(ulong* address, Vector256 mask, Vector256 source) { throw new PlatformNotSupportedException(); } /// /// void _mm_mask_store_pd (void * mem_addr, __mmask8 k, __m128d a) /// VMOVAPD m128 {k1}{z}, xmm1 /// - [RequiresUnsafe] public static unsafe void MaskStoreAligned(double* address, Vector128 mask, Vector128 source) { throw new PlatformNotSupportedException(); } /// /// void _mm_mask_store_epi32 (void * mem_addr, __mmask8 k, __m128i a) /// VMOVDQA32 m128 {k1}{z}, xmm1 /// - [RequiresUnsafe] public static unsafe void MaskStoreAligned(int* address, Vector128 mask, Vector128 source) { throw new PlatformNotSupportedException(); } /// /// void _mm_mask_store_epi64 (void * mem_addr, __mmask8 k, __m128i a) /// VMOVDQA32 m128 {k1}{z}, xmm1 /// - [RequiresUnsafe] public static unsafe void MaskStoreAligned(long* address, Vector128 mask, Vector128 source) { throw new PlatformNotSupportedException(); } /// /// void _mm_mask_store_ps (void * mem_addr, __mmask8 k, __m128 a) /// VMOVAPS m128 {k1}{z}, xmm1 /// - [RequiresUnsafe] public static unsafe void MaskStoreAligned(float* address, Vector128 mask, Vector128 source) { throw new PlatformNotSupportedException(); } /// /// void _mm_mask_store_epi32 (void * mem_addr, __mmask8 k, __m128i a) /// VMOVDQA32 m128 {k1}{z}, xmm1 /// - [RequiresUnsafe] public static unsafe void MaskStoreAligned(uint* address, Vector128 mask, Vector128 source) { throw new PlatformNotSupportedException(); } /// /// void _mm_mask_store_epi64 (void * mem_addr, __mmask8 k, __m128i a) /// VMOVDQA32 m128 {k1}{z}, xmm1 /// - [RequiresUnsafe] public static unsafe void MaskStoreAligned(ulong* address, Vector128 mask, Vector128 source) { throw new PlatformNotSupportedException(); } /// /// void _mm256_mask_store_pd (void * mem_addr, __mmask8 k, __m256d a) /// VMOVAPD m256 {k1}{z}, ymm1 /// - [RequiresUnsafe] public static unsafe void MaskStoreAligned(double* address, Vector256 mask, Vector256 source) { throw new PlatformNotSupportedException(); } /// /// void _mm256_mask_store_epi32 (void * mem_addr, __mmask8 k, __m256i a) /// VMOVDQA32 m256 {k1}{z}, ymm1 /// - [RequiresUnsafe] public static unsafe void MaskStoreAligned(int* address, Vector256 mask, Vector256 source) { throw new PlatformNotSupportedException(); } /// /// void _mm256_mask_store_epi64 (void * mem_addr, __mmask8 k, __m256i a) /// VMOVDQA32 m256 {k1}{z}, ymm1 /// - [RequiresUnsafe] public static unsafe void MaskStoreAligned(long* address, Vector256 mask, Vector256 source) { throw new PlatformNotSupportedException(); } /// /// void _mm256_mask_store_ps (void * mem_addr, __mmask8 k, __m256 a) /// VMOVAPS m256 {k1}{z}, ymm1 /// - [RequiresUnsafe] public static unsafe void MaskStoreAligned(float* address, Vector256 mask, Vector256 source) { throw new PlatformNotSupportedException(); } /// /// void _mm256_mask_store_epi32 (void * mem_addr, __mmask8 k, __m256i a) /// VMOVDQA32 m256 {k1}{z}, ymm1 /// - [RequiresUnsafe] public static unsafe void MaskStoreAligned(uint* address, Vector256 mask, Vector256 source) { throw new PlatformNotSupportedException(); } /// /// void _mm256_mask_store_epi64 (void * mem_addr, __mmask8 k, __m256i a) /// VMOVDQA32 m256 {k1}{z}, ymm1 /// - [RequiresUnsafe] public static unsafe void MaskStoreAligned(ulong* address, Vector256 mask, Vector256 source) { throw new PlatformNotSupportedException(); } /// @@ -4105,38 +4001,32 @@ internal V512() { } /// __m512i _mm512_broadcast_i64x2 (__m128i const * mem_addr) /// VBROADCASTI64x2 zmm1 {k1}{z}, m128 /// - [RequiresUnsafe] public static unsafe Vector512 BroadcastVector128ToVector512(long* address) { throw new PlatformNotSupportedException(); } /// /// __m512i _mm512_broadcast_i64x2 (__m128i const * mem_addr) /// VBROADCASTI64x2 zmm1 {k1}{z}, m128 /// - [RequiresUnsafe] public static unsafe Vector512 BroadcastVector128ToVector512(ulong* address) { throw new PlatformNotSupportedException(); } /// /// __m512d _mm512_broadcast_f64x2 (__m128d const * mem_addr) /// VBROADCASTF64x2 zmm1 {k1}{z}, m128 /// - [RequiresUnsafe] public static unsafe Vector512 BroadcastVector128ToVector512(double* address) { throw new PlatformNotSupportedException(); } /// /// __m512i _mm512_broadcast_i32x8 (__m256i const * mem_addr) /// VBROADCASTI32x8 zmm1 {k1}{z}, m256 /// - [RequiresUnsafe] public static unsafe Vector512 BroadcastVector256ToVector512(int* address) { throw new PlatformNotSupportedException(); } /// /// __m512i _mm512_broadcast_i32x8 (__m256i const * mem_addr) /// VBROADCASTI32x8 zmm1 {k1}{z}, m256 /// - [RequiresUnsafe] public static unsafe Vector512 BroadcastVector256ToVector512(uint* address) { throw new PlatformNotSupportedException(); } /// /// __m512 _mm512_broadcast_f32x8 (__m256 const * mem_addr) /// VBROADCASTF32x8 zmm1 {k1}{z}, m256 /// - [RequiresUnsafe] public static unsafe Vector512 BroadcastVector256ToVector512(float* address) { throw new PlatformNotSupportedException(); } /// @@ -4175,25 +4065,21 @@ internal V512() { } /// __m512i _mm512_mask_compresstoreu_epi8 (void * s, __mmask64 k, __m512i a) /// VPCOMPRESSB m512 {k1}{z}, zmm2 /// - [RequiresUnsafe] public static unsafe void CompressStore(byte* address, Vector512 mask, Vector512 source) { throw new PlatformNotSupportedException(); } /// /// __m512i _mm512_mask_compresstoreu_epi16 (void * s, __mmask32 k, __m512i a) /// VPCOMPRESSW m512 {k1}{z}, zmm2 /// - [RequiresUnsafe] public static unsafe void CompressStore(short* address, Vector512 mask, Vector512 source) { throw new PlatformNotSupportedException(); } /// /// __m512i _mm512_mask_compresstoreu_epi8 (void * s, __mmask64 k, __m512i a) /// VPCOMPRESSB m512 {k1}{z}, zmm2 /// - [RequiresUnsafe] public static unsafe void CompressStore(sbyte* address, Vector512 mask, Vector512 source) { throw new PlatformNotSupportedException(); } /// /// __m512i _mm512_mask_compresstoreu_epi16 (void * s, __mmask32 k, __m512i a) /// VPCOMPRESSW m512 {k1}{z}, zmm2 /// - [RequiresUnsafe] public static unsafe void CompressStore(ushort* address, Vector512 mask, Vector512 source) { throw new PlatformNotSupportedException(); } /// @@ -4349,28 +4235,24 @@ internal V512() { } /// VPEXPANDB zmm1 {k1}{z}, m512 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector512 ExpandLoad(byte* address, Vector512 mask, Vector512 merge) { throw new PlatformNotSupportedException(); } /// /// __m512i _mm512_mask_expandloadu_epi16 (__m512i s, __mmask32 k, void * const a) /// VPEXPANDW zmm1 {k1}{z}, m512 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector512 ExpandLoad(short* address, Vector512 mask, Vector512 merge) { throw new PlatformNotSupportedException(); } /// /// __m512i _mm512_mask_expandloadu_epi8 (__m512i s, __mmask64 k, void * const a) /// VPEXPANDB zmm1 {k1}{z}, m512 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector512 ExpandLoad(sbyte* address, Vector512 mask, Vector512 merge) { throw new PlatformNotSupportedException(); } /// /// __m512i _mm512_mask_expandloadu_epi16 (__m512i s, __mmask32 k, void * const a) /// VPEXPANDW zmm1 {k1}{z}, m512 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector512 ExpandLoad(ushort* address, Vector512 mask, Vector512 merge) { throw new PlatformNotSupportedException(); } /// diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Avx10v1.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Avx10v1.cs index aaaa02cf2ea57b..e546d3c4364185 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Avx10v1.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Avx10v1.cs @@ -1179,140 +1179,120 @@ internal Avx10v1() { } /// __m128i _mm_mask_compressstoreu_epi8 (void * s, __mmask16 k, __m128i a) /// VPCOMPRESSB m128 {k1}{z}, xmm2 /// - [RequiresUnsafe] public static unsafe void CompressStore(byte* address, Vector128 mask, Vector128 source) => CompressStore(address, mask, source); /// /// __m128d _mm_mask_compressstoreu_pd (void * a, __mmask8 k, __m128d a) /// VCOMPRESSPD m128 {k1}{z}, xmm2 /// - [RequiresUnsafe] public static unsafe void CompressStore(double* address, Vector128 mask, Vector128 source) => CompressStore(address, mask, source); /// /// __m128i _mm_mask_compressstoreu_epi16 (void * s, __mmask8 k, __m128i a) /// VPCOMPRESSW m128 {k1}{z}, xmm2 /// - [RequiresUnsafe] public static unsafe void CompressStore(short* address, Vector128 mask, Vector128 source) => CompressStore(address, mask, source); /// /// __m128i _mm_mask_compressstoreu_epi32 (void * a, __mask8 k, __m128i a) /// VPCOMPRESSD m128 {k1}{z}, xmm2 /// - [RequiresUnsafe] public static unsafe void CompressStore(int* address, Vector128 mask, Vector128 source) => CompressStore(address, mask, source); /// /// __m128i _mm_mask_compressstoreu_epi64 (void * a, __mask8 k, __m128i a) /// VPCOMPRESSQ m128 {k1}{z}, xmm2 /// - [RequiresUnsafe] public static unsafe void CompressStore(long* address, Vector128 mask, Vector128 source) => CompressStore(address, mask, source); /// /// __m128i _mm_mask_compressstoreu_epi8 (void * s, __mmask16 k, __m128i a) /// VPCOMPRESSB m128 {k1}{z}, xmm2 /// - [RequiresUnsafe] public static unsafe void CompressStore(sbyte* address, Vector128 mask, Vector128 source) => CompressStore(address, mask, source); /// /// __m128 _mm_mask_compressstoreu_ps (void * a, __mmask8 k, __m128 a) /// VCOMPRESSPS m128 {k1}{z}, xmm2 /// - [RequiresUnsafe] public static unsafe void CompressStore(float* address, Vector128 mask, Vector128 source) => CompressStore(address, mask, source); /// /// __m128i _mm_mask_compressstoreu_epi16 (void * s, __mmask8 k, __m128i a) /// VPCOMPRESSW m128 {k1}{z}, xmm2 /// - [RequiresUnsafe] public static unsafe void CompressStore(ushort* address, Vector128 mask, Vector128 source) => CompressStore(address, mask, source); /// /// __m128i _mm_mask_compressstoreu_epi32 (void * a, __mask8 k, __m128i a) /// VPCOMPRESSD m128 {k1}{z}, xmm2 /// - [RequiresUnsafe] public static unsafe void CompressStore(uint* address, Vector128 mask, Vector128 source) => CompressStore(address, mask, source); /// /// __m128i _mm_mask_compressstoreu_epi64 (void * a, __mask8 k, __m128i a) /// VPCOMPRESSQ m128 {k1}{z}, xmm2 /// - [RequiresUnsafe] public static unsafe void CompressStore(ulong* address, Vector128 mask, Vector128 source) => CompressStore(address, mask, source); /// /// void _mm256_mask_compressstoreu_epi8 (void * s, __mmask32 k, __m256i a) /// VPCOMPRESSB m256 {k1}{z}, ymm2 /// - [RequiresUnsafe] public static unsafe void CompressStore(byte* address, Vector256 mask, Vector256 source) => CompressStore(address, mask, source); /// /// __m256d _mm256_mask_compressstoreu_pd (void * a, __mmask8 k, __m256d a) /// VCOMPRESSPD m256 {k1}{z}, ymm2 /// - [RequiresUnsafe] public static unsafe void CompressStore(double* address, Vector256 mask, Vector256 source) => CompressStore(address, mask, source); /// /// void _mm256_mask_compressstoreu_epi16 (void * s, __mmask16 k, __m256i a) /// VPCOMPRESSW m256 {k1}{z}, ymm2 /// - [RequiresUnsafe] public static unsafe void CompressStore(short* address, Vector256 mask, Vector256 source) => CompressStore(address, mask, source); /// /// void _mm256_mask_compressstoreu_epi32 (void * a, __mmask8 k, __m256i a) /// VPCOMPRESSD m256 {k1}{z}, ymm2 /// - [RequiresUnsafe] public static unsafe void CompressStore(int* address, Vector256 mask, Vector256 source) => CompressStore(address, mask, source); /// /// void _mm256_mask_compressstoreu_epi64 (void * a, __mmask8 k, __m256i a) /// VPCOMPRESSQ m256 {k1}{z}, ymm2 /// - [RequiresUnsafe] public static unsafe void CompressStore(long* address, Vector256 mask, Vector256 source) => CompressStore(address, mask, source); /// /// void _mm256_mask_compressstoreu_epi8 (void * s, __mmask32 k, __m256i a) /// VPCOMPRESSB m256 {k1}{z}, ymm2 /// - [RequiresUnsafe] public static unsafe void CompressStore(sbyte* address, Vector256 mask, Vector256 source) => CompressStore(address, mask, source); /// /// __m256 _mm256_mask_compressstoreu_ps (void * a, __mmask8 k, __m256 a) /// VCOMPRESSPS m256 {k1}{z}, ymm2 /// - [RequiresUnsafe] public static unsafe void CompressStore(float* address, Vector256 mask, Vector256 source) => CompressStore(address, mask, source); /// /// void _mm256_mask_compressstoreu_epi16 (void * s, __mmask16 k, __m256i a) /// VPCOMPRESSW m256 {k1}{z}, ymm2 /// - [RequiresUnsafe] public static unsafe void CompressStore(ushort* address, Vector256 mask, Vector256 source) => CompressStore(address, mask, source); /// /// void _mm256_mask_compressstoreu_epi32 (void * a, __mmask8 k, __m256i a) /// VPCOMPRESSD m256 {k1}{z}, ymm2 /// - [RequiresUnsafe] public static unsafe void CompressStore(uint* address, Vector256 mask, Vector256 source) => CompressStore(address, mask, source); /// /// void _mm256_mask_compressstoreu_epi64 (void * a, __mmask8 k, __m256i a) /// VPCOMPRESSQ m256 {k1}{z}, ymm2 /// - [RequiresUnsafe] public static unsafe void CompressStore(ulong* address, Vector256 mask, Vector256 source) => CompressStore(address, mask, source); /// @@ -2112,7 +2092,6 @@ internal Avx10v1() { } /// VPEXPANDB xmm1 {k1}{z}, m128 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector128 ExpandLoad(byte* address, Vector128 mask, Vector128 merge) => ExpandLoad(address, mask, merge); /// @@ -2120,7 +2099,6 @@ internal Avx10v1() { } /// VEXPANDPD xmm1 {k1}{z}, m128 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector128 ExpandLoad(double* address, Vector128 mask, Vector128 merge) => ExpandLoad(address, mask, merge); /// @@ -2128,7 +2106,6 @@ internal Avx10v1() { } /// VPEXPANDW xmm1 {k1}{z}, m128 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector128 ExpandLoad(short* address, Vector128 mask, Vector128 merge) => ExpandLoad(address, mask, merge); /// @@ -2136,7 +2113,6 @@ internal Avx10v1() { } /// VPEXPANDD xmm1 {k1}{z}, m128 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector128 ExpandLoad(int* address, Vector128 mask, Vector128 merge) => ExpandLoad(address, mask, merge); /// @@ -2144,7 +2120,6 @@ internal Avx10v1() { } /// VPEXPANDQ xmm1 {k1}{z}, m128 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector128 ExpandLoad(long* address, Vector128 mask, Vector128 merge) => ExpandLoad(address, mask, merge); /// @@ -2152,7 +2127,6 @@ internal Avx10v1() { } /// VPEXPANDB xmm1 {k1}{z}, m128 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector128 ExpandLoad(sbyte* address, Vector128 mask, Vector128 merge) => ExpandLoad(address, mask, merge); /// @@ -2160,7 +2134,6 @@ internal Avx10v1() { } /// VEXPANDPS xmm1 {k1}{z}, m128 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector128 ExpandLoad(float* address, Vector128 mask, Vector128 merge) => ExpandLoad(address, mask, merge); /// @@ -2168,7 +2141,6 @@ internal Avx10v1() { } /// VPEXPANDW xmm1 {k1}{z}, m128 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector128 ExpandLoad(ushort* address, Vector128 mask, Vector128 merge) => ExpandLoad(address, mask, merge); /// @@ -2176,7 +2148,6 @@ internal Avx10v1() { } /// VPEXPANDD xmm1 {k1}{z}, m128 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector128 ExpandLoad(uint* address, Vector128 mask, Vector128 merge) => ExpandLoad(address, mask, merge); /// @@ -2184,7 +2155,6 @@ internal Avx10v1() { } /// VPEXPANDQ xmm1 {k1}{z}, m128 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector128 ExpandLoad(ulong* address, Vector128 mask, Vector128 merge) => ExpandLoad(address, mask, merge); /// @@ -2192,7 +2162,6 @@ internal Avx10v1() { } /// VPEXPANDB ymm1 {k1}{z}, m256 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector256 ExpandLoad(byte* address, Vector256 mask, Vector256 merge) => ExpandLoad(address, mask, merge); /// @@ -2200,7 +2169,6 @@ internal Avx10v1() { } /// VEXPANDPD ymm1 {k1}{z}, m256 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector256 ExpandLoad(double* address, Vector256 mask, Vector256 merge) => ExpandLoad(address, mask, merge); /// @@ -2208,7 +2176,6 @@ internal Avx10v1() { } /// VPEXPANDW ymm1 {k1}{z}, m256 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector256 ExpandLoad(short* address, Vector256 mask, Vector256 merge) => ExpandLoad(address, mask, merge); /// @@ -2216,7 +2183,6 @@ internal Avx10v1() { } /// VPEXPANDD ymm1 {k1}{z}, m256 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector256 ExpandLoad(int* address, Vector256 mask, Vector256 merge) => ExpandLoad(address, mask, merge); /// @@ -2224,7 +2190,6 @@ internal Avx10v1() { } /// VPEXPANDQ ymm1 {k1}{z}, m256 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector256 ExpandLoad(long* address, Vector256 mask, Vector256 merge) => ExpandLoad(address, mask, merge); /// @@ -2232,7 +2197,6 @@ internal Avx10v1() { } /// VPEXPANDB ymm1 {k1}{z}, m256 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector256 ExpandLoad(sbyte* address, Vector256 mask, Vector256 merge) => ExpandLoad(address, mask, merge); /// @@ -2240,7 +2204,6 @@ internal Avx10v1() { } /// VEXPANDPS ymm1 {k1}{z}, m256 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector256 ExpandLoad(float* address, Vector256 mask, Vector256 merge) => ExpandLoad(address, mask, merge); /// @@ -2248,7 +2211,6 @@ internal Avx10v1() { } /// VPEXPANDW ymm1 {k1}{z}, m256 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector256 ExpandLoad(ushort* address, Vector256 mask, Vector256 merge) => ExpandLoad(address, mask, merge); /// @@ -2256,7 +2218,6 @@ internal Avx10v1() { } /// VPEXPANDD ymm1 {k1}{z}, m256 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector256 ExpandLoad(uint* address, Vector256 mask, Vector256 merge) => ExpandLoad(address, mask, merge); /// @@ -2264,7 +2225,6 @@ internal Avx10v1() { } /// VPEXPANDQ ymm1 {k1}{z}, m256 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector256 ExpandLoad(ulong* address, Vector256 mask, Vector256 merge) => ExpandLoad(address, mask, merge); /// @@ -2479,7 +2439,6 @@ internal Avx10v1() { } /// VMOVDQU8 xmm1 {k1}{z}, m128 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector128 MaskLoad(byte* address, Vector128 mask, Vector128 merge) => MaskLoad(address, mask, merge); /// @@ -2487,7 +2446,6 @@ internal Avx10v1() { } /// VMOVUPD xmm1 {k1}{z}, m128 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector128 MaskLoad(double* address, Vector128 mask, Vector128 merge) => MaskLoad(address, mask, merge); /// @@ -2495,7 +2453,6 @@ internal Avx10v1() { } /// VMOVDQU32 xmm1 {k1}{z}, m128 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector128 MaskLoad(short* address, Vector128 mask, Vector128 merge) => MaskLoad(address, mask, merge); /// @@ -2503,7 +2460,6 @@ internal Avx10v1() { } /// VMOVDQU32 xmm1 {k1}{z}, m128 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector128 MaskLoad(int* address, Vector128 mask, Vector128 merge) => MaskLoad(address, mask, merge); /// @@ -2511,7 +2467,6 @@ internal Avx10v1() { } /// VMOVDQU64 xmm1 {k1}{z}, m128 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector128 MaskLoad(long* address, Vector128 mask, Vector128 merge) => MaskLoad(address, mask, merge); /// @@ -2519,7 +2474,6 @@ internal Avx10v1() { } /// VMOVDQU8 xmm1 {k1}{z}, m128 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector128 MaskLoad(sbyte* address, Vector128 mask, Vector128 merge) => MaskLoad(address, mask, merge); /// @@ -2527,7 +2481,6 @@ internal Avx10v1() { } /// VMOVUPS xmm1 {k1}{z}, m128 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector128 MaskLoad(float* address, Vector128 mask, Vector128 merge) => MaskLoad(address, mask, merge); /// @@ -2535,7 +2488,6 @@ internal Avx10v1() { } /// VMOVDQU32 xmm1 {k1}{z}, m128 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector128 MaskLoad(ushort* address, Vector128 mask, Vector128 merge) => MaskLoad(address, mask, merge); /// @@ -2543,7 +2495,6 @@ internal Avx10v1() { } /// VMOVDQU32 xmm1 {k1}{z}, m128 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector128 MaskLoad(uint* address, Vector128 mask, Vector128 merge) => MaskLoad(address, mask, merge); /// @@ -2551,7 +2502,6 @@ internal Avx10v1() { } /// VMOVDQU64 xmm1 {k1}{z}, m128 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector128 MaskLoad(ulong* address, Vector128 mask, Vector128 merge) => MaskLoad(address, mask, merge); /// @@ -2559,7 +2509,6 @@ internal Avx10v1() { } /// VMOVDQU8 ymm1 {k1}{z}, m256 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector256 MaskLoad(byte* address, Vector256 mask, Vector256 merge) => MaskLoad(address, mask, merge); /// @@ -2567,7 +2516,6 @@ internal Avx10v1() { } /// VMOVUPD ymm1 {k1}{z}, m256 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector256 MaskLoad(double* address, Vector256 mask, Vector256 merge) => MaskLoad(address, mask, merge); /// @@ -2575,14 +2523,12 @@ internal Avx10v1() { } /// VMOVDQU32 ymm1 {k1}{z}, m256 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector256 MaskLoad(short* address, Vector256 mask, Vector256 merge) => MaskLoad(address, mask, merge); /// /// __m256i _mm256_mask_loadu_epi32 (__m256i s, __mmask8 k, void const * mem_addr) /// VMOVDQU32 ymm1 {k1}{z}, m256 /// - [RequiresUnsafe] public static unsafe Vector256 MaskLoad(int* address, Vector256 mask, Vector256 merge) => MaskLoad(address, mask, merge); /// @@ -2590,7 +2536,6 @@ internal Avx10v1() { } /// VMOVDQU64 ymm1 {k1}{z}, m256 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector256 MaskLoad(long* address, Vector256 mask, Vector256 merge) => MaskLoad(address, mask, merge); /// @@ -2598,7 +2543,6 @@ internal Avx10v1() { } /// VMOVDQU8 ymm1 {k1}{z}, m256 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector256 MaskLoad(sbyte* address, Vector256 mask, Vector256 merge) => MaskLoad(address, mask, merge); /// @@ -2606,7 +2550,6 @@ internal Avx10v1() { } /// VMOVUPS ymm1 {k1}{z}, m256 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector256 MaskLoad(float* address, Vector256 mask, Vector256 merge) => MaskLoad(address, mask, merge); /// @@ -2614,7 +2557,6 @@ internal Avx10v1() { } /// VMOVDQU32 ymm1 {k1}{z}, m256 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector256 MaskLoad(ushort* address, Vector256 mask, Vector256 merge) => MaskLoad(address, mask, merge); /// @@ -2622,7 +2564,6 @@ internal Avx10v1() { } /// VMOVDQU32 ymm1 {k1}{z}, m256 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector256 MaskLoad(uint* address, Vector256 mask, Vector256 merge) => MaskLoad(address, mask, merge); /// @@ -2630,7 +2571,6 @@ internal Avx10v1() { } /// VMOVDQU64 ymm1 {k1}{z}, m256 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector256 MaskLoad(ulong* address, Vector256 mask, Vector256 merge) => MaskLoad(address, mask, merge); /// @@ -2638,7 +2578,6 @@ internal Avx10v1() { } /// VMOVAPD xmm1 {k1}{z}, m128 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector128 MaskLoadAligned(double* address, Vector128 mask, Vector128 merge) => MaskLoadAligned(address, mask, merge); /// @@ -2646,7 +2585,6 @@ internal Avx10v1() { } /// VMOVDQA32 xmm1 {k1}{z}, m128 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector128 MaskLoadAligned(int* address, Vector128 mask, Vector128 merge) => MaskLoadAligned(address, mask, merge); /// @@ -2654,7 +2592,6 @@ internal Avx10v1() { } /// VMOVDQA64 xmm1 {k1}{z}, m128 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector128 MaskLoadAligned(long* address, Vector128 mask, Vector128 merge) => MaskLoadAligned(address, mask, merge); /// @@ -2662,7 +2599,6 @@ internal Avx10v1() { } /// VMOVAPS xmm1 {k1}{z}, m128 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector128 MaskLoadAligned(float* address, Vector128 mask, Vector128 merge) => MaskLoadAligned(address, mask, merge); /// @@ -2670,7 +2606,6 @@ internal Avx10v1() { } /// VMOVDQA32 xmm1 {k1}{z}, m128 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector128 MaskLoadAligned(uint* address, Vector128 mask, Vector128 merge) => MaskLoadAligned(address, mask, merge); /// @@ -2678,7 +2613,6 @@ internal Avx10v1() { } /// VMOVDQA64 xmm1 {k1}{z}, m128 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector128 MaskLoadAligned(ulong* address, Vector128 mask, Vector128 merge) => MaskLoadAligned(address, mask, merge); /// @@ -2686,7 +2620,6 @@ internal Avx10v1() { } /// VMOVAPD ymm1 {k1}{z}, m256 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector256 MaskLoadAligned(double* address, Vector256 mask, Vector256 merge) => MaskLoadAligned(address, mask, merge); /// @@ -2694,7 +2627,6 @@ internal Avx10v1() { } /// VMOVDQA32 ymm1 {k1}{z}, m256 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector256 MaskLoadAligned(int* address, Vector256 mask, Vector256 merge) => MaskLoadAligned(address, mask, merge); /// @@ -2702,7 +2634,6 @@ internal Avx10v1() { } /// VMOVDQA64 ymm1 {k1}{z}, m256 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector256 MaskLoadAligned(long* address, Vector256 mask, Vector256 merge) => MaskLoadAligned(address, mask, merge); /// @@ -2710,7 +2641,6 @@ internal Avx10v1() { } /// VMOVAPS ymm1 {k1}{z}, m256 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector256 MaskLoadAligned(float* address, Vector256 mask, Vector256 merge) => MaskLoadAligned(address, mask, merge); /// @@ -2718,7 +2648,6 @@ internal Avx10v1() { } /// VMOVDQA32 ymm1 {k1}{z}, m256 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector256 MaskLoadAligned(uint* address, Vector256 mask, Vector256 merge) => MaskLoadAligned(address, mask, merge); /// @@ -2726,231 +2655,198 @@ internal Avx10v1() { } /// VMOVDQA64 ymm1 {k1}{z}, m256 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector256 MaskLoadAligned(ulong* address, Vector256 mask, Vector256 merge) => MaskLoadAligned(address, mask, merge); /// /// void _mm_mask_storeu_si128 (void * mem_addr, __mmask16 k, __m128i a) /// VMOVDQU8 m128 {k1}{z}, xmm1 /// - [RequiresUnsafe] public static unsafe void MaskStore(byte* address, Vector128 mask, Vector128 source) => MaskStore(address, mask, source); /// /// void _mm_mask_storeu_pd (void * mem_addr, __mmask8 k, __m128d a) /// VMOVUPD m128 {k1}{z}, xmm1 /// - [RequiresUnsafe] public static new unsafe void MaskStore(double* address, Vector128 mask, Vector128 source) => MaskStore(address, mask, source); /// /// void _mm_mask_storeu_si128 (void * mem_addr, __mmask8 k, __m128i a) /// VMOVDQU16 m128 {k1}{z}, xmm1 /// - [RequiresUnsafe] public static unsafe void MaskStore(short* address, Vector128 mask, Vector128 source) => MaskStore(address, mask, source); /// /// void _mm_mask_storeu_epi32 (void * mem_addr, __mmask8 k, __m128i a) /// VMOVDQU32 m128 {k1}{z}, xmm1 /// - [RequiresUnsafe] public static new unsafe void MaskStore(int* address, Vector128 mask, Vector128 source) => MaskStore(address, mask, source); /// /// void _mm_mask_storeu_epi64 (void * mem_addr, __mmask8 k, __m128i a) /// VMOVDQU64 m128 {k1}{z}, xmm1 /// - [RequiresUnsafe] public static new unsafe void MaskStore(long* address, Vector128 mask, Vector128 source) => MaskStore(address, mask, source); /// /// void _mm_mask_storeu_si128 (void * mem_addr, __mmask16 k, __m128i a) /// VMOVDQU8 m128 {k1}{z}, xmm1 /// - [RequiresUnsafe] public static unsafe void MaskStore(sbyte* address, Vector128 mask, Vector128 source) => MaskStore(address, mask, source); /// /// void _mm_mask_storeu_ps (void * mem_addr, __mmask8 k, __m128 a) /// VMOVUPS m128 {k1}{z}, xmm1 /// - [RequiresUnsafe] public static new unsafe void MaskStore(float* address, Vector128 mask, Vector128 source) => MaskStore(address, mask, source); /// /// void _mm_mask_storeu_si128 (void * mem_addr, __mmask8 k, __m128i a) /// VMOVDQU16 m128 {k1}{z}, xmm1 /// - [RequiresUnsafe] public static unsafe void MaskStore(ushort* address, Vector128 mask, Vector128 source) => MaskStore(address, mask, source); /// /// void _mm_mask_storeu_epi32 (void * mem_addr, __mmask8 k, __m128i a) /// VMOVDQU32 m128 {k1}{z}, xmm1 /// - [RequiresUnsafe] public static new unsafe void MaskStore(uint* address, Vector128 mask, Vector128 source) => MaskStore(address, mask, source); /// /// void _mm_mask_storeu_epi64 (void * mem_addr, __mmask8 k, __m128i a) /// VMOVDQU64 m128 {k1}{z}, xmm1 /// - [RequiresUnsafe] public static new unsafe void MaskStore(ulong* address, Vector128 mask, Vector128 source) => MaskStore(address, mask, source); /// /// void _mm256_mask_storeu_si256 (void * mem_addr, __mmask32 k, __m256i a) /// VMOVDQU8 m256 {k1}{z}, ymm1 /// - [RequiresUnsafe] public static unsafe void MaskStore(byte* address, Vector256 mask, Vector256 source) => MaskStore(address, mask, source); /// /// void _mm256_mask_storeu_pd (void * mem_addr, __mmask8 k, __m256d a) /// VMOVUPD m256 {k1}{z}, ymm1 /// - [RequiresUnsafe] public static new unsafe void MaskStore(double* address, Vector256 mask, Vector256 source) => MaskStore(address, mask, source); /// /// void _mm256_mask_storeu_si256 (void * mem_addr, __mmask16 k, __m256i a) /// VMOVDQU16 m256 {k1}{z}, ymm1 /// - [RequiresUnsafe] public static unsafe void MaskStore(short* address, Vector256 mask, Vector256 source) => MaskStore(address, mask, source); /// /// void _mm256_mask_storeu_epi32 (void * mem_addr, __mmask8 k, __m256i a) /// VMOVDQU32 m256 {k1}{z}, ymm1 /// - [RequiresUnsafe] public static new unsafe void MaskStore(int* address, Vector256 mask, Vector256 source) => MaskStore(address, mask, source); /// /// void _mm256_mask_storeu_epi64 (void * mem_addr, __mmask8 k, __m256i a) /// VMOVDQU64 m256 {k1}{z}, ymm1 /// - [RequiresUnsafe] public static new unsafe void MaskStore(long* address, Vector256 mask, Vector256 source) => MaskStore(address, mask, source); /// /// void _mm256_mask_storeu_si256 (void * mem_addr, __mmask32 k, __m256i a) /// VMOVDQU8 m256 {k1}{z}, ymm1 /// - [RequiresUnsafe] public static unsafe void MaskStore(sbyte* address, Vector256 mask, Vector256 source) => MaskStore(address, mask, source); /// /// void _mm256_mask_storeu_ps (void * mem_addr, __mmask8 k, __m256 a) /// VMOVUPS m256 {k1}{z}, ymm1 /// - [RequiresUnsafe] public static new unsafe void MaskStore(float* address, Vector256 mask, Vector256 source) => MaskStore(address, mask, source); /// /// void _mm256_mask_storeu_si256 (void * mem_addr, __mmask16 k, __m256i a) /// VMOVDQU16 m256 {k1}{z}, ymm1 /// - [RequiresUnsafe] public static unsafe void MaskStore(ushort* address, Vector256 mask, Vector256 source) => MaskStore(address, mask, source); /// /// void _mm256_mask_storeu_epi32 (void * mem_addr, __mmask8 k, __m256i a) /// VMOVDQU32 m256 {k1}{z}, ymm1 /// - [RequiresUnsafe] public static new unsafe void MaskStore(uint* address, Vector256 mask, Vector256 source) => MaskStore(address, mask, source); /// /// void _mm256_mask_storeu_epi64 (void * mem_addr, __mmask8 k, __m256i a) /// VMOVDQU64 m256 {k1}{z}, ymm1 /// - [RequiresUnsafe] public static new unsafe void MaskStore(ulong* address, Vector256 mask, Vector256 source) => MaskStore(address, mask, source); /// /// void _mm_mask_store_pd (void * mem_addr, __mmask8 k, __m128d a) /// VMOVAPD m128 {k1}{z}, xmm1 /// - [RequiresUnsafe] public static unsafe void MaskStoreAligned(double* address, Vector128 mask, Vector128 source) => MaskStoreAligned(address, mask, source); /// /// void _mm_mask_store_epi32 (void * mem_addr, __mmask8 k, __m128i a) /// VMOVDQA32 m128 {k1}{z}, xmm1 /// - [RequiresUnsafe] public static unsafe void MaskStoreAligned(int* address, Vector128 mask, Vector128 source) => MaskStoreAligned(address, mask, source); /// /// void _mm_mask_store_epi64 (void * mem_addr, __mmask8 k, __m128i a) /// VMOVDQA32 m128 {k1}{z}, xmm1 /// - [RequiresUnsafe] public static unsafe void MaskStoreAligned(long* address, Vector128 mask, Vector128 source) => MaskStoreAligned(address, mask, source); /// /// void _mm_mask_store_ps (void * mem_addr, __mmask8 k, __m128 a) /// VMOVAPS m128 {k1}{z}, xmm1 /// - [RequiresUnsafe] public static unsafe void MaskStoreAligned(float* address, Vector128 mask, Vector128 source) => MaskStoreAligned(address, mask, source); /// /// void _mm_mask_store_epi32 (void * mem_addr, __mmask8 k, __m128i a) /// VMOVDQA32 m128 {k1}{z}, xmm1 /// - [RequiresUnsafe] public static unsafe void MaskStoreAligned(uint* address, Vector128 mask, Vector128 source) => MaskStoreAligned(address, mask, source); /// /// void _mm_mask_store_epi64 (void * mem_addr, __mmask8 k, __m128i a) /// VMOVDQA32 m128 {k1}{z}, xmm1 /// - [RequiresUnsafe] public static unsafe void MaskStoreAligned(ulong* address, Vector128 mask, Vector128 source) => MaskStoreAligned(address, mask, source); /// /// void _mm256_mask_store_pd (void * mem_addr, __mmask8 k, __m256d a) /// VMOVAPD m256 {k1}{z}, ymm1 /// - [RequiresUnsafe] public static unsafe void MaskStoreAligned(double* address, Vector256 mask, Vector256 source) => MaskStoreAligned(address, mask, source); /// /// void _mm256_mask_store_epi32 (void * mem_addr, __mmask8 k, __m256i a) /// VMOVDQA32 m256 {k1}{z}, ymm1 /// - [RequiresUnsafe] public static unsafe void MaskStoreAligned(int* address, Vector256 mask, Vector256 source) => MaskStoreAligned(address, mask, source); /// /// void _mm256_mask_store_epi64 (void * mem_addr, __mmask8 k, __m256i a) /// VMOVDQA32 m256 {k1}{z}, ymm1 /// - [RequiresUnsafe] public static unsafe void MaskStoreAligned(long* address, Vector256 mask, Vector256 source) => MaskStoreAligned(address, mask, source); /// /// void _mm256_mask_store_ps (void * mem_addr, __mmask8 k, __m256 a) /// VMOVAPS m256 {k1}{z}, ymm1 /// - [RequiresUnsafe] public static unsafe void MaskStoreAligned(float* address, Vector256 mask, Vector256 source) => MaskStoreAligned(address, mask, source); /// /// void _mm256_mask_store_epi32 (void * mem_addr, __mmask8 k, __m256i a) /// VMOVDQA32 m256 {k1}{z}, ymm1 /// - [RequiresUnsafe] public static unsafe void MaskStoreAligned(uint* address, Vector256 mask, Vector256 source) => MaskStoreAligned(address, mask, source); /// /// void _mm256_mask_store_epi64 (void * mem_addr, __mmask8 k, __m256i a) /// VMOVDQA32 m256 {k1}{z}, ymm1 /// - [RequiresUnsafe] public static unsafe void MaskStoreAligned(ulong* address, Vector256 mask, Vector256 source) => MaskStoreAligned(address, mask, source); /// @@ -4197,42 +4093,36 @@ internal V512() { } /// __m512i _mm512_broadcast_i64x2 (__m128i const * mem_addr) /// VBROADCASTI64x2 zmm1 {k1}{z}, m128 /// - [RequiresUnsafe] public static unsafe Vector512 BroadcastVector128ToVector512(long* address) => BroadcastVector128ToVector512(address); /// /// __m512i _mm512_broadcast_i64x2 (__m128i const * mem_addr) /// VBROADCASTI64x2 zmm1 {k1}{z}, m128 /// - [RequiresUnsafe] public static unsafe Vector512 BroadcastVector128ToVector512(ulong* address) => BroadcastVector128ToVector512(address); /// /// __m512d _mm512_broadcast_f64x2 (__m128d const * mem_addr) /// VBROADCASTF64x2 zmm1 {k1}{z}, m128 /// - [RequiresUnsafe] public static unsafe Vector512 BroadcastVector128ToVector512(double* address) => BroadcastVector128ToVector512(address); /// /// __m512i _mm512_broadcast_i32x8 (__m256i const * mem_addr) /// VBROADCASTI32x8 zmm1 {k1}{z}, m256 /// - [RequiresUnsafe] public static unsafe Vector512 BroadcastVector256ToVector512(int* address) => BroadcastVector256ToVector512(address); /// /// __m512i _mm512_broadcast_i32x8 (__m256i const * mem_addr) /// VBROADCASTI32x8 zmm1 {k1}{z}, m256 /// - [RequiresUnsafe] public static unsafe Vector512 BroadcastVector256ToVector512(uint* address) => BroadcastVector256ToVector512(address); /// /// __m512 _mm512_broadcast_f32x8 (__m256 const * mem_addr) /// VBROADCASTF32x8 zmm1 {k1}{z}, m256 /// - [RequiresUnsafe] public static unsafe Vector512 BroadcastVector256ToVector512(float* address) => BroadcastVector256ToVector512(address); /// @@ -4271,28 +4161,24 @@ internal V512() { } /// __m512i _mm512_mask_compresstoreu_epi8 (void * s, __mmask64 k, __m512i a) /// VPCOMPRESSB m512 {k1}{z}, zmm2 /// - [RequiresUnsafe] public static unsafe void CompressStore(byte* address, Vector512 mask, Vector512 source) => CompressStore(address, mask, source); /// /// __m512i _mm512_mask_compresstoreu_epi16 (void * s, __mmask32 k, __m512i a) /// VPCOMPRESSW m512 {k1}{z}, zmm2 /// - [RequiresUnsafe] public static unsafe void CompressStore(short* address, Vector512 mask, Vector512 source) => CompressStore(address, mask, source); /// /// __m512i _mm512_mask_compresstoreu_epi8 (void * s, __mmask64 k, __m512i a) /// VPCOMPRESSB m512 {k1}{z}, zmm2 /// - [RequiresUnsafe] public static unsafe void CompressStore(sbyte* address, Vector512 mask, Vector512 source) => CompressStore(address, mask, source); /// /// __m512i _mm512_mask_compresstoreu_epi16 (void * s, __mmask32 k, __m512i a) /// VPCOMPRESSW m512 {k1}{z}, zmm2 /// - [RequiresUnsafe] public static unsafe void CompressStore(ushort* address, Vector512 mask, Vector512 source) => CompressStore(address, mask, source); /// @@ -4448,7 +4334,6 @@ internal V512() { } /// VPEXPANDB zmm1 {k1}{z}, m512 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector512 ExpandLoad(byte* address, Vector512 mask, Vector512 merge) => ExpandLoad(address, mask, merge); /// @@ -4456,7 +4341,6 @@ internal V512() { } /// VPEXPANDW zmm1 {k1}{z}, m512 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector512 ExpandLoad(short* address, Vector512 mask, Vector512 merge) => ExpandLoad(address, mask, merge); /// @@ -4464,7 +4348,6 @@ internal V512() { } /// VPEXPANDB zmm1 {k1}{z}, m512 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector512 ExpandLoad(sbyte* address, Vector512 mask, Vector512 merge) => ExpandLoad(address, mask, merge); /// @@ -4472,7 +4355,6 @@ internal V512() { } /// VPEXPANDW zmm1 {k1}{z}, m512 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector512 ExpandLoad(ushort* address, Vector512 mask, Vector512 merge) => ExpandLoad(address, mask, merge); /// diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Avx10v2.PlatformNotSupported.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Avx10v2.PlatformNotSupported.cs index 9f1eb6b5ed908b..f35bcb189f6aec 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Avx10v2.PlatformNotSupported.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Avx10v2.PlatformNotSupported.cs @@ -112,13 +112,11 @@ internal Avx10v2() { } /// /// VMOVW xmm1/m16, xmm2 /// - [RequiresUnsafe] public static unsafe void StoreScalar(short* address, Vector128 source) { throw new PlatformNotSupportedException(); } /// /// VMOVW xmm1/m16, xmm2 /// - [RequiresUnsafe] public static unsafe void StoreScalar(ushort* address, Vector128 source) { throw new PlatformNotSupportedException(); } /// Provides access to the x86 AVX10.2 hardware instructions, that are only available to 64-bit processes, via intrinsics. diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Avx10v2.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Avx10v2.cs index 9ba7e082a57de4..a3c1a88477b6f6 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Avx10v2.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Avx10v2.cs @@ -111,13 +111,11 @@ internal Avx10v2() { } /// /// VMOVW xmm1/m16, xmm2 /// - [RequiresUnsafe] public static unsafe void StoreScalar(short* address, Vector128 source) => StoreScalar(address, source); /// /// VMOVW xmm1/m16, xmm2 /// - [RequiresUnsafe] public static unsafe void StoreScalar(ushort* address, Vector128 source) => StoreScalar(address, source); /// Provides access to the x86 AVX10.2 hardware instructions, that are only available to 64-bit processes, via intrinsics. diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Avx2.PlatformNotSupported.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Avx2.PlatformNotSupported.cs index 90ccfef5c6108c..b8d03d4f576fe9 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Avx2.PlatformNotSupported.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Avx2.PlatformNotSupported.cs @@ -425,7 +425,6 @@ internal X64() { } /// VPBROADCASTB xmm1 {k1}{z}, m8 /// The above native signature does not directly correspond to the managed signature. /// - [RequiresUnsafe] public static unsafe Vector128 BroadcastScalarToVector128(byte* source) { throw new PlatformNotSupportedException(); } /// /// __m128i _mm_broadcastb_epi8 (__m128i a) @@ -433,7 +432,6 @@ internal X64() { } /// VPBROADCASTB xmm1 {k1}{z}, m8 /// The above native signature does not directly correspond to the managed signature. /// - [RequiresUnsafe] public static unsafe Vector128 BroadcastScalarToVector128(sbyte* source) { throw new PlatformNotSupportedException(); } /// /// __m128i _mm_broadcastw_epi16 (__m128i a) @@ -441,7 +439,6 @@ internal X64() { } /// VPBROADCASTW xmm1 {k1}{z}, m16 /// The above native signature does not directly correspond to the managed signature. /// - [RequiresUnsafe] public static unsafe Vector128 BroadcastScalarToVector128(short* source) { throw new PlatformNotSupportedException(); } /// /// __m128i _mm_broadcastw_epi16 (__m128i a) @@ -449,7 +446,6 @@ internal X64() { } /// VPBROADCASTW xmm1 {k1}{z}, m16 /// The above native signature does not directly correspond to the managed signature. /// - [RequiresUnsafe] public static unsafe Vector128 BroadcastScalarToVector128(ushort* source) { throw new PlatformNotSupportedException(); } /// /// __m128i _mm_broadcastd_epi32 (__m128i a) @@ -457,7 +453,6 @@ internal X64() { } /// VPBROADCASTD xmm1 {k1}{z}, m32 /// The above native signature does not directly correspond to the managed signature. /// - [RequiresUnsafe] public static unsafe Vector128 BroadcastScalarToVector128(int* source) { throw new PlatformNotSupportedException(); } /// /// __m128i _mm_broadcastd_epi32 (__m128i a) @@ -465,7 +460,6 @@ internal X64() { } /// VPBROADCASTD xmm1 {k1}{z}, m32 /// The above native signature does not directly correspond to the managed signature. /// - [RequiresUnsafe] public static unsafe Vector128 BroadcastScalarToVector128(uint* source) { throw new PlatformNotSupportedException(); } /// /// __m128i _mm_broadcastq_epi64 (__m128i a) @@ -473,7 +467,6 @@ internal X64() { } /// VPBROADCASTQ xmm1 {k1}{z}, m64 /// The above native signature does not directly correspond to the managed signature. /// - [RequiresUnsafe] public static unsafe Vector128 BroadcastScalarToVector128(long* source) { throw new PlatformNotSupportedException(); } /// /// __m128i _mm_broadcastq_epi64 (__m128i a) @@ -481,7 +474,6 @@ internal X64() { } /// VPBROADCASTQ xmm1 {k1}{z}, m64 /// The above native signature does not directly correspond to the managed signature. /// - [RequiresUnsafe] public static unsafe Vector128 BroadcastScalarToVector128(ulong* source) { throw new PlatformNotSupportedException(); } /// @@ -551,7 +543,6 @@ internal X64() { } /// VPBROADCASTB ymm1 {k1}{z}, m8 /// The above native signature does not directly correspond to the managed signature. /// - [RequiresUnsafe] public static unsafe Vector256 BroadcastScalarToVector256(byte* source) { throw new PlatformNotSupportedException(); } /// /// __m256i _mm256_broadcastb_epi8 (__m128i a) @@ -559,7 +550,6 @@ internal X64() { } /// VPBROADCASTB ymm1 {k1}{z}, m8 /// The above native signature does not directly correspond to the managed signature. /// - [RequiresUnsafe] public static unsafe Vector256 BroadcastScalarToVector256(sbyte* source) { throw new PlatformNotSupportedException(); } /// /// __m256i _mm256_broadcastw_epi16 (__m128i a) @@ -567,7 +557,6 @@ internal X64() { } /// VPBROADCASTW ymm1 {k1}{z}, m16 /// The above native signature does not directly correspond to the managed signature. /// - [RequiresUnsafe] public static unsafe Vector256 BroadcastScalarToVector256(short* source) { throw new PlatformNotSupportedException(); } /// /// __m256i _mm256_broadcastw_epi16 (__m128i a) @@ -575,7 +564,6 @@ internal X64() { } /// VPBROADCASTW ymm1 {k1}{z}, m16 /// The above native signature does not directly correspond to the managed signature. /// - [RequiresUnsafe] public static unsafe Vector256 BroadcastScalarToVector256(ushort* source) { throw new PlatformNotSupportedException(); } /// /// __m256i _mm256_broadcastd_epi32 (__m128i a) @@ -583,7 +571,6 @@ internal X64() { } /// VPBROADCASTD ymm1 {k1}{z}, m32 /// The above native signature does not directly correspond to the managed signature. /// - [RequiresUnsafe] public static unsafe Vector256 BroadcastScalarToVector256(int* source) { throw new PlatformNotSupportedException(); } /// /// __m256i _mm256_broadcastd_epi32 (__m128i a) @@ -591,7 +578,6 @@ internal X64() { } /// VPBROADCASTD ymm1 {k1}{z}, m32 /// The above native signature does not directly correspond to the managed signature. /// - [RequiresUnsafe] public static unsafe Vector256 BroadcastScalarToVector256(uint* source) { throw new PlatformNotSupportedException(); } /// /// __m256i _mm256_broadcastq_epi64 (__m128i a) @@ -599,7 +585,6 @@ internal X64() { } /// VPBROADCASTQ ymm1 {k1}{z}, m64 /// The above native signature does not directly correspond to the managed signature. /// - [RequiresUnsafe] public static unsafe Vector256 BroadcastScalarToVector256(long* source) { throw new PlatformNotSupportedException(); } /// /// __m256i _mm256_broadcastq_epi64 (__m128i a) @@ -607,7 +592,6 @@ internal X64() { } /// VPBROADCASTQ ymm1 {k1}{z}, m64 /// The above native signature does not directly correspond to the managed signature. /// - [RequiresUnsafe] public static unsafe Vector256 BroadcastScalarToVector256(ulong* source) { throw new PlatformNotSupportedException(); } /// @@ -616,7 +600,6 @@ internal X64() { } /// VBROADCASTI32x4 ymm1 {k1}{z}, m128 /// The above native signature does not directly correspond to the managed signature. /// - [RequiresUnsafe] public static unsafe Vector256 BroadcastVector128ToVector256(sbyte* address) { throw new PlatformNotSupportedException(); } /// /// __m256i _mm256_broadcastsi128_si256 (__m128i a) @@ -624,7 +607,6 @@ internal X64() { } /// VBROADCASTI32x4 ymm1 {k1}{z}, m128 /// The above native signature does not directly correspond to the managed signature. /// - [RequiresUnsafe] public static unsafe Vector256 BroadcastVector128ToVector256(byte* address) { throw new PlatformNotSupportedException(); } /// /// __m256i _mm256_broadcastsi128_si256 (__m128i a) @@ -632,7 +614,6 @@ internal X64() { } /// VBROADCASTI32x4 ymm1 {k1}{z}, m128 /// The above native signature does not directly correspond to the managed signature. /// - [RequiresUnsafe] public static unsafe Vector256 BroadcastVector128ToVector256(short* address) { throw new PlatformNotSupportedException(); } /// /// __m256i _mm256_broadcastsi128_si256 (__m128i a) @@ -640,7 +621,6 @@ internal X64() { } /// VBROADCASTI32x4 ymm1 {k1}{z}, m128 /// The above native signature does not directly correspond to the managed signature. /// - [RequiresUnsafe] public static unsafe Vector256 BroadcastVector128ToVector256(ushort* address) { throw new PlatformNotSupportedException(); } /// /// __m256i _mm256_broadcastsi128_si256 (__m128i a) @@ -648,7 +628,6 @@ internal X64() { } /// VBROADCASTI32x4 ymm1 {k1}{z}, m128 /// The above native signature does not directly correspond to the managed signature. /// - [RequiresUnsafe] public static unsafe Vector256 BroadcastVector128ToVector256(int* address) { throw new PlatformNotSupportedException(); } /// /// __m256i _mm256_broadcastsi128_si256 (__m128i a) @@ -656,7 +635,6 @@ internal X64() { } /// VBROADCASTI32x4 ymm1 {k1}{z}, m128 /// The above native signature does not directly correspond to the managed signature. /// - [RequiresUnsafe] public static unsafe Vector256 BroadcastVector128ToVector256(uint* address) { throw new PlatformNotSupportedException(); } /// /// __m256i _mm256_broadcastsi128_si256 (__m128i a) @@ -664,7 +642,6 @@ internal X64() { } /// VBROADCASTI64x2 ymm1 {k1}{z}, m128 /// The above native signature does not directly correspond to the managed signature. /// - [RequiresUnsafe] public static unsafe Vector256 BroadcastVector128ToVector256(long* address) { throw new PlatformNotSupportedException(); } /// /// __m256i _mm256_broadcastsi128_si256 (__m128i a) @@ -672,7 +649,6 @@ internal X64() { } /// VBROADCASTI64x2 ymm1 {k1}{z}, m128 /// The above native signature does not directly correspond to the managed signature. /// - [RequiresUnsafe] public static unsafe Vector256 BroadcastVector128ToVector256(ulong* address) { throw new PlatformNotSupportedException(); } /// @@ -826,84 +802,72 @@ internal X64() { } /// VPMOVSXBW ymm1 {k1}{z}, m128 /// The native signature does not exist. We provide this additional overload for completeness. /// - [RequiresUnsafe] public static unsafe Vector256 ConvertToVector256Int16(sbyte* address) { throw new PlatformNotSupportedException(); } /// /// VPMOVZXBW ymm1, m128 /// VPMOVZXBW ymm1 {k1}{z}, m128 /// The native signature does not exist. We provide this additional overload for completeness. /// - [RequiresUnsafe] public static unsafe Vector256 ConvertToVector256Int16(byte* address) { throw new PlatformNotSupportedException(); } /// /// VPMOVSXBD ymm1, m64 /// VPMOVSXBD ymm1 {k1}{z}, m64 /// The native signature does not exist. We provide this additional overload for completeness. /// - [RequiresUnsafe] public static unsafe Vector256 ConvertToVector256Int32(sbyte* address) { throw new PlatformNotSupportedException(); } /// /// VPMOVZXBD ymm1, m64 /// VPMOVZXBD ymm1 {k1}{z}, m64 /// The native signature does not exist. We provide this additional overload for completeness. /// - [RequiresUnsafe] public static unsafe Vector256 ConvertToVector256Int32(byte* address) { throw new PlatformNotSupportedException(); } /// /// VPMOVSXWD ymm1, m128 /// VPMOVSXWD ymm1 {k1}{z}, m128 /// The native signature does not exist. We provide this additional overload for completeness. /// - [RequiresUnsafe] public static unsafe Vector256 ConvertToVector256Int32(short* address) { throw new PlatformNotSupportedException(); } /// /// VPMOVZXWD ymm1, m128 /// VPMOVZXWD ymm1 {k1}{z}, m128 /// The native signature does not exist. We provide this additional overload for completeness. /// - [RequiresUnsafe] public static unsafe Vector256 ConvertToVector256Int32(ushort* address) { throw new PlatformNotSupportedException(); } /// /// VPMOVSXBQ ymm1, m32 /// VPMOVSXBQ ymm1 {k1}{z}, m32 /// The native signature does not exist. We provide this additional overload for completeness. /// - [RequiresUnsafe] public static unsafe Vector256 ConvertToVector256Int64(sbyte* address) { throw new PlatformNotSupportedException(); } /// /// VPMOVZXBQ ymm1, m32 /// VPMOVZXBQ ymm1 {k1}{z}, m32 /// The native signature does not exist. We provide this additional overload for completeness. /// - [RequiresUnsafe] public static unsafe Vector256 ConvertToVector256Int64(byte* address) { throw new PlatformNotSupportedException(); } /// /// VPMOVSXWQ ymm1, m64 /// VPMOVSXWQ ymm1 {k1}{z}, m64 /// The native signature does not exist. We provide this additional overload for completeness. /// - [RequiresUnsafe] public static unsafe Vector256 ConvertToVector256Int64(short* address) { throw new PlatformNotSupportedException(); } /// /// VPMOVZXWQ ymm1, m64 /// VPMOVZXWQ ymm1 {k1}{z}, m64 /// The native signature does not exist. We provide this additional overload for completeness. /// - [RequiresUnsafe] public static unsafe Vector256 ConvertToVector256Int64(ushort* address) { throw new PlatformNotSupportedException(); } /// /// VPMOVSXDQ ymm1, m128 /// VPMOVSXDQ ymm1 {k1}{z}, m128 /// The native signature does not exist. We provide this additional overload for completeness. /// - [RequiresUnsafe] public static unsafe Vector256 ConvertToVector256Int64(int* address) { throw new PlatformNotSupportedException(); } /// /// VPMOVZXDQ ymm1, m128 /// VPMOVZXDQ ymm1 {k1}{z}, m128 /// The native signature does not exist. We provide this additional overload for completeness. /// - [RequiresUnsafe] public static unsafe Vector256 ConvertToVector256Int64(uint* address) { throw new PlatformNotSupportedException(); } /// @@ -960,168 +924,144 @@ internal X64() { } /// VPGATHERDD xmm1, vm32x, xmm2 /// The scale parameter should be 1, 2, 4 or 8, otherwise, ArgumentOutOfRangeException will be thrown. /// - [RequiresUnsafe] public static unsafe Vector128 GatherVector128(int* baseAddress, Vector128 index, [ConstantExpected(Min = (byte)(1), Max = (byte)(8))] byte scale) { throw new PlatformNotSupportedException(); } /// /// __m128i _mm_i32gather_epi32 (int const* base_addr, __m128i vindex, const int scale) /// VPGATHERDD xmm1, vm32x, xmm2 /// The scale parameter should be 1, 2, 4 or 8, otherwise, ArgumentOutOfRangeException will be thrown. /// - [RequiresUnsafe] public static unsafe Vector128 GatherVector128(uint* baseAddress, Vector128 index, [ConstantExpected(Min = (byte)(1), Max = (byte)(8))] byte scale) { throw new PlatformNotSupportedException(); } /// /// __m128i _mm_i32gather_epi64 (__int64 const* base_addr, __m128i vindex, const int scale) /// VPGATHERDQ xmm1, vm32x, xmm2 /// The scale parameter should be 1, 2, 4 or 8, otherwise, ArgumentOutOfRangeException will be thrown. /// - [RequiresUnsafe] public static unsafe Vector128 GatherVector128(long* baseAddress, Vector128 index, [ConstantExpected(Min = (byte)(1), Max = (byte)(8))] byte scale) { throw new PlatformNotSupportedException(); } /// /// __m128i _mm_i32gather_epi64 (__int64 const* base_addr, __m128i vindex, const int scale) /// VPGATHERDQ xmm1, vm32x, xmm2 /// The scale parameter should be 1, 2, 4 or 8, otherwise, ArgumentOutOfRangeException will be thrown. /// - [RequiresUnsafe] public static unsafe Vector128 GatherVector128(ulong* baseAddress, Vector128 index, [ConstantExpected(Min = (byte)(1), Max = (byte)(8))] byte scale) { throw new PlatformNotSupportedException(); } /// /// __m128 _mm_i32gather_ps (float const* base_addr, __m128i vindex, const int scale) /// VGATHERDPS xmm1, vm32x, xmm2 /// The scale parameter should be 1, 2, 4 or 8, otherwise, ArgumentOutOfRangeException will be thrown. /// - [RequiresUnsafe] public static unsafe Vector128 GatherVector128(float* baseAddress, Vector128 index, [ConstantExpected(Min = (byte)(1), Max = (byte)(8))] byte scale) { throw new PlatformNotSupportedException(); } /// /// __m128d _mm_i32gather_pd (double const* base_addr, __m128i vindex, const int scale) /// VGATHERDPD xmm1, vm32x, xmm2 /// The scale parameter should be 1, 2, 4 or 8, otherwise, ArgumentOutOfRangeException will be thrown. /// - [RequiresUnsafe] public static unsafe Vector128 GatherVector128(double* baseAddress, Vector128 index, [ConstantExpected(Min = (byte)(1), Max = (byte)(8))] byte scale) { throw new PlatformNotSupportedException(); } /// /// __m128i _mm_i64gather_epi32 (int const* base_addr, __m128i vindex, const int scale) /// VPGATHERQD xmm1, vm64x, xmm2 /// The scale parameter should be 1, 2, 4 or 8, otherwise, ArgumentOutOfRangeException will be thrown. /// - [RequiresUnsafe] public static unsafe Vector128 GatherVector128(int* baseAddress, Vector128 index, [ConstantExpected(Min = (byte)(1), Max = (byte)(8))] byte scale) { throw new PlatformNotSupportedException(); } /// /// __m128i _mm_i64gather_epi32 (int const* base_addr, __m128i vindex, const int scale) /// VPGATHERQD xmm1, vm64x, xmm2 /// The scale parameter should be 1, 2, 4 or 8, otherwise, ArgumentOutOfRangeException will be thrown. /// - [RequiresUnsafe] public static unsafe Vector128 GatherVector128(uint* baseAddress, Vector128 index, [ConstantExpected(Min = (byte)(1), Max = (byte)(8))] byte scale) { throw new PlatformNotSupportedException(); } /// /// __m128i _mm_i64gather_epi64 (__int64 const* base_addr, __m128i vindex, const int scale) /// VPGATHERQQ xmm1, vm64x, xmm2 /// The scale parameter should be 1, 2, 4 or 8, otherwise, ArgumentOutOfRangeException will be thrown. /// - [RequiresUnsafe] public static unsafe Vector128 GatherVector128(long* baseAddress, Vector128 index, [ConstantExpected(Min = (byte)(1), Max = (byte)(8))] byte scale) { throw new PlatformNotSupportedException(); } /// /// __m128i _mm_i64gather_epi64 (__int64 const* base_addr, __m128i vindex, const int scale) /// VPGATHERQQ xmm1, vm64x, xmm2 /// The scale parameter should be 1, 2, 4 or 8, otherwise, ArgumentOutOfRangeException will be thrown. /// - [RequiresUnsafe] public static unsafe Vector128 GatherVector128(ulong* baseAddress, Vector128 index, [ConstantExpected(Min = (byte)(1), Max = (byte)(8))] byte scale) { throw new PlatformNotSupportedException(); } /// /// __m128 _mm_i64gather_ps (float const* base_addr, __m128i vindex, const int scale) /// VGATHERQPS xmm1, vm64x, xmm2 /// The scale parameter should be 1, 2, 4 or 8, otherwise, ArgumentOutOfRangeException will be thrown. /// - [RequiresUnsafe] public static unsafe Vector128 GatherVector128(float* baseAddress, Vector128 index, [ConstantExpected(Min = (byte)(1), Max = (byte)(8))] byte scale) { throw new PlatformNotSupportedException(); } /// /// __m128d _mm_i64gather_pd (double const* base_addr, __m128i vindex, const int scale) /// VGATHERQPD xmm1, vm64x, xmm2 /// The scale parameter should be 1, 2, 4 or 8, otherwise, ArgumentOutOfRangeException will be thrown. /// - [RequiresUnsafe] public static unsafe Vector128 GatherVector128(double* baseAddress, Vector128 index, [ConstantExpected(Min = (byte)(1), Max = (byte)(8))] byte scale) { throw new PlatformNotSupportedException(); } /// /// __m256i _mm256_i32gather_epi32 (int const* base_addr, __m256i vindex, const int scale) /// VPGATHERDD ymm1, vm32y, ymm2 /// The scale parameter should be 1, 2, 4 or 8, otherwise, ArgumentOutOfRangeException will be thrown. /// - [RequiresUnsafe] public static unsafe Vector256 GatherVector256(int* baseAddress, Vector256 index, [ConstantExpected(Min = (byte)(1), Max = (byte)(8))] byte scale) { throw new PlatformNotSupportedException(); } /// /// __m256i _mm256_i32gather_epi32 (int const* base_addr, __m256i vindex, const int scale) /// VPGATHERDD ymm1, vm32y, ymm2 /// The scale parameter should be 1, 2, 4 or 8, otherwise, ArgumentOutOfRangeException will be thrown. /// - [RequiresUnsafe] public static unsafe Vector256 GatherVector256(uint* baseAddress, Vector256 index, [ConstantExpected(Min = (byte)(1), Max = (byte)(8))] byte scale) { throw new PlatformNotSupportedException(); } /// /// __m256i _mm256_i32gather_epi64 (__int64 const* base_addr, __m128i vindex, const int scale) /// VPGATHERDQ ymm1, vm32y, ymm2 /// The scale parameter should be 1, 2, 4 or 8, otherwise, ArgumentOutOfRangeException will be thrown. /// - [RequiresUnsafe] public static unsafe Vector256 GatherVector256(long* baseAddress, Vector128 index, [ConstantExpected(Min = (byte)(1), Max = (byte)(8))] byte scale) { throw new PlatformNotSupportedException(); } /// /// __m256i _mm256_i32gather_epi64 (__int64 const* base_addr, __m128i vindex, const int scale) /// VPGATHERDQ ymm1, vm32y, ymm2 /// The scale parameter should be 1, 2, 4 or 8, otherwise, ArgumentOutOfRangeException will be thrown. /// - [RequiresUnsafe] public static unsafe Vector256 GatherVector256(ulong* baseAddress, Vector128 index, [ConstantExpected(Min = (byte)(1), Max = (byte)(8))] byte scale) { throw new PlatformNotSupportedException(); } /// /// __m256 _mm256_i32gather_ps (float const* base_addr, __m256i vindex, const int scale) /// VGATHERDPS ymm1, vm32y, ymm2 /// The scale parameter should be 1, 2, 4 or 8, otherwise, ArgumentOutOfRangeException will be thrown. /// - [RequiresUnsafe] public static unsafe Vector256 GatherVector256(float* baseAddress, Vector256 index, [ConstantExpected(Min = (byte)(1), Max = (byte)(8))] byte scale) { throw new PlatformNotSupportedException(); } /// /// __m256d _mm256_i32gather_pd (double const* base_addr, __m128i vindex, const int scale) /// VGATHERDPD ymm1, vm32y, ymm2 /// The scale parameter should be 1, 2, 4 or 8, otherwise, ArgumentOutOfRangeException will be thrown. /// - [RequiresUnsafe] public static unsafe Vector256 GatherVector256(double* baseAddress, Vector128 index, [ConstantExpected(Min = (byte)(1), Max = (byte)(8))] byte scale) { throw new PlatformNotSupportedException(); } /// /// __m128i _mm256_i64gather_epi32 (int const* base_addr, __m256i vindex, const int scale) /// VPGATHERQD xmm1, vm64y, xmm2 /// The scale parameter should be 1, 2, 4 or 8, otherwise, ArgumentOutOfRangeException will be thrown. /// - [RequiresUnsafe] public static unsafe Vector128 GatherVector128(int* baseAddress, Vector256 index, [ConstantExpected(Min = (byte)(1), Max = (byte)(8))] byte scale) { throw new PlatformNotSupportedException(); } /// /// __m128i _mm256_i64gather_epi32 (int const* base_addr, __m256i vindex, const int scale) /// VPGATHERQD xmm1, vm64y, xmm2 /// The scale parameter should be 1, 2, 4 or 8, otherwise, ArgumentOutOfRangeException will be thrown. /// - [RequiresUnsafe] public static unsafe Vector128 GatherVector128(uint* baseAddress, Vector256 index, [ConstantExpected(Min = (byte)(1), Max = (byte)(8))] byte scale) { throw new PlatformNotSupportedException(); } /// /// __m256i _mm256_i64gather_epi64 (__int64 const* base_addr, __m256i vindex, const int scale) /// VPGATHERQQ ymm1, vm64y, ymm2 /// The scale parameter should be 1, 2, 4 or 8, otherwise, ArgumentOutOfRangeException will be thrown. /// - [RequiresUnsafe] public static unsafe Vector256 GatherVector256(long* baseAddress, Vector256 index, [ConstantExpected(Min = (byte)(1), Max = (byte)(8))] byte scale) { throw new PlatformNotSupportedException(); } /// /// __m256i _mm256_i64gather_epi64 (__int64 const* base_addr, __m256i vindex, const int scale) /// VPGATHERQQ ymm1, vm64y, ymm2 /// The scale parameter should be 1, 2, 4 or 8, otherwise, ArgumentOutOfRangeException will be thrown. /// - [RequiresUnsafe] public static unsafe Vector256 GatherVector256(ulong* baseAddress, Vector256 index, [ConstantExpected(Min = (byte)(1), Max = (byte)(8))] byte scale) { throw new PlatformNotSupportedException(); } /// /// __m128 _mm256_i64gather_ps (float const* base_addr, __m256i vindex, const int scale) /// VGATHERQPS xmm1, vm64y, xmm2 /// The scale parameter should be 1, 2, 4 or 8, otherwise, ArgumentOutOfRangeException will be thrown. /// - [RequiresUnsafe] public static unsafe Vector128 GatherVector128(float* baseAddress, Vector256 index, [ConstantExpected(Min = (byte)(1), Max = (byte)(8))] byte scale) { throw new PlatformNotSupportedException(); } /// /// __m256d _mm256_i64gather_pd (double const* base_addr, __m256i vindex, const int scale) /// VGATHERQPD ymm1, vm64y, ymm2 /// The scale parameter should be 1, 2, 4 or 8, otherwise, ArgumentOutOfRangeException will be thrown. /// - [RequiresUnsafe] public static unsafe Vector256 GatherVector256(double* baseAddress, Vector256 index, [ConstantExpected(Min = (byte)(1), Max = (byte)(8))] byte scale) { throw new PlatformNotSupportedException(); } /// @@ -1129,168 +1069,144 @@ internal X64() { } /// VPGATHERDD xmm1, vm32x, xmm2 /// The scale parameter should be 1, 2, 4 or 8, otherwise, ArgumentOutOfRangeException will be thrown. /// - [RequiresUnsafe] public static unsafe Vector128 GatherMaskVector128(Vector128 source, int* baseAddress, Vector128 index, Vector128 mask, [ConstantExpected(Min = (byte)(1), Max = (byte)(8))] byte scale) { throw new PlatformNotSupportedException(); } /// /// __m128i _mm_mask_i32gather_epi32 (__m128i src, int const* base_addr, __m128i vindex, __m128i mask, const int scale) /// VPGATHERDD xmm1, vm32x, xmm2 /// The scale parameter should be 1, 2, 4 or 8, otherwise, ArgumentOutOfRangeException will be thrown. /// - [RequiresUnsafe] public static unsafe Vector128 GatherMaskVector128(Vector128 source, uint* baseAddress, Vector128 index, Vector128 mask, [ConstantExpected(Min = (byte)(1), Max = (byte)(8))] byte scale) { throw new PlatformNotSupportedException(); } /// /// __m128i _mm_mask_i32gather_epi64 (__m128i src, __int64 const* base_addr, __m128i vindex, __m128i mask, const int scale) /// VPGATHERDQ xmm1, vm32x, xmm2 /// The scale parameter should be 1, 2, 4 or 8, otherwise, ArgumentOutOfRangeException will be thrown. /// - [RequiresUnsafe] public static unsafe Vector128 GatherMaskVector128(Vector128 source, long* baseAddress, Vector128 index, Vector128 mask, [ConstantExpected(Min = (byte)(1), Max = (byte)(8))] byte scale) { throw new PlatformNotSupportedException(); } /// /// __m128i _mm_mask_i32gather_epi64 (__m128i src, __int64 const* base_addr, __m128i vindex, __m128i mask, const int scale) /// VPGATHERDQ xmm1, vm32x, xmm2 /// The scale parameter should be 1, 2, 4 or 8, otherwise, ArgumentOutOfRangeException will be thrown. /// - [RequiresUnsafe] public static unsafe Vector128 GatherMaskVector128(Vector128 source, ulong* baseAddress, Vector128 index, Vector128 mask, [ConstantExpected(Min = (byte)(1), Max = (byte)(8))] byte scale) { throw new PlatformNotSupportedException(); } /// /// __m128 _mm_mask_i32gather_ps (__m128 src, float const* base_addr, __m128i vindex, __m128 mask, const int scale) /// VGATHERDPS xmm1, vm32x, xmm2 /// The scale parameter should be 1, 2, 4 or 8, otherwise, ArgumentOutOfRangeException will be thrown. /// - [RequiresUnsafe] public static unsafe Vector128 GatherMaskVector128(Vector128 source, float* baseAddress, Vector128 index, Vector128 mask, [ConstantExpected(Min = (byte)(1), Max = (byte)(8))] byte scale) { throw new PlatformNotSupportedException(); } /// /// __m128d _mm_mask_i32gather_pd (__m128d src, double const* base_addr, __m128i vindex, __m128d mask, const int scale) /// VGATHERDPD xmm1, vm32x, xmm2 /// The scale parameter should be 1, 2, 4 or 8, otherwise, ArgumentOutOfRangeException will be thrown. /// - [RequiresUnsafe] public static unsafe Vector128 GatherMaskVector128(Vector128 source, double* baseAddress, Vector128 index, Vector128 mask, [ConstantExpected(Min = (byte)(1), Max = (byte)(8))] byte scale) { throw new PlatformNotSupportedException(); } /// /// __m128i _mm_mask_i64gather_epi32 (__m128i src, int const* base_addr, __m128i vindex, __m128i mask, const int scale) /// VPGATHERQD xmm1, vm64x, xmm2 /// The scale parameter should be 1, 2, 4 or 8, otherwise, ArgumentOutOfRangeException will be thrown. /// - [RequiresUnsafe] public static unsafe Vector128 GatherMaskVector128(Vector128 source, int* baseAddress, Vector128 index, Vector128 mask, [ConstantExpected(Min = (byte)(1), Max = (byte)(8))] byte scale) { throw new PlatformNotSupportedException(); } /// /// __m128i _mm_mask_i64gather_epi32 (__m128i src, int const* base_addr, __m128i vindex, __m128i mask, const int scale) /// VPGATHERQD xmm1, vm64x, xmm2 /// The scale parameter should be 1, 2, 4 or 8, otherwise, ArgumentOutOfRangeException will be thrown. /// - [RequiresUnsafe] public static unsafe Vector128 GatherMaskVector128(Vector128 source, uint* baseAddress, Vector128 index, Vector128 mask, [ConstantExpected(Min = (byte)(1), Max = (byte)(8))] byte scale) { throw new PlatformNotSupportedException(); } /// /// __m128i _mm_mask_i64gather_epi64 (__m128i src, __int64 const* base_addr, __m128i vindex, __m128i mask, const int scale) /// VPGATHERQQ xmm1, vm64x, xmm2 /// The scale parameter should be 1, 2, 4 or 8, otherwise, ArgumentOutOfRangeException will be thrown. /// - [RequiresUnsafe] public static unsafe Vector128 GatherMaskVector128(Vector128 source, long* baseAddress, Vector128 index, Vector128 mask, [ConstantExpected(Min = (byte)(1), Max = (byte)(8))] byte scale) { throw new PlatformNotSupportedException(); } /// /// __m128i _mm_mask_i64gather_epi64 (__m128i src, __int64 const* base_addr, __m128i vindex, __m128i mask, const int scale) /// VPGATHERQQ xmm1, vm64x, xmm2 /// The scale parameter should be 1, 2, 4 or 8, otherwise, ArgumentOutOfRangeException will be thrown. /// - [RequiresUnsafe] public static unsafe Vector128 GatherMaskVector128(Vector128 source, ulong* baseAddress, Vector128 index, Vector128 mask, [ConstantExpected(Min = (byte)(1), Max = (byte)(8))] byte scale) { throw new PlatformNotSupportedException(); } /// /// __m128 _mm_mask_i64gather_ps (__m128 src, float const* base_addr, __m128i vindex, __m128 mask, const int scale) /// VGATHERQPS xmm1, vm64x, xmm2 /// The scale parameter should be 1, 2, 4 or 8, otherwise, ArgumentOutOfRangeException will be thrown. /// - [RequiresUnsafe] public static unsafe Vector128 GatherMaskVector128(Vector128 source, float* baseAddress, Vector128 index, Vector128 mask, [ConstantExpected(Min = (byte)(1), Max = (byte)(8))] byte scale) { throw new PlatformNotSupportedException(); } /// /// __m128d _mm_mask_i64gather_pd (__m128d src, double const* base_addr, __m128i vindex, __m128d mask, const int scale) /// VGATHERQPD xmm1, vm64x, xmm2 /// The scale parameter should be 1, 2, 4 or 8, otherwise, ArgumentOutOfRangeException will be thrown. /// - [RequiresUnsafe] public static unsafe Vector128 GatherMaskVector128(Vector128 source, double* baseAddress, Vector128 index, Vector128 mask, [ConstantExpected(Min = (byte)(1), Max = (byte)(8))] byte scale) { throw new PlatformNotSupportedException(); } /// /// __m256i _mm256_mask_i32gather_epi32 (__m256i src, int const* base_addr, __m256i vindex, __m256i mask, const int scale) /// VPGATHERDD ymm1, vm32y, ymm2 /// The scale parameter should be 1, 2, 4 or 8, otherwise, ArgumentOutOfRangeException will be thrown. /// - [RequiresUnsafe] public static unsafe Vector256 GatherMaskVector256(Vector256 source, int* baseAddress, Vector256 index, Vector256 mask, [ConstantExpected(Min = (byte)(1), Max = (byte)(8))] byte scale) { throw new PlatformNotSupportedException(); } /// /// __m256i _mm256_mask_i32gather_epi32 (__m256i src, int const* base_addr, __m256i vindex, __m256i mask, const int scale) /// VPGATHERDD ymm1, vm32y, ymm2 /// The scale parameter should be 1, 2, 4 or 8, otherwise, ArgumentOutOfRangeException will be thrown. /// - [RequiresUnsafe] public static unsafe Vector256 GatherMaskVector256(Vector256 source, uint* baseAddress, Vector256 index, Vector256 mask, [ConstantExpected(Min = (byte)(1), Max = (byte)(8))] byte scale) { throw new PlatformNotSupportedException(); } /// /// __m256i _mm256_mask_i32gather_epi64 (__m256i src, __int64 const* base_addr, __m128i vindex, __m256i mask, const int scale) /// VPGATHERDQ ymm1, vm32y, ymm2 /// The scale parameter should be 1, 2, 4 or 8, otherwise, ArgumentOutOfRangeException will be thrown. /// - [RequiresUnsafe] public static unsafe Vector256 GatherMaskVector256(Vector256 source, long* baseAddress, Vector128 index, Vector256 mask, [ConstantExpected(Min = (byte)(1), Max = (byte)(8))] byte scale) { throw new PlatformNotSupportedException(); } /// /// __m256i _mm256_mask_i32gather_epi64 (__m256i src, __int64 const* base_addr, __m128i vindex, __m256i mask, const int scale) /// VPGATHERDQ ymm1, vm32y, ymm2 /// The scale parameter should be 1, 2, 4 or 8, otherwise, ArgumentOutOfRangeException will be thrown. /// - [RequiresUnsafe] public static unsafe Vector256 GatherMaskVector256(Vector256 source, ulong* baseAddress, Vector128 index, Vector256 mask, [ConstantExpected(Min = (byte)(1), Max = (byte)(8))] byte scale) { throw new PlatformNotSupportedException(); } /// /// __m256 _mm256_mask_i32gather_ps (__m256 src, float const* base_addr, __m256i vindex, __m256 mask, const int scale) /// VPGATHERDPS ymm1, vm32y, ymm2 /// The scale parameter should be 1, 2, 4 or 8, otherwise, ArgumentOutOfRangeException will be thrown. /// - [RequiresUnsafe] public static unsafe Vector256 GatherMaskVector256(Vector256 source, float* baseAddress, Vector256 index, Vector256 mask, [ConstantExpected(Min = (byte)(1), Max = (byte)(8))] byte scale) { throw new PlatformNotSupportedException(); } /// /// __m256d _mm256_mask_i32gather_pd (__m256d src, double const* base_addr, __m128i vindex, __m256d mask, const int scale) /// VPGATHERDPD ymm1, vm32y, ymm2 /// The scale parameter should be 1, 2, 4 or 8, otherwise, ArgumentOutOfRangeException will be thrown. /// - [RequiresUnsafe] public static unsafe Vector256 GatherMaskVector256(Vector256 source, double* baseAddress, Vector128 index, Vector256 mask, [ConstantExpected(Min = (byte)(1), Max = (byte)(8))] byte scale) { throw new PlatformNotSupportedException(); } /// /// __m128i _mm256_mask_i64gather_epi32 (__m128i src, int const* base_addr, __m256i vindex, __m128i mask, const int scale) /// VPGATHERQD xmm1, vm32y, xmm2 /// The scale parameter should be 1, 2, 4 or 8, otherwise, ArgumentOutOfRangeException will be thrown. /// - [RequiresUnsafe] public static unsafe Vector128 GatherMaskVector128(Vector128 source, int* baseAddress, Vector256 index, Vector128 mask, [ConstantExpected(Min = (byte)(1), Max = (byte)(8))] byte scale) { throw new PlatformNotSupportedException(); } /// /// __m128i _mm256_mask_i64gather_epi32 (__m128i src, int const* base_addr, __m256i vindex, __m128i mask, const int scale) /// VPGATHERQD xmm1, vm32y, xmm2 /// The scale parameter should be 1, 2, 4 or 8, otherwise, ArgumentOutOfRangeException will be thrown. /// - [RequiresUnsafe] public static unsafe Vector128 GatherMaskVector128(Vector128 source, uint* baseAddress, Vector256 index, Vector128 mask, [ConstantExpected(Min = (byte)(1), Max = (byte)(8))] byte scale) { throw new PlatformNotSupportedException(); } /// /// __m256i _mm256_mask_i64gather_epi64 (__m256i src, __int64 const* base_addr, __m256i vindex, __m256i mask, const int scale) /// VPGATHERQQ ymm1, vm32y, ymm2 /// The scale parameter should be 1, 2, 4 or 8, otherwise, ArgumentOutOfRangeException will be thrown. /// - [RequiresUnsafe] public static unsafe Vector256 GatherMaskVector256(Vector256 source, long* baseAddress, Vector256 index, Vector256 mask, [ConstantExpected(Min = (byte)(1), Max = (byte)(8))] byte scale) { throw new PlatformNotSupportedException(); } /// /// __m256i _mm256_mask_i64gather_epi64 (__m256i src, __int64 const* base_addr, __m256i vindex, __m256i mask, const int scale) /// VPGATHERQQ ymm1, vm32y, ymm2 /// The scale parameter should be 1, 2, 4 or 8, otherwise, ArgumentOutOfRangeException will be thrown. /// - [RequiresUnsafe] public static unsafe Vector256 GatherMaskVector256(Vector256 source, ulong* baseAddress, Vector256 index, Vector256 mask, [ConstantExpected(Min = (byte)(1), Max = (byte)(8))] byte scale) { throw new PlatformNotSupportedException(); } /// /// __m128 _mm256_mask_i64gather_ps (__m128 src, float const* base_addr, __m256i vindex, __m128 mask, const int scale) /// VGATHERQPS xmm1, vm32y, xmm2 /// The scale parameter should be 1, 2, 4 or 8, otherwise, ArgumentOutOfRangeException will be thrown. /// - [RequiresUnsafe] public static unsafe Vector128 GatherMaskVector128(Vector128 source, float* baseAddress, Vector256 index, Vector128 mask, [ConstantExpected(Min = (byte)(1), Max = (byte)(8))] byte scale) { throw new PlatformNotSupportedException(); } /// /// __m256d _mm256_mask_i64gather_pd (__m256d src, double const* base_addr, __m256i vindex, __m256d mask, const int scale) /// VGATHERQPD ymm1, vm32y, ymm2 /// The scale parameter should be 1, 2, 4 or 8, otherwise, ArgumentOutOfRangeException will be thrown. /// - [RequiresUnsafe] public static unsafe Vector256 GatherMaskVector256(Vector256 source, double* baseAddress, Vector256 index, Vector256 mask, [ConstantExpected(Min = (byte)(1), Max = (byte)(8))] byte scale) { throw new PlatformNotSupportedException(); } /// @@ -1380,147 +1296,123 @@ internal X64() { } /// __m256i _mm256_stream_load_si256 (__m256i const* mem_addr) /// VMOVNTDQA ymm1, m256 /// - [RequiresUnsafe] public static unsafe Vector256 LoadAlignedVector256NonTemporal(sbyte* address) { throw new PlatformNotSupportedException(); } /// /// __m256i _mm256_stream_load_si256 (__m256i const* mem_addr) /// VMOVNTDQA ymm1, m256 /// - [RequiresUnsafe] public static unsafe Vector256 LoadAlignedVector256NonTemporal(byte* address) { throw new PlatformNotSupportedException(); } /// /// __m256i _mm256_stream_load_si256 (__m256i const* mem_addr) /// VMOVNTDQA ymm1, m256 /// - [RequiresUnsafe] public static unsafe Vector256 LoadAlignedVector256NonTemporal(short* address) { throw new PlatformNotSupportedException(); } /// /// __m256i _mm256_stream_load_si256 (__m256i const* mem_addr) /// VMOVNTDQA ymm1, m256 /// - [RequiresUnsafe] public static unsafe Vector256 LoadAlignedVector256NonTemporal(ushort* address) { throw new PlatformNotSupportedException(); } /// /// __m256i _mm256_stream_load_si256 (__m256i const* mem_addr) /// VMOVNTDQA ymm1, m256 /// - [RequiresUnsafe] public static unsafe Vector256 LoadAlignedVector256NonTemporal(int* address) { throw new PlatformNotSupportedException(); } /// /// __m256i _mm256_stream_load_si256 (__m256i const* mem_addr) /// VMOVNTDQA ymm1, m256 /// - [RequiresUnsafe] public static unsafe Vector256 LoadAlignedVector256NonTemporal(uint* address) { throw new PlatformNotSupportedException(); } /// /// __m256i _mm256_stream_load_si256 (__m256i const* mem_addr) /// VMOVNTDQA ymm1, m256 /// - [RequiresUnsafe] public static unsafe Vector256 LoadAlignedVector256NonTemporal(long* address) { throw new PlatformNotSupportedException(); } /// /// __m256i _mm256_stream_load_si256 (__m256i const* mem_addr) /// VMOVNTDQA ymm1, m256 /// - [RequiresUnsafe] public static unsafe Vector256 LoadAlignedVector256NonTemporal(ulong* address) { throw new PlatformNotSupportedException(); } /// /// __m128i _mm_maskload_epi32 (int const* mem_addr, __m128i mask) /// VPMASKMOVD xmm1, xmm2, m128 /// - [RequiresUnsafe] public static unsafe Vector128 MaskLoad(int* address, Vector128 mask) { throw new PlatformNotSupportedException(); } /// /// __m128i _mm_maskload_epi32 (int const* mem_addr, __m128i mask) /// VPMASKMOVD xmm1, xmm2, m128 /// - [RequiresUnsafe] public static unsafe Vector128 MaskLoad(uint* address, Vector128 mask) { throw new PlatformNotSupportedException(); } /// /// __m128i _mm_maskload_epi64 (__int64 const* mem_addr, __m128i mask) /// VPMASKMOVQ xmm1, xmm2, m128 /// - [RequiresUnsafe] public static unsafe Vector128 MaskLoad(long* address, Vector128 mask) { throw new PlatformNotSupportedException(); } /// /// __m128i _mm_maskload_epi64 (__int64 const* mem_addr, __m128i mask) /// VPMASKMOVQ xmm1, xmm2, m128 /// - [RequiresUnsafe] public static unsafe Vector128 MaskLoad(ulong* address, Vector128 mask) { throw new PlatformNotSupportedException(); } /// /// __m256i _mm256_maskload_epi32 (int const* mem_addr, __m256i mask) /// VPMASKMOVD ymm1, ymm2, m256 /// - [RequiresUnsafe] public static unsafe Vector256 MaskLoad(int* address, Vector256 mask) { throw new PlatformNotSupportedException(); } /// /// __m256i _mm256_maskload_epi32 (int const* mem_addr, __m256i mask) /// VPMASKMOVD ymm1, ymm2, m256 /// - [RequiresUnsafe] public static unsafe Vector256 MaskLoad(uint* address, Vector256 mask) { throw new PlatformNotSupportedException(); } /// /// __m256i _mm256_maskload_epi64 (__int64 const* mem_addr, __m256i mask) /// VPMASKMOVQ ymm1, ymm2, m256 /// - [RequiresUnsafe] public static unsafe Vector256 MaskLoad(long* address, Vector256 mask) { throw new PlatformNotSupportedException(); } /// /// __m256i _mm256_maskload_epi64 (__int64 const* mem_addr, __m256i mask) /// VPMASKMOVQ ymm1, ymm2, m256 /// - [RequiresUnsafe] public static unsafe Vector256 MaskLoad(ulong* address, Vector256 mask) { throw new PlatformNotSupportedException(); } /// /// void _mm_maskstore_epi32 (int* mem_addr, __m128i mask, __m128i a) /// VPMASKMOVD m128, xmm1, xmm2 /// - [RequiresUnsafe] public static unsafe void MaskStore(int* address, Vector128 mask, Vector128 source) { throw new PlatformNotSupportedException(); } /// /// void _mm_maskstore_epi32 (int* mem_addr, __m128i mask, __m128i a) /// VPMASKMOVD m128, xmm1, xmm2 /// - [RequiresUnsafe] public static unsafe void MaskStore(uint* address, Vector128 mask, Vector128 source) { throw new PlatformNotSupportedException(); } /// /// void _mm_maskstore_epi64 (__int64* mem_addr, __m128i mask, __m128i a) /// VPMASKMOVQ m128, xmm1, xmm2 /// - [RequiresUnsafe] public static unsafe void MaskStore(long* address, Vector128 mask, Vector128 source) { throw new PlatformNotSupportedException(); } /// /// void _mm_maskstore_epi64 (__int64* mem_addr, __m128i mask, __m128i a) /// VPMASKMOVQ m128, xmm1, xmm2 /// - [RequiresUnsafe] public static unsafe void MaskStore(ulong* address, Vector128 mask, Vector128 source) { throw new PlatformNotSupportedException(); } /// /// void _mm256_maskstore_epi32 (int* mem_addr, __m256i mask, __m256i a) /// VPMASKMOVD m256, ymm1, ymm2 /// - [RequiresUnsafe] public static unsafe void MaskStore(int* address, Vector256 mask, Vector256 source) { throw new PlatformNotSupportedException(); } /// /// void _mm256_maskstore_epi32 (int* mem_addr, __m256i mask, __m256i a) /// VPMASKMOVD m256, ymm1, ymm2 /// - [RequiresUnsafe] public static unsafe void MaskStore(uint* address, Vector256 mask, Vector256 source) { throw new PlatformNotSupportedException(); } /// /// void _mm256_maskstore_epi64 (__int64* mem_addr, __m256i mask, __m256i a) /// VPMASKMOVQ m256, ymm1, ymm2 /// - [RequiresUnsafe] public static unsafe void MaskStore(long* address, Vector256 mask, Vector256 source) { throw new PlatformNotSupportedException(); } /// /// void _mm256_maskstore_epi64 (__int64* mem_addr, __m256i mask, __m256i a) /// VPMASKMOVQ m256, ymm1, ymm2 /// - [RequiresUnsafe] public static unsafe void MaskStore(ulong* address, Vector256 mask, Vector256 source) { throw new PlatformNotSupportedException(); } /// diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Avx2.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Avx2.cs index 5fc1b2001a70ad..5a9a7a50346179 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Avx2.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Avx2.cs @@ -425,7 +425,6 @@ internal X64() { } /// VPBROADCASTB xmm1 {k1}{z}, m8 /// The above native signature does not directly correspond to the managed signature. /// - [RequiresUnsafe] public static unsafe Vector128 BroadcastScalarToVector128(byte* source) => BroadcastScalarToVector128(source); /// @@ -434,7 +433,6 @@ internal X64() { } /// VPBROADCASTB xmm1 {k1}{z}, m8 /// The above native signature does not directly correspond to the managed signature. /// - [RequiresUnsafe] public static unsafe Vector128 BroadcastScalarToVector128(sbyte* source) => BroadcastScalarToVector128(source); /// @@ -443,7 +441,6 @@ internal X64() { } /// VPBROADCASTW xmm1 {k1}{z}, m16 /// The above native signature does not directly correspond to the managed signature. /// - [RequiresUnsafe] public static unsafe Vector128 BroadcastScalarToVector128(short* source) => BroadcastScalarToVector128(source); /// @@ -452,7 +449,6 @@ internal X64() { } /// VPBROADCASTW xmm1 {k1}{z}, m16 /// The above native signature does not directly correspond to the managed signature. /// - [RequiresUnsafe] public static unsafe Vector128 BroadcastScalarToVector128(ushort* source) => BroadcastScalarToVector128(source); /// @@ -461,7 +457,6 @@ internal X64() { } /// VPBROADCASTD xmm1 {k1}{z}, m32 /// The above native signature does not directly correspond to the managed signature. /// - [RequiresUnsafe] public static unsafe Vector128 BroadcastScalarToVector128(int* source) => BroadcastScalarToVector128(source); /// @@ -470,7 +465,6 @@ internal X64() { } /// VPBROADCASTD xmm1 {k1}{z}, m32 /// The above native signature does not directly correspond to the managed signature. /// - [RequiresUnsafe] public static unsafe Vector128 BroadcastScalarToVector128(uint* source) => BroadcastScalarToVector128(source); /// @@ -479,7 +473,6 @@ internal X64() { } /// VPBROADCASTQ xmm1 {k1}{z}, m64 /// The above native signature does not directly correspond to the managed signature. /// - [RequiresUnsafe] public static unsafe Vector128 BroadcastScalarToVector128(long* source) => BroadcastScalarToVector128(source); /// @@ -488,7 +481,6 @@ internal X64() { } /// VPBROADCASTQ xmm1 {k1}{z}, m64 /// The above native signature does not directly correspond to the managed signature. /// - [RequiresUnsafe] public static unsafe Vector128 BroadcastScalarToVector128(ulong* source) => BroadcastScalarToVector128(source); /// @@ -558,7 +550,6 @@ internal X64() { } /// VPBROADCASTB ymm1 {k1}{z}, m8 /// The above native signature does not directly correspond to the managed signature. /// - [RequiresUnsafe] public static unsafe Vector256 BroadcastScalarToVector256(byte* source) => BroadcastScalarToVector256(source); /// @@ -567,7 +558,6 @@ internal X64() { } /// VPBROADCASTB ymm1 {k1}{z}, m8 /// The above native signature does not directly correspond to the managed signature. /// - [RequiresUnsafe] public static unsafe Vector256 BroadcastScalarToVector256(sbyte* source) => BroadcastScalarToVector256(source); /// @@ -576,7 +566,6 @@ internal X64() { } /// VPBROADCASTW ymm1 {k1}{z}, m16 /// The above native signature does not directly correspond to the managed signature. /// - [RequiresUnsafe] public static unsafe Vector256 BroadcastScalarToVector256(short* source) => BroadcastScalarToVector256(source); /// @@ -585,7 +574,6 @@ internal X64() { } /// VPBROADCASTW ymm1 {k1}{z}, m16 /// The above native signature does not directly correspond to the managed signature. /// - [RequiresUnsafe] public static unsafe Vector256 BroadcastScalarToVector256(ushort* source) => BroadcastScalarToVector256(source); /// @@ -594,7 +582,6 @@ internal X64() { } /// VPBROADCASTD ymm1 {k1}{z}, m32 /// The above native signature does not directly correspond to the managed signature. /// - [RequiresUnsafe] public static unsafe Vector256 BroadcastScalarToVector256(int* source) => BroadcastScalarToVector256(source); /// @@ -603,7 +590,6 @@ internal X64() { } /// VPBROADCASTD ymm1 {k1}{z}, m32 /// The above native signature does not directly correspond to the managed signature. /// - [RequiresUnsafe] public static unsafe Vector256 BroadcastScalarToVector256(uint* source) => BroadcastScalarToVector256(source); /// @@ -612,7 +598,6 @@ internal X64() { } /// VPBROADCASTQ ymm1 {k1}{z}, m64 /// The above native signature does not directly correspond to the managed signature. /// - [RequiresUnsafe] public static unsafe Vector256 BroadcastScalarToVector256(long* source) => BroadcastScalarToVector256(source); /// @@ -621,7 +606,6 @@ internal X64() { } /// VPBROADCASTQ ymm1 {k1}{z}, m64 /// The above native signature does not directly correspond to the managed signature. /// - [RequiresUnsafe] public static unsafe Vector256 BroadcastScalarToVector256(ulong* source) => BroadcastScalarToVector256(source); /// @@ -630,7 +614,6 @@ internal X64() { } /// VBROADCASTI32x4 ymm1 {k1}{z}, m128 /// The above native signature does not directly correspond to the managed signature. /// - [RequiresUnsafe] public static unsafe Vector256 BroadcastVector128ToVector256(sbyte* address) => BroadcastVector128ToVector256(address); /// @@ -639,7 +622,6 @@ internal X64() { } /// VBROADCASTI32x4 ymm1 {k1}{z}, m128 /// The above native signature does not directly correspond to the managed signature. /// - [RequiresUnsafe] public static unsafe Vector256 BroadcastVector128ToVector256(byte* address) => BroadcastVector128ToVector256(address); /// @@ -648,7 +630,6 @@ internal X64() { } /// VBROADCASTI32x4 ymm1 {k1}{z}, m128 /// The above native signature does not directly correspond to the managed signature. /// - [RequiresUnsafe] public static unsafe Vector256 BroadcastVector128ToVector256(short* address) => BroadcastVector128ToVector256(address); /// @@ -657,7 +638,6 @@ internal X64() { } /// VBROADCASTI32x4 ymm1 {k1}{z}, m128 /// The above native signature does not directly correspond to the managed signature. /// - [RequiresUnsafe] public static unsafe Vector256 BroadcastVector128ToVector256(ushort* address) => BroadcastVector128ToVector256(address); /// @@ -666,7 +646,6 @@ internal X64() { } /// VBROADCASTI32x4 ymm1 {k1}{z}, m128 /// The above native signature does not directly correspond to the managed signature. /// - [RequiresUnsafe] public static unsafe Vector256 BroadcastVector128ToVector256(int* address) => BroadcastVector128ToVector256(address); /// @@ -675,7 +654,6 @@ internal X64() { } /// VBROADCASTI32x4 ymm1 {k1}{z}, m128 /// The above native signature does not directly correspond to the managed signature. /// - [RequiresUnsafe] public static unsafe Vector256 BroadcastVector128ToVector256(uint* address) => BroadcastVector128ToVector256(address); /// @@ -684,7 +662,6 @@ internal X64() { } /// VBROADCASTI64x2 ymm1 {k1}{z}, m128 /// The above native signature does not directly correspond to the managed signature. /// - [RequiresUnsafe] public static unsafe Vector256 BroadcastVector128ToVector256(long* address) => BroadcastVector128ToVector256(address); /// @@ -693,7 +670,6 @@ internal X64() { } /// VBROADCASTI64x2 ymm1 {k1}{z}, m128 /// The above native signature does not directly correspond to the managed signature. /// - [RequiresUnsafe] public static unsafe Vector256 BroadcastVector128ToVector256(ulong* address) => BroadcastVector128ToVector256(address); /// @@ -847,7 +823,6 @@ internal X64() { } /// VPMOVSXBW ymm1 {k1}{z}, m128 /// The native signature does not exist. We provide this additional overload for completeness. /// - [RequiresUnsafe] public static unsafe Vector256 ConvertToVector256Int16(sbyte* address) => ConvertToVector256Int16(address); /// @@ -855,7 +830,6 @@ internal X64() { } /// VPMOVZXBW ymm1 {k1}{z}, m128 /// The native signature does not exist. We provide this additional overload for completeness. /// - [RequiresUnsafe] public static unsafe Vector256 ConvertToVector256Int16(byte* address) => ConvertToVector256Int16(address); /// @@ -863,7 +837,6 @@ internal X64() { } /// VPMOVSXBD ymm1 {k1}{z}, m64 /// The native signature does not exist. We provide this additional overload for completeness. /// - [RequiresUnsafe] public static unsafe Vector256 ConvertToVector256Int32(sbyte* address) => ConvertToVector256Int32(address); /// @@ -871,7 +844,6 @@ internal X64() { } /// VPMOVZXBD ymm1 {k1}{z}, m64 /// The native signature does not exist. We provide this additional overload for completeness. /// - [RequiresUnsafe] public static unsafe Vector256 ConvertToVector256Int32(byte* address) => ConvertToVector256Int32(address); /// @@ -879,7 +851,6 @@ internal X64() { } /// VPMOVSXWD ymm1 {k1}{z}, m128 /// The native signature does not exist. We provide this additional overload for completeness. /// - [RequiresUnsafe] public static unsafe Vector256 ConvertToVector256Int32(short* address) => ConvertToVector256Int32(address); /// @@ -887,7 +858,6 @@ internal X64() { } /// VPMOVZXWD ymm1 {k1}{z}, m128 /// The native signature does not exist. We provide this additional overload for completeness. /// - [RequiresUnsafe] public static unsafe Vector256 ConvertToVector256Int32(ushort* address) => ConvertToVector256Int32(address); /// @@ -895,7 +865,6 @@ internal X64() { } /// VPMOVSXBQ ymm1 {k1}{z}, m32 /// The native signature does not exist. We provide this additional overload for completeness. /// - [RequiresUnsafe] public static unsafe Vector256 ConvertToVector256Int64(sbyte* address) => ConvertToVector256Int64(address); /// @@ -903,7 +872,6 @@ internal X64() { } /// VPMOVZXBQ ymm1 {k1}{z}, m32 /// The native signature does not exist. We provide this additional overload for completeness. /// - [RequiresUnsafe] public static unsafe Vector256 ConvertToVector256Int64(byte* address) => ConvertToVector256Int64(address); /// @@ -911,7 +879,6 @@ internal X64() { } /// VPMOVSXWQ ymm1 {k1}{z}, m64 /// The native signature does not exist. We provide this additional overload for completeness. /// - [RequiresUnsafe] public static unsafe Vector256 ConvertToVector256Int64(short* address) => ConvertToVector256Int64(address); /// @@ -919,7 +886,6 @@ internal X64() { } /// VPMOVZXWQ ymm1 {k1}{z}, m64 /// The native signature does not exist. We provide this additional overload for completeness. /// - [RequiresUnsafe] public static unsafe Vector256 ConvertToVector256Int64(ushort* address) => ConvertToVector256Int64(address); /// @@ -927,7 +893,6 @@ internal X64() { } /// VPMOVSXDQ ymm1 {k1}{z}, m128 /// The native signature does not exist. We provide this additional overload for completeness. /// - [RequiresUnsafe] public static unsafe Vector256 ConvertToVector256Int64(int* address) => ConvertToVector256Int64(address); /// @@ -935,7 +900,6 @@ internal X64() { } /// VPMOVZXDQ ymm1 {k1}{z}, m128 /// The native signature does not exist. We provide this additional overload for completeness. /// - [RequiresUnsafe] public static unsafe Vector256 ConvertToVector256Int64(uint* address) => ConvertToVector256Int64(address); /// @@ -992,7 +956,6 @@ internal X64() { } /// VPGATHERDD xmm1, vm32x, xmm2 /// The scale parameter should be 1, 2, 4 or 8, otherwise, ArgumentOutOfRangeException will be thrown. /// - [RequiresUnsafe] public static unsafe Vector128 GatherVector128(int* baseAddress, Vector128 index, [ConstantExpected(Min = (byte)(1), Max = (byte)(8))] byte scale) { return scale switch @@ -1010,7 +973,6 @@ public static unsafe Vector128 GatherVector128(int* baseAddress, Vector128< /// VPGATHERDD xmm1, vm32x, xmm2 /// The scale parameter should be 1, 2, 4 or 8, otherwise, ArgumentOutOfRangeException will be thrown. /// - [RequiresUnsafe] public static unsafe Vector128 GatherVector128(uint* baseAddress, Vector128 index, [ConstantExpected(Min = (byte)(1), Max = (byte)(8))] byte scale) { return scale switch @@ -1028,7 +990,6 @@ public static unsafe Vector128 GatherVector128(uint* baseAddress, Vector12 /// VPGATHERDQ xmm1, vm32x, xmm2 /// The scale parameter should be 1, 2, 4 or 8, otherwise, ArgumentOutOfRangeException will be thrown. /// - [RequiresUnsafe] public static unsafe Vector128 GatherVector128(long* baseAddress, Vector128 index, [ConstantExpected(Min = (byte)(1), Max = (byte)(8))] byte scale) { return scale switch @@ -1046,7 +1007,6 @@ public static unsafe Vector128 GatherVector128(long* baseAddress, Vector12 /// VPGATHERDQ xmm1, vm32x, xmm2 /// The scale parameter should be 1, 2, 4 or 8, otherwise, ArgumentOutOfRangeException will be thrown. /// - [RequiresUnsafe] public static unsafe Vector128 GatherVector128(ulong* baseAddress, Vector128 index, [ConstantExpected(Min = (byte)(1), Max = (byte)(8))] byte scale) { return scale switch @@ -1064,7 +1024,6 @@ public static unsafe Vector128 GatherVector128(ulong* baseAddress, Vector /// VGATHERDPS xmm1, vm32x, xmm2 /// The scale parameter should be 1, 2, 4 or 8, otherwise, ArgumentOutOfRangeException will be thrown. /// - [RequiresUnsafe] public static unsafe Vector128 GatherVector128(float* baseAddress, Vector128 index, [ConstantExpected(Min = (byte)(1), Max = (byte)(8))] byte scale) { return scale switch @@ -1082,7 +1041,6 @@ public static unsafe Vector128 GatherVector128(float* baseAddress, Vector /// VGATHERDPD xmm1, vm32x, xmm2 /// The scale parameter should be 1, 2, 4 or 8, otherwise, ArgumentOutOfRangeException will be thrown. /// - [RequiresUnsafe] public static unsafe Vector128 GatherVector128(double* baseAddress, Vector128 index, [ConstantExpected(Min = (byte)(1), Max = (byte)(8))] byte scale) { return scale switch @@ -1100,7 +1058,6 @@ public static unsafe Vector128 GatherVector128(double* baseAddress, Vect /// VPGATHERQD xmm1, vm64x, xmm2 /// The scale parameter should be 1, 2, 4 or 8, otherwise, ArgumentOutOfRangeException will be thrown. /// - [RequiresUnsafe] public static unsafe Vector128 GatherVector128(int* baseAddress, Vector128 index, [ConstantExpected(Min = (byte)(1), Max = (byte)(8))] byte scale) { return scale switch @@ -1118,7 +1075,6 @@ public static unsafe Vector128 GatherVector128(int* baseAddress, Vector128< /// VPGATHERQD xmm1, vm64x, xmm2 /// The scale parameter should be 1, 2, 4 or 8, otherwise, ArgumentOutOfRangeException will be thrown. /// - [RequiresUnsafe] public static unsafe Vector128 GatherVector128(uint* baseAddress, Vector128 index, [ConstantExpected(Min = (byte)(1), Max = (byte)(8))] byte scale) { return scale switch @@ -1136,7 +1092,6 @@ public static unsafe Vector128 GatherVector128(uint* baseAddress, Vector12 /// VPGATHERQQ xmm1, vm64x, xmm2 /// The scale parameter should be 1, 2, 4 or 8, otherwise, ArgumentOutOfRangeException will be thrown. /// - [RequiresUnsafe] public static unsafe Vector128 GatherVector128(long* baseAddress, Vector128 index, [ConstantExpected(Min = (byte)(1), Max = (byte)(8))] byte scale) { return scale switch @@ -1154,7 +1109,6 @@ public static unsafe Vector128 GatherVector128(long* baseAddress, Vector12 /// VPGATHERQQ xmm1, vm64x, xmm2 /// The scale parameter should be 1, 2, 4 or 8, otherwise, ArgumentOutOfRangeException will be thrown. /// - [RequiresUnsafe] public static unsafe Vector128 GatherVector128(ulong* baseAddress, Vector128 index, [ConstantExpected(Min = (byte)(1), Max = (byte)(8))] byte scale) { return scale switch @@ -1172,7 +1126,6 @@ public static unsafe Vector128 GatherVector128(ulong* baseAddress, Vector /// VGATHERQPS xmm1, vm64x, xmm2 /// The scale parameter should be 1, 2, 4 or 8, otherwise, ArgumentOutOfRangeException will be thrown. /// - [RequiresUnsafe] public static unsafe Vector128 GatherVector128(float* baseAddress, Vector128 index, [ConstantExpected(Min = (byte)(1), Max = (byte)(8))] byte scale) { return scale switch @@ -1190,7 +1143,6 @@ public static unsafe Vector128 GatherVector128(float* baseAddress, Vector /// VGATHERQPD xmm1, vm64x, xmm2 /// The scale parameter should be 1, 2, 4 or 8, otherwise, ArgumentOutOfRangeException will be thrown. /// - [RequiresUnsafe] public static unsafe Vector128 GatherVector128(double* baseAddress, Vector128 index, [ConstantExpected(Min = (byte)(1), Max = (byte)(8))] byte scale) { return scale switch @@ -1208,7 +1160,6 @@ public static unsafe Vector128 GatherVector128(double* baseAddress, Vect /// VPGATHERDD ymm1, vm32y, ymm2 /// The scale parameter should be 1, 2, 4 or 8, otherwise, ArgumentOutOfRangeException will be thrown. /// - [RequiresUnsafe] public static unsafe Vector256 GatherVector256(int* baseAddress, Vector256 index, [ConstantExpected(Min = (byte)(1), Max = (byte)(8))] byte scale) { return scale switch @@ -1226,7 +1177,6 @@ public static unsafe Vector256 GatherVector256(int* baseAddress, Vector256< /// VPGATHERDD ymm1, vm32y, ymm2 /// The scale parameter should be 1, 2, 4 or 8, otherwise, ArgumentOutOfRangeException will be thrown. /// - [RequiresUnsafe] public static unsafe Vector256 GatherVector256(uint* baseAddress, Vector256 index, [ConstantExpected(Min = (byte)(1), Max = (byte)(8))] byte scale) { return scale switch @@ -1244,7 +1194,6 @@ public static unsafe Vector256 GatherVector256(uint* baseAddress, Vector25 /// VPGATHERDQ ymm1, vm32y, ymm2 /// The scale parameter should be 1, 2, 4 or 8, otherwise, ArgumentOutOfRangeException will be thrown. /// - [RequiresUnsafe] public static unsafe Vector256 GatherVector256(long* baseAddress, Vector128 index, [ConstantExpected(Min = (byte)(1), Max = (byte)(8))] byte scale) { return scale switch @@ -1262,7 +1211,6 @@ public static unsafe Vector256 GatherVector256(long* baseAddress, Vector12 /// VPGATHERDQ ymm1, vm32y, ymm2 /// The scale parameter should be 1, 2, 4 or 8, otherwise, ArgumentOutOfRangeException will be thrown. /// - [RequiresUnsafe] public static unsafe Vector256 GatherVector256(ulong* baseAddress, Vector128 index, [ConstantExpected(Min = (byte)(1), Max = (byte)(8))] byte scale) { return scale switch @@ -1280,7 +1228,6 @@ public static unsafe Vector256 GatherVector256(ulong* baseAddress, Vector /// VGATHERDPS ymm1, vm32y, ymm2 /// The scale parameter should be 1, 2, 4 or 8, otherwise, ArgumentOutOfRangeException will be thrown. /// - [RequiresUnsafe] public static unsafe Vector256 GatherVector256(float* baseAddress, Vector256 index, [ConstantExpected(Min = (byte)(1), Max = (byte)(8))] byte scale) { return scale switch @@ -1298,7 +1245,6 @@ public static unsafe Vector256 GatherVector256(float* baseAddress, Vector /// VGATHERDPD ymm1, vm32y, ymm2 /// The scale parameter should be 1, 2, 4 or 8, otherwise, ArgumentOutOfRangeException will be thrown. /// - [RequiresUnsafe] public static unsafe Vector256 GatherVector256(double* baseAddress, Vector128 index, [ConstantExpected(Min = (byte)(1), Max = (byte)(8))] byte scale) { return scale switch @@ -1316,7 +1262,6 @@ public static unsafe Vector256 GatherVector256(double* baseAddress, Vect /// VPGATHERQD xmm1, vm64y, xmm2 /// The scale parameter should be 1, 2, 4 or 8, otherwise, ArgumentOutOfRangeException will be thrown. /// - [RequiresUnsafe] public static unsafe Vector128 GatherVector128(int* baseAddress, Vector256 index, [ConstantExpected(Min = (byte)(1), Max = (byte)(8))] byte scale) { return scale switch @@ -1334,7 +1279,6 @@ public static unsafe Vector128 GatherVector128(int* baseAddress, Vector256< /// VPGATHERQD xmm1, vm64y, xmm2 /// The scale parameter should be 1, 2, 4 or 8, otherwise, ArgumentOutOfRangeException will be thrown. /// - [RequiresUnsafe] public static unsafe Vector128 GatherVector128(uint* baseAddress, Vector256 index, [ConstantExpected(Min = (byte)(1), Max = (byte)(8))] byte scale) { return scale switch @@ -1352,7 +1296,6 @@ public static unsafe Vector128 GatherVector128(uint* baseAddress, Vector25 /// VPGATHERQQ ymm1, vm64y, ymm2 /// The scale parameter should be 1, 2, 4 or 8, otherwise, ArgumentOutOfRangeException will be thrown. /// - [RequiresUnsafe] public static unsafe Vector256 GatherVector256(long* baseAddress, Vector256 index, [ConstantExpected(Min = (byte)(1), Max = (byte)(8))] byte scale) { return scale switch @@ -1370,7 +1313,6 @@ public static unsafe Vector256 GatherVector256(long* baseAddress, Vector25 /// VPGATHERQQ ymm1, vm64y, ymm2 /// The scale parameter should be 1, 2, 4 or 8, otherwise, ArgumentOutOfRangeException will be thrown. /// - [RequiresUnsafe] public static unsafe Vector256 GatherVector256(ulong* baseAddress, Vector256 index, [ConstantExpected(Min = (byte)(1), Max = (byte)(8))] byte scale) { return scale switch @@ -1388,7 +1330,6 @@ public static unsafe Vector256 GatherVector256(ulong* baseAddress, Vector /// VGATHERQPS xmm1, vm64y, xmm2 /// The scale parameter should be 1, 2, 4 or 8, otherwise, ArgumentOutOfRangeException will be thrown. /// - [RequiresUnsafe] public static unsafe Vector128 GatherVector128(float* baseAddress, Vector256 index, [ConstantExpected(Min = (byte)(1), Max = (byte)(8))] byte scale) { return scale switch @@ -1406,7 +1347,6 @@ public static unsafe Vector128 GatherVector128(float* baseAddress, Vector /// VGATHERQPD ymm1, vm64y, ymm2 /// The scale parameter should be 1, 2, 4 or 8, otherwise, ArgumentOutOfRangeException will be thrown. /// - [RequiresUnsafe] public static unsafe Vector256 GatherVector256(double* baseAddress, Vector256 index, [ConstantExpected(Min = (byte)(1), Max = (byte)(8))] byte scale) { return scale switch @@ -1424,7 +1364,6 @@ public static unsafe Vector256 GatherVector256(double* baseAddress, Vect /// VPGATHERDD xmm1, vm32x, xmm2 /// The scale parameter should be 1, 2, 4 or 8, otherwise, ArgumentOutOfRangeException will be thrown. /// - [RequiresUnsafe] public static unsafe Vector128 GatherMaskVector128(Vector128 source, int* baseAddress, Vector128 index, Vector128 mask, [ConstantExpected(Min = (byte)(1), Max = (byte)(8))] byte scale) { return scale switch @@ -1442,7 +1381,6 @@ public static unsafe Vector128 GatherMaskVector128(Vector128 source, i /// VPGATHERDD xmm1, vm32x, xmm2 /// The scale parameter should be 1, 2, 4 or 8, otherwise, ArgumentOutOfRangeException will be thrown. /// - [RequiresUnsafe] public static unsafe Vector128 GatherMaskVector128(Vector128 source, uint* baseAddress, Vector128 index, Vector128 mask, [ConstantExpected(Min = (byte)(1), Max = (byte)(8))] byte scale) { return scale switch @@ -1460,7 +1398,6 @@ public static unsafe Vector128 GatherMaskVector128(Vector128 source, /// VPGATHERDQ xmm1, vm32x, xmm2 /// The scale parameter should be 1, 2, 4 or 8, otherwise, ArgumentOutOfRangeException will be thrown. /// - [RequiresUnsafe] public static unsafe Vector128 GatherMaskVector128(Vector128 source, long* baseAddress, Vector128 index, Vector128 mask, [ConstantExpected(Min = (byte)(1), Max = (byte)(8))] byte scale) { return scale switch @@ -1478,7 +1415,6 @@ public static unsafe Vector128 GatherMaskVector128(Vector128 source, /// VPGATHERDQ xmm1, vm32x, xmm2 /// The scale parameter should be 1, 2, 4 or 8, otherwise, ArgumentOutOfRangeException will be thrown. /// - [RequiresUnsafe] public static unsafe Vector128 GatherMaskVector128(Vector128 source, ulong* baseAddress, Vector128 index, Vector128 mask, [ConstantExpected(Min = (byte)(1), Max = (byte)(8))] byte scale) { return scale switch @@ -1496,7 +1432,6 @@ public static unsafe Vector128 GatherMaskVector128(Vector128 sourc /// VGATHERDPS xmm1, vm32x, xmm2 /// The scale parameter should be 1, 2, 4 or 8, otherwise, ArgumentOutOfRangeException will be thrown. /// - [RequiresUnsafe] public static unsafe Vector128 GatherMaskVector128(Vector128 source, float* baseAddress, Vector128 index, Vector128 mask, [ConstantExpected(Min = (byte)(1), Max = (byte)(8))] byte scale) { return scale switch @@ -1514,7 +1449,6 @@ public static unsafe Vector128 GatherMaskVector128(Vector128 sourc /// VGATHERDPD xmm1, vm32x, xmm2 /// The scale parameter should be 1, 2, 4 or 8, otherwise, ArgumentOutOfRangeException will be thrown. /// - [RequiresUnsafe] public static unsafe Vector128 GatherMaskVector128(Vector128 source, double* baseAddress, Vector128 index, Vector128 mask, [ConstantExpected(Min = (byte)(1), Max = (byte)(8))] byte scale) { return scale switch @@ -1532,7 +1466,6 @@ public static unsafe Vector128 GatherMaskVector128(Vector128 sou /// VPGATHERQD xmm1, vm64x, xmm2 /// The scale parameter should be 1, 2, 4 or 8, otherwise, ArgumentOutOfRangeException will be thrown. /// - [RequiresUnsafe] public static unsafe Vector128 GatherMaskVector128(Vector128 source, int* baseAddress, Vector128 index, Vector128 mask, [ConstantExpected(Min = (byte)(1), Max = (byte)(8))] byte scale) { return scale switch @@ -1550,7 +1483,6 @@ public static unsafe Vector128 GatherMaskVector128(Vector128 source, i /// VPGATHERQD xmm1, vm64x, xmm2 /// The scale parameter should be 1, 2, 4 or 8, otherwise, ArgumentOutOfRangeException will be thrown. /// - [RequiresUnsafe] public static unsafe Vector128 GatherMaskVector128(Vector128 source, uint* baseAddress, Vector128 index, Vector128 mask, [ConstantExpected(Min = (byte)(1), Max = (byte)(8))] byte scale) { return scale switch @@ -1568,7 +1500,6 @@ public static unsafe Vector128 GatherMaskVector128(Vector128 source, /// VPGATHERQQ xmm1, vm64x, xmm2 /// The scale parameter should be 1, 2, 4 or 8, otherwise, ArgumentOutOfRangeException will be thrown. /// - [RequiresUnsafe] public static unsafe Vector128 GatherMaskVector128(Vector128 source, long* baseAddress, Vector128 index, Vector128 mask, [ConstantExpected(Min = (byte)(1), Max = (byte)(8))] byte scale) { return scale switch @@ -1586,7 +1517,6 @@ public static unsafe Vector128 GatherMaskVector128(Vector128 source, /// VPGATHERQQ xmm1, vm64x, xmm2 /// The scale parameter should be 1, 2, 4 or 8, otherwise, ArgumentOutOfRangeException will be thrown. /// - [RequiresUnsafe] public static unsafe Vector128 GatherMaskVector128(Vector128 source, ulong* baseAddress, Vector128 index, Vector128 mask, [ConstantExpected(Min = (byte)(1), Max = (byte)(8))] byte scale) { return scale switch @@ -1604,7 +1534,6 @@ public static unsafe Vector128 GatherMaskVector128(Vector128 sourc /// VGATHERQPS xmm1, vm64x, xmm2 /// The scale parameter should be 1, 2, 4 or 8, otherwise, ArgumentOutOfRangeException will be thrown. /// - [RequiresUnsafe] public static unsafe Vector128 GatherMaskVector128(Vector128 source, float* baseAddress, Vector128 index, Vector128 mask, [ConstantExpected(Min = (byte)(1), Max = (byte)(8))] byte scale) { return scale switch @@ -1622,7 +1551,6 @@ public static unsafe Vector128 GatherMaskVector128(Vector128 sourc /// VGATHERQPD xmm1, vm64x, xmm2 /// The scale parameter should be 1, 2, 4 or 8, otherwise, ArgumentOutOfRangeException will be thrown. /// - [RequiresUnsafe] public static unsafe Vector128 GatherMaskVector128(Vector128 source, double* baseAddress, Vector128 index, Vector128 mask, [ConstantExpected(Min = (byte)(1), Max = (byte)(8))] byte scale) { return scale switch @@ -1640,7 +1568,6 @@ public static unsafe Vector128 GatherMaskVector128(Vector128 sou /// VPGATHERDD ymm1, vm32y, ymm2 /// The scale parameter should be 1, 2, 4 or 8, otherwise, ArgumentOutOfRangeException will be thrown. /// - [RequiresUnsafe] public static unsafe Vector256 GatherMaskVector256(Vector256 source, int* baseAddress, Vector256 index, Vector256 mask, [ConstantExpected(Min = (byte)(1), Max = (byte)(8))] byte scale) { return scale switch @@ -1658,7 +1585,6 @@ public static unsafe Vector256 GatherMaskVector256(Vector256 source, i /// VPGATHERDD ymm1, vm32y, ymm2 /// The scale parameter should be 1, 2, 4 or 8, otherwise, ArgumentOutOfRangeException will be thrown. /// - [RequiresUnsafe] public static unsafe Vector256 GatherMaskVector256(Vector256 source, uint* baseAddress, Vector256 index, Vector256 mask, [ConstantExpected(Min = (byte)(1), Max = (byte)(8))] byte scale) { return scale switch @@ -1676,7 +1602,6 @@ public static unsafe Vector256 GatherMaskVector256(Vector256 source, /// VPGATHERDQ ymm1, vm32y, ymm2 /// The scale parameter should be 1, 2, 4 or 8, otherwise, ArgumentOutOfRangeException will be thrown. /// - [RequiresUnsafe] public static unsafe Vector256 GatherMaskVector256(Vector256 source, long* baseAddress, Vector128 index, Vector256 mask, [ConstantExpected(Min = (byte)(1), Max = (byte)(8))] byte scale) { return scale switch @@ -1694,7 +1619,6 @@ public static unsafe Vector256 GatherMaskVector256(Vector256 source, /// VPGATHERDQ ymm1, vm32y, ymm2 /// The scale parameter should be 1, 2, 4 or 8, otherwise, ArgumentOutOfRangeException will be thrown. /// - [RequiresUnsafe] public static unsafe Vector256 GatherMaskVector256(Vector256 source, ulong* baseAddress, Vector128 index, Vector256 mask, [ConstantExpected(Min = (byte)(1), Max = (byte)(8))] byte scale) { return scale switch @@ -1712,7 +1636,6 @@ public static unsafe Vector256 GatherMaskVector256(Vector256 sourc /// VPGATHERDPS ymm1, vm32y, ymm2 /// The scale parameter should be 1, 2, 4 or 8, otherwise, ArgumentOutOfRangeException will be thrown. /// - [RequiresUnsafe] public static unsafe Vector256 GatherMaskVector256(Vector256 source, float* baseAddress, Vector256 index, Vector256 mask, [ConstantExpected(Min = (byte)(1), Max = (byte)(8))] byte scale) { return scale switch @@ -1730,7 +1653,6 @@ public static unsafe Vector256 GatherMaskVector256(Vector256 sourc /// VPGATHERDPD ymm1, vm32y, ymm2 /// The scale parameter should be 1, 2, 4 or 8, otherwise, ArgumentOutOfRangeException will be thrown. /// - [RequiresUnsafe] public static unsafe Vector256 GatherMaskVector256(Vector256 source, double* baseAddress, Vector128 index, Vector256 mask, [ConstantExpected(Min = (byte)(1), Max = (byte)(8))] byte scale) { return scale switch @@ -1748,7 +1670,6 @@ public static unsafe Vector256 GatherMaskVector256(Vector256 sou /// VPGATHERQD xmm1, vm32y, xmm2 /// The scale parameter should be 1, 2, 4 or 8, otherwise, ArgumentOutOfRangeException will be thrown. /// - [RequiresUnsafe] public static unsafe Vector128 GatherMaskVector128(Vector128 source, int* baseAddress, Vector256 index, Vector128 mask, [ConstantExpected(Min = (byte)(1), Max = (byte)(8))] byte scale) { return scale switch @@ -1766,7 +1687,6 @@ public static unsafe Vector128 GatherMaskVector128(Vector128 source, i /// VPGATHERQD xmm1, vm32y, xmm2 /// The scale parameter should be 1, 2, 4 or 8, otherwise, ArgumentOutOfRangeException will be thrown. /// - [RequiresUnsafe] public static unsafe Vector128 GatherMaskVector128(Vector128 source, uint* baseAddress, Vector256 index, Vector128 mask, [ConstantExpected(Min = (byte)(1), Max = (byte)(8))] byte scale) { return scale switch @@ -1784,7 +1704,6 @@ public static unsafe Vector128 GatherMaskVector128(Vector128 source, /// VPGATHERQQ ymm1, vm32y, ymm2 /// The scale parameter should be 1, 2, 4 or 8, otherwise, ArgumentOutOfRangeException will be thrown. /// - [RequiresUnsafe] public static unsafe Vector256 GatherMaskVector256(Vector256 source, long* baseAddress, Vector256 index, Vector256 mask, [ConstantExpected(Min = (byte)(1), Max = (byte)(8))] byte scale) { return scale switch @@ -1802,7 +1721,6 @@ public static unsafe Vector256 GatherMaskVector256(Vector256 source, /// VPGATHERQQ ymm1, vm32y, ymm2 /// The scale parameter should be 1, 2, 4 or 8, otherwise, ArgumentOutOfRangeException will be thrown. /// - [RequiresUnsafe] public static unsafe Vector256 GatherMaskVector256(Vector256 source, ulong* baseAddress, Vector256 index, Vector256 mask, [ConstantExpected(Min = (byte)(1), Max = (byte)(8))] byte scale) { return scale switch @@ -1820,7 +1738,6 @@ public static unsafe Vector256 GatherMaskVector256(Vector256 sourc /// VGATHERQPS xmm1, vm32y, xmm2 /// The scale parameter should be 1, 2, 4 or 8, otherwise, ArgumentOutOfRangeException will be thrown. /// - [RequiresUnsafe] public static unsafe Vector128 GatherMaskVector128(Vector128 source, float* baseAddress, Vector256 index, Vector128 mask, [ConstantExpected(Min = (byte)(1), Max = (byte)(8))] byte scale) { return scale switch @@ -1838,7 +1755,6 @@ public static unsafe Vector128 GatherMaskVector128(Vector128 sourc /// VGATHERQPD ymm1, vm32y, ymm2 /// The scale parameter should be 1, 2, 4 or 8, otherwise, ArgumentOutOfRangeException will be thrown. /// - [RequiresUnsafe] public static unsafe Vector256 GatherMaskVector256(Vector256 source, double* baseAddress, Vector256 index, Vector256 mask, [ConstantExpected(Min = (byte)(1), Max = (byte)(8))] byte scale) { return scale switch @@ -1938,168 +1854,144 @@ public static unsafe Vector256 GatherMaskVector256(Vector256 sou /// __m256i _mm256_stream_load_si256 (__m256i const* mem_addr) /// VMOVNTDQA ymm1, m256 /// - [RequiresUnsafe] public static unsafe Vector256 LoadAlignedVector256NonTemporal(sbyte* address) => LoadAlignedVector256NonTemporal(address); /// /// __m256i _mm256_stream_load_si256 (__m256i const* mem_addr) /// VMOVNTDQA ymm1, m256 /// - [RequiresUnsafe] public static unsafe Vector256 LoadAlignedVector256NonTemporal(byte* address) => LoadAlignedVector256NonTemporal(address); /// /// __m256i _mm256_stream_load_si256 (__m256i const* mem_addr) /// VMOVNTDQA ymm1, m256 /// - [RequiresUnsafe] public static unsafe Vector256 LoadAlignedVector256NonTemporal(short* address) => LoadAlignedVector256NonTemporal(address); /// /// __m256i _mm256_stream_load_si256 (__m256i const* mem_addr) /// VMOVNTDQA ymm1, m256 /// - [RequiresUnsafe] public static unsafe Vector256 LoadAlignedVector256NonTemporal(ushort* address) => LoadAlignedVector256NonTemporal(address); /// /// __m256i _mm256_stream_load_si256 (__m256i const* mem_addr) /// VMOVNTDQA ymm1, m256 /// - [RequiresUnsafe] public static unsafe Vector256 LoadAlignedVector256NonTemporal(int* address) => LoadAlignedVector256NonTemporal(address); /// /// __m256i _mm256_stream_load_si256 (__m256i const* mem_addr) /// VMOVNTDQA ymm1, m256 /// - [RequiresUnsafe] public static unsafe Vector256 LoadAlignedVector256NonTemporal(uint* address) => LoadAlignedVector256NonTemporal(address); /// /// __m256i _mm256_stream_load_si256 (__m256i const* mem_addr) /// VMOVNTDQA ymm1, m256 /// - [RequiresUnsafe] public static unsafe Vector256 LoadAlignedVector256NonTemporal(long* address) => LoadAlignedVector256NonTemporal(address); /// /// __m256i _mm256_stream_load_si256 (__m256i const* mem_addr) /// VMOVNTDQA ymm1, m256 /// - [RequiresUnsafe] public static unsafe Vector256 LoadAlignedVector256NonTemporal(ulong* address) => LoadAlignedVector256NonTemporal(address); /// /// __m128i _mm_maskload_epi32 (int const* mem_addr, __m128i mask) /// VPMASKMOVD xmm1, xmm2, m128 /// - [RequiresUnsafe] public static unsafe Vector128 MaskLoad(int* address, Vector128 mask) => MaskLoad(address, mask); /// /// __m128i _mm_maskload_epi32 (int const* mem_addr, __m128i mask) /// VPMASKMOVD xmm1, xmm2, m128 /// - [RequiresUnsafe] public static unsafe Vector128 MaskLoad(uint* address, Vector128 mask) => MaskLoad(address, mask); /// /// __m128i _mm_maskload_epi64 (__int64 const* mem_addr, __m128i mask) /// VPMASKMOVQ xmm1, xmm2, m128 /// - [RequiresUnsafe] public static unsafe Vector128 MaskLoad(long* address, Vector128 mask) => MaskLoad(address, mask); /// /// __m128i _mm_maskload_epi64 (__int64 const* mem_addr, __m128i mask) /// VPMASKMOVQ xmm1, xmm2, m128 /// - [RequiresUnsafe] public static unsafe Vector128 MaskLoad(ulong* address, Vector128 mask) => MaskLoad(address, mask); /// /// __m256i _mm256_maskload_epi32 (int const* mem_addr, __m256i mask) /// VPMASKMOVD ymm1, ymm2, m256 /// - [RequiresUnsafe] public static unsafe Vector256 MaskLoad(int* address, Vector256 mask) => MaskLoad(address, mask); /// /// __m256i _mm256_maskload_epi32 (int const* mem_addr, __m256i mask) /// VPMASKMOVD ymm1, ymm2, m256 /// - [RequiresUnsafe] public static unsafe Vector256 MaskLoad(uint* address, Vector256 mask) => MaskLoad(address, mask); /// /// __m256i _mm256_maskload_epi64 (__int64 const* mem_addr, __m256i mask) /// VPMASKMOVQ ymm1, ymm2, m256 /// - [RequiresUnsafe] public static unsafe Vector256 MaskLoad(long* address, Vector256 mask) => MaskLoad(address, mask); /// /// __m256i _mm256_maskload_epi64 (__int64 const* mem_addr, __m256i mask) /// VPMASKMOVQ ymm1, ymm2, m256 /// - [RequiresUnsafe] public static unsafe Vector256 MaskLoad(ulong* address, Vector256 mask) => MaskLoad(address, mask); /// /// void _mm_maskstore_epi32 (int* mem_addr, __m128i mask, __m128i a) /// VPMASKMOVD m128, xmm1, xmm2 /// - [RequiresUnsafe] public static unsafe void MaskStore(int* address, Vector128 mask, Vector128 source) => MaskStore(address, mask, source); /// /// void _mm_maskstore_epi32 (int* mem_addr, __m128i mask, __m128i a) /// VPMASKMOVD m128, xmm1, xmm2 /// - [RequiresUnsafe] public static unsafe void MaskStore(uint* address, Vector128 mask, Vector128 source) => MaskStore(address, mask, source); /// /// void _mm_maskstore_epi64 (__int64* mem_addr, __m128i mask, __m128i a) /// VPMASKMOVQ m128, xmm1, xmm2 /// - [RequiresUnsafe] public static unsafe void MaskStore(long* address, Vector128 mask, Vector128 source) => MaskStore(address, mask, source); /// /// void _mm_maskstore_epi64 (__int64* mem_addr, __m128i mask, __m128i a) /// VPMASKMOVQ m128, xmm1, xmm2 /// - [RequiresUnsafe] public static unsafe void MaskStore(ulong* address, Vector128 mask, Vector128 source) => MaskStore(address, mask, source); /// /// void _mm256_maskstore_epi32 (int* mem_addr, __m256i mask, __m256i a) /// VPMASKMOVD m256, ymm1, ymm2 /// - [RequiresUnsafe] public static unsafe void MaskStore(int* address, Vector256 mask, Vector256 source) => MaskStore(address, mask, source); /// /// void _mm256_maskstore_epi32 (int* mem_addr, __m256i mask, __m256i a) /// VPMASKMOVD m256, ymm1, ymm2 /// - [RequiresUnsafe] public static unsafe void MaskStore(uint* address, Vector256 mask, Vector256 source) => MaskStore(address, mask, source); /// /// void _mm256_maskstore_epi64 (__int64* mem_addr, __m256i mask, __m256i a) /// VPMASKMOVQ m256, ymm1, ymm2 /// - [RequiresUnsafe] public static unsafe void MaskStore(long* address, Vector256 mask, Vector256 source) => MaskStore(address, mask, source); /// /// void _mm256_maskstore_epi64 (__int64* mem_addr, __m256i mask, __m256i a) /// VPMASKMOVQ m256, ymm1, ymm2 /// - [RequiresUnsafe] public static unsafe void MaskStore(ulong* address, Vector256 mask, Vector256 source) => MaskStore(address, mask, source); /// diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Avx512BW.PlatformNotSupported.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Avx512BW.PlatformNotSupported.cs index 50bcc33b6024fa..19e626b8e020ab 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Avx512BW.PlatformNotSupported.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Avx512BW.PlatformNotSupported.cs @@ -394,28 +394,24 @@ internal VL() { } /// VMOVDQU8 xmm1 {k1}{z}, m128 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector128 MaskLoad(byte* address, Vector128 mask, Vector128 merge) { throw new PlatformNotSupportedException(); } /// /// __m128i _mm_mask_loadu_epi16 (__m128i s, __mmask8 k, void const * mem_addr) /// VMOVDQU32 xmm1 {k1}{z}, m128 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector128 MaskLoad(short* address, Vector128 mask, Vector128 merge) { throw new PlatformNotSupportedException(); } /// /// __m128i _mm_mask_loadu_epi8 (__m128i s, __mmask16 k, void const * mem_addr) /// VMOVDQU8 xmm1 {k1}{z}, m128 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector128 MaskLoad(sbyte* address, Vector128 mask, Vector128 merge) { throw new PlatformNotSupportedException(); } /// /// __m128i _mm_mask_loadu_epi16 (__m128i s, __mmask8 k, void const * mem_addr) /// VMOVDQU32 xmm1 {k1}{z}, m128 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector128 MaskLoad(ushort* address, Vector128 mask, Vector128 merge) { throw new PlatformNotSupportedException(); } /// @@ -423,78 +419,66 @@ internal VL() { } /// VMOVDQU8 ymm1 {k1}{z}, m256 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector256 MaskLoad(byte* address, Vector256 mask, Vector256 merge) { throw new PlatformNotSupportedException(); } /// /// __m256i _mm256_mask_loadu_epi16 (__m256i s, __mmask16 k, void const * mem_addr) /// VMOVDQU32 ymm1 {k1}{z}, m256 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector256 MaskLoad(short* address, Vector256 mask, Vector256 merge) { throw new PlatformNotSupportedException(); } /// /// __m256i _mm256_mask_loadu_epi8 (__m256i s, __mmask32 k, void const * mem_addr) /// VMOVDQU8 ymm1 {k1}{z}, m256 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector256 MaskLoad(sbyte* address, Vector256 mask, Vector256 merge) { throw new PlatformNotSupportedException(); } /// /// __m256i _mm256_mask_loadu_epi16 (__m256i s, __mmask16 k, void const * mem_addr) /// VMOVDQU32 ymm1 {k1}{z}, m256 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector256 MaskLoad(ushort* address, Vector256 mask, Vector256 merge) { throw new PlatformNotSupportedException(); } /// /// void _mm_mask_storeu_si128 (void * mem_addr, __mmask16 k, __m128i a) /// VMOVDQU8 m128 {k1}{z}, xmm1 /// - [RequiresUnsafe] public static unsafe void MaskStore(byte* address, Vector128 mask, Vector128 source) { throw new PlatformNotSupportedException(); } /// /// void _mm_mask_storeu_si128 (void * mem_addr, __mmask8 k, __m128i a) /// VMOVDQU16 m128 {k1}{z}, xmm1 /// - [RequiresUnsafe] public static unsafe void MaskStore(short* address, Vector128 mask, Vector128 source) { throw new PlatformNotSupportedException(); } /// /// void _mm_mask_storeu_si128 (void * mem_addr, __mmask16 k, __m128i a) /// VMOVDQU8 m128 {k1}{z}, xmm1 /// - [RequiresUnsafe] public static unsafe void MaskStore(sbyte* address, Vector128 mask, Vector128 source) { throw new PlatformNotSupportedException(); } /// /// void _mm_mask_storeu_si128 (void * mem_addr, __mmask8 k, __m128i a) /// VMOVDQU16 m128 {k1}{z}, xmm1 /// - [RequiresUnsafe] public static unsafe void MaskStore(ushort* address, Vector128 mask, Vector128 source) { throw new PlatformNotSupportedException(); } /// /// void _mm256_mask_storeu_si256 (void * mem_addr, __mmask32 k, __m256i a) /// VMOVDQU8 m256 {k1}{z}, ymm1 /// - [RequiresUnsafe] public static unsafe void MaskStore(byte* address, Vector256 mask, Vector256 source) { throw new PlatformNotSupportedException(); } /// /// void _mm256_mask_storeu_si256 (void * mem_addr, __mmask16 k, __m256i a) /// VMOVDQU16 m256 {k1}{z}, ymm1 /// - [RequiresUnsafe] public static unsafe void MaskStore(short* address, Vector256 mask, Vector256 source) { throw new PlatformNotSupportedException(); } /// /// void _mm256_mask_storeu_si256 (void * mem_addr, __mmask32 k, __m256i a) /// VMOVDQU8 m256 {k1}{z}, ymm1 /// - [RequiresUnsafe] public static unsafe void MaskStore(sbyte* address, Vector256 mask, Vector256 source) { throw new PlatformNotSupportedException(); } /// /// void _mm256_mask_storeu_si256 (void * mem_addr, __mmask16 k, __m256i a) /// VMOVDQU16 m256 {k1}{z}, ymm1 /// - [RequiresUnsafe] public static unsafe void MaskStore(ushort* address, Vector256 mask, Vector256 source) { throw new PlatformNotSupportedException(); } /// @@ -927,25 +911,21 @@ internal X64() { } /// __m512i _mm512_loadu_epi8 (void const * mem_addr) /// VMOVDQU8 zmm1, m512 /// - [RequiresUnsafe] public static new unsafe Vector512 LoadVector512(sbyte* address) { throw new PlatformNotSupportedException(); } /// /// __m512i _mm512_loadu_epi8 (void const * mem_addr) /// VMOVDQU8 zmm1, m512 /// - [RequiresUnsafe] public static new unsafe Vector512 LoadVector512(byte* address) { throw new PlatformNotSupportedException(); } /// /// __m512i _mm512_loadu_epi16 (void const * mem_addr) /// VMOVDQU16 zmm1, m512 /// - [RequiresUnsafe] public static new unsafe Vector512 LoadVector512(short* address) { throw new PlatformNotSupportedException(); } /// /// __m512i _mm512_loadu_epi16 (void const * mem_addr) /// VMOVDQU16 zmm1, m512 /// - [RequiresUnsafe] public static new unsafe Vector512 LoadVector512(ushort* address) { throw new PlatformNotSupportedException(); } /// @@ -953,53 +933,45 @@ internal X64() { } /// VMOVDQU8 zmm1 {k1}{z}, m512 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector512 MaskLoad(byte* address, Vector512 mask, Vector512 merge) { throw new PlatformNotSupportedException(); } /// /// __m512i _mm512_mask_loadu_epi16 (__m512i s, __mmask32 k, void const * mem_addr) /// VMOVDQU32 zmm1 {k1}{z}, m512 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector512 MaskLoad(short* address, Vector512 mask, Vector512 merge) { throw new PlatformNotSupportedException(); } /// /// __m512i _mm512_mask_loadu_epi8 (__m512i s, __mmask64 k, void const * mem_addr) /// VMOVDQU8 zmm1 {k1}{z}, m512 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector512 MaskLoad(sbyte* address, Vector512 mask, Vector512 merge) { throw new PlatformNotSupportedException(); } /// /// __m512i _mm512_mask_loadu_epi16 (__m512i s, __mmask32 k, void const * mem_addr) /// VMOVDQU32 zmm1 {k1}{z}, m512 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector512 MaskLoad(ushort* address, Vector512 mask, Vector512 merge) { throw new PlatformNotSupportedException(); } /// /// void _mm512_mask_storeu_si512 (void * mem_addr, __mmask64 k, __m512i a) /// VMOVDQU8 m512 {k1}{z}, zmm1 /// - [RequiresUnsafe] public static unsafe void MaskStore(byte* address, Vector512 mask, Vector512 source) { throw new PlatformNotSupportedException(); } /// /// void _mm512_mask_storeu_si512 (void * mem_addr, __mmask32 k, __m512i a) /// VMOVDQU16 m512 {k1}{z}, zmm1 /// - [RequiresUnsafe] public static unsafe void MaskStore(short* address, Vector512 mask, Vector512 source) { throw new PlatformNotSupportedException(); } /// /// void _mm512_mask_storeu_si512 (void * mem_addr, __mmask64 k, __m512i a) /// VMOVDQU8 m512 {k1}{z}, zmm1 /// - [RequiresUnsafe] public static unsafe void MaskStore(sbyte* address, Vector512 mask, Vector512 source) { throw new PlatformNotSupportedException(); } /// /// void _mm512_mask_storeu_si512 (void * mem_addr, __mmask32 k, __m512i a) /// VMOVDQU16 m512 {k1}{z}, zmm1 /// - [RequiresUnsafe] public static unsafe void MaskStore(ushort* address, Vector512 mask, Vector512 source) { throw new PlatformNotSupportedException(); } /// @@ -1306,25 +1278,21 @@ internal X64() { } /// void _mm512_storeu_epi8 (void * mem_addr, __m512i a) /// VMOVDQU8 m512, zmm1 /// - [RequiresUnsafe] public static new unsafe void Store(sbyte* address, Vector512 source) { throw new PlatformNotSupportedException(); } /// /// void _mm512_storeu_epi8 (void * mem_addr, __m512i a) /// VMOVDQU8 m512, zmm1 /// - [RequiresUnsafe] public static new unsafe void Store(byte* address, Vector512 source) { throw new PlatformNotSupportedException(); } /// /// void _mm512_storeu_epi16 (void * mem_addr, __m512i a) /// VMOVDQU16 m512, zmm1 /// - [RequiresUnsafe] public static new unsafe void Store(short* address, Vector512 source) { throw new PlatformNotSupportedException(); } /// /// void _mm512_storeu_epi16 (void * mem_addr, __m512i a) /// VMOVDQU16 m512, zmm1 /// - [RequiresUnsafe] public static new unsafe void Store(ushort* address, Vector512 source) { throw new PlatformNotSupportedException(); } /// diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Avx512BW.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Avx512BW.cs index 767b650223af3f..c8c2be62993e85 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Avx512BW.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Avx512BW.cs @@ -394,7 +394,6 @@ internal VL() { } /// VMOVDQU8 xmm1 {k1}{z}, m128 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector128 MaskLoad(byte* address, Vector128 mask, Vector128 merge) => MaskLoad(address, mask, merge); /// @@ -402,7 +401,6 @@ internal VL() { } /// VMOVDQU32 xmm1 {k1}{z}, m128 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector128 MaskLoad(short* address, Vector128 mask, Vector128 merge) => MaskLoad(address, mask, merge); /// @@ -410,7 +408,6 @@ internal VL() { } /// VMOVDQU8 xmm1 {k1}{z}, m128 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector128 MaskLoad(sbyte* address, Vector128 mask, Vector128 merge) => MaskLoad(address, mask, merge); /// @@ -418,7 +415,6 @@ internal VL() { } /// VMOVDQU32 xmm1 {k1}{z}, m128 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector128 MaskLoad(ushort* address, Vector128 mask, Vector128 merge) => MaskLoad(address, mask, merge); /// @@ -426,7 +422,6 @@ internal VL() { } /// VMOVDQU8 ymm1 {k1}{z}, m256 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector256 MaskLoad(byte* address, Vector256 mask, Vector256 merge) => MaskLoad(address, mask, merge); /// @@ -434,7 +429,6 @@ internal VL() { } /// VMOVDQU32 ymm1 {k1}{z}, m256 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector256 MaskLoad(short* address, Vector256 mask, Vector256 merge) => MaskLoad(address, mask, merge); /// @@ -442,7 +436,6 @@ internal VL() { } /// VMOVDQU8 ymm1 {k1}{z}, m256 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector256 MaskLoad(sbyte* address, Vector256 mask, Vector256 merge) => MaskLoad(address, mask, merge); /// @@ -450,63 +443,54 @@ internal VL() { } /// VMOVDQU32 ymm1 {k1}{z}, m256 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector256 MaskLoad(ushort* address, Vector256 mask, Vector256 merge) => MaskLoad(address, mask, merge); /// /// void _mm_mask_storeu_si128 (void * mem_addr, __mmask16 k, __m128i a) /// VMOVDQU8 m128 {k1}{z}, xmm1 /// - [RequiresUnsafe] public static unsafe void MaskStore(byte* address, Vector128 mask, Vector128 source) => MaskStore(address, mask, source); /// /// void _mm_mask_storeu_si128 (void * mem_addr, __mmask8 k, __m128i a) /// VMOVDQU16 m128 {k1}{z}, xmm1 /// - [RequiresUnsafe] public static unsafe void MaskStore(short* address, Vector128 mask, Vector128 source) => MaskStore(address, mask, source); /// /// void _mm_mask_storeu_si128 (void * mem_addr, __mmask16 k, __m128i a) /// VMOVDQU8 m128 {k1}{z}, xmm1 /// - [RequiresUnsafe] public static unsafe void MaskStore(sbyte* address, Vector128 mask, Vector128 source) => MaskStore(address, mask, source); /// /// void _mm_mask_storeu_si128 (void * mem_addr, __mmask8 k, __m128i a) /// VMOVDQU16 m128 {k1}{z}, xmm1 /// - [RequiresUnsafe] public static unsafe void MaskStore(ushort* address, Vector128 mask, Vector128 source) => MaskStore(address, mask, source); /// /// void _mm256_mask_storeu_si256 (void * mem_addr, __mmask32 k, __m256i a) /// VMOVDQU8 m256 {k1}{z}, ymm1 /// - [RequiresUnsafe] public static unsafe void MaskStore(byte* address, Vector256 mask, Vector256 source) => MaskStore(address, mask, source); /// /// void _mm256_mask_storeu_si256 (void * mem_addr, __mmask16 k, __m256i a) /// VMOVDQU16 m256 {k1}{z}, ymm1 /// - [RequiresUnsafe] public static unsafe void MaskStore(short* address, Vector256 mask, Vector256 source) => MaskStore(address, mask, source); /// /// void _mm256_mask_storeu_si256 (void * mem_addr, __mmask32 k, __m256i a) /// VMOVDQU8 m256 {k1}{z}, ymm1 /// - [RequiresUnsafe] public static unsafe void MaskStore(sbyte* address, Vector256 mask, Vector256 source) => MaskStore(address, mask, source); /// /// void _mm256_mask_storeu_si256 (void * mem_addr, __mmask16 k, __m256i a) /// VMOVDQU16 m256 {k1}{z}, ymm1 /// - [RequiresUnsafe] public static unsafe void MaskStore(ushort* address, Vector256 mask, Vector256 source) => MaskStore(address, mask, source); /// @@ -940,28 +924,24 @@ internal X64() { } /// __m512i _mm512_loadu_epi8 (void const * mem_addr) /// VMOVDQU8 zmm1, m512 /// - [RequiresUnsafe] public static new unsafe Vector512 LoadVector512(sbyte* address) => LoadVector512(address); /// /// __m512i _mm512_loadu_epi8 (void const * mem_addr) /// VMOVDQU8 zmm1, m512 /// - [RequiresUnsafe] public static new unsafe Vector512 LoadVector512(byte* address) => LoadVector512(address); /// /// __m512i _mm512_loadu_epi16 (void const * mem_addr) /// VMOVDQU16 zmm1, m512 /// - [RequiresUnsafe] public static new unsafe Vector512 LoadVector512(short* address) => LoadVector512(address); /// /// __m512i _mm512_loadu_epi16 (void const * mem_addr) /// VMOVDQU16 zmm1, m512 /// - [RequiresUnsafe] public static new unsafe Vector512 LoadVector512(ushort* address) => LoadVector512(address); /// @@ -969,7 +949,6 @@ internal X64() { } /// VMOVDQU8 zmm1 {k1}{z}, m512 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector512 MaskLoad(byte* address, Vector512 mask, Vector512 merge) => MaskLoad(address, mask, merge); /// @@ -977,7 +956,6 @@ internal X64() { } /// VMOVDQU32 zmm1 {k1}{z}, m512 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector512 MaskLoad(short* address, Vector512 mask, Vector512 merge) => MaskLoad(address, mask, merge); /// @@ -985,7 +963,6 @@ internal X64() { } /// VMOVDQU8 zmm1 {k1}{z}, m512 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector512 MaskLoad(sbyte* address, Vector512 mask, Vector512 merge) => MaskLoad(address, mask, merge); /// @@ -993,35 +970,30 @@ internal X64() { } /// VMOVDQU32 zmm1 {k1}{z}, m512 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector512 MaskLoad(ushort* address, Vector512 mask, Vector512 merge) => MaskLoad(address, mask, merge); /// /// void _mm512_mask_storeu_si512 (void * mem_addr, __mmask64 k, __m512i a) /// VMOVDQU8 m512 {k1}{z}, zmm1 /// - [RequiresUnsafe] public static unsafe void MaskStore(byte* address, Vector512 mask, Vector512 source) => MaskStore(address, mask, source); /// /// void _mm512_mask_storeu_si512 (void * mem_addr, __mmask32 k, __m512i a) /// VMOVDQU16 m512 {k1}{z}, zmm1 /// - [RequiresUnsafe] public static unsafe void MaskStore(short* address, Vector512 mask, Vector512 source) => MaskStore(address, mask, source); /// /// void _mm512_mask_storeu_si512 (void * mem_addr, __mmask64 k, __m512i a) /// VMOVDQU8 m512 {k1}{z}, zmm1 /// - [RequiresUnsafe] public static unsafe void MaskStore(sbyte* address, Vector512 mask, Vector512 source) => MaskStore(address, mask, source); /// /// void _mm512_mask_storeu_si512 (void * mem_addr, __mmask32 k, __m512i a) /// VMOVDQU16 m512 {k1}{z}, zmm1 /// - [RequiresUnsafe] public static unsafe void MaskStore(ushort* address, Vector512 mask, Vector512 source) => MaskStore(address, mask, source); /// @@ -1328,28 +1300,24 @@ internal X64() { } /// void _mm512_storeu_epi8 (void * mem_addr, __m512i a) /// VMOVDQU8 m512, zmm1 /// - [RequiresUnsafe] public static new unsafe void Store(sbyte* address, Vector512 source) => Store(address, source); /// /// void _mm512_storeu_epi8 (void * mem_addr, __m512i a) /// VMOVDQU8 m512, zmm1 /// - [RequiresUnsafe] public static new unsafe void Store(byte* address, Vector512 source) => Store(address, source); /// /// void _mm512_storeu_epi16 (void * mem_addr, __m512i a) /// VMOVDQU16 m512, zmm1 /// - [RequiresUnsafe] public static new unsafe void Store(short* address, Vector512 source) => Store(address, source); /// /// void _mm512_storeu_epi16 (void * mem_addr, __m512i a) /// VMOVDQU16 m512, zmm1 /// - [RequiresUnsafe] public static new unsafe void Store(ushort* address, Vector512 source) => Store(address, source); /// diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Avx512DQ.PlatformNotSupported.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Avx512DQ.PlatformNotSupported.cs index 3a0c5a5bb5cda0..ed94c908861853 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Avx512DQ.PlatformNotSupported.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Avx512DQ.PlatformNotSupported.cs @@ -316,38 +316,32 @@ internal X64() { } /// __m512i _mm512_broadcast_i64x2 (__m128i const * mem_addr) /// VBROADCASTI64x2 zmm1 {k1}{z}, m128 /// - [RequiresUnsafe] public static unsafe Vector512 BroadcastVector128ToVector512(long* address) { throw new PlatformNotSupportedException(); } /// /// __m512i _mm512_broadcast_i64x2 (__m128i const * mem_addr) /// VBROADCASTI64x2 zmm1 {k1}{z}, m128 /// - [RequiresUnsafe] public static unsafe Vector512 BroadcastVector128ToVector512(ulong* address) { throw new PlatformNotSupportedException(); } /// /// __m512d _mm512_broadcast_f64x2 (__m128d const * mem_addr) /// VBROADCASTF64x2 zmm1 {k1}{z}, m128 /// - [RequiresUnsafe] public static unsafe Vector512 BroadcastVector128ToVector512(double* address) { throw new PlatformNotSupportedException(); } /// /// __m512i _mm512_broadcast_i32x8 (__m256i const * mem_addr) /// VBROADCASTI32x8 zmm1 {k1}{z}, m256 /// - [RequiresUnsafe] public static unsafe Vector512 BroadcastVector256ToVector512(int* address) { throw new PlatformNotSupportedException(); } /// /// __m512i _mm512_broadcast_i32x8 (__m256i const * mem_addr) /// VBROADCASTI32x8 zmm1 {k1}{z}, m256 /// - [RequiresUnsafe] public static unsafe Vector512 BroadcastVector256ToVector512(uint* address) { throw new PlatformNotSupportedException(); } /// /// __m512 _mm512_broadcast_f32x8 (__m256 const * mem_addr) /// VBROADCASTF32x8 zmm1 {k1}{z}, m256 /// - [RequiresUnsafe] public static unsafe Vector512 BroadcastVector256ToVector512(float* address) { throw new PlatformNotSupportedException(); } /// diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Avx512DQ.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Avx512DQ.cs index 076bc6d83ac941..8523c4e409c552 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Avx512DQ.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Avx512DQ.cs @@ -317,42 +317,36 @@ internal X64() { } /// __m512i _mm512_broadcast_i64x2 (__m128i const * mem_addr) /// VBROADCASTI64x2 zmm1 {k1}{z}, m128 /// - [RequiresUnsafe] public static unsafe Vector512 BroadcastVector128ToVector512(long* address) => BroadcastVector128ToVector512(address); /// /// __m512i _mm512_broadcast_i64x2 (__m128i const * mem_addr) /// VBROADCASTI64x2 zmm1 {k1}{z}, m128 /// - [RequiresUnsafe] public static unsafe Vector512 BroadcastVector128ToVector512(ulong* address) => BroadcastVector128ToVector512(address); /// /// __m512d _mm512_broadcast_f64x2 (__m128d const * mem_addr) /// VBROADCASTF64x2 zmm1 {k1}{z}, m128 /// - [RequiresUnsafe] public static unsafe Vector512 BroadcastVector128ToVector512(double* address) => BroadcastVector128ToVector512(address); /// /// __m512i _mm512_broadcast_i32x8 (__m256i const * mem_addr) /// VBROADCASTI32x8 zmm1 {k1}{z}, m256 /// - [RequiresUnsafe] public static unsafe Vector512 BroadcastVector256ToVector512(int* address) => BroadcastVector256ToVector512(address); /// /// __m512i _mm512_broadcast_i32x8 (__m256i const * mem_addr) /// VBROADCASTI32x8 zmm1 {k1}{z}, m256 /// - [RequiresUnsafe] public static unsafe Vector512 BroadcastVector256ToVector512(uint* address) => BroadcastVector256ToVector512(address); /// /// __m512 _mm512_broadcast_f32x8 (__m256 const * mem_addr) /// VBROADCASTF32x8 zmm1 {k1}{z}, m256 /// - [RequiresUnsafe] public static unsafe Vector512 BroadcastVector256ToVector512(float* address) => BroadcastVector256ToVector512(address); /// diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Avx512F.PlatformNotSupported.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Avx512F.PlatformNotSupported.cs index d3deca7539da47..9a16487ba7317d 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Avx512F.PlatformNotSupported.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Avx512F.PlatformNotSupported.cs @@ -782,74 +782,62 @@ internal VL() { } /// __m128d _mm_mask_compressstoreu_pd (void * a, __mmask8 k, __m128d a) /// VCOMPRESSPD m128 {k1}{z}, xmm2 /// - [RequiresUnsafe] public static unsafe void CompressStore(double* address, Vector128 mask, Vector128 source) { throw new PlatformNotSupportedException(); } /// /// __m128i _mm_mask_compressstoreu_epi32 (void * a, __mask8 k, __m128i a) /// VPCOMPRESSD m128 {k1}{z}, xmm2 /// - [RequiresUnsafe] public static unsafe void CompressStore(int* address, Vector128 mask, Vector128 source) { throw new PlatformNotSupportedException(); } /// /// __m128i _mm_mask_compressstoreu_epi64 (void * a, __mask8 k, __m128i a) /// VPCOMPRESSQ m128 {k1}{z}, xmm2 /// - [RequiresUnsafe] public static unsafe void CompressStore(long* address, Vector128 mask, Vector128 source) { throw new PlatformNotSupportedException(); } /// /// __m128 _mm_mask_compressstoreu_ps (void * a, __mmask8 k, __m128 a) /// VCOMPRESSPS m128 {k1}{z}, xmm2 /// - [RequiresUnsafe] public static unsafe void CompressStore(float* address, Vector128 mask, Vector128 source) { throw new PlatformNotSupportedException(); } /// /// __m128i _mm_mask_compressstoreu_epi32 (void * a, __mask8 k, __m128i a) /// VPCOMPRESSD m128 {k1}{z}, xmm2 /// - [RequiresUnsafe] public static unsafe void CompressStore(uint* address, Vector128 mask, Vector128 source) { throw new PlatformNotSupportedException(); } /// /// __m128i _mm_mask_compressstoreu_epi64 (void * a, __mask8 k, __m128i a) /// VPCOMPRESSQ m128 {k1}{z}, xmm2 /// - [RequiresUnsafe] public static unsafe void CompressStore(ulong* address, Vector128 mask, Vector128 source) { throw new PlatformNotSupportedException(); } /// /// __m256d _mm256_mask_compressstoreu_pd (void * a, __mmask8 k, __m256d a) /// VCOMPRESSPD m256 {k1}{z}, ymm2 /// - [RequiresUnsafe] public static unsafe void CompressStore(double* address, Vector256 mask, Vector256 source) { throw new PlatformNotSupportedException(); } /// /// void _mm256_mask_compressstoreu_epi32 (void * a, __mmask8 k, __m256i a) /// VPCOMPRESSD m256 {k1}{z}, ymm2 /// - [RequiresUnsafe] public static unsafe void CompressStore(int* address, Vector256 mask, Vector256 source) { throw new PlatformNotSupportedException(); } /// /// void _mm256_mask_compressstoreu_epi64 (void * a, __mmask8 k, __m256i a) /// VPCOMPRESSQ m256 {k1}{z}, ymm2 /// - [RequiresUnsafe] public static unsafe void CompressStore(long* address, Vector256 mask, Vector256 source) { throw new PlatformNotSupportedException(); } /// /// __m256 _mm256_mask_compressstoreu_ps (void * a, __mmask8 k, __m256 a) /// VCOMPRESSPS m256 {k1}{z}, ymm2 /// - [RequiresUnsafe] public static unsafe void CompressStore(float* address, Vector256 mask, Vector256 source) { throw new PlatformNotSupportedException(); } /// /// void _mm256_mask_compressstoreu_epi32 (void * a, __mmask8 k, __m256i a) /// VPCOMPRESSD m256 {k1}{z}, ymm2 /// - [RequiresUnsafe] public static unsafe void CompressStore(uint* address, Vector256 mask, Vector256 source) { throw new PlatformNotSupportedException(); } /// /// void _mm256_mask_compressstoreu_epi64 (void * a, __mmask8 k, __m256i a) /// VPCOMPRESSQ m256 {k1}{z}, ymm2 /// - [RequiresUnsafe] public static unsafe void CompressStore(ulong* address, Vector256 mask, Vector256 source) { throw new PlatformNotSupportedException(); } /// @@ -1288,42 +1276,36 @@ internal VL() { } /// VEXPANDPD xmm1 {k1}{z}, m128 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector128 ExpandLoad(double* address, Vector128 mask, Vector128 merge) { throw new PlatformNotSupportedException(); } /// /// __m128i _mm_mask_expandloadu_epi32 (__m128i s, __mmask8 k, void const * a) /// VPEXPANDD xmm1 {k1}{z}, m128 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector128 ExpandLoad(int* address, Vector128 mask, Vector128 merge) { throw new PlatformNotSupportedException(); } /// /// __m128i _mm_mask_expandloadu_epi64 (__m128i s, __mmask8 k, void const * a) /// VPEXPANDQ xmm1 {k1}{z}, m128 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector128 ExpandLoad(long* address, Vector128 mask, Vector128 merge) { throw new PlatformNotSupportedException(); } /// /// __m128 _mm_mask_expandloadu_ps (__m128 s, __mmask8 k, void const * a) /// VEXPANDPS xmm1 {k1}{z}, m128 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector128 ExpandLoad(float* address, Vector128 mask, Vector128 merge) { throw new PlatformNotSupportedException(); } /// /// __m128i _mm_mask_expandloadu_epi32 (__m128i s, __mmask8 k, void const * a) /// VPEXPANDD xmm1 {k1}{z}, m128 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector128 ExpandLoad(uint* address, Vector128 mask, Vector128 merge) { throw new PlatformNotSupportedException(); } /// /// __m128i _mm_mask_expandloadu_epi64 (__m128i s, __mmask8 k, void const * a) /// VPEXPANDQ xmm1 {k1}{z}, m128 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector128 ExpandLoad(ulong* address, Vector128 mask, Vector128 merge) { throw new PlatformNotSupportedException(); } /// @@ -1331,42 +1313,36 @@ internal VL() { } /// VEXPANDPD ymm1 {k1}{z}, m256 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector256 ExpandLoad(double* address, Vector256 mask, Vector256 merge) { throw new PlatformNotSupportedException(); } /// /// __m256i _mm256_address_expandloadu_epi32 (__m256i s, __mmask8 k, void const * a) /// VPEXPANDD ymm1 {k1}{z}, m256 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector256 ExpandLoad(int* address, Vector256 mask, Vector256 merge) { throw new PlatformNotSupportedException(); } /// /// __m256i _mm256_address_expandloadu_epi64 (__m256i s, __mmask8 k, void const * a) /// VPEXPANDQ ymm1 {k1}{z}, m256 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector256 ExpandLoad(long* address, Vector256 mask, Vector256 merge) { throw new PlatformNotSupportedException(); } /// /// __m256 _mm256_address_expandloadu_ps (__m256 s, __mmask8 k, void const * a) /// VEXPANDPS ymm1 {k1}{z}, m256 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector256 ExpandLoad(float* address, Vector256 mask, Vector256 merge) { throw new PlatformNotSupportedException(); } /// /// __m256i _mm256_address_expandloadu_epi32 (__m256i s, __mmask8 k, void const * a) /// VPEXPANDD ymm1 {k1}{z}, m256 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector256 ExpandLoad(uint* address, Vector256 mask, Vector256 merge) { throw new PlatformNotSupportedException(); } /// /// __m256i _mm256_address_expandloadu_epi64 (__m256i s, __mmask8 k, void const * a) /// VPEXPANDQ ymm1 {k1}{z}, m256 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector256 ExpandLoad(ulong* address, Vector256 mask, Vector256 merge) { throw new PlatformNotSupportedException(); } /// @@ -1437,42 +1413,36 @@ internal VL() { } /// VMOVUPD xmm1 {k1}{z}, m128 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector128 MaskLoad(double* address, Vector128 mask, Vector128 merge) { throw new PlatformNotSupportedException(); } /// /// __m128i _mm_mask_loadu_epi32 (__m128i s, __mmask8 k, void const * mem_addr) /// VMOVDQU32 xmm1 {k1}{z}, m128 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector128 MaskLoad(int* address, Vector128 mask, Vector128 merge) { throw new PlatformNotSupportedException(); } /// /// __m128i _mm_mask_loadu_epi64 (__m128i s, __mmask8 k, void const * mem_addr) /// VMOVDQU64 xmm1 {k1}{z}, m128 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector128 MaskLoad(long* address, Vector128 mask, Vector128 merge) { throw new PlatformNotSupportedException(); } /// /// __m128 _mm_mask_loadu_ps (__m128 s, __mmask8 k, void const * mem_addr) /// VMOVUPS xmm1 {k1}{z}, m128 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector128 MaskLoad(float* address, Vector128 mask, Vector128 merge) { throw new PlatformNotSupportedException(); } /// /// __m128i _mm_mask_loadu_epi32 (__m128i s, __mmask8 k, void const * mem_addr) /// VMOVDQU32 xmm1 {k1}{z}, m128 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector128 MaskLoad(uint* address, Vector128 mask, Vector128 merge) { throw new PlatformNotSupportedException(); } /// /// __m128i _mm_mask_loadu_epi64 (__m128i s, __mmask8 k, void const * mem_addr) /// VMOVDQU64 xmm1 {k1}{z}, m128 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector128 MaskLoad(ulong* address, Vector128 mask, Vector128 merge) { throw new PlatformNotSupportedException(); } /// @@ -1480,41 +1450,35 @@ internal VL() { } /// VMOVUPD ymm1 {k1}{z}, m256 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector256 MaskLoad(double* address, Vector256 mask, Vector256 merge) { throw new PlatformNotSupportedException(); } /// /// __m256i _mm256_mask_loadu_epi32 (__m256i s, __mmask8 k, void const * mem_addr) /// VMOVDQU32 ymm1 {k1}{z}, m256 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector256 MaskLoad(int* address, Vector256 mask, Vector256 merge) { throw new PlatformNotSupportedException(); } /// /// __m256i _mm256_mask_loadu_epi64 (__m256i s, __mmask8 k, void const * mem_addr) /// VMOVDQU64 ymm1 {k1}{z}, m256 /// - [RequiresUnsafe] public static unsafe Vector256 MaskLoad(long* address, Vector256 mask, Vector256 merge) { throw new PlatformNotSupportedException(); } /// /// __m256 _mm256_mask_loadu_ps (__m256 s, __mmask8 k, void const * mem_addr) /// VMOVUPS ymm1 {k1}{z}, m256 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector256 MaskLoad(float* address, Vector256 mask, Vector256 merge) { throw new PlatformNotSupportedException(); } /// /// __m256i _mm256_mask_loadu_epi32 (__m256i s, __mmask8 k, void const * mem_addr) /// VMOVDQU32 ymm1 {k1}{z}, m256 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector256 MaskLoad(uint* address, Vector256 mask, Vector256 merge) { throw new PlatformNotSupportedException(); } /// /// __m256i _mm256_mask_loadu_epi64 (__m256i s, __mmask8 k, void const * mem_addr) /// VMOVDQU64 ymm1 {k1}{z}, m256 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector256 MaskLoad(ulong* address, Vector256 mask, Vector256 merge) { throw new PlatformNotSupportedException(); } /// @@ -1522,42 +1486,36 @@ internal VL() { } /// VMOVAPD xmm1 {k1}{z}, m128 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector128 MaskLoadAligned(double* address, Vector128 mask, Vector128 merge) { throw new PlatformNotSupportedException(); } /// /// __m128i _mm_mask_load_epi32 (__m128i s, __mmask8 k, void const * mem_addr) /// VMOVDQA32 xmm1 {k1}{z}, m128 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector128 MaskLoadAligned(int* address, Vector128 mask, Vector128 merge) { throw new PlatformNotSupportedException(); } /// /// __m128i _mm_mask_load_epi64 (__m128i s, __mmask8 k, void const * mem_addr) /// VMOVDQA64 xmm1 {k1}{z}, m128 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector128 MaskLoadAligned(long* address, Vector128 mask, Vector128 merge) { throw new PlatformNotSupportedException(); } /// /// __m128 _mm_mask_load_ps (__m128 s, __mmask8 k, void const * mem_addr) /// VMOVAPS xmm1 {k1}{z}, m128 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector128 MaskLoadAligned(float* address, Vector128 mask, Vector128 merge) { throw new PlatformNotSupportedException(); } /// /// __m128i _mm_mask_load_epi32 (__m128i s, __mmask8 k, void const * mem_addr) /// VMOVDQA32 xmm1 {k1}{z}, m128 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector128 MaskLoadAligned(uint* address, Vector128 mask, Vector128 merge) { throw new PlatformNotSupportedException(); } /// /// __m128i _mm_mask_load_epi64 (__m128i s, __mmask8 k, void const * mem_addr) /// VMOVDQA64 xmm1 {k1}{z}, m128 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector128 MaskLoadAligned(ulong* address, Vector128 mask, Vector128 merge) { throw new PlatformNotSupportedException(); } /// @@ -1565,190 +1523,160 @@ internal VL() { } /// VMOVAPD ymm1 {k1}{z}, m256 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector256 MaskLoadAligned(double* address, Vector256 mask, Vector256 merge) { throw new PlatformNotSupportedException(); } /// /// __m256i _mm256_mask_load_epi32 (__m256i s, __mmask8 k, void const * mem_addr) /// VMOVDQA32 ymm1 {k1}{z}, m256 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector256 MaskLoadAligned(int* address, Vector256 mask, Vector256 merge) { throw new PlatformNotSupportedException(); } /// /// __m256i _mm256_mask_load_epi64 (__m256i s, __mmask8 k, void const * mem_addr) /// VMOVDQA64 ymm1 {k1}{z}, m256 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector256 MaskLoadAligned(long* address, Vector256 mask, Vector256 merge) { throw new PlatformNotSupportedException(); } /// /// __m256 _mm256_mask_load_ps (__m256 s, __mmask8 k, void const * mem_addr) /// VMOVAPS ymm1 {k1}{z}, m256 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector256 MaskLoadAligned(float* address, Vector256 mask, Vector256 merge) { throw new PlatformNotSupportedException(); } /// /// __m256i _mm256_mask_load_epi32 (__m256i s, __mmask8 k, void const * mem_addr) /// VMOVDQA32 ymm1 {k1}{z}, m256 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector256 MaskLoadAligned(uint* address, Vector256 mask, Vector256 merge) { throw new PlatformNotSupportedException(); } /// /// __m256i _mm256_mask_load_epi64 (__m256i s, __mmask8 k, void const * mem_addr) /// VMOVDQA64 ymm1 {k1}{z}, m256 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector256 MaskLoadAligned(ulong* address, Vector256 mask, Vector256 merge) { throw new PlatformNotSupportedException(); } /// /// void _mm_mask_storeu_pd (void * mem_addr, __mmask8 k, __m128d a) /// VMOVUPD m128 {k1}{z}, xmm1 /// - [RequiresUnsafe] public static unsafe void MaskStore(double* address, Vector128 mask, Vector128 source) { throw new PlatformNotSupportedException(); } /// /// void _mm_mask_storeu_epi32 (void * mem_addr, __mmask8 k, __m128i a) /// VMOVDQU32 m128 {k1}{z}, xmm1 /// - [RequiresUnsafe] public static unsafe void MaskStore(int* address, Vector128 mask, Vector128 source) { throw new PlatformNotSupportedException(); } /// /// void _mm_mask_storeu_epi64 (void * mem_addr, __mmask8 k, __m128i a) /// VMOVDQU64 m128 {k1}{z}, xmm1 /// - [RequiresUnsafe] public static unsafe void MaskStore(long* address, Vector128 mask, Vector128 source) { throw new PlatformNotSupportedException(); } /// /// void _mm_mask_storeu_ps (void * mem_addr, __mmask8 k, __m128 a) /// VMOVUPS m128 {k1}{z}, xmm1 /// - [RequiresUnsafe] public static unsafe void MaskStore(float* address, Vector128 mask, Vector128 source) { throw new PlatformNotSupportedException(); } /// /// void _mm_mask_storeu_epi32 (void * mem_addr, __mmask8 k, __m128i a) /// VMOVDQU32 m128 {k1}{z}, xmm1 /// - [RequiresUnsafe] public static unsafe void MaskStore(uint* address, Vector128 mask, Vector128 source) { throw new PlatformNotSupportedException(); } /// /// void _mm_mask_storeu_epi64 (void * mem_addr, __mmask8 k, __m128i a) /// VMOVDQU64 m128 {k1}{z}, xmm1 /// - [RequiresUnsafe] public static unsafe void MaskStore(ulong* address, Vector128 mask, Vector128 source) { throw new PlatformNotSupportedException(); } /// /// void _mm256_mask_storeu_pd (void * mem_addr, __mmask8 k, __m256d a) /// VMOVUPD m256 {k1}{z}, ymm1 /// - [RequiresUnsafe] public static unsafe void MaskStore(double* address, Vector256 mask, Vector256 source) { throw new PlatformNotSupportedException(); } /// /// void _mm256_mask_storeu_epi32 (void * mem_addr, __mmask8 k, __m256i a) /// VMOVDQU32 m256 {k1}{z}, ymm1 /// - [RequiresUnsafe] public static unsafe void MaskStore(int* address, Vector256 mask, Vector256 source) { throw new PlatformNotSupportedException(); } /// /// void _mm256_mask_storeu_epi64 (void * mem_addr, __mmask8 k, __m256i a) /// VMOVDQU64 m256 {k1}{z}, ymm1 /// - [RequiresUnsafe] public static unsafe void MaskStore(long* address, Vector256 mask, Vector256 source) { throw new PlatformNotSupportedException(); } /// /// void _mm256_mask_storeu_ps (void * mem_addr, __mmask8 k, __m256 a) /// VMOVUPS m256 {k1}{z}, ymm1 /// - [RequiresUnsafe] public static unsafe void MaskStore(float* address, Vector256 mask, Vector256 source) { throw new PlatformNotSupportedException(); } /// /// void _mm256_mask_storeu_epi32 (void * mem_addr, __mmask8 k, __m256i a) /// VMOVDQU32 m256 {k1}{z}, ymm1 /// - [RequiresUnsafe] public static unsafe void MaskStore(uint* address, Vector256 mask, Vector256 source) { throw new PlatformNotSupportedException(); } /// /// void _mm256_mask_storeu_epi64 (void * mem_addr, __mmask8 k, __m256i a) /// VMOVDQU64 m256 {k1}{z}, ymm1 /// - [RequiresUnsafe] public static unsafe void MaskStore(ulong* address, Vector256 mask, Vector256 source) { throw new PlatformNotSupportedException(); } /// /// void _mm_mask_store_pd (void * mem_addr, __mmask8 k, __m128d a) /// VMOVAPD m128 {k1}{z}, xmm1 /// - [RequiresUnsafe] public static unsafe void MaskStoreAligned(double* address, Vector128 mask, Vector128 source) { throw new PlatformNotSupportedException(); } /// /// void _mm_mask_store_epi32 (void * mem_addr, __mmask8 k, __m128i a) /// VMOVDQA32 m128 {k1}{z}, xmm1 /// - [RequiresUnsafe] public static unsafe void MaskStoreAligned(int* address, Vector128 mask, Vector128 source) { throw new PlatformNotSupportedException(); } /// /// void _mm_mask_store_epi64 (void * mem_addr, __mmask8 k, __m128i a) /// VMOVDQA32 m128 {k1}{z}, xmm1 /// - [RequiresUnsafe] public static unsafe void MaskStoreAligned(long* address, Vector128 mask, Vector128 source) { throw new PlatformNotSupportedException(); } /// /// void _mm_mask_store_ps (void * mem_addr, __mmask8 k, __m128 a) /// VMOVAPS m128 {k1}{z}, xmm1 /// - [RequiresUnsafe] public static unsafe void MaskStoreAligned(float* address, Vector128 mask, Vector128 source) { throw new PlatformNotSupportedException(); } /// /// void _mm_mask_store_epi32 (void * mem_addr, __mmask8 k, __m128i a) /// VMOVDQA32 m128 {k1}{z}, xmm1 /// - [RequiresUnsafe] public static unsafe void MaskStoreAligned(uint* address, Vector128 mask, Vector128 source) { throw new PlatformNotSupportedException(); } /// /// void _mm_mask_store_epi64 (void * mem_addr, __mmask8 k, __m128i a) /// VMOVDQA32 m128 {k1}{z}, xmm1 /// - [RequiresUnsafe] public static unsafe void MaskStoreAligned(ulong* address, Vector128 mask, Vector128 source) { throw new PlatformNotSupportedException(); } /// /// void _mm256_mask_store_pd (void * mem_addr, __mmask8 k, __m256d a) /// VMOVAPD m256 {k1}{z}, ymm1 /// - [RequiresUnsafe] public static unsafe void MaskStoreAligned(double* address, Vector256 mask, Vector256 source) { throw new PlatformNotSupportedException(); } /// /// void _mm256_mask_store_epi32 (void * mem_addr, __mmask8 k, __m256i a) /// VMOVDQA32 m256 {k1}{z}, ymm1 /// - [RequiresUnsafe] public static unsafe void MaskStoreAligned(int* address, Vector256 mask, Vector256 source) { throw new PlatformNotSupportedException(); } /// /// void _mm256_mask_store_epi64 (void * mem_addr, __mmask8 k, __m256i a) /// VMOVDQA32 m256 {k1}{z}, ymm1 /// - [RequiresUnsafe] public static unsafe void MaskStoreAligned(long* address, Vector256 mask, Vector256 source) { throw new PlatformNotSupportedException(); } /// /// void _mm256_mask_store_ps (void * mem_addr, __mmask8 k, __m256 a) /// VMOVAPS m256 {k1}{z}, ymm1 /// - [RequiresUnsafe] public static unsafe void MaskStoreAligned(float* address, Vector256 mask, Vector256 source) { throw new PlatformNotSupportedException(); } /// /// void _mm256_mask_store_epi32 (void * mem_addr, __mmask8 k, __m256i a) /// VMOVDQA32 m256 {k1}{z}, ymm1 /// - [RequiresUnsafe] public static unsafe void MaskStoreAligned(uint* address, Vector256 mask, Vector256 source) { throw new PlatformNotSupportedException(); } /// /// void _mm256_mask_store_epi64 (void * mem_addr, __mmask8 k, __m256i a) /// VMOVDQA32 m256 {k1}{z}, ymm1 /// - [RequiresUnsafe] public static unsafe void MaskStoreAligned(ulong* address, Vector256 mask, Vector256 source) { throw new PlatformNotSupportedException(); } /// @@ -2642,38 +2570,32 @@ internal X64() { } /// __m512i _mm512_broadcast_i32x4 (__m128i const * mem_addr) /// VBROADCASTI32x4 zmm1 {k1}{z}, m128 /// - [RequiresUnsafe] public static unsafe Vector512 BroadcastVector128ToVector512(int* address) { throw new PlatformNotSupportedException(); } /// /// __m512i _mm512_broadcast_i32x4 (__m128i const * mem_addr) /// VBROADCASTI32x4 zmm1 {k1}{z}, m128 /// - [RequiresUnsafe] public static unsafe Vector512 BroadcastVector128ToVector512(uint* address) { throw new PlatformNotSupportedException(); } /// /// __m512 _mm512_broadcast_f32x4 (__m128 const * mem_addr) /// VBROADCASTF32x4 zmm1 {k1}{z}, m128 /// - [RequiresUnsafe] public static unsafe Vector512 BroadcastVector128ToVector512(float* address) { throw new PlatformNotSupportedException(); } /// /// __m512i _mm512_broadcast_i64x4 (__m256i const * mem_addr) /// VBROADCASTI64x4 zmm1 {k1}{z}, m256 /// - [RequiresUnsafe] public static unsafe Vector512 BroadcastVector256ToVector512(long* address) { throw new PlatformNotSupportedException(); } /// /// __m512i _mm512_broadcast_i64x4 (__m256i const * mem_addr) /// VBROADCASTI64x4 zmm1 {k1}{z}, m256 /// - [RequiresUnsafe] public static unsafe Vector512 BroadcastVector256ToVector512(ulong* address) { throw new PlatformNotSupportedException(); } /// /// __m512d _mm512_broadcast_f64x4 (__m256d const * mem_addr) /// VBROADCASTF64x4 zmm1 {k1}{z}, m256 /// - [RequiresUnsafe] public static unsafe Vector512 BroadcastVector256ToVector512(double* address) { throw new PlatformNotSupportedException(); } /// @@ -2991,37 +2913,31 @@ internal X64() { } /// __m512d _mm512_mask_compressstoreu_pd (void * s, __mmask8 k, __m512d a) /// VCOMPRESSPD m512 {k1}{z}, zmm2 /// - [RequiresUnsafe] public static unsafe void CompressStore(double* address, Vector512 mask, Vector512 source) { throw new PlatformNotSupportedException(); } /// /// void _mm512_mask_compressstoreu_epi32 (void * s, __mmask16 k, __m512i a) /// VPCOMPRESSD m512 {k1}{z}, zmm2 /// - [RequiresUnsafe] public static unsafe void CompressStore(int* address, Vector512 mask, Vector512 source) { throw new PlatformNotSupportedException(); } /// /// void _mm512_mask_compressstoreu_epi64 (void * s, __mmask8 k, __m512i a) /// VPCOMPRESSQ m512 {k1}{z}, zmm2 /// - [RequiresUnsafe] public static unsafe void CompressStore(long* address, Vector512 mask, Vector512 source) { throw new PlatformNotSupportedException(); } /// /// __m512 _mm512_mask_compressstoreu_ps (void * s, __mmask16 k, __m512 a) /// VCOMPRESSPS m512 {k1}{z}, zmm2 /// - [RequiresUnsafe] public static unsafe void CompressStore(float* address, Vector512 mask, Vector512 source) { throw new PlatformNotSupportedException(); } /// /// void _mm512_mask_compressstoreu_epi32 (void * s, __mmask16 k, __m512i a) /// VPCOMPRESSD m512 {k1}{z}, zmm2 /// - [RequiresUnsafe] public static unsafe void CompressStore(uint* address, Vector512 mask, Vector512 source) { throw new PlatformNotSupportedException(); } /// /// void _mm512_mask_compressstoreu_epi64 (void * s, __mmask8 k, __m512i a) /// VPCOMPRESSQ m512 {k1}{z}, zmm2 /// - [RequiresUnsafe] public static unsafe void CompressStore(ulong* address, Vector512 mask, Vector512 source) { throw new PlatformNotSupportedException(); } /// @@ -3537,42 +3453,36 @@ internal X64() { } /// VEXPANDPD zmm1 {k1}{z}, m512 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector512 ExpandLoad(double* address, Vector512 mask, Vector512 merge) { throw new PlatformNotSupportedException(); } /// /// __m512i _mm512_mask_expandloadu_epi32 (__m512i s, __mmask16 k, void * const a) /// VPEXPANDD zmm1 {k1}{z}, m512 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector512 ExpandLoad(int* address, Vector512 mask, Vector512 merge) { throw new PlatformNotSupportedException(); } /// /// __m512i _mm512_mask_expandloadu_epi64 (__m512i s, __mmask8 k, void * const a) /// VPEXPANDQ zmm1 {k1}{z}, m512 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector512 ExpandLoad(long* address, Vector512 mask, Vector512 merge) { throw new PlatformNotSupportedException(); } /// /// __m512 _mm512_mask_expandloadu_ps (__m512 s, __mmask16 k, void * const a) /// VEXPANDPS zmm1 {k1}{z}, m512 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector512 ExpandLoad(float* address, Vector512 mask, Vector512 merge) { throw new PlatformNotSupportedException(); } /// /// __m512i _mm512_mask_expandloadu_epi32 (__m512i s, __mmask16 k, void * const a) /// VPEXPANDD zmm1 {k1}{z}, m512 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector512 ExpandLoad(uint* address, Vector512 mask, Vector512 merge) { throw new PlatformNotSupportedException(); } /// /// __m512i _mm512_mask_expandloadu_epi64 (__m512i s, __mmask8 k, void * const a) /// VPEXPANDQ zmm1 {k1}{z}, m512 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector512 ExpandLoad(ulong* address, Vector512 mask, Vector512 merge) { throw new PlatformNotSupportedException(); } /// @@ -4037,171 +3947,143 @@ internal X64() { } /// __m512i _mm512_load_si512 (__m512i const * mem_addr) /// VMOVDQA32 zmm1, m512 /// - [RequiresUnsafe] public static unsafe Vector512 LoadAlignedVector512(byte* address) { throw new PlatformNotSupportedException(); } /// /// __m512i _mm512_load_si512 (__m512i const * mem_addr) /// VMOVDQA32 zmm1, m512 /// - [RequiresUnsafe] public static unsafe Vector512 LoadAlignedVector512(sbyte* address) { throw new PlatformNotSupportedException(); } /// /// __m512i _mm512_load_si512 (__m512i const * mem_addr) /// VMOVDQA32 zmm1, m512 /// - [RequiresUnsafe] public static unsafe Vector512 LoadAlignedVector512(short* address) { throw new PlatformNotSupportedException(); } /// /// __m512i _mm512_load_si512 (__m512i const * mem_addr) /// VMOVDQA32 zmm1, m512 /// - [RequiresUnsafe] public static unsafe Vector512 LoadAlignedVector512(ushort* address) { throw new PlatformNotSupportedException(); } /// /// __m512i _mm512_load_epi32 (__m512i const * mem_addr) /// VMOVDQA32 zmm1, m512 /// - [RequiresUnsafe] public static unsafe Vector512 LoadAlignedVector512(int* address) { throw new PlatformNotSupportedException(); } /// /// __m512i _mm512_load_epi32 (__m512i const * mem_addr) /// VMOVDQA32 zmm1, m512 /// - [RequiresUnsafe] public static unsafe Vector512 LoadAlignedVector512(uint* address) { throw new PlatformNotSupportedException(); } /// /// __m512i _mm512_load_epi64 (__m512i const * mem_addr) /// VMOVDQA64 zmm1, m512 /// - [RequiresUnsafe] public static unsafe Vector512 LoadAlignedVector512(long* address) { throw new PlatformNotSupportedException(); } /// /// __m512i _mm512_load_epi64 (__m512i const * mem_addr) /// VMOVDQA64 zmm1, m512 /// - [RequiresUnsafe] public static unsafe Vector512 LoadAlignedVector512(ulong* address) { throw new PlatformNotSupportedException(); } /// /// __m512 _mm512_load_ps (float const * mem_addr) /// VMOVAPS zmm1, m512 /// - [RequiresUnsafe] public static unsafe Vector512 LoadAlignedVector512(float* address) { throw new PlatformNotSupportedException(); } /// /// __m512d _mm512_load_pd (double const * mem_addr) /// VMOVAPD zmm1, m512 /// - [RequiresUnsafe] public static unsafe Vector512 LoadAlignedVector512(double* address) { throw new PlatformNotSupportedException(); } /// /// __m512i _mm512_stream_load_si512 (__m512i const* mem_addr) /// VMOVNTDQA zmm1, m512 /// - [RequiresUnsafe] public static unsafe Vector512 LoadAlignedVector512NonTemporal(sbyte* address) { throw new PlatformNotSupportedException(); } /// /// __m512i _mm512_stream_load_si512 (__m512i const* mem_addr) /// VMOVNTDQA zmm1, m512 /// - [RequiresUnsafe] public static unsafe Vector512 LoadAlignedVector512NonTemporal(byte* address) { throw new PlatformNotSupportedException(); } /// /// __m512i _mm512_stream_load_si512 (__m512i const* mem_addr) /// VMOVNTDQA zmm1, m512 /// - [RequiresUnsafe] public static unsafe Vector512 LoadAlignedVector512NonTemporal(short* address) { throw new PlatformNotSupportedException(); } /// /// __m512i _mm512_stream_load_si512 (__m512i const* mem_addr) /// VMOVNTDQA zmm1, m512 /// - [RequiresUnsafe] public static unsafe Vector512 LoadAlignedVector512NonTemporal(ushort* address) { throw new PlatformNotSupportedException(); } /// /// __m512i _mm512_stream_load_si512 (__m512i const* mem_addr) /// VMOVNTDQA zmm1, m512 /// - [RequiresUnsafe] public static unsafe Vector512 LoadAlignedVector512NonTemporal(int* address) { throw new PlatformNotSupportedException(); } /// /// __m512i _mm512_stream_load_si512 (__m512i const* mem_addr) /// VMOVNTDQA zmm1, m512 /// - [RequiresUnsafe] public static unsafe Vector512 LoadAlignedVector512NonTemporal(uint* address) { throw new PlatformNotSupportedException(); } /// /// __m512i _mm512_stream_load_si512 (__m512i const* mem_addr) /// VMOVNTDQA zmm1, m512 /// - [RequiresUnsafe] public static unsafe Vector512 LoadAlignedVector512NonTemporal(long* address) { throw new PlatformNotSupportedException(); } /// /// __m512i _mm512_stream_load_si512 (__m512i const* mem_addr) /// VMOVNTDQA zmm1, m512 /// - [RequiresUnsafe] public static unsafe Vector512 LoadAlignedVector512NonTemporal(ulong* address) { throw new PlatformNotSupportedException(); } /// /// __m512i _mm512_loadu_si512 (__m512i const * mem_addr) /// VMOVDQU32 zmm1, m512 /// - [RequiresUnsafe] public static unsafe Vector512 LoadVector512(sbyte* address) { throw new PlatformNotSupportedException(); } /// /// __m512i _mm512_loadu_si512 (__m512i const * mem_addr) /// VMOVDQU32 zmm1, m512 /// - [RequiresUnsafe] public static unsafe Vector512 LoadVector512(byte* address) { throw new PlatformNotSupportedException(); } /// /// __m512i _mm512_loadu_si512 (__m512i const * mem_addr) /// VMOVDQU32 zmm1, m512 /// - [RequiresUnsafe] public static unsafe Vector512 LoadVector512(short* address) { throw new PlatformNotSupportedException(); } /// /// __m512i _mm512_loadu_si512 (__m512i const * mem_addr) /// VMOVDQU32 zmm1, m512 /// - [RequiresUnsafe] public static unsafe Vector512 LoadVector512(ushort* address) { throw new PlatformNotSupportedException(); } /// /// __m512i _mm512_loadu_epi32 (__m512i const * mem_addr) /// VMOVDQU32 zmm1, m512 /// - [RequiresUnsafe] public static unsafe Vector512 LoadVector512(int* address) { throw new PlatformNotSupportedException(); } /// /// __m512i _mm512_loadu_epi32 (__m512i const * mem_addr) /// VMOVDQU32 zmm1, m512 /// - [RequiresUnsafe] public static unsafe Vector512 LoadVector512(uint* address) { throw new PlatformNotSupportedException(); } /// /// __m512i _mm512_loadu_epi64 (__m512i const * mem_addr) /// VMOVDQU64 zmm1, m512 /// - [RequiresUnsafe] public static unsafe Vector512 LoadVector512(long* address) { throw new PlatformNotSupportedException(); } /// /// __m512i _mm512_loadu_epi64 (__m512i const * mem_addr) /// VMOVDQU64 zmm1 , m512 /// - [RequiresUnsafe] public static unsafe Vector512 LoadVector512(ulong* address) { throw new PlatformNotSupportedException(); } /// /// __m512 _mm512_loadu_ps (float const * mem_addr) /// VMOVUPS zmm1, m512 /// - [RequiresUnsafe] public static unsafe Vector512 LoadVector512(float* address) { throw new PlatformNotSupportedException(); } /// /// __m512d _mm512_loadu_pd (double const * mem_addr) /// VMOVUPD zmm1, m512 /// - [RequiresUnsafe] public static unsafe Vector512 LoadVector512(double* address) { throw new PlatformNotSupportedException(); } /// @@ -4209,42 +4091,36 @@ internal X64() { } /// VMOVUPD zmm1 {k1}{z}, m512 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector512 MaskLoad(double* address, Vector512 mask, Vector512 merge) { throw new PlatformNotSupportedException(); } /// /// __m512i _mm512_mask_loadu_epi32 (__m512i s, __mmask16 k, void const * mem_addr) /// VMOVDQU32 zmm1 {k1}{z}, m512 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector512 MaskLoad(int* address, Vector512 mask, Vector512 merge) { throw new PlatformNotSupportedException(); } /// /// __m512i _mm512_mask_loadu_epi64 (__m512i s, __mmask8 k, void const * mem_addr) /// VMOVDQU64 zmm1 {k1}{z}, m512 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector512 MaskLoad(long* address, Vector512 mask, Vector512 merge) { throw new PlatformNotSupportedException(); } /// /// __m512 _mm512_mask_loadu_ps (__m512 s, __mmask16 k, void const * mem_addr) /// VMOVUPS zmm1 {k1}{z}, m512 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector512 MaskLoad(float* address, Vector512 mask, Vector512 merge) { throw new PlatformNotSupportedException(); } /// /// __m512i _mm512_mask_loadu_epi32 (__m512i s, __mmask16 k, void const * mem_addr) /// VMOVDQU32 zmm1 {k1}{z}, m512 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector512 MaskLoad(uint* address, Vector512 mask, Vector512 merge) { throw new PlatformNotSupportedException(); } /// /// __m512i _mm512_mask_loadu_epi64 (__m512i s, __mmask8 k, void const * mem_addr) /// VMOVDQU64 zmm1 {k1}{z}, m512 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector512 MaskLoad(ulong* address, Vector512 mask, Vector512 merge) { throw new PlatformNotSupportedException(); } /// @@ -4252,116 +4128,98 @@ internal X64() { } /// VMOVAPD zmm1 {k1}{z}, m512 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector512 MaskLoadAligned(double* address, Vector512 mask, Vector512 merge) { throw new PlatformNotSupportedException(); } /// /// __m512i _mm512_mask_load_epi32 (__m512i s, __mmask16 k, void const * mem_addr) /// VMOVDQA32 zmm1 {k1}{z}, m512 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector512 MaskLoadAligned(int* address, Vector512 mask, Vector512 merge) { throw new PlatformNotSupportedException(); } /// /// __m512i _mm512_mask_load_epi64 (__m512i s, __mmask8 k, void const * mem_addr) /// VMOVDQA64 zmm1 {k1}{z}, m512 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector512 MaskLoadAligned(long* address, Vector512 mask, Vector512 merge) { throw new PlatformNotSupportedException(); } /// /// __m512 _mm512_mask_load_ps (__m512 s, __mmask16 k, void const * mem_addr) /// VMOVAPS zmm1 {k1}{z}, m512 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector512 MaskLoadAligned(float* address, Vector512 mask, Vector512 merge) { throw new PlatformNotSupportedException(); } /// /// __m512i _mm512_mask_load_epi32 (__m512i s, __mmask16 k, void const * mem_addr) /// VMOVDQA32 zmm1 {k1}{z}, m512 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector512 MaskLoadAligned(uint* address, Vector512 mask, Vector512 merge) { throw new PlatformNotSupportedException(); } /// /// __m512i _mm512_mask_load_epi64 (__m512i s, __mmask8 k, void const * mem_addr) /// VMOVDQA64 zmm1 {k1}{z}, m512 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector512 MaskLoadAligned(ulong* address, Vector512 mask, Vector512 merge) { throw new PlatformNotSupportedException(); } /// /// void _mm512_mask_storeu_pd (void * mem_addr, __mmask8 k, __m512d a) /// VMOVUPD m512 {k1}{z}, zmm1 /// - [RequiresUnsafe] public static unsafe void MaskStore(double* address, Vector512 mask, Vector512 source) { throw new PlatformNotSupportedException(); } /// /// void _mm512_mask_storeu_epi32 (void * mem_addr, __mmask16 k, __m512i a) /// VMOVDQU32 m512 {k1}{z}, zmm1 /// - [RequiresUnsafe] public static unsafe void MaskStore(int* address, Vector512 mask, Vector512 source) { throw new PlatformNotSupportedException(); } /// /// void _mm512_mask_storeu_epi64 (void * mem_addr, __mmask8 k, __m512i a) /// VMOVDQU64 m512 {k1}{z}, zmm1 /// - [RequiresUnsafe] public static unsafe void MaskStore(long* address, Vector512 mask, Vector512 source) { throw new PlatformNotSupportedException(); } /// /// void _mm512_mask_storeu_ps (void * mem_addr, __mmask16 k, __m512 a) /// VMOVUPS m512 {k1}{z}, zmm1 /// - [RequiresUnsafe] public static unsafe void MaskStore(float* address, Vector512 mask, Vector512 source) { throw new PlatformNotSupportedException(); } /// /// void _mm512_mask_storeu_epi32 (void * mem_addr, __mmask16 k, __m512i a) /// VMOVDQU32 m512 {k1}{z}, zmm1 /// - [RequiresUnsafe] public static unsafe void MaskStore(uint* address, Vector512 mask, Vector512 source) { throw new PlatformNotSupportedException(); } /// /// void _mm512_mask_storeu_epi64 (void * mem_addr, __mmask8 k, __m512i a) /// VMOVDQU64 m512 {k1}{z}, zmm1 /// - [RequiresUnsafe] public static unsafe void MaskStore(ulong* address, Vector512 mask, Vector512 source) { throw new PlatformNotSupportedException(); } /// /// void _mm512_mask_store_pd (void * mem_addr, __mmask8 k, __m512d a) /// VMOVAPD m512 {k1}{z}, zmm1 /// - [RequiresUnsafe] public static unsafe void MaskStoreAligned(double* address, Vector512 mask, Vector512 source) { throw new PlatformNotSupportedException(); } /// /// void _mm512_mask_store_epi32 (void * mem_addr, __mmask16 k, __m512i a) /// VMOVDQA32 m512 {k1}{z}, zmm1 /// - [RequiresUnsafe] public static unsafe void MaskStoreAligned(int* address, Vector512 mask, Vector512 source) { throw new PlatformNotSupportedException(); } /// /// void _mm512_mask_store_epi64 (void * mem_addr, __mmask8 k, __m512i a) /// VMOVDQA32 m512 {k1}{z}, zmm1 /// - [RequiresUnsafe] public static unsafe void MaskStoreAligned(long* address, Vector512 mask, Vector512 source) { throw new PlatformNotSupportedException(); } /// /// void _mm512_mask_store_ps (void * mem_addr, __mmask16 k, __m512 a) /// VMOVAPS m512 {k1}{z}, zmm1 /// - [RequiresUnsafe] public static unsafe void MaskStoreAligned(float* address, Vector512 mask, Vector512 source) { throw new PlatformNotSupportedException(); } /// /// void _mm512_mask_store_epi32 (void * mem_addr, __mmask16 k, __m512i a) /// VMOVDQA32 m512 {k1}{z}, zmm1 /// - [RequiresUnsafe] public static unsafe void MaskStoreAligned(uint* address, Vector512 mask, Vector512 source) { throw new PlatformNotSupportedException(); } /// /// void _mm512_mask_store_epi64 (void * mem_addr, __mmask8 k, __m512i a) /// VMOVDQA32 m512 {k1}{z}, zmm1 /// - [RequiresUnsafe] public static unsafe void MaskStoreAligned(ulong* address, Vector512 mask, Vector512 source) { throw new PlatformNotSupportedException(); } /// @@ -5145,183 +5003,153 @@ internal X64() { } /// void _mm512_storeu_si512 (void * mem_addr, __m512i a) /// VMOVDQU32 m512, zmm1 /// - [RequiresUnsafe] public static unsafe void Store(sbyte* address, Vector512 source) { throw new PlatformNotSupportedException(); } /// /// void _mm512_storeu_si512 (void * mem_addr, __m512i a) /// VMOVDQU32 m512, zmm1 /// - [RequiresUnsafe] public static unsafe void Store(byte* address, Vector512 source) { throw new PlatformNotSupportedException(); } /// /// void _mm512_storeu_si512 (void * mem_addr, __m512i a) /// VMOVDQU32 m512, zmm1 /// - [RequiresUnsafe] public static unsafe void Store(short* address, Vector512 source) { throw new PlatformNotSupportedException(); } /// /// void _mm512_storeu_si512 (void * mem_addr, __m512i a) /// VMOVDQU32 m512, zmm1 /// - [RequiresUnsafe] public static unsafe void Store(ushort* address, Vector512 source) { throw new PlatformNotSupportedException(); } /// /// void _mm512_storeu_epi32 (void * mem_addr, __m512i a) /// VMOVDQU32 m512, zmm1 /// - [RequiresUnsafe] public static unsafe void Store(int* address, Vector512 source) { throw new PlatformNotSupportedException(); } /// /// void _mm512_storeu_epi32 (void * mem_addr, __m512i a) /// VMOVDQU32 m512, zmm1 /// - [RequiresUnsafe] public static unsafe void Store(uint* address, Vector512 source) { throw new PlatformNotSupportedException(); } /// /// void _mm512_storeu_epi64 (void * mem_addr, __m512i a) /// VMOVDQU64 m512, zmm1 /// - [RequiresUnsafe] public static unsafe void Store(long* address, Vector512 source) { throw new PlatformNotSupportedException(); } /// /// void _mm512_storeu_epi64 (void * mem_addr, __m512i a) /// VMOVDQU64 m512, zmm1 /// - [RequiresUnsafe] public static unsafe void Store(ulong* address, Vector512 source) { throw new PlatformNotSupportedException(); } /// /// void _mm512_storeu_ps (float * mem_addr, __m512 a) /// VMOVUPS m512, zmm1 /// - [RequiresUnsafe] public static unsafe void Store(float* address, Vector512 source) { throw new PlatformNotSupportedException(); } /// /// void _mm512_storeu_pd (double * mem_addr, __m512d a) /// VMOVUPD m512, zmm1 /// - [RequiresUnsafe] public static unsafe void Store(double* address, Vector512 source) { throw new PlatformNotSupportedException(); } /// /// void _mm512_store_si512 (void * mem_addr, __m512i a) /// VMOVDQA32 m512, zmm1 /// - [RequiresUnsafe] public static unsafe void StoreAligned(byte* address, Vector512 source) { throw new PlatformNotSupportedException(); } /// /// void _mm512_store_si512 (void * mem_addr, __m512i a) /// VMOVDQA32 m512, zmm1 /// - [RequiresUnsafe] public static unsafe void StoreAligned(sbyte* address, Vector512 source) { throw new PlatformNotSupportedException(); } /// /// void _mm512_store_si512 (void * mem_addr, __m512i a) /// VMOVDQA32 m512, zmm1 /// - [RequiresUnsafe] public static unsafe void StoreAligned(short* address, Vector512 source) { throw new PlatformNotSupportedException(); } /// /// void _mm512_store_si512 (void * mem_addr, __m512i a) /// VMOVDQA32 m512, zmm1 /// - [RequiresUnsafe] public static unsafe void StoreAligned(ushort* address, Vector512 source) { throw new PlatformNotSupportedException(); } /// /// void _mm512_store_epi32 (void * mem_addr, __m512i a) /// VMOVDQA32 m512, zmm1 /// - [RequiresUnsafe] public static unsafe void StoreAligned(int* address, Vector512 source) { throw new PlatformNotSupportedException(); } /// /// void _mm512_store_epi32 (void * mem_addr, __m512i a) /// VMOVDQA32 m512, zmm1 /// - [RequiresUnsafe] public static unsafe void StoreAligned(uint* address, Vector512 source) { throw new PlatformNotSupportedException(); } /// /// void _mm512_store_epi64 (void * mem_addr, __m512i a) /// VMOVDQA32 m512, zmm1 /// - [RequiresUnsafe] public static unsafe void StoreAligned(long* address, Vector512 source) { throw new PlatformNotSupportedException(); } /// /// void _mm512_store_epi64 (void * mem_addr, __m512i a) /// VMOVDQA32 m512, zmm1 /// - [RequiresUnsafe] public static unsafe void StoreAligned(ulong* address, Vector512 source) { throw new PlatformNotSupportedException(); } /// /// void _mm512_store_ps (float * mem_addr, __m512 a) /// VMOVAPS m512, zmm1 /// - [RequiresUnsafe] public static unsafe void StoreAligned(float* address, Vector512 source) { throw new PlatformNotSupportedException(); } /// /// void _mm512_store_pd (double * mem_addr, __m512d a) /// VMOVAPD m512, zmm1 /// - [RequiresUnsafe] public static unsafe void StoreAligned(double* address, Vector512 source) { throw new PlatformNotSupportedException(); } /// /// void _mm512_stream_si512 (void * mem_addr, __m512i a) /// VMOVNTDQ m512, zmm1 /// - [RequiresUnsafe] public static unsafe void StoreAlignedNonTemporal(sbyte* address, Vector512 source) { throw new PlatformNotSupportedException(); } /// /// void _mm512_stream_si512 (void * mem_addr, __m512i a) /// VMOVNTDQ m512, zmm1 /// - [RequiresUnsafe] public static unsafe void StoreAlignedNonTemporal(byte* address, Vector512 source) { throw new PlatformNotSupportedException(); } /// /// void _mm512_stream_si512 (void * mem_addr, __m512i a) /// VMOVNTDQ m512, zmm1 /// - [RequiresUnsafe] public static unsafe void StoreAlignedNonTemporal(short* address, Vector512 source) { throw new PlatformNotSupportedException(); } /// /// void _mm512_stream_si512 (void * mem_addr, __m512i a) /// VMOVNTDQ m512, zmm1 /// - [RequiresUnsafe] public static unsafe void StoreAlignedNonTemporal(ushort* address, Vector512 source) { throw new PlatformNotSupportedException(); } /// /// void _mm512_stream_si512 (void * mem_addr, __m512i a) /// VMOVNTDQ m512, zmm1 /// - [RequiresUnsafe] public static unsafe void StoreAlignedNonTemporal(int* address, Vector512 source) { throw new PlatformNotSupportedException(); } /// /// void _mm512_stream_si512 (void * mem_addr, __m512i a) /// VMOVNTDQ m512, zmm1 /// - [RequiresUnsafe] public static unsafe void StoreAlignedNonTemporal(uint* address, Vector512 source) { throw new PlatformNotSupportedException(); } /// /// void _mm512_stream_si512 (void * mem_addr, __m512i a) /// VMOVNTDQ m512, zmm1 /// - [RequiresUnsafe] public static unsafe void StoreAlignedNonTemporal(long* address, Vector512 source) { throw new PlatformNotSupportedException(); } /// /// void _mm512_stream_si512 (void * mem_addr, __m512i a) /// VMOVNTDQ m512, zmm1 /// - [RequiresUnsafe] public static unsafe void StoreAlignedNonTemporal(ulong* address, Vector512 source) { throw new PlatformNotSupportedException(); } /// /// void _mm512_stream_ps (float * mem_addr, __m512 a) /// VMOVNTPS m512, zmm1 /// - [RequiresUnsafe] public static unsafe void StoreAlignedNonTemporal(float* address, Vector512 source) { throw new PlatformNotSupportedException(); } /// /// void _mm512_stream_pd (double * mem_addr, __m512d a) /// VMOVNTPD m512, zmm1 /// - [RequiresUnsafe] public static unsafe void StoreAlignedNonTemporal(double* address, Vector512 source) { throw new PlatformNotSupportedException(); } /// diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Avx512F.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Avx512F.cs index 6caa2a4cd1ecca..80357db1ca66dc 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Avx512F.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Avx512F.cs @@ -782,84 +782,72 @@ internal VL() { } /// __m128d _mm_mask_compressstoreu_pd (void * a, __mmask8 k, __m128d a) /// VCOMPRESSPD m128 {k1}{z}, xmm2 /// - [RequiresUnsafe] public static unsafe void CompressStore(double* address, Vector128 mask, Vector128 source) => CompressStore(address, mask, source); /// /// __m128i _mm_mask_compressstoreu_epi32 (void * a, __mask8 k, __m128i a) /// VPCOMPRESSD m128 {k1}{z}, xmm2 /// - [RequiresUnsafe] public static unsafe void CompressStore(int* address, Vector128 mask, Vector128 source) => CompressStore(address, mask, source); /// /// __m128i _mm_mask_compressstoreu_epi64 (void * a, __mask8 k, __m128i a) /// VPCOMPRESSQ m128 {k1}{z}, xmm2 /// - [RequiresUnsafe] public static unsafe void CompressStore(long* address, Vector128 mask, Vector128 source) => CompressStore(address, mask, source); /// /// __m128 _mm_mask_compressstoreu_ps (void * a, __mmask8 k, __m128 a) /// VCOMPRESSPS m128 {k1}{z}, xmm2 /// - [RequiresUnsafe] public static unsafe void CompressStore(float* address, Vector128 mask, Vector128 source) => CompressStore(address, mask, source); /// /// __m128i _mm_mask_compressstoreu_epi32 (void * a, __mask8 k, __m128i a) /// VPCOMPRESSD m128 {k1}{z}, xmm2 /// - [RequiresUnsafe] public static unsafe void CompressStore(uint* address, Vector128 mask, Vector128 source) => CompressStore(address, mask, source); /// /// __m128i _mm_mask_compressstoreu_epi64 (void * a, __mask8 k, __m128i a) /// VPCOMPRESSQ m128 {k1}{z}, xmm2 /// - [RequiresUnsafe] public static unsafe void CompressStore(ulong* address, Vector128 mask, Vector128 source) => CompressStore(address, mask, source); /// /// __m256d _mm256_mask_compressstoreu_pd (void * a, __mmask8 k, __m256d a) /// VCOMPRESSPD m256 {k1}{z}, ymm2 /// - [RequiresUnsafe] public static unsafe void CompressStore(double* address, Vector256 mask, Vector256 source) => CompressStore(address, mask, source); /// /// void _mm256_mask_compressstoreu_epi32 (void * a, __mmask8 k, __m256i a) /// VPCOMPRESSD m256 {k1}{z}, ymm2 /// - [RequiresUnsafe] public static unsafe void CompressStore(int* address, Vector256 mask, Vector256 source) => CompressStore(address, mask, source); /// /// void _mm256_mask_compressstoreu_epi64 (void * a, __mmask8 k, __m256i a) /// VPCOMPRESSQ m256 {k1}{z}, ymm2 /// - [RequiresUnsafe] public static unsafe void CompressStore(long* address, Vector256 mask, Vector256 source) => CompressStore(address, mask, source); /// /// __m256 _mm256_mask_compressstoreu_ps (void * a, __mmask8 k, __m256 a) /// VCOMPRESSPS m256 {k1}{z}, ymm2 /// - [RequiresUnsafe] public static unsafe void CompressStore(float* address, Vector256 mask, Vector256 source) => CompressStore(address, mask, source); /// /// void _mm256_mask_compressstoreu_epi32 (void * a, __mmask8 k, __m256i a) /// VPCOMPRESSD m256 {k1}{z}, ymm2 /// - [RequiresUnsafe] public static unsafe void CompressStore(uint* address, Vector256 mask, Vector256 source) => CompressStore(address, mask, source); /// /// void _mm256_mask_compressstoreu_epi64 (void * a, __mmask8 k, __m256i a) /// VPCOMPRESSQ m256 {k1}{z}, ymm2 /// - [RequiresUnsafe] public static unsafe void CompressStore(ulong* address, Vector256 mask, Vector256 source) => CompressStore(address, mask, source); /// @@ -1298,7 +1286,6 @@ internal VL() { } /// VEXPANDPD xmm1 {k1}{z}, m128 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector128 ExpandLoad(double* address, Vector128 mask, Vector128 merge) => ExpandLoad(address, mask, merge); /// @@ -1306,7 +1293,6 @@ internal VL() { } /// VPEXPANDD xmm1 {k1}{z}, m128 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector128 ExpandLoad(int* address, Vector128 mask, Vector128 merge) => ExpandLoad(address, mask, merge); /// @@ -1314,7 +1300,6 @@ internal VL() { } /// VPEXPANDQ xmm1 {k1}{z}, m128 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector128 ExpandLoad(long* address, Vector128 mask, Vector128 merge) => ExpandLoad(address, mask, merge); /// @@ -1322,7 +1307,6 @@ internal VL() { } /// VEXPANDPS xmm1 {k1}{z}, m128 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector128 ExpandLoad(float* address, Vector128 mask, Vector128 merge) => ExpandLoad(address, mask, merge); /// @@ -1330,7 +1314,6 @@ internal VL() { } /// VPEXPANDD xmm1 {k1}{z}, m128 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector128 ExpandLoad(uint* address, Vector128 mask, Vector128 merge) => ExpandLoad(address, mask, merge); /// @@ -1338,7 +1321,6 @@ internal VL() { } /// VPEXPANDQ xmm1 {k1}{z}, m128 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector128 ExpandLoad(ulong* address, Vector128 mask, Vector128 merge) => ExpandLoad(address, mask, merge); /// @@ -1346,7 +1328,6 @@ internal VL() { } /// VEXPANDPD ymm1 {k1}{z}, m256 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector256 ExpandLoad(double* address, Vector256 mask, Vector256 merge) => ExpandLoad(address, mask, merge); /// @@ -1354,7 +1335,6 @@ internal VL() { } /// VPEXPANDD ymm1 {k1}{z}, m256 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector256 ExpandLoad(int* address, Vector256 mask, Vector256 merge) => ExpandLoad(address, mask, merge); /// @@ -1362,7 +1342,6 @@ internal VL() { } /// VPEXPANDQ ymm1 {k1}{z}, m256 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector256 ExpandLoad(long* address, Vector256 mask, Vector256 merge) => ExpandLoad(address, mask, merge); /// @@ -1370,7 +1349,6 @@ internal VL() { } /// VEXPANDPS ymm1 {k1}{z}, m256 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector256 ExpandLoad(float* address, Vector256 mask, Vector256 merge) => ExpandLoad(address, mask, merge); /// @@ -1378,7 +1356,6 @@ internal VL() { } /// VPEXPANDD ymm1 {k1}{z}, m256 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector256 ExpandLoad(uint* address, Vector256 mask, Vector256 merge) => ExpandLoad(address, mask, merge); /// @@ -1386,7 +1363,6 @@ internal VL() { } /// VPEXPANDQ ymm1 {k1}{z}, m256 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector256 ExpandLoad(ulong* address, Vector256 mask, Vector256 merge) => ExpandLoad(address, mask, merge); /// @@ -1457,7 +1433,6 @@ internal VL() { } /// VMOVUPD xmm1 {k1}{z}, m128 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector128 MaskLoad(double* address, Vector128 mask, Vector128 merge) => MaskLoad(address, mask, merge); /// @@ -1465,7 +1440,6 @@ internal VL() { } /// VMOVDQU32 xmm1 {k1}{z}, m128 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector128 MaskLoad(int* address, Vector128 mask, Vector128 merge) => MaskLoad(address, mask, merge); /// @@ -1473,7 +1447,6 @@ internal VL() { } /// VMOVDQU64 xmm1 {k1}{z}, m128 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector128 MaskLoad(long* address, Vector128 mask, Vector128 merge) => MaskLoad(address, mask, merge); /// @@ -1481,7 +1454,6 @@ internal VL() { } /// VMOVUPS xmm1 {k1}{z}, m128 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector128 MaskLoad(float* address, Vector128 mask, Vector128 merge) => MaskLoad(address, mask, merge); /// @@ -1489,7 +1461,6 @@ internal VL() { } /// VMOVDQU32 xmm1 {k1}{z}, m128 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector128 MaskLoad(uint* address, Vector128 mask, Vector128 merge) => MaskLoad(address, mask, merge); /// @@ -1497,7 +1468,6 @@ internal VL() { } /// VMOVDQU64 xmm1 {k1}{z}, m128 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector128 MaskLoad(ulong* address, Vector128 mask, Vector128 merge) => MaskLoad(address, mask, merge); /// @@ -1505,14 +1475,12 @@ internal VL() { } /// VMOVUPD ymm1 {k1}{z}, m256 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector256 MaskLoad(double* address, Vector256 mask, Vector256 merge) => MaskLoad(address, mask, merge); /// /// __m256i _mm256_mask_loadu_epi32 (__m256i s, __mmask8 k, void const * mem_addr) /// VMOVDQU32 ymm1 {k1}{z}, m256 /// - [RequiresUnsafe] public static unsafe Vector256 MaskLoad(int* address, Vector256 mask, Vector256 merge) => MaskLoad(address, mask, merge); /// @@ -1520,7 +1488,6 @@ internal VL() { } /// VMOVDQU64 ymm1 {k1}{z}, m256 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector256 MaskLoad(long* address, Vector256 mask, Vector256 merge) => MaskLoad(address, mask, merge); /// @@ -1528,7 +1495,6 @@ internal VL() { } /// VMOVUPS ymm1 {k1}{z}, m256 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector256 MaskLoad(float* address, Vector256 mask, Vector256 merge) => MaskLoad(address, mask, merge); /// @@ -1536,7 +1502,6 @@ internal VL() { } /// VMOVDQU32 ymm1 {k1}{z}, m256 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector256 MaskLoad(uint* address, Vector256 mask, Vector256 merge) => MaskLoad(address, mask, merge); /// @@ -1544,7 +1509,6 @@ internal VL() { } /// VMOVDQU64 ymm1 {k1}{z}, m256 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector256 MaskLoad(ulong* address, Vector256 mask, Vector256 merge) => MaskLoad(address, mask, merge); /// @@ -1552,7 +1516,6 @@ internal VL() { } /// VMOVAPD xmm1 {k1}{z}, m128 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector128 MaskLoadAligned(double* address, Vector128 mask, Vector128 merge) => MaskLoadAligned(address, mask, merge); /// @@ -1560,7 +1523,6 @@ internal VL() { } /// VMOVDQA32 xmm1 {k1}{z}, m128 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector128 MaskLoadAligned(int* address, Vector128 mask, Vector128 merge) => MaskLoadAligned(address, mask, merge); /// @@ -1568,7 +1530,6 @@ internal VL() { } /// VMOVDQA64 xmm1 {k1}{z}, m128 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector128 MaskLoadAligned(long* address, Vector128 mask, Vector128 merge) => MaskLoadAligned(address, mask, merge); /// @@ -1576,7 +1537,6 @@ internal VL() { } /// VMOVAPS xmm1 {k1}{z}, m128 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector128 MaskLoadAligned(float* address, Vector128 mask, Vector128 merge) => MaskLoadAligned(address, mask, merge); /// @@ -1584,7 +1544,6 @@ internal VL() { } /// VMOVDQA32 xmm1 {k1}{z}, m128 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector128 MaskLoadAligned(uint* address, Vector128 mask, Vector128 merge) => MaskLoadAligned(address, mask, merge); /// @@ -1592,7 +1551,6 @@ internal VL() { } /// VMOVDQA64 xmm1 {k1}{z}, m128 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector128 MaskLoadAligned(ulong* address, Vector128 mask, Vector128 merge) => MaskLoadAligned(address, mask, merge); /// @@ -1600,7 +1558,6 @@ internal VL() { } /// VMOVAPD ymm1 {k1}{z}, m256 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector256 MaskLoadAligned(double* address, Vector256 mask, Vector256 merge) => MaskLoadAligned(address, mask, merge); /// @@ -1608,7 +1565,6 @@ internal VL() { } /// VMOVDQA32 ymm1 {k1}{z}, m256 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector256 MaskLoadAligned(int* address, Vector256 mask, Vector256 merge) => MaskLoadAligned(address, mask, merge); /// @@ -1616,7 +1572,6 @@ internal VL() { } /// VMOVDQA64 ymm1 {k1}{z}, m256 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector256 MaskLoadAligned(long* address, Vector256 mask, Vector256 merge) => MaskLoadAligned(address, mask, merge); /// @@ -1624,7 +1579,6 @@ internal VL() { } /// VMOVAPS ymm1 {k1}{z}, m256 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector256 MaskLoadAligned(float* address, Vector256 mask, Vector256 merge) => MaskLoadAligned(address, mask, merge); /// @@ -1632,7 +1586,6 @@ internal VL() { } /// VMOVDQA32 ymm1 {k1}{z}, m256 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector256 MaskLoadAligned(uint* address, Vector256 mask, Vector256 merge) => MaskLoadAligned(address, mask, merge); /// @@ -1640,175 +1593,150 @@ internal VL() { } /// VMOVDQA64 ymm1 {k1}{z}, m256 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector256 MaskLoadAligned(ulong* address, Vector256 mask, Vector256 merge) => MaskLoadAligned(address, mask, merge); /// /// void _mm_mask_storeu_pd (void * mem_addr, __mmask8 k, __m128d a) /// VMOVUPD m128 {k1}{z}, xmm1 /// - [RequiresUnsafe] public static unsafe void MaskStore(double* address, Vector128 mask, Vector128 source) => MaskStore(address, mask, source); /// /// void _mm_mask_storeu_epi32 (void * mem_addr, __mmask8 k, __m128i a) /// VMOVDQU32 m128 {k1}{z}, xmm1 /// - [RequiresUnsafe] public static unsafe void MaskStore(int* address, Vector128 mask, Vector128 source) => MaskStore(address, mask, source); /// /// void _mm_mask_storeu_epi64 (void * mem_addr, __mmask8 k, __m128i a) /// VMOVDQU64 m128 {k1}{z}, xmm1 /// - [RequiresUnsafe] public static unsafe void MaskStore(long* address, Vector128 mask, Vector128 source) => MaskStore(address, mask, source); /// /// void _mm_mask_storeu_ps (void * mem_addr, __mmask8 k, __m128 a) /// VMOVUPS m128 {k1}{z}, xmm1 /// - [RequiresUnsafe] public static unsafe void MaskStore(float* address, Vector128 mask, Vector128 source) => MaskStore(address, mask, source); /// /// void _mm_mask_storeu_epi32 (void * mem_addr, __mmask8 k, __m128i a) /// VMOVDQU32 m128 {k1}{z}, xmm1 /// - [RequiresUnsafe] public static unsafe void MaskStore(uint* address, Vector128 mask, Vector128 source) => MaskStore(address, mask, source); /// /// void _mm_mask_storeu_epi64 (void * mem_addr, __mmask8 k, __m128i a) /// VMOVDQU64 m128 {k1}{z}, xmm1 /// - [RequiresUnsafe] public static unsafe void MaskStore(ulong* address, Vector128 mask, Vector128 source) => MaskStore(address, mask, source); /// /// void _mm256_mask_storeu_pd (void * mem_addr, __mmask8 k, __m256d a) /// VMOVUPD m256 {k1}{z}, ymm1 /// - [RequiresUnsafe] public static unsafe void MaskStore(double* address, Vector256 mask, Vector256 source) => MaskStore(address, mask, source); /// /// void _mm256_mask_storeu_epi32 (void * mem_addr, __mmask8 k, __m256i a) /// VMOVDQU32 m256 {k1}{z}, ymm1 /// - [RequiresUnsafe] public static unsafe void MaskStore(int* address, Vector256 mask, Vector256 source) => MaskStore(address, mask, source); /// /// void _mm256_mask_storeu_epi64 (void * mem_addr, __mmask8 k, __m256i a) /// VMOVDQU64 m256 {k1}{z}, ymm1 /// - [RequiresUnsafe] public static unsafe void MaskStore(long* address, Vector256 mask, Vector256 source) => MaskStore(address, mask, source); /// /// void _mm256_mask_storeu_ps (void * mem_addr, __mmask8 k, __m256 a) /// VMOVUPS m256 {k1}{z}, ymm1 /// - [RequiresUnsafe] public static unsafe void MaskStore(float* address, Vector256 mask, Vector256 source) => MaskStore(address, mask, source); /// /// void _mm256_mask_storeu_epi32 (void * mem_addr, __mmask8 k, __m256i a) /// VMOVDQU32 m256 {k1}{z}, ymm1 /// - [RequiresUnsafe] public static unsafe void MaskStore(uint* address, Vector256 mask, Vector256 source) => MaskStore(address, mask, source); /// /// void _mm256_mask_storeu_epi64 (void * mem_addr, __mmask8 k, __m256i a) /// VMOVDQU64 m256 {k1}{z}, ymm1 /// - [RequiresUnsafe] public static unsafe void MaskStore(ulong* address, Vector256 mask, Vector256 source) => MaskStore(address, mask, source); /// /// void _mm_mask_store_pd (void * mem_addr, __mmask8 k, __m128d a) /// VMOVAPD m128 {k1}{z}, xmm1 /// - [RequiresUnsafe] public static unsafe void MaskStoreAligned(double* address, Vector128 mask, Vector128 source) => MaskStoreAligned(address, mask, source); /// /// void _mm_mask_store_epi32 (void * mem_addr, __mmask8 k, __m128i a) /// VMOVDQA32 m128 {k1}{z}, xmm1 /// - [RequiresUnsafe] public static unsafe void MaskStoreAligned(int* address, Vector128 mask, Vector128 source) => MaskStoreAligned(address, mask, source); /// /// void _mm_mask_store_epi64 (void * mem_addr, __mmask8 k, __m128i a) /// VMOVDQA32 m128 {k1}{z}, xmm1 /// - [RequiresUnsafe] public static unsafe void MaskStoreAligned(long* address, Vector128 mask, Vector128 source) => MaskStoreAligned(address, mask, source); /// /// void _mm_mask_store_ps (void * mem_addr, __mmask8 k, __m128 a) /// VMOVAPS m128 {k1}{z}, xmm1 /// - [RequiresUnsafe] public static unsafe void MaskStoreAligned(float* address, Vector128 mask, Vector128 source) => MaskStoreAligned(address, mask, source); /// /// void _mm_mask_store_epi32 (void * mem_addr, __mmask8 k, __m128i a) /// VMOVDQA32 m128 {k1}{z}, xmm1 /// - [RequiresUnsafe] public static unsafe void MaskStoreAligned(uint* address, Vector128 mask, Vector128 source) => MaskStoreAligned(address, mask, source); /// /// void _mm_mask_store_epi64 (void * mem_addr, __mmask8 k, __m128i a) /// VMOVDQA32 m128 {k1}{z}, xmm1 /// - [RequiresUnsafe] public static unsafe void MaskStoreAligned(ulong* address, Vector128 mask, Vector128 source) => MaskStoreAligned(address, mask, source); /// /// void _mm256_mask_store_pd (void * mem_addr, __mmask8 k, __m256d a) /// VMOVAPD m256 {k1}{z}, ymm1 /// - [RequiresUnsafe] public static unsafe void MaskStoreAligned(double* address, Vector256 mask, Vector256 source) => MaskStoreAligned(address, mask, source); /// /// void _mm256_mask_store_epi32 (void * mem_addr, __mmask8 k, __m256i a) /// VMOVDQA32 m256 {k1}{z}, ymm1 /// - [RequiresUnsafe] public static unsafe void MaskStoreAligned(int* address, Vector256 mask, Vector256 source) => MaskStoreAligned(address, mask, source); /// /// void _mm256_mask_store_epi64 (void * mem_addr, __mmask8 k, __m256i a) /// VMOVDQA32 m256 {k1}{z}, ymm1 /// - [RequiresUnsafe] public static unsafe void MaskStoreAligned(long* address, Vector256 mask, Vector256 source) => MaskStoreAligned(address, mask, source); /// /// void _mm256_mask_store_ps (void * mem_addr, __mmask8 k, __m256 a) /// VMOVAPS m256 {k1}{z}, ymm1 /// - [RequiresUnsafe] public static unsafe void MaskStoreAligned(float* address, Vector256 mask, Vector256 source) => MaskStoreAligned(address, mask, source); /// /// void _mm256_mask_store_epi32 (void * mem_addr, __mmask8 k, __m256i a) /// VMOVDQA32 m256 {k1}{z}, ymm1 /// - [RequiresUnsafe] public static unsafe void MaskStoreAligned(uint* address, Vector256 mask, Vector256 source) => MaskStoreAligned(address, mask, source); /// /// void _mm256_mask_store_epi64 (void * mem_addr, __mmask8 k, __m256i a) /// VMOVDQA32 m256 {k1}{z}, ymm1 /// - [RequiresUnsafe] public static unsafe void MaskStoreAligned(ulong* address, Vector256 mask, Vector256 source) => MaskStoreAligned(address, mask, source); /// @@ -2704,42 +2632,36 @@ internal X64() { } /// __m512i _mm512_broadcast_i32x4 (__m128i const * mem_addr) /// VBROADCASTI32x4 zmm1 {k1}{z}, m128 /// - [RequiresUnsafe] public static unsafe Vector512 BroadcastVector128ToVector512(int* address) => BroadcastVector128ToVector512(address); /// /// __m512i _mm512_broadcast_i32x4 (__m128i const * mem_addr) /// VBROADCASTI32x4 zmm1 {k1}{z}, m128 /// - [RequiresUnsafe] public static unsafe Vector512 BroadcastVector128ToVector512(uint* address) => BroadcastVector128ToVector512(address); /// /// __m512 _mm512_broadcast_f32x4 (__m128 const * mem_addr) /// VBROADCASTF32x4 zmm1 {k1}{z}, m128 /// - [RequiresUnsafe] public static unsafe Vector512 BroadcastVector128ToVector512(float* address) => BroadcastVector128ToVector512(address); /// /// __m512i _mm512_broadcast_i64x4 (__m256i const * mem_addr) /// VBROADCASTI64x4 zmm1 {k1}{z}, m256 /// - [RequiresUnsafe] public static unsafe Vector512 BroadcastVector256ToVector512(long* address) => BroadcastVector256ToVector512(address); /// /// __m512i _mm512_broadcast_i64x4 (__m256i const * mem_addr) /// VBROADCASTI64x4 zmm1 {k1}{z}, m256 /// - [RequiresUnsafe] public static unsafe Vector512 BroadcastVector256ToVector512(ulong* address) => BroadcastVector256ToVector512(address); /// /// __m512d _mm512_broadcast_f64x4 (__m256d const * mem_addr) /// VBROADCASTF64x4 zmm1 {k1}{z}, m256 /// - [RequiresUnsafe] public static unsafe Vector512 BroadcastVector256ToVector512(double* address) => BroadcastVector256ToVector512(address); /// @@ -3057,42 +2979,36 @@ internal X64() { } /// __m512d _mm512_mask_compressstoreu_pd (void * s, __mmask8 k, __m512d a) /// VCOMPRESSPD m512 {k1}{z}, zmm2 /// - [RequiresUnsafe] public static unsafe void CompressStore(double* address, Vector512 mask, Vector512 source) => CompressStore(address, mask, source); /// /// void _mm512_mask_compressstoreu_epi32 (void * s, __mmask16 k, __m512i a) /// VPCOMPRESSD m512 {k1}{z}, zmm2 /// - [RequiresUnsafe] public static unsafe void CompressStore(int* address, Vector512 mask, Vector512 source) => CompressStore(address, mask, source); /// /// void _mm512_mask_compressstoreu_epi64 (void * s, __mmask8 k, __m512i a) /// VPCOMPRESSQ m512 {k1}{z}, zmm2 /// - [RequiresUnsafe] public static unsafe void CompressStore(long* address, Vector512 mask, Vector512 source) => CompressStore(address, mask, source); /// /// __m512 _mm512_mask_compressstoreu_ps (void * s, __mmask16 k, __m512 a) /// VCOMPRESSPS m512 {k1}{z}, zmm2 /// - [RequiresUnsafe] public static unsafe void CompressStore(float* address, Vector512 mask, Vector512 source) => CompressStore(address, mask, source); /// /// void _mm512_mask_compressstoreu_epi32 (void * s, __mmask16 k, __m512i a) /// VPCOMPRESSD m512 {k1}{z}, zmm2 /// - [RequiresUnsafe] public static unsafe void CompressStore(uint* address, Vector512 mask, Vector512 source) => CompressStore(address, mask, source); /// /// void _mm512_mask_compressstoreu_epi64 (void * s, __mmask8 k, __m512i a) /// VPCOMPRESSQ m512 {k1}{z}, zmm2 /// - [RequiresUnsafe] public static unsafe void CompressStore(ulong* address, Vector512 mask, Vector512 source) => CompressStore(address, mask, source); /// @@ -3610,7 +3526,6 @@ internal X64() { } /// VEXPANDPD zmm1 {k1}{z}, m512 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector512 ExpandLoad(double* address, Vector512 mask, Vector512 merge) => ExpandLoad(address, mask, merge); /// @@ -3618,7 +3533,6 @@ internal X64() { } /// VPEXPANDD zmm1 {k1}{z}, m512 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector512 ExpandLoad(int* address, Vector512 mask, Vector512 merge) => ExpandLoad(address, mask, merge); /// @@ -3626,7 +3540,6 @@ internal X64() { } /// VPEXPANDQ zmm1 {k1}{z}, m512 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector512 ExpandLoad(long* address, Vector512 mask, Vector512 merge) => ExpandLoad(address, mask, merge); /// @@ -3634,7 +3547,6 @@ internal X64() { } /// VEXPANDPS zmm1 {k1}{z}, m512 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector512 ExpandLoad(float* address, Vector512 mask, Vector512 merge) => ExpandLoad(address, mask, merge); /// @@ -3642,7 +3554,6 @@ internal X64() { } /// VPEXPANDD zmm1 {k1}{z}, m512 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector512 ExpandLoad(uint* address, Vector512 mask, Vector512 merge) => ExpandLoad(address, mask, merge); /// @@ -3650,7 +3561,6 @@ internal X64() { } /// VPEXPANDQ zmm1 {k1}{z}, m512 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector512 ExpandLoad(ulong* address, Vector512 mask, Vector512 merge) => ExpandLoad(address, mask, merge); /// @@ -4117,196 +4027,168 @@ internal X64() { } /// __m512i _mm512_load_si512 (__m512i const * mem_addr) /// VMOVDQA32 zmm1, m512 /// - [RequiresUnsafe] public static unsafe Vector512 LoadAlignedVector512(byte* address) => LoadAlignedVector512(address); /// /// __m512i _mm512_load_si512 (__m512i const * mem_addr) /// VMOVDQA32 zmm1, m512 /// - [RequiresUnsafe] public static unsafe Vector512 LoadAlignedVector512(sbyte* address) => LoadAlignedVector512(address); /// /// __m512i _mm512_load_si512 (__m512i const * mem_addr) /// VMOVDQA32 zmm1, m512 /// - [RequiresUnsafe] public static unsafe Vector512 LoadAlignedVector512(short* address) => LoadAlignedVector512(address); /// /// __m512i _mm512_load_si512 (__m512i const * mem_addr) /// VMOVDQA32 zmm1, m512 /// - [RequiresUnsafe] public static unsafe Vector512 LoadAlignedVector512(ushort* address) => LoadAlignedVector512(address); /// /// __m512i _mm512_load_epi32 (__m512i const * mem_addr) /// VMOVDQA32 zmm1, m512 /// - [RequiresUnsafe] public static unsafe Vector512 LoadAlignedVector512(int* address) => LoadAlignedVector512(address); /// /// __m512i _mm512_load_epi32 (__m512i const * mem_addr) /// VMOVDQA32 zmm1, m512 /// - [RequiresUnsafe] public static unsafe Vector512 LoadAlignedVector512(uint* address) => LoadAlignedVector512(address); /// /// __m512i _mm512_load_epi64 (__m512i const * mem_addr) /// VMOVDQA64 zmm1, m512 /// - [RequiresUnsafe] public static unsafe Vector512 LoadAlignedVector512(long* address) => LoadAlignedVector512(address); /// /// __m512i _mm512_load_epi64 (__m512i const * mem_addr) /// VMOVDQA64 zmm1, m512 /// - [RequiresUnsafe] public static unsafe Vector512 LoadAlignedVector512(ulong* address) => LoadAlignedVector512(address); /// /// __m512 _mm512_load_ps (float const * mem_addr) /// VMOVAPS zmm1, m512 /// - [RequiresUnsafe] public static unsafe Vector512 LoadAlignedVector512(float* address) => LoadAlignedVector512(address); /// /// __m512d _mm512_load_pd (double const * mem_addr) /// VMOVAPD zmm1, m512 /// - [RequiresUnsafe] public static unsafe Vector512 LoadAlignedVector512(double* address) => LoadAlignedVector512(address); /// /// __m512i _mm512_stream_load_si512 (__m512i const* mem_addr) /// VMOVNTDQA zmm1, m512 /// - [RequiresUnsafe] public static unsafe Vector512 LoadAlignedVector512NonTemporal(sbyte* address) => LoadAlignedVector512NonTemporal(address); /// /// __m512i _mm512_stream_load_si512 (__m512i const* mem_addr) /// VMOVNTDQA zmm1, m512 /// - [RequiresUnsafe] public static unsafe Vector512 LoadAlignedVector512NonTemporal(byte* address) => LoadAlignedVector512NonTemporal(address); /// /// __m512i _mm512_stream_load_si512 (__m512i const* mem_addr) /// VMOVNTDQA zmm1, m512 /// - [RequiresUnsafe] public static unsafe Vector512 LoadAlignedVector512NonTemporal(short* address) => LoadAlignedVector512NonTemporal(address); /// /// __m512i _mm512_stream_load_si512 (__m512i const* mem_addr) /// VMOVNTDQA zmm1, m512 /// - [RequiresUnsafe] public static unsafe Vector512 LoadAlignedVector512NonTemporal(ushort* address) => LoadAlignedVector512NonTemporal(address); /// /// __m512i _mm512_stream_load_si512 (__m512i const* mem_addr) /// VMOVNTDQA zmm1, m512 /// - [RequiresUnsafe] public static unsafe Vector512 LoadAlignedVector512NonTemporal(int* address) => LoadAlignedVector512NonTemporal(address); /// /// __m512i _mm512_stream_load_si512 (__m512i const* mem_addr) /// VMOVNTDQA zmm1, m512 /// - [RequiresUnsafe] public static unsafe Vector512 LoadAlignedVector512NonTemporal(uint* address) => LoadAlignedVector512NonTemporal(address); /// /// __m512i _mm512_stream_load_si512 (__m512i const* mem_addr) /// VMOVNTDQA zmm1, m512 /// - [RequiresUnsafe] public static unsafe Vector512 LoadAlignedVector512NonTemporal(long* address) => LoadAlignedVector512NonTemporal(address); /// /// __m512i _mm512_stream_load_si512 (__m512i const* mem_addr) /// VMOVNTDQA zmm1, m512 /// - [RequiresUnsafe] public static unsafe Vector512 LoadAlignedVector512NonTemporal(ulong* address) => LoadAlignedVector512NonTemporal(address); /// /// __m512i _mm512_loadu_si512 (__m512i const * mem_addr) /// VMOVDQU32 zmm1, m512 /// - [RequiresUnsafe] public static unsafe Vector512 LoadVector512(sbyte* address) => LoadVector512(address); /// /// __m512i _mm512_loadu_si512 (__m512i const * mem_addr) /// VMOVDQU32 zmm1, m512 /// - [RequiresUnsafe] public static unsafe Vector512 LoadVector512(byte* address) => LoadVector512(address); /// /// __m512i _mm512_loadu_si512 (__m512i const * mem_addr) /// VMOVDQU32 zmm1, m512 /// - [RequiresUnsafe] public static unsafe Vector512 LoadVector512(short* address) => LoadVector512(address); /// /// __m512i _mm512_loadu_si512 (__m512i const * mem_addr) /// VMOVDQU32 zmm1, m512 /// - [RequiresUnsafe] public static unsafe Vector512 LoadVector512(ushort* address) => LoadVector512(address); /// /// __m512i _mm512_loadu_epi32 (__m512i const * mem_addr) /// VMOVDQU32 zmm1, m512 /// - [RequiresUnsafe] public static unsafe Vector512 LoadVector512(int* address) => LoadVector512(address); /// /// __m512i _mm512_loadu_epi32 (__m512i const * mem_addr) /// VMOVDQU32 zmm1, m512 /// - [RequiresUnsafe] public static unsafe Vector512 LoadVector512(uint* address) => LoadVector512(address); /// /// __m512i _mm512_loadu_epi64 (__m512i const * mem_addr) /// VMOVDQU64 zmm1, m512 /// - [RequiresUnsafe] public static unsafe Vector512 LoadVector512(long* address) => LoadVector512(address); /// /// __m512i _mm512_loadu_epi64 (__m512i const * mem_addr) /// VMOVDQU64 zmm1 , m512 /// - [RequiresUnsafe] public static unsafe Vector512 LoadVector512(ulong* address) => LoadVector512(address); /// /// __m512 _mm512_loadu_ps (float const * mem_addr) /// VMOVUPS zmm1, m512 /// - [RequiresUnsafe] public static unsafe Vector512 LoadVector512(float* address) => LoadVector512(address); /// /// __m512d _mm512_loadu_pd (double const * mem_addr) /// VMOVUPD zmm1, m512 /// - [RequiresUnsafe] public static unsafe Vector512 LoadVector512(double* address) => LoadVector512(address); /// @@ -4314,7 +4196,6 @@ internal X64() { } /// VMOVUPD zmm1 {k1}{z}, m512 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector512 MaskLoad(double* address, Vector512 mask, Vector512 merge) => MaskLoad(address, mask, merge); /// @@ -4322,7 +4203,6 @@ internal X64() { } /// VMOVDQU32 zmm1 {k1}{z}, m512 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector512 MaskLoad(int* address, Vector512 mask, Vector512 merge) => MaskLoad(address, mask, merge); /// @@ -4330,7 +4210,6 @@ internal X64() { } /// VMOVDQU64 zmm1 {k1}{z}, m512 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector512 MaskLoad(long* address, Vector512 mask, Vector512 merge) => MaskLoad(address, mask, merge); /// @@ -4338,7 +4217,6 @@ internal X64() { } /// VMOVUPS zmm1 {k1}{z}, m512 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector512 MaskLoad(float* address, Vector512 mask, Vector512 merge) => MaskLoad(address, mask, merge); /// @@ -4346,7 +4224,6 @@ internal X64() { } /// VMOVDQU32 zmm1 {k1}{z}, m512 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector512 MaskLoad(uint* address, Vector512 mask, Vector512 merge) => MaskLoad(address, mask, merge); /// @@ -4354,7 +4231,6 @@ internal X64() { } /// VMOVDQU64 zmm1 {k1}{z}, m512 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector512 MaskLoad(ulong* address, Vector512 mask, Vector512 merge) => MaskLoad(address, mask, merge); /// @@ -4362,7 +4238,6 @@ internal X64() { } /// VMOVAPD zmm1 {k1}{z}, m512 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector512 MaskLoadAligned(double* address, Vector512 mask, Vector512 merge) => MaskLoadAligned(address, mask, merge); /// @@ -4370,7 +4245,6 @@ internal X64() { } /// VMOVDQA32 zmm1 {k1}{z}, m512 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector512 MaskLoadAligned(int* address, Vector512 mask, Vector512 merge) => MaskLoadAligned(address, mask, merge); /// @@ -4378,7 +4252,6 @@ internal X64() { } /// VMOVDQA64 zmm1 {k1}{z}, m512 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector512 MaskLoadAligned(long* address, Vector512 mask, Vector512 merge) => MaskLoadAligned(address, mask, merge); /// @@ -4386,7 +4259,6 @@ internal X64() { } /// VMOVAPS zmm1 {k1}{z}, m512 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector512 MaskLoadAligned(float* address, Vector512 mask, Vector512 merge) => MaskLoadAligned(address, mask, merge); /// @@ -4394,7 +4266,6 @@ internal X64() { } /// VMOVDQA32 zmm1 {k1}{z}, m512 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector512 MaskLoadAligned(uint* address, Vector512 mask, Vector512 merge) => MaskLoadAligned(address, mask, merge); /// @@ -4402,91 +4273,78 @@ internal X64() { } /// VMOVDQA64 zmm1 {k1}{z}, m512 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector512 MaskLoadAligned(ulong* address, Vector512 mask, Vector512 merge) => MaskLoadAligned(address, mask, merge); /// /// void _mm512_mask_storeu_pd (void * mem_addr, __mmask8 k, __m512d a) /// VMOVUPD m512 {k1}{z}, zmm1 /// - [RequiresUnsafe] public static unsafe void MaskStore(double* address, Vector512 mask, Vector512 source) => MaskStore(address, mask, source); /// /// void _mm512_mask_storeu_epi32 (void * mem_addr, __mmask16 k, __m512i a) /// VMOVDQU32 m512 {k1}{z}, zmm1 /// - [RequiresUnsafe] public static unsafe void MaskStore(int* address, Vector512 mask, Vector512 source) => MaskStore(address, mask, source); /// /// void _mm512_mask_storeu_epi64 (void * mem_addr, __mmask8 k, __m512i a) /// VMOVDQU64 m512 {k1}{z}, zmm1 /// - [RequiresUnsafe] public static unsafe void MaskStore(long* address, Vector512 mask, Vector512 source) => MaskStore(address, mask, source); /// /// void _mm512_mask_storeu_ps (void * mem_addr, __mmask16 k, __m512 a) /// VMOVUPS m512 {k1}{z}, zmm1 /// - [RequiresUnsafe] public static unsafe void MaskStore(float* address, Vector512 mask, Vector512 source) => MaskStore(address, mask, source); /// /// void _mm512_mask_storeu_epi32 (void * mem_addr, __mmask16 k, __m512i a) /// VMOVDQU32 m512 {k1}{z}, zmm1 /// - [RequiresUnsafe] public static unsafe void MaskStore(uint* address, Vector512 mask, Vector512 source) => MaskStore(address, mask, source); /// /// void _mm512_mask_storeu_epi64 (void * mem_addr, __mmask8 k, __m512i a) /// VMOVDQU64 m512 {k1}{z}, zmm1 /// - [RequiresUnsafe] public static unsafe void MaskStore(ulong* address, Vector512 mask, Vector512 source) => MaskStore(address, mask, source); /// /// void _mm512_mask_store_pd (void * mem_addr, __mmask8 k, __m512d a) /// VMOVAPD m512 {k1}{z}, zmm1 /// - [RequiresUnsafe] public static unsafe void MaskStoreAligned(double* address, Vector512 mask, Vector512 source) => MaskStoreAligned(address, mask, source); /// /// void _mm512_mask_store_epi32 (void * mem_addr, __mmask16 k, __m512i a) /// VMOVDQA32 m512 {k1}{z}, zmm1 /// - [RequiresUnsafe] public static unsafe void MaskStoreAligned(int* address, Vector512 mask, Vector512 source) => MaskStoreAligned(address, mask, source); /// /// void _mm512_mask_store_epi64 (void * mem_addr, __mmask8 k, __m512i a) /// VMOVDQA32 m512 {k1}{z}, zmm1 /// - [RequiresUnsafe] public static unsafe void MaskStoreAligned(long* address, Vector512 mask, Vector512 source) => MaskStoreAligned(address, mask, source); /// /// void _mm512_mask_store_ps (void * mem_addr, __mmask16 k, __m512 a) /// VMOVAPS m512 {k1}{z}, zmm1 /// - [RequiresUnsafe] public static unsafe void MaskStoreAligned(float* address, Vector512 mask, Vector512 source) => MaskStoreAligned(address, mask, source); /// /// void _mm512_mask_store_epi32 (void * mem_addr, __mmask16 k, __m512i a) /// VMOVDQA32 m512 {k1}{z}, zmm1 /// - [RequiresUnsafe] public static unsafe void MaskStoreAligned(uint* address, Vector512 mask, Vector512 source) => MaskStoreAligned(address, mask, source); /// /// void _mm512_mask_store_epi64 (void * mem_addr, __mmask8 k, __m512i a) /// VMOVDQA32 m512 {k1}{z}, zmm1 /// - [RequiresUnsafe] public static unsafe void MaskStoreAligned(ulong* address, Vector512 mask, Vector512 source) => MaskStoreAligned(address, mask, source); /// @@ -5271,210 +5129,180 @@ internal X64() { } /// void _mm512_storeu_si512 (void * mem_addr, __m512i a) /// VMOVDQU32 m512, zmm1 /// - [RequiresUnsafe] public static unsafe void Store(sbyte* address, Vector512 source) => Store(address, source); /// /// void _mm512_storeu_si512 (void * mem_addr, __m512i a) /// VMOVDQU32 m512, zmm1 /// - [RequiresUnsafe] public static unsafe void Store(byte* address, Vector512 source) => Store(address, source); /// /// void _mm512_storeu_si512 (void * mem_addr, __m512i a) /// VMOVDQU32 m512, zmm1 /// - [RequiresUnsafe] public static unsafe void Store(short* address, Vector512 source) => Store(address, source); /// /// void _mm512_storeu_si512 (void * mem_addr, __m512i a) /// VMOVDQU32 m512, zmm1 /// - [RequiresUnsafe] public static unsafe void Store(ushort* address, Vector512 source) => Store(address, source); /// /// void _mm512_storeu_epi32 (void * mem_addr, __m512i a) /// VMOVDQU32 m512, zmm1 /// - [RequiresUnsafe] public static unsafe void Store(int* address, Vector512 source) => Store(address, source); /// /// void _mm512_storeu_epi32 (void * mem_addr, __m512i a) /// VMOVDQU32 m512, zmm1 /// - [RequiresUnsafe] public static unsafe void Store(uint* address, Vector512 source) => Store(address, source); /// /// void _mm512_storeu_epi64 (void * mem_addr, __m512i a) /// VMOVDQU64 m512, zmm1 /// - [RequiresUnsafe] public static unsafe void Store(long* address, Vector512 source) => Store(address, source); /// /// void _mm512_storeu_epi64 (void * mem_addr, __m512i a) /// VMOVDQU64 m512, zmm1 /// - [RequiresUnsafe] public static unsafe void Store(ulong* address, Vector512 source) => Store(address, source); /// /// void _mm512_storeu_ps (float * mem_addr, __m512 a) /// VMOVUPS m512, zmm1 /// - [RequiresUnsafe] public static unsafe void Store(float* address, Vector512 source) => Store(address, source); /// /// void _mm512_storeu_pd (double * mem_addr, __m512d a) /// VMOVUPD m512, zmm1 /// - [RequiresUnsafe] public static unsafe void Store(double* address, Vector512 source) => Store(address, source); /// /// void _mm512_store_si512 (void * mem_addr, __m512i a) /// VMOVDQA32 m512, zmm1 /// - [RequiresUnsafe] public static unsafe void StoreAligned(byte* address, Vector512 source) => StoreAligned(address, source); /// /// void _mm512_store_si512 (void * mem_addr, __m512i a) /// VMOVDQA32 m512, zmm1 /// - [RequiresUnsafe] public static unsafe void StoreAligned(sbyte* address, Vector512 source) => StoreAligned(address, source); /// /// void _mm512_store_si512 (void * mem_addr, __m512i a) /// VMOVDQA32 m512, zmm1 /// - [RequiresUnsafe] public static unsafe void StoreAligned(short* address, Vector512 source) => StoreAligned(address, source); /// /// void _mm512_store_si512 (void * mem_addr, __m512i a) /// VMOVDQA32 m512, zmm1 /// - [RequiresUnsafe] public static unsafe void StoreAligned(ushort* address, Vector512 source) => StoreAligned(address, source); /// /// void _mm512_store_epi32 (void * mem_addr, __m512i a) /// VMOVDQA32 m512, zmm1 /// - [RequiresUnsafe] public static unsafe void StoreAligned(int* address, Vector512 source) => StoreAligned(address, source); /// /// void _mm512_store_epi32 (void * mem_addr, __m512i a) /// VMOVDQA32 m512, zmm1 /// - [RequiresUnsafe] public static unsafe void StoreAligned(uint* address, Vector512 source) => StoreAligned(address, source); /// /// void _mm512_store_epi64 (void * mem_addr, __m512i a) /// VMOVDQA32 m512, zmm1 /// - [RequiresUnsafe] public static unsafe void StoreAligned(long* address, Vector512 source) => StoreAligned(address, source); /// /// void _mm512_store_epi64 (void * mem_addr, __m512i a) /// VMOVDQA32 m512, zmm1 /// - [RequiresUnsafe] public static unsafe void StoreAligned(ulong* address, Vector512 source) => StoreAligned(address, source); /// /// void _mm512_store_ps (float * mem_addr, __m512 a) /// VMOVAPS m512, zmm1 /// - [RequiresUnsafe] public static unsafe void StoreAligned(float* address, Vector512 source) => StoreAligned(address, source); /// /// void _mm512_store_pd (double * mem_addr, __m512d a) /// VMOVAPD m512, zmm1 /// - [RequiresUnsafe] public static unsafe void StoreAligned(double* address, Vector512 source) => StoreAligned(address, source); /// /// void _mm512_stream_si512 (void * mem_addr, __m512i a) /// VMOVNTDQ m512, zmm1 /// - [RequiresUnsafe] public static unsafe void StoreAlignedNonTemporal(sbyte* address, Vector512 source) => StoreAlignedNonTemporal(address, source); /// /// void _mm512_stream_si512 (void * mem_addr, __m512i a) /// VMOVNTDQ m512, zmm1 /// - [RequiresUnsafe] public static unsafe void StoreAlignedNonTemporal(byte* address, Vector512 source) => StoreAlignedNonTemporal(address, source); /// /// void _mm512_stream_si512 (void * mem_addr, __m512i a) /// VMOVNTDQ m512, zmm1 /// - [RequiresUnsafe] public static unsafe void StoreAlignedNonTemporal(short* address, Vector512 source) => StoreAlignedNonTemporal(address, source); /// /// void _mm512_stream_si512 (void * mem_addr, __m512i a) /// VMOVNTDQ m512, zmm1 /// - [RequiresUnsafe] public static unsafe void StoreAlignedNonTemporal(ushort* address, Vector512 source) => StoreAlignedNonTemporal(address, source); /// /// void _mm512_stream_si512 (void * mem_addr, __m512i a) /// VMOVNTDQ m512, zmm1 /// - [RequiresUnsafe] public static unsafe void StoreAlignedNonTemporal(int* address, Vector512 source) => StoreAlignedNonTemporal(address, source); /// /// void _mm512_stream_si512 (void * mem_addr, __m512i a) /// VMOVNTDQ m512, zmm1 /// - [RequiresUnsafe] public static unsafe void StoreAlignedNonTemporal(uint* address, Vector512 source) => StoreAlignedNonTemporal(address, source); /// /// void _mm512_stream_si512 (void * mem_addr, __m512i a) /// VMOVNTDQ m512, zmm1 /// - [RequiresUnsafe] public static unsafe void StoreAlignedNonTemporal(long* address, Vector512 source) => StoreAlignedNonTemporal(address, source); /// /// void _mm512_stream_si512 (void * mem_addr, __m512i a) /// VMOVNTDQ m512, zmm1 /// - [RequiresUnsafe] public static unsafe void StoreAlignedNonTemporal(ulong* address, Vector512 source) => StoreAlignedNonTemporal(address, source); /// /// void _mm512_stream_ps (float * mem_addr, __m512 a) /// VMOVNTPS m512, zmm1 /// - [RequiresUnsafe] public static unsafe void StoreAlignedNonTemporal(float* address, Vector512 source) => StoreAlignedNonTemporal(address, source); /// /// void _mm512_stream_pd (double * mem_addr, __m512d a) /// VMOVNTPD m512, zmm1 /// - [RequiresUnsafe] public static unsafe void StoreAlignedNonTemporal(double* address, Vector512 source) => StoreAlignedNonTemporal(address, source); /// diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Avx512Vbmi2.PlatformNotSupported.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Avx512Vbmi2.PlatformNotSupported.cs index 9b23380f4a4a48..1770fcfc5121ab 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Avx512Vbmi2.PlatformNotSupported.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Avx512Vbmi2.PlatformNotSupported.cs @@ -75,50 +75,42 @@ internal VL() { } /// __m128i _mm_mask_compressstoreu_epi8 (void * s, __mmask16 k, __m128i a) /// VPCOMPRESSB m128 {k1}{z}, xmm2 /// - [RequiresUnsafe] public static unsafe void CompressStore(byte* address, Vector128 mask, Vector128 source) { throw new PlatformNotSupportedException(); } /// /// __m128i _mm_mask_compressstoreu_epi16 (void * s, __mmask8 k, __m128i a) /// VPCOMPRESSW m128 {k1}{z}, xmm2 /// - [RequiresUnsafe] public static unsafe void CompressStore(short* address, Vector128 mask, Vector128 source) { throw new PlatformNotSupportedException(); } /// /// __m128i _mm_mask_compressstoreu_epi8 (void * s, __mmask16 k, __m128i a) /// VPCOMPRESSB m128 {k1}{z}, xmm2 /// - [RequiresUnsafe] public static unsafe void CompressStore(sbyte* address, Vector128 mask, Vector128 source) { throw new PlatformNotSupportedException(); } /// /// __m128i _mm_mask_compressstoreu_epi16 (void * s, __mmask8 k, __m128i a) /// VPCOMPRESSW m128 {k1}{z}, xmm2 /// - [RequiresUnsafe] public static unsafe void CompressStore(ushort* address, Vector128 mask, Vector128 source) { throw new PlatformNotSupportedException(); } /// /// void _mm256_mask_compressstoreu_epi8 (void * s, __mmask32 k, __m256i a) /// VPCOMPRESSB m256 {k1}{z}, ymm2 /// - [RequiresUnsafe] public static unsafe void CompressStore(byte* address, Vector256 mask, Vector256 source) { throw new PlatformNotSupportedException(); } /// /// void _mm256_mask_compressstoreu_epi16 (void * s, __mmask16 k, __m256i a) /// VPCOMPRESSW m256 {k1}{z}, ymm2 /// - [RequiresUnsafe] public static unsafe void CompressStore(short* address, Vector256 mask, Vector256 source) { throw new PlatformNotSupportedException(); } /// /// void _mm256_mask_compressstoreu_epi8 (void * s, __mmask32 k, __m256i a) /// VPCOMPRESSB m256 {k1}{z}, ymm2 /// - [RequiresUnsafe] public static unsafe void CompressStore(sbyte* address, Vector256 mask, Vector256 source) { throw new PlatformNotSupportedException(); } /// /// void _mm256_mask_compressstoreu_epi16 (void * s, __mmask16 k, __m256i a) /// VPCOMPRESSW m256 {k1}{z}, ymm2 /// - [RequiresUnsafe] public static unsafe void CompressStore(ushort* address, Vector256 mask, Vector256 source) { throw new PlatformNotSupportedException(); } /// @@ -168,28 +160,24 @@ internal VL() { } /// VPEXPANDB xmm1 {k1}{z}, m128 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector128 ExpandLoad(byte* address, Vector128 mask, Vector128 merge) { throw new PlatformNotSupportedException(); } /// /// __m128i _mm_mask_expandloadu_epi16 (__m128i s, __mmask8 k, void const * a) /// VPEXPANDW xmm1 {k1}{z}, m128 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector128 ExpandLoad(short* address, Vector128 mask, Vector128 merge) { throw new PlatformNotSupportedException(); } /// /// __m128i _mm_mask_expandloadu_epi8 (__m128i s, __mmask16 k, void const * a) /// VPEXPANDB xmm1 {k1}{z}, m128 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector128 ExpandLoad(sbyte* address, Vector128 mask, Vector128 merge) { throw new PlatformNotSupportedException(); } /// /// __m128i _mm_mask_expandloadu_epi16 (__m128i s, __mmask8 k, void const * a) /// VPEXPANDW xmm1 {k1}{z}, m128 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector128 ExpandLoad(ushort* address, Vector128 mask, Vector128 merge) { throw new PlatformNotSupportedException(); } /// @@ -197,28 +185,24 @@ internal VL() { } /// VPEXPANDB ymm1 {k1}{z}, m256 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector256 ExpandLoad(byte* address, Vector256 mask, Vector256 merge) { throw new PlatformNotSupportedException(); } /// /// __m256i _mm256_mask_expandloadu_epi16 (__m256i s, __mmask16 k, void const * a) /// VPEXPANDW ymm1 {k1}{z}, m256 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector256 ExpandLoad(short* address, Vector256 mask, Vector256 merge) { throw new PlatformNotSupportedException(); } /// /// __m256i _mm256_mask_expandloadu_epi8 (__m256i s, __mmask32 k, void const * a) /// VPEXPANDB ymm1 {k1}{z}, m256 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector256 ExpandLoad(sbyte* address, Vector256 mask, Vector256 merge) { throw new PlatformNotSupportedException(); } /// /// __m256i _mm256_mask_expandloadu_epi16 (__m256i s, __mmask16 k, void const * a) /// VPEXPANDW ymm1 {k1}{z}, m256 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector256 ExpandLoad(ushort* address, Vector256 mask, Vector256 merge) { throw new PlatformNotSupportedException(); } } @@ -258,25 +242,21 @@ internal X64() { } /// __m512i _mm512_mask_compresstoreu_epi8 (void * s, __mmask64 k, __m512i a) /// VPCOMPRESSB m512 {k1}{z}, zmm2 /// - [RequiresUnsafe] public static unsafe void CompressStore(byte* address, Vector512 mask, Vector512 source) { throw new PlatformNotSupportedException(); } /// /// __m512i _mm512_mask_compresstoreu_epi16 (void * s, __mmask32 k, __m512i a) /// VPCOMPRESSW m512 {k1}{z}, zmm2 /// - [RequiresUnsafe] public static unsafe void CompressStore(short* address, Vector512 mask, Vector512 source) { throw new PlatformNotSupportedException(); } /// /// __m512i _mm512_mask_compresstoreu_epi8 (void * s, __mmask64 k, __m512i a) /// VPCOMPRESSB m512 {k1}{z}, zmm2 /// - [RequiresUnsafe] public static unsafe void CompressStore(sbyte* address, Vector512 mask, Vector512 source) { throw new PlatformNotSupportedException(); } /// /// __m512i _mm512_mask_compresstoreu_epi16 (void * s, __mmask32 k, __m512i a) /// VPCOMPRESSW m512 {k1}{z}, zmm2 /// - [RequiresUnsafe] public static unsafe void CompressStore(ushort* address, Vector512 mask, Vector512 source) { throw new PlatformNotSupportedException(); } /// @@ -305,28 +285,24 @@ internal X64() { } /// VPEXPANDB zmm1 {k1}{z}, m512 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector512 ExpandLoad(byte* address, Vector512 mask, Vector512 merge) { throw new PlatformNotSupportedException(); } /// /// __m512i _mm512_mask_expandloadu_epi16 (__m512i s, __mmask32 k, void * const a) /// VPEXPANDW zmm1 {k1}{z}, m512 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector512 ExpandLoad(short* address, Vector512 mask, Vector512 merge) { throw new PlatformNotSupportedException(); } /// /// __m512i _mm512_mask_expandloadu_epi8 (__m512i s, __mmask64 k, void * const a) /// VPEXPANDB zmm1 {k1}{z}, m512 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector512 ExpandLoad(sbyte* address, Vector512 mask, Vector512 merge) { throw new PlatformNotSupportedException(); } /// /// __m512i _mm512_mask_expandloadu_epi16 (__m512i s, __mmask32 k, void * const a) /// VPEXPANDW zmm1 {k1}{z}, m512 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector512 ExpandLoad(ushort* address, Vector512 mask, Vector512 merge) { throw new PlatformNotSupportedException(); } } } diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Avx512Vbmi2.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Avx512Vbmi2.cs index 57db4a9eba90f0..830bcd25911dcc 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Avx512Vbmi2.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Avx512Vbmi2.cs @@ -77,56 +77,48 @@ internal VL() { } /// __m128i _mm_mask_compressstoreu_epi8 (void * s, __mmask16 k, __m128i a) /// VPCOMPRESSB m128 {k1}{z}, xmm2 /// - [RequiresUnsafe] public static unsafe void CompressStore(byte* address, Vector128 mask, Vector128 source) => CompressStore(address, mask, source); /// /// __m128i _mm_mask_compressstoreu_epi16 (void * s, __mmask8 k, __m128i a) /// VPCOMPRESSW m128 {k1}{z}, xmm2 /// - [RequiresUnsafe] public static unsafe void CompressStore(short* address, Vector128 mask, Vector128 source) => CompressStore(address, mask, source); /// /// __m128i _mm_mask_compressstoreu_epi8 (void * s, __mmask16 k, __m128i a) /// VPCOMPRESSB m128 {k1}{z}, xmm2 /// - [RequiresUnsafe] public static unsafe void CompressStore(sbyte* address, Vector128 mask, Vector128 source) => CompressStore(address, mask, source); /// /// __m128i _mm_mask_compressstoreu_epi16 (void * s, __mmask8 k, __m128i a) /// VPCOMPRESSW m128 {k1}{z}, xmm2 /// - [RequiresUnsafe] public static unsafe void CompressStore(ushort* address, Vector128 mask, Vector128 source) => CompressStore(address, mask, source); /// /// void _mm256_mask_compressstoreu_epi8 (void * s, __mmask32 k, __m256i a) /// VPCOMPRESSB m256 {k1}{z}, ymm2 /// - [RequiresUnsafe] public static unsafe void CompressStore(byte* address, Vector256 mask, Vector256 source) => CompressStore(address, mask, source); /// /// void _mm256_mask_compressstoreu_epi16 (void * s, __mmask16 k, __m256i a) /// VPCOMPRESSW m256 {k1}{z}, ymm2 /// - [RequiresUnsafe] public static unsafe void CompressStore(short* address, Vector256 mask, Vector256 source) => CompressStore(address, mask, source); /// /// void _mm256_mask_compressstoreu_epi8 (void * s, __mmask32 k, __m256i a) /// VPCOMPRESSB m256 {k1}{z}, ymm2 /// - [RequiresUnsafe] public static unsafe void CompressStore(sbyte* address, Vector256 mask, Vector256 source) => CompressStore(address, mask, source); /// /// void _mm256_mask_compressstoreu_epi16 (void * s, __mmask16 k, __m256i a) /// VPCOMPRESSW m256 {k1}{z}, ymm2 /// - [RequiresUnsafe] public static unsafe void CompressStore(ushort* address, Vector256 mask, Vector256 source) => CompressStore(address, mask, source); /// @@ -176,7 +168,6 @@ internal VL() { } /// VPEXPANDB xmm1 {k1}{z}, m128 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector128 ExpandLoad(byte* address, Vector128 mask, Vector128 merge) => ExpandLoad(address, mask, merge); /// @@ -184,7 +175,6 @@ internal VL() { } /// VPEXPANDW xmm1 {k1}{z}, m128 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector128 ExpandLoad(short* address, Vector128 mask, Vector128 merge) => ExpandLoad(address, mask, merge); /// @@ -192,7 +182,6 @@ internal VL() { } /// VPEXPANDB xmm1 {k1}{z}, m128 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector128 ExpandLoad(sbyte* address, Vector128 mask, Vector128 merge) => ExpandLoad(address, mask, merge); /// @@ -200,7 +189,6 @@ internal VL() { } /// VPEXPANDW xmm1 {k1}{z}, m128 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector128 ExpandLoad(ushort* address, Vector128 mask, Vector128 merge) => ExpandLoad(address, mask, merge); /// @@ -208,7 +196,6 @@ internal VL() { } /// VPEXPANDB ymm1 {k1}{z}, m256 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector256 ExpandLoad(byte* address, Vector256 mask, Vector256 merge) => ExpandLoad(address, mask, merge); /// @@ -216,7 +203,6 @@ internal VL() { } /// VPEXPANDW ymm1 {k1}{z}, m256 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector256 ExpandLoad(short* address, Vector256 mask, Vector256 merge) => ExpandLoad(address, mask, merge); /// @@ -224,7 +210,6 @@ internal VL() { } /// VPEXPANDB ymm1 {k1}{z}, m256 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector256 ExpandLoad(sbyte* address, Vector256 mask, Vector256 merge) => ExpandLoad(address, mask, merge); /// @@ -232,7 +217,6 @@ internal VL() { } /// VPEXPANDW ymm1 {k1}{z}, m256 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector256 ExpandLoad(ushort* address, Vector256 mask, Vector256 merge) => ExpandLoad(address, mask, merge); } @@ -273,28 +257,24 @@ internal X64() { } /// __m512i _mm512_mask_compresstoreu_epi8 (void * s, __mmask64 k, __m512i a) /// VPCOMPRESSB m512 {k1}{z}, zmm2 /// - [RequiresUnsafe] public static unsafe void CompressStore(byte* address, Vector512 mask, Vector512 source) => CompressStore(address, mask, source); /// /// __m512i _mm512_mask_compresstoreu_epi16 (void * s, __mmask32 k, __m512i a) /// VPCOMPRESSW m512 {k1}{z}, zmm2 /// - [RequiresUnsafe] public static unsafe void CompressStore(short* address, Vector512 mask, Vector512 source) => CompressStore(address, mask, source); /// /// __m512i _mm512_mask_compresstoreu_epi8 (void * s, __mmask64 k, __m512i a) /// VPCOMPRESSB m512 {k1}{z}, zmm2 /// - [RequiresUnsafe] public static unsafe void CompressStore(sbyte* address, Vector512 mask, Vector512 source) => CompressStore(address, mask, source); /// /// __m512i _mm512_mask_compresstoreu_epi16 (void * s, __mmask32 k, __m512i a) /// VPCOMPRESSW m512 {k1}{z}, zmm2 /// - [RequiresUnsafe] public static unsafe void CompressStore(ushort* address, Vector512 mask, Vector512 source) => CompressStore(address, mask, source); /// @@ -323,7 +303,6 @@ internal X64() { } /// VPEXPANDB zmm1 {k1}{z}, m512 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector512 ExpandLoad(byte* address, Vector512 mask, Vector512 merge) => ExpandLoad(address, mask, merge); /// @@ -331,7 +310,6 @@ internal X64() { } /// VPEXPANDW zmm1 {k1}{z}, m512 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector512 ExpandLoad(short* address, Vector512 mask, Vector512 merge) => ExpandLoad(address, mask, merge); /// @@ -339,7 +317,6 @@ internal X64() { } /// VPEXPANDB zmm1 {k1}{z}, m512 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector512 ExpandLoad(sbyte* address, Vector512 mask, Vector512 merge) => ExpandLoad(address, mask, merge); /// @@ -347,7 +324,6 @@ internal X64() { } /// VPEXPANDW zmm1 {k1}{z}, m512 /// /// The native and managed intrinsics have different order of parameters. - [RequiresUnsafe] public static unsafe Vector512 ExpandLoad(ushort* address, Vector512 mask, Vector512 merge) => ExpandLoad(address, mask, merge); } } diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Bmi2.PlatformNotSupported.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Bmi2.PlatformNotSupported.cs index 31f6f23f0e5cd0..6fc68dd5673eaf 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Bmi2.PlatformNotSupported.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Bmi2.PlatformNotSupported.cs @@ -50,7 +50,6 @@ internal X64() { } /// The above native signature does not directly correspond to the managed signature. /// This intrinsic is only available on 64-bit processes /// - [RequiresUnsafe] public static unsafe ulong MultiplyNoFlags(ulong left, ulong right, ulong* low) { throw new PlatformNotSupportedException(); } /// @@ -86,7 +85,6 @@ internal X64() { } /// MULX r32a, r32b, r/m32 /// The above native signature does not directly correspond to the managed signature. /// - [RequiresUnsafe] public static unsafe uint MultiplyNoFlags(uint left, uint right, uint* low) { throw new PlatformNotSupportedException(); } /// diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Bmi2.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Bmi2.cs index 311e6cefeed75b..29a519e97ef9ec 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Bmi2.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Bmi2.cs @@ -50,7 +50,6 @@ internal X64() { } /// The above native signature does not directly correspond to the managed signature. /// This intrinsic is only available on 64-bit processes /// - [RequiresUnsafe] public static unsafe ulong MultiplyNoFlags(ulong left, ulong right, ulong* low) => MultiplyNoFlags(left, right, low); /// @@ -86,7 +85,6 @@ internal X64() { } /// MULX r32a, r32b, r/m32 /// The above native signature does not directly correspond to the managed signature. /// - [RequiresUnsafe] public static unsafe uint MultiplyNoFlags(uint left, uint right, uint* low) => MultiplyNoFlags(left, right, low); /// diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Sse.PlatformNotSupported.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Sse.PlatformNotSupported.cs index e817faa253ee93..f732f500d45910 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Sse.PlatformNotSupported.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Sse.PlatformNotSupported.cs @@ -359,21 +359,18 @@ internal X64() { } /// VMOVAPS xmm1, m128 /// VMOVAPS xmm1 {k1}{z}, m128 /// - [RequiresUnsafe] public static unsafe Vector128 LoadAlignedVector128(float* address) { throw new PlatformNotSupportedException(); } /// /// __m128 _mm_loadh_pi (__m128 a, __m64 const* mem_addr) /// MOVHPS xmm1, m64 /// VMOVHPS xmm1, xmm2, m64 /// - [RequiresUnsafe] public static unsafe Vector128 LoadHigh(Vector128 lower, float* address) { throw new PlatformNotSupportedException(); } /// /// __m128 _mm_loadl_pi (__m128 a, __m64 const* mem_addr) /// MOVLPS xmm1, m64 /// VMOVLPS xmm1, xmm2, m64 /// - [RequiresUnsafe] public static unsafe Vector128 LoadLow(Vector128 upper, float* address) { throw new PlatformNotSupportedException(); } /// /// __m128 _mm_load_ss (float const* mem_address) @@ -381,7 +378,6 @@ internal X64() { } /// VMOVSS xmm1, m32 /// VMOVSS xmm1 {k1}, m32 /// - [RequiresUnsafe] public static unsafe Vector128 LoadScalarVector128(float* address) { throw new PlatformNotSupportedException(); } /// /// __m128 _mm_loadu_ps (float const* mem_address) @@ -389,7 +385,6 @@ internal X64() { } /// VMOVUPS xmm1, m128 /// VMOVUPS xmm1 {k1}{z}, m128 /// - [RequiresUnsafe] public static unsafe Vector128 LoadVector128(float* address) { throw new PlatformNotSupportedException(); } /// @@ -475,25 +470,21 @@ internal X64() { } /// void _mm_prefetch(char* p, int i) /// PREFETCHT0 m8 /// - [RequiresUnsafe] public static unsafe void Prefetch0(void* address) { throw new PlatformNotSupportedException(); } /// /// void _mm_prefetch(char* p, int i) /// PREFETCHT1 m8 /// - [RequiresUnsafe] public static unsafe void Prefetch1(void* address) { throw new PlatformNotSupportedException(); } /// /// void _mm_prefetch(char* p, int i) /// PREFETCHT2 m8 /// - [RequiresUnsafe] public static unsafe void Prefetch2(void* address) { throw new PlatformNotSupportedException(); } /// /// void _mm_prefetch(char* p, int i) /// PREFETCHNTA m8 /// - [RequiresUnsafe] public static unsafe void PrefetchNonTemporal(void* address) { throw new PlatformNotSupportedException(); } /// @@ -576,7 +567,6 @@ internal X64() { } /// VMOVUPS m128, xmm1 /// VMOVUPS m128 {k1}{z}, xmm1 /// - [RequiresUnsafe] public static unsafe void Store(float* address, Vector128 source) { throw new PlatformNotSupportedException(); } /// /// void _mm_store_ps (float* mem_addr, __m128 a) @@ -584,14 +574,12 @@ internal X64() { } /// VMOVAPS m128, xmm1 /// VMOVAPS m128 {k1}{z}, xmm1 /// - [RequiresUnsafe] public static unsafe void StoreAligned(float* address, Vector128 source) { throw new PlatformNotSupportedException(); } /// /// void _mm_stream_ps (float* mem_addr, __m128 a) /// MOVNTPS m128, xmm1 /// VMOVNTPS m128, xmm1 /// - [RequiresUnsafe] public static unsafe void StoreAlignedNonTemporal(float* address, Vector128 source) { throw new PlatformNotSupportedException(); } /// /// void _mm_sfence(void) @@ -603,14 +591,12 @@ internal X64() { } /// MOVHPS m64, xmm1 /// VMOVHPS m64, xmm1 /// - [RequiresUnsafe] public static unsafe void StoreHigh(float* address, Vector128 source) { throw new PlatformNotSupportedException(); } /// /// void _mm_storel_pi (__m64* mem_addr, __m128 a) /// MOVLPS m64, xmm1 /// VMOVLPS m64, xmm1 /// - [RequiresUnsafe] public static unsafe void StoreLow(float* address, Vector128 source) { throw new PlatformNotSupportedException(); } /// /// void _mm_store_ss (float* mem_addr, __m128 a) @@ -618,7 +604,6 @@ internal X64() { } /// VMOVSS m32, xmm1 /// VMOVSS m32 {k1}, xmm1 /// - [RequiresUnsafe] public static unsafe void StoreScalar(float* address, Vector128 source) { throw new PlatformNotSupportedException(); } /// diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Sse.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Sse.cs index 4bc3349964f3a1..85f9f0a13c8f4c 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Sse.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Sse.cs @@ -359,7 +359,6 @@ internal X64() { } /// VMOVAPS xmm1, m128 /// VMOVAPS xmm1 {k1}{z}, m128 /// - [RequiresUnsafe] public static unsafe Vector128 LoadAlignedVector128(float* address) => LoadAlignedVector128(address); /// @@ -367,7 +366,6 @@ internal X64() { } /// MOVHPS xmm1, m64 /// VMOVHPS xmm1, xmm2, m64 /// - [RequiresUnsafe] public static unsafe Vector128 LoadHigh(Vector128 lower, float* address) => LoadHigh(lower, address); /// @@ -375,7 +373,6 @@ internal X64() { } /// MOVLPS xmm1, m64 /// VMOVLPS xmm1, xmm2, m64 /// - [RequiresUnsafe] public static unsafe Vector128 LoadLow(Vector128 upper, float* address) => LoadLow(upper, address); /// @@ -384,7 +381,6 @@ internal X64() { } /// VMOVSS xmm1, m32 /// VMOVSS xmm1 {k1}, m32 /// - [RequiresUnsafe] public static unsafe Vector128 LoadScalarVector128(float* address) => LoadScalarVector128(address); /// @@ -393,7 +389,6 @@ internal X64() { } /// VMOVUPS xmm1, m128 /// VMOVUPS xmm1 {k1}{z}, m128 /// - [RequiresUnsafe] public static unsafe Vector128 LoadVector128(float* address) => LoadVector128(address); /// @@ -479,28 +474,24 @@ internal X64() { } /// void _mm_prefetch(char* p, int i) /// PREFETCHT0 m8 /// - [RequiresUnsafe] public static unsafe void Prefetch0(void* address) => Prefetch0(address); /// /// void _mm_prefetch(char* p, int i) /// PREFETCHT1 m8 /// - [RequiresUnsafe] public static unsafe void Prefetch1(void* address) => Prefetch1(address); /// /// void _mm_prefetch(char* p, int i) /// PREFETCHT2 m8 /// - [RequiresUnsafe] public static unsafe void Prefetch2(void* address) => Prefetch2(address); /// /// void _mm_prefetch(char* p, int i) /// PREFETCHNTA m8 /// - [RequiresUnsafe] public static unsafe void PrefetchNonTemporal(void* address) => PrefetchNonTemporal(address); /// @@ -583,7 +574,6 @@ internal X64() { } /// VMOVAPS m128, xmm1 /// VMOVAPS m128 {k1}{z}, xmm1 /// - [RequiresUnsafe] public static unsafe void Store(float* address, Vector128 source) => Store(address, source); /// @@ -592,7 +582,6 @@ internal X64() { } /// VMOVAPS m128, xmm1 /// VMOVAPS m128 {k1}{z}, xmm1 /// - [RequiresUnsafe] public static unsafe void StoreAligned(float* address, Vector128 source) => StoreAligned(address, source); /// @@ -600,7 +589,6 @@ internal X64() { } /// MOVNTPS m128, xmm1 /// VMOVNTPS m128, xmm1 /// - [RequiresUnsafe] public static unsafe void StoreAlignedNonTemporal(float* address, Vector128 source) => StoreAlignedNonTemporal(address, source); /// /// void _mm_sfence(void) @@ -613,7 +601,6 @@ internal X64() { } /// MOVHPS m64, xmm1 /// VMOVHPS m64, xmm1 /// - [RequiresUnsafe] public static unsafe void StoreHigh(float* address, Vector128 source) => StoreHigh(address, source); /// @@ -621,7 +608,6 @@ internal X64() { } /// MOVLPS m64, xmm1 /// VMOVLPS m64, xmm1 /// - [RequiresUnsafe] public static unsafe void StoreLow(float* address, Vector128 source) => StoreLow(address, source); /// @@ -630,7 +616,6 @@ internal X64() { } /// VMOVSS m32, xmm1 /// VMOVSS m32 {k1}, xmm1 /// - [RequiresUnsafe] public static unsafe void StoreScalar(float* address, Vector128 source) => StoreScalar(address, source); /// diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Sse2.PlatformNotSupported.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Sse2.PlatformNotSupported.cs index 6d7ac8da92bbc8..4fae2c1bf12117 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Sse2.PlatformNotSupported.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Sse2.PlatformNotSupported.cs @@ -85,14 +85,12 @@ internal X64() { } /// MOVNTI m64, r64 /// This intrinsic is only available on 64-bit processes /// - [RequiresUnsafe] public static unsafe void StoreNonTemporal(long* address, long value) { throw new PlatformNotSupportedException(); } /// /// void _mm_stream_si64(__int64 *p, __int64 a) /// MOVNTI m64, r64 /// This intrinsic is only available on 64-bit processes /// - [RequiresUnsafe] public static unsafe void StoreNonTemporal(ulong* address, ulong value) { throw new PlatformNotSupportedException(); } } @@ -795,7 +793,6 @@ internal X64() { } /// VMOVDQA xmm1, m128 /// VMOVDQA32 xmm1 {k1}{z}, m128 /// - [RequiresUnsafe] public static unsafe Vector128 LoadAlignedVector128(sbyte* address) { throw new PlatformNotSupportedException(); } /// /// __m128i _mm_load_si128 (__m128i const* mem_address) @@ -803,13 +800,11 @@ internal X64() { } /// VMOVDQA xmm1, m128 /// VMOVDQA32 xmm1 {k1}{z}, m128 /// - [RequiresUnsafe] public static unsafe Vector128 LoadAlignedVector128(byte* address) { throw new PlatformNotSupportedException(); } /// /// __m128i _mm_load_si128 (__m128i const* mem_address) /// MOVDQA xmm, m128 /// - [RequiresUnsafe] public static unsafe Vector128 LoadAlignedVector128(short* address) { throw new PlatformNotSupportedException(); } /// /// __m128i _mm_load_si128 (__m128i const* mem_address) @@ -817,7 +812,6 @@ internal X64() { } /// VMOVDQA xmm1, m128 /// VMOVDQA32 xmm1 {k1}{z}, m128 /// - [RequiresUnsafe] public static unsafe Vector128 LoadAlignedVector128(ushort* address) { throw new PlatformNotSupportedException(); } /// /// __m128i _mm_load_si128 (__m128i const* mem_address) @@ -825,7 +819,6 @@ internal X64() { } /// VMOVDQA xmm1, m128 /// VMOVDQA32 xmm1 {k1}{z}, m128 /// - [RequiresUnsafe] public static unsafe Vector128 LoadAlignedVector128(int* address) { throw new PlatformNotSupportedException(); } /// /// __m128i _mm_load_si128 (__m128i const* mem_address) @@ -833,7 +826,6 @@ internal X64() { } /// VMOVDQA xmm1, m128 /// VMOVDQA32 xmm1 {k1}{z}, m128 /// - [RequiresUnsafe] public static unsafe Vector128 LoadAlignedVector128(uint* address) { throw new PlatformNotSupportedException(); } /// /// __m128i _mm_load_si128 (__m128i const* mem_address) @@ -841,7 +833,6 @@ internal X64() { } /// VMOVDQA xmm1, m128 /// VMOVDQA64 xmm1 {k1}{z}, m128 /// - [RequiresUnsafe] public static unsafe Vector128 LoadAlignedVector128(long* address) { throw new PlatformNotSupportedException(); } /// /// __m128i _mm_load_si128 (__m128i const* mem_address) @@ -849,7 +840,6 @@ internal X64() { } /// VMOVDQA xmm1, m128 /// VMOVDQA64 xmm1 {k1}{z}, m128 /// - [RequiresUnsafe] public static unsafe Vector128 LoadAlignedVector128(ulong* address) { throw new PlatformNotSupportedException(); } /// /// __m128d _mm_load_pd (double const* mem_address) @@ -857,7 +847,6 @@ internal X64() { } /// VMOVAPD xmm1, m128 /// VMOVAPD xmm1 {k1}{z}, m128 /// - [RequiresUnsafe] public static unsafe Vector128 LoadAlignedVector128(double* address) { throw new PlatformNotSupportedException(); } /// @@ -870,14 +859,12 @@ internal X64() { } /// MOVHPD xmm1, m64 /// VMOVHPD xmm1, xmm2, m64 /// - [RequiresUnsafe] public static unsafe Vector128 LoadHigh(Vector128 lower, double* address) { throw new PlatformNotSupportedException(); } /// /// __m128d _mm_loadl_pd (__m128d a, double const* mem_addr) /// MOVLPD xmm1, m64 /// VMOVLPD xmm1, xmm2, m64 /// - [RequiresUnsafe] public static unsafe Vector128 LoadLow(Vector128 upper, double* address) { throw new PlatformNotSupportedException(); } /// @@ -885,28 +872,24 @@ internal X64() { } /// MOVD xmm1, m32 /// VMOVD xmm1, m32 /// - [RequiresUnsafe] public static unsafe Vector128 LoadScalarVector128(int* address) { throw new PlatformNotSupportedException(); } /// /// __m128i _mm_loadu_si32 (void const* mem_addr) /// MOVD xmm1, m32 /// VMOVD xmm1, m32 /// - [RequiresUnsafe] public static unsafe Vector128 LoadScalarVector128(uint* address) { throw new PlatformNotSupportedException(); } /// /// __m128i _mm_loadl_epi64 (__m128i const* mem_addr) /// MOVQ xmm1, m64 /// VMOVQ xmm1, m64 /// - [RequiresUnsafe] public static unsafe Vector128 LoadScalarVector128(long* address) { throw new PlatformNotSupportedException(); } /// /// __m128i _mm_loadl_epi64 (__m128i const* mem_addr) /// MOVQ xmm1, m64 /// VMOVQ xmm1, m64 /// - [RequiresUnsafe] public static unsafe Vector128 LoadScalarVector128(ulong* address) { throw new PlatformNotSupportedException(); } /// /// __m128d _mm_load_sd (double const* mem_address) @@ -914,7 +897,6 @@ internal X64() { } /// VMOVSD xmm1, m64 /// VMOVSD xmm1 {k1}, m64 /// - [RequiresUnsafe] public static unsafe Vector128 LoadScalarVector128(double* address) { throw new PlatformNotSupportedException(); } /// @@ -923,7 +905,6 @@ internal X64() { } /// VMOVDQU xmm1, m128 /// VMOVDQU8 xmm1 {k1}{z}, m128 /// - [RequiresUnsafe] public static unsafe Vector128 LoadVector128(sbyte* address) { throw new PlatformNotSupportedException(); } /// /// __m128i _mm_loadu_si128 (__m128i const* mem_address) @@ -931,7 +912,6 @@ internal X64() { } /// VMOVDQU xmm1, m128 /// VMOVDQU8 xmm1 {k1}{z}, m128 /// - [RequiresUnsafe] public static unsafe Vector128 LoadVector128(byte* address) { throw new PlatformNotSupportedException(); } /// /// __m128i _mm_loadu_si128 (__m128i const* mem_address) @@ -939,7 +919,6 @@ internal X64() { } /// VMOVDQU xmm1, m128 /// VMOVDQU16 xmm1 {k1}{z}, m128 /// - [RequiresUnsafe] public static unsafe Vector128 LoadVector128(short* address) { throw new PlatformNotSupportedException(); } /// /// __m128i _mm_loadu_si128 (__m128i const* mem_address) @@ -947,7 +926,6 @@ internal X64() { } /// VMOVDQU xmm1, m128 /// VMOVDQU16 xmm1 {k1}{z}, m128 /// - [RequiresUnsafe] public static unsafe Vector128 LoadVector128(ushort* address) { throw new PlatformNotSupportedException(); } /// /// __m128i _mm_loadu_si128 (__m128i const* mem_address) @@ -955,7 +933,6 @@ internal X64() { } /// VMOVDQU xmm1, m128 /// VMOVDQU32 xmm1 {k1}{z}, m128 /// - [RequiresUnsafe] public static unsafe Vector128 LoadVector128(int* address) { throw new PlatformNotSupportedException(); } /// /// __m128i _mm_loadu_si128 (__m128i const* mem_address) @@ -963,7 +940,6 @@ internal X64() { } /// VMOVDQU xmm1, m128 /// VMOVDQU32 xmm1 {k1}{z}, m128 /// - [RequiresUnsafe] public static unsafe Vector128 LoadVector128(uint* address) { throw new PlatformNotSupportedException(); } /// /// __m128i _mm_loadu_si128 (__m128i const* mem_address) @@ -971,7 +947,6 @@ internal X64() { } /// VMOVDQU xmm1, m128 /// VMOVDQU64 xmm1 {k1}{z}, m128 /// - [RequiresUnsafe] public static unsafe Vector128 LoadVector128(long* address) { throw new PlatformNotSupportedException(); } /// /// __m128i _mm_loadu_si128 (__m128i const* mem_address) @@ -979,7 +954,6 @@ internal X64() { } /// VMOVDQU xmm1, m128 /// VMOVDQU64 xmm1 {k1}{z}, m128 /// - [RequiresUnsafe] public static unsafe Vector128 LoadVector128(ulong* address) { throw new PlatformNotSupportedException(); } /// /// __m128d _mm_loadu_pd (double const* mem_address) @@ -987,7 +961,6 @@ internal X64() { } /// VMOVUPD xmm1, m128 /// VMOVUPD xmm1 {k1}{z}, m128 /// - [RequiresUnsafe] public static unsafe Vector128 LoadVector128(double* address) { throw new PlatformNotSupportedException(); } /// @@ -995,14 +968,12 @@ internal X64() { } /// MASKMOVDQU xmm1, xmm2 ; Address: EDI/RDI /// VMASKMOVDQU xmm1, xmm2 ; Address: EDI/RDI /// - [RequiresUnsafe] public static unsafe void MaskMove(Vector128 source, Vector128 mask, sbyte* address) { throw new PlatformNotSupportedException(); } /// /// void _mm_maskmoveu_si128 (__m128i a, __m128i mask, char* mem_address) /// MASKMOVDQU xmm1, xmm2 ; Address: EDI/RDI /// VMASKMOVDQU xmm1, xmm2 ; Address: EDI/RDI /// - [RequiresUnsafe] public static unsafe void MaskMove(Vector128 source, Vector128 mask, byte* address) { throw new PlatformNotSupportedException(); } /// @@ -1645,7 +1616,6 @@ internal X64() { } /// VMOVDQU m128, xmm1 /// VMOVDQU8 m128 {k1}{z}, xmm1 /// - [RequiresUnsafe] public static unsafe void Store(sbyte* address, Vector128 source) { throw new PlatformNotSupportedException(); } /// /// void _mm_storeu_si128 (__m128i* mem_addr, __m128i a) @@ -1653,7 +1623,6 @@ internal X64() { } /// VMOVDQU m128, xmm1 /// VMOVDQU8 m128 {k1}{z}, xmm1 /// - [RequiresUnsafe] public static unsafe void Store(byte* address, Vector128 source) { throw new PlatformNotSupportedException(); } /// /// void _mm_storeu_si128 (__m128i* mem_addr, __m128i a) @@ -1661,7 +1630,6 @@ internal X64() { } /// VMOVDQU m128, xmm1 /// VMOVDQU16 m128 {k1}{z}, xmm1 /// - [RequiresUnsafe] public static unsafe void Store(short* address, Vector128 source) { throw new PlatformNotSupportedException(); } /// /// void _mm_storeu_si128 (__m128i* mem_addr, __m128i a) @@ -1669,7 +1637,6 @@ internal X64() { } /// VMOVDQU m128, xmm1 /// VMOVDQU16 m128 {k1}{z}, xmm1 /// - [RequiresUnsafe] public static unsafe void Store(ushort* address, Vector128 source) { throw new PlatformNotSupportedException(); } /// /// void _mm_storeu_si128 (__m128i* mem_addr, __m128i a) @@ -1677,7 +1644,6 @@ internal X64() { } /// VMOVDQU m128, xmm1 /// VMOVDQU32 m128 {k1}{z}, xmm1 /// - [RequiresUnsafe] public static unsafe void Store(int* address, Vector128 source) { throw new PlatformNotSupportedException(); } /// /// void _mm_storeu_si128 (__m128i* mem_addr, __m128i a) @@ -1685,7 +1651,6 @@ internal X64() { } /// VMOVDQU m128, xmm1 /// VMOVDQU32 m128 {k1}{z}, xmm1 /// - [RequiresUnsafe] public static unsafe void Store(uint* address, Vector128 source) { throw new PlatformNotSupportedException(); } /// /// void _mm_storeu_si128 (__m128i* mem_addr, __m128i a) @@ -1693,7 +1658,6 @@ internal X64() { } /// VMOVDQU m128, xmm1 /// VMOVDQU64 m128 {k1}{z}, xmm1 /// - [RequiresUnsafe] public static unsafe void Store(long* address, Vector128 source) { throw new PlatformNotSupportedException(); } /// /// void _mm_storeu_si128 (__m128i* mem_addr, __m128i a) @@ -1701,7 +1665,6 @@ internal X64() { } /// VMOVDQU m128, xmm1 /// VMOVDQU64 m128 {k1}{z}, xmm1 /// - [RequiresUnsafe] public static unsafe void Store(ulong* address, Vector128 source) { throw new PlatformNotSupportedException(); } /// /// void _mm_storeu_pd (double* mem_addr, __m128d a) @@ -1709,7 +1672,6 @@ internal X64() { } /// VMOVAPD m128, xmm1 /// VMOVAPD m128 {k1}{z}, xmm1 /// - [RequiresUnsafe] public static unsafe void Store(double* address, Vector128 source) { throw new PlatformNotSupportedException(); } /// @@ -1718,7 +1680,6 @@ internal X64() { } /// VMOVDQA m128, xmm1 /// VMOVDQA32 m128 {k1}{z}, xmm1 /// - [RequiresUnsafe] public static unsafe void StoreAligned(sbyte* address, Vector128 source) { throw new PlatformNotSupportedException(); } /// /// void _mm_store_si128 (__m128i* mem_addr, __m128i a) @@ -1726,7 +1687,6 @@ internal X64() { } /// VMOVDQA m128, xmm1 /// VMOVDQA32 m128 {k1}{z}, xmm1 /// - [RequiresUnsafe] public static unsafe void StoreAligned(byte* address, Vector128 source) { throw new PlatformNotSupportedException(); } /// /// void _mm_store_si128 (__m128i* mem_addr, __m128i a) @@ -1734,7 +1694,6 @@ internal X64() { } /// VMOVDQA m128, xmm1 /// VMOVDQA32 m128 {k1}{z}, xmm1 /// - [RequiresUnsafe] public static unsafe void StoreAligned(short* address, Vector128 source) { throw new PlatformNotSupportedException(); } /// /// void _mm_store_si128 (__m128i* mem_addr, __m128i a) @@ -1742,7 +1701,6 @@ internal X64() { } /// VMOVDQA m128, xmm1 /// VMOVDQA32 m128 {k1}{z}, xmm1 /// - [RequiresUnsafe] public static unsafe void StoreAligned(ushort* address, Vector128 source) { throw new PlatformNotSupportedException(); } /// /// void _mm_store_si128 (__m128i* mem_addr, __m128i a) @@ -1750,7 +1708,6 @@ internal X64() { } /// VMOVDQA m128, xmm1 /// VMOVDQA32 m128 {k1}{z}, xmm1 /// - [RequiresUnsafe] public static unsafe void StoreAligned(int* address, Vector128 source) { throw new PlatformNotSupportedException(); } /// /// void _mm_store_si128 (__m128i* mem_addr, __m128i a) @@ -1758,7 +1715,6 @@ internal X64() { } /// VMOVDQA m128, xmm1 /// VMOVDQA32 m128 {k1}{z}, xmm1 /// - [RequiresUnsafe] public static unsafe void StoreAligned(uint* address, Vector128 source) { throw new PlatformNotSupportedException(); } /// /// void _mm_store_si128 (__m128i* mem_addr, __m128i a) @@ -1766,7 +1722,6 @@ internal X64() { } /// VMOVDQA m128, xmm1 /// VMOVDQA64 m128 {k1}{z}, xmm1 /// - [RequiresUnsafe] public static unsafe void StoreAligned(long* address, Vector128 source) { throw new PlatformNotSupportedException(); } /// /// void _mm_store_si128 (__m128i* mem_addr, __m128i a) @@ -1774,7 +1729,6 @@ internal X64() { } /// VMOVDQA m128, xmm1 /// VMOVDQA64 m128 {k1}{z}, xmm1 /// - [RequiresUnsafe] public static unsafe void StoreAligned(ulong* address, Vector128 source) { throw new PlatformNotSupportedException(); } /// /// void _mm_store_pd (double* mem_addr, __m128d a) @@ -1782,7 +1736,6 @@ internal X64() { } /// VMOVAPD m128, xmm1 /// VMOVAPD m128 {k1}{z}, xmm1 /// - [RequiresUnsafe] public static unsafe void StoreAligned(double* address, Vector128 source) { throw new PlatformNotSupportedException(); } /// @@ -1790,63 +1743,54 @@ internal X64() { } /// MOVNTDQ m128, xmm1 /// VMOVNTDQ m128, xmm1 /// - [RequiresUnsafe] public static unsafe void StoreAlignedNonTemporal(sbyte* address, Vector128 source) { throw new PlatformNotSupportedException(); } /// /// void _mm_stream_si128 (__m128i* mem_addr, __m128i a) /// MOVNTDQ m128, xmm1 /// VMOVNTDQ m128, xmm1 /// - [RequiresUnsafe] public static unsafe void StoreAlignedNonTemporal(byte* address, Vector128 source) { throw new PlatformNotSupportedException(); } /// /// void _mm_stream_si128 (__m128i* mem_addr, __m128i a) /// MOVNTDQ m128, xmm1 /// VMOVNTDQ m128, xmm1 /// - [RequiresUnsafe] public static unsafe void StoreAlignedNonTemporal(short* address, Vector128 source) { throw new PlatformNotSupportedException(); } /// /// void _mm_stream_si128 (__m128i* mem_addr, __m128i a) /// MOVNTDQ m128, xmm1 /// VMOVNTDQ m128, xmm1 /// - [RequiresUnsafe] public static unsafe void StoreAlignedNonTemporal(ushort* address, Vector128 source) { throw new PlatformNotSupportedException(); } /// /// void _mm_stream_si128 (__m128i* mem_addr, __m128i a) /// MOVNTDQ m128, xmm1 /// VMOVNTDQ m128, xmm1 /// - [RequiresUnsafe] public static unsafe void StoreAlignedNonTemporal(int* address, Vector128 source) { throw new PlatformNotSupportedException(); } /// /// void _mm_stream_si128 (__m128i* mem_addr, __m128i a) /// MOVNTDQ m128, xmm1 /// VMOVNTDQ m128, xmm1 /// - [RequiresUnsafe] public static unsafe void StoreAlignedNonTemporal(uint* address, Vector128 source) { throw new PlatformNotSupportedException(); } /// /// void _mm_stream_si128 (__m128i* mem_addr, __m128i a) /// MOVNTDQ m128, xmm1 /// VMOVNTDQ m128, xmm1 /// - [RequiresUnsafe] public static unsafe void StoreAlignedNonTemporal(long* address, Vector128 source) { throw new PlatformNotSupportedException(); } /// /// void _mm_stream_si128 (__m128i* mem_addr, __m128i a) /// MOVNTDQ m128, xmm1 /// VMOVNTDQ m128, xmm1 /// - [RequiresUnsafe] public static unsafe void StoreAlignedNonTemporal(ulong* address, Vector128 source) { throw new PlatformNotSupportedException(); } /// /// void _mm_stream_pd (double* mem_addr, __m128d a) /// MOVNTPD m128, xmm1 /// VMOVNTPD m128, xmm1 /// - [RequiresUnsafe] public static unsafe void StoreAlignedNonTemporal(double* address, Vector128 source) { throw new PlatformNotSupportedException(); } /// @@ -1854,27 +1798,23 @@ internal X64() { } /// MOVHPD m64, xmm1 /// VMOVHPD m64, xmm1 /// - [RequiresUnsafe] public static unsafe void StoreHigh(double* address, Vector128 source) { throw new PlatformNotSupportedException(); } /// /// void _mm_storel_pd (double* mem_addr, __m128d a) /// MOVLPD m64, xmm1 /// VMOVLPD m64, xmm1 /// - [RequiresUnsafe] public static unsafe void StoreLow(double* address, Vector128 source) { throw new PlatformNotSupportedException(); } /// /// void _mm_stream_si32(int *p, int a) /// MOVNTI m32, r32 /// - [RequiresUnsafe] public static unsafe void StoreNonTemporal(int* address, int value) { throw new PlatformNotSupportedException(); } /// /// void _mm_stream_si32(int *p, int a) /// MOVNTI m32, r32 /// - [RequiresUnsafe] public static unsafe void StoreNonTemporal(uint* address, uint value) { throw new PlatformNotSupportedException(); } /// @@ -1882,28 +1822,24 @@ internal X64() { } /// MOVD m32, xmm1 /// VMOVD m32, xmm1 /// - [RequiresUnsafe] public static unsafe void StoreScalar(int* address, Vector128 source) { throw new PlatformNotSupportedException(); } /// /// void _mm_storeu_si32 (void* mem_addr, __m128i a) /// MOVD m32, xmm1 /// VMOVD m32, xmm1 /// - [RequiresUnsafe] public static unsafe void StoreScalar(uint* address, Vector128 source) { throw new PlatformNotSupportedException(); } /// /// void _mm_storel_epi64 (__m128i* mem_addr, __m128i a) /// MOVQ m64, xmm1 /// VMOVQ m64, xmm1 /// - [RequiresUnsafe] public static unsafe void StoreScalar(long* address, Vector128 source) { throw new PlatformNotSupportedException(); } /// /// void _mm_storel_epi64 (__m128i* mem_addr, __m128i a) /// MOVQ m64, xmm1 /// VMOVQ m64, xmm1 /// - [RequiresUnsafe] public static unsafe void StoreScalar(ulong* address, Vector128 source) { throw new PlatformNotSupportedException(); } /// /// void _mm_store_sd (double* mem_addr, __m128d a) @@ -1911,7 +1847,6 @@ internal X64() { } /// VMOVSD m64, xmm1 /// VMOVSD m64 {k1}, xmm1 /// - [RequiresUnsafe] public static unsafe void StoreScalar(double* address, Vector128 source) { throw new PlatformNotSupportedException(); } /// diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Sse2.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Sse2.cs index eb9319f94ced26..e65cbf7f166704 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Sse2.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Sse2.cs @@ -85,7 +85,6 @@ internal X64() { } /// MOVNTI m64, r64 /// This intrinsic is only available on 64-bit processes /// - [RequiresUnsafe] public static unsafe void StoreNonTemporal(long* address, long value) => StoreNonTemporal(address, value); /// @@ -93,7 +92,6 @@ internal X64() { } /// MOVNTI m64, r64 /// This intrinsic is only available on 64-bit processes /// - [RequiresUnsafe] public static unsafe void StoreNonTemporal(ulong* address, ulong value) => StoreNonTemporal(address, value); } @@ -796,7 +794,6 @@ internal X64() { } /// VMOVDQA xmm1, m128 /// VMOVDQA32 xmm1 {k1}{z}, m128 /// - [RequiresUnsafe] public static unsafe Vector128 LoadAlignedVector128(sbyte* address) => LoadAlignedVector128(address); /// @@ -805,7 +802,6 @@ internal X64() { } /// VMOVDQA xmm1, m128 /// VMOVDQA32 xmm1 {k1}{z}, m128 /// - [RequiresUnsafe] public static unsafe Vector128 LoadAlignedVector128(byte* address) => LoadAlignedVector128(address); /// @@ -814,7 +810,6 @@ internal X64() { } /// VMOVDQA xmm1, m128 /// VMOVDQA32 xmm1 {k1}{z}, m128 /// - [RequiresUnsafe] public static unsafe Vector128 LoadAlignedVector128(short* address) => LoadAlignedVector128(address); /// @@ -823,7 +818,6 @@ internal X64() { } /// VMOVDQA xmm1, m128 /// VMOVDQA32 xmm1 {k1}{z}, m128 /// - [RequiresUnsafe] public static unsafe Vector128 LoadAlignedVector128(ushort* address) => LoadAlignedVector128(address); /// @@ -832,7 +826,6 @@ internal X64() { } /// VMOVDQA xmm1, m128 /// VMOVDQA32 xmm1 {k1}{z}, m128 /// - [RequiresUnsafe] public static unsafe Vector128 LoadAlignedVector128(int* address) => LoadAlignedVector128(address); /// @@ -841,7 +834,6 @@ internal X64() { } /// VMOVDQA xmm1, m128 /// VMOVDQA32 xmm1 {k1}{z}, m128 /// - [RequiresUnsafe] public static unsafe Vector128 LoadAlignedVector128(uint* address) => LoadAlignedVector128(address); /// @@ -850,7 +842,6 @@ internal X64() { } /// VMOVDQA xmm1, m128 /// VMOVDQA64 xmm1 {k1}{z}, m128 /// - [RequiresUnsafe] public static unsafe Vector128 LoadAlignedVector128(long* address) => LoadAlignedVector128(address); /// @@ -859,7 +850,6 @@ internal X64() { } /// VMOVDQA xmm1, m128 /// VMOVDQA64 xmm1 {k1}{z}, m128 /// - [RequiresUnsafe] public static unsafe Vector128 LoadAlignedVector128(ulong* address) => LoadAlignedVector128(address); /// @@ -868,7 +858,6 @@ internal X64() { } /// VMOVAPD xmm1, m128 /// VMOVAPD xmm1 {k1}{z}, m128 /// - [RequiresUnsafe] public static unsafe Vector128 LoadAlignedVector128(double* address) => LoadAlignedVector128(address); /// @@ -882,7 +871,6 @@ internal X64() { } /// MOVHPD xmm1, m64 /// VMOVHPD xmm1, xmm2, m64 /// - [RequiresUnsafe] public static unsafe Vector128 LoadHigh(Vector128 lower, double* address) => LoadHigh(lower, address); /// @@ -890,7 +878,6 @@ internal X64() { } /// MOVLPD xmm1, m64 /// VMOVLPD xmm1, xmm2, m64 /// - [RequiresUnsafe] public static unsafe Vector128 LoadLow(Vector128 upper, double* address) => LoadLow(upper, address); /// @@ -898,7 +885,6 @@ internal X64() { } /// MOVD xmm1, m32 /// VMOVD xmm1, m32 /// - [RequiresUnsafe] public static unsafe Vector128 LoadScalarVector128(int* address) => LoadScalarVector128(address); /// @@ -906,7 +892,6 @@ internal X64() { } /// MOVD xmm1, m32 /// VMOVD xmm1, m32 /// - [RequiresUnsafe] public static unsafe Vector128 LoadScalarVector128(uint* address) => LoadScalarVector128(address); /// @@ -914,7 +899,6 @@ internal X64() { } /// MOVQ xmm1, m64 /// VMOVQ xmm1, m64 /// - [RequiresUnsafe] public static unsafe Vector128 LoadScalarVector128(long* address) => LoadScalarVector128(address); /// @@ -922,7 +906,6 @@ internal X64() { } /// MOVQ xmm1, m64 /// VMOVQ xmm1, m64 /// - [RequiresUnsafe] public static unsafe Vector128 LoadScalarVector128(ulong* address) => LoadScalarVector128(address); /// @@ -931,7 +914,6 @@ internal X64() { } /// VMOVSD xmm1, m64 /// VMOVSD xmm1 {k1}, m64 /// - [RequiresUnsafe] public static unsafe Vector128 LoadScalarVector128(double* address) => LoadScalarVector128(address); /// @@ -940,7 +922,6 @@ internal X64() { } /// VMOVDQU xmm1, m128 /// VMOVDQU8 xmm1 {k1}{z}, m128 /// - [RequiresUnsafe] public static unsafe Vector128 LoadVector128(sbyte* address) => LoadVector128(address); /// @@ -949,7 +930,6 @@ internal X64() { } /// VMOVDQU xmm1, m128 /// VMOVDQU8 xmm1 {k1}{z}, m128 /// - [RequiresUnsafe] public static unsafe Vector128 LoadVector128(byte* address) => LoadVector128(address); /// @@ -958,7 +938,6 @@ internal X64() { } /// VMOVDQU xmm1, m128 /// VMOVDQU16 xmm1 {k1}{z}, m128 /// - [RequiresUnsafe] public static unsafe Vector128 LoadVector128(short* address) => LoadVector128(address); /// @@ -967,7 +946,6 @@ internal X64() { } /// VMOVDQU xmm1, m128 /// VMOVDQU16 xmm1 {k1}{z}, m128 /// - [RequiresUnsafe] public static unsafe Vector128 LoadVector128(ushort* address) => LoadVector128(address); /// @@ -976,7 +954,6 @@ internal X64() { } /// VMOVDQU xmm1, m128 /// VMOVDQU32 xmm1 {k1}{z}, m128 /// - [RequiresUnsafe] public static unsafe Vector128 LoadVector128(int* address) => LoadVector128(address); /// @@ -985,7 +962,6 @@ internal X64() { } /// VMOVDQU xmm1, m128 /// VMOVDQU32 xmm1 {k1}{z}, m128 /// - [RequiresUnsafe] public static unsafe Vector128 LoadVector128(uint* address) => LoadVector128(address); /// @@ -994,7 +970,6 @@ internal X64() { } /// VMOVDQU xmm1, m128 /// VMOVDQU64 xmm1 {k1}{z}, m128 /// - [RequiresUnsafe] public static unsafe Vector128 LoadVector128(long* address) => LoadVector128(address); /// @@ -1003,7 +978,6 @@ internal X64() { } /// VMOVDQU xmm1, m128 /// VMOVDQU64 xmm1 {k1}{z}, m128 /// - [RequiresUnsafe] public static unsafe Vector128 LoadVector128(ulong* address) => LoadVector128(address); /// @@ -1012,7 +986,6 @@ internal X64() { } /// VMOVUPD xmm1, m128 /// VMOVUPD xmm1 {k1}{z}, m128 /// - [RequiresUnsafe] public static unsafe Vector128 LoadVector128(double* address) => LoadVector128(address); /// @@ -1020,7 +993,6 @@ internal X64() { } /// MASKMOVDQU xmm1, xmm2 ; Address: EDI/RDI /// VMASKMOVDQU xmm1, xmm2 ; Address: EDI/RDI /// - [RequiresUnsafe] public static unsafe void MaskMove(Vector128 source, Vector128 mask, sbyte* address) => MaskMove(source, mask, address); /// @@ -1028,7 +1000,6 @@ internal X64() { } /// MASKMOVDQU xmm1, xmm2 ; Address: EDI/RDI /// VMASKMOVDQU xmm1, xmm2 ; Address: EDI/RDI /// - [RequiresUnsafe] public static unsafe void MaskMove(Vector128 source, Vector128 mask, byte* address) => MaskMove(source, mask, address); /// @@ -1671,7 +1642,6 @@ internal X64() { } /// VMOVDQU m128, xmm1 /// VMOVDQU8 m128 {k1}{z}, xmm1 /// - [RequiresUnsafe] public static unsafe void Store(sbyte* address, Vector128 source) => Store(address, source); /// @@ -1680,7 +1650,6 @@ internal X64() { } /// VMOVDQU m128, xmm1 /// VMOVDQU8 m128 {k1}{z}, xmm1 /// - [RequiresUnsafe] public static unsafe void Store(byte* address, Vector128 source) => Store(address, source); /// @@ -1689,7 +1658,6 @@ internal X64() { } /// VMOVDQU m128, xmm1 /// VMOVDQU16 m128 {k1}{z}, xmm1 /// - [RequiresUnsafe] public static unsafe void Store(short* address, Vector128 source) => Store(address, source); /// @@ -1698,7 +1666,6 @@ internal X64() { } /// VMOVDQU m128, xmm1 /// VMOVDQU16 m128 {k1}{z}, xmm1 /// - [RequiresUnsafe] public static unsafe void Store(ushort* address, Vector128 source) => Store(address, source); /// @@ -1707,7 +1674,6 @@ internal X64() { } /// VMOVDQU m128, xmm1 /// VMOVDQU32 m128 {k1}{z}, xmm1 /// - [RequiresUnsafe] public static unsafe void Store(int* address, Vector128 source) => Store(address, source); /// @@ -1716,7 +1682,6 @@ internal X64() { } /// VMOVDQU m128, xmm1 /// VMOVDQU32 m128 {k1}{z}, xmm1 /// - [RequiresUnsafe] public static unsafe void Store(uint* address, Vector128 source) => Store(address, source); /// @@ -1725,7 +1690,6 @@ internal X64() { } /// VMOVDQU m128, xmm1 /// VMOVDQU64 m128 {k1}{z}, xmm1 /// - [RequiresUnsafe] public static unsafe void Store(long* address, Vector128 source) => Store(address, source); /// @@ -1734,7 +1698,6 @@ internal X64() { } /// VMOVDQU m128, xmm1 /// VMOVDQU64 m128 {k1}{z}, xmm1 /// - [RequiresUnsafe] public static unsafe void Store(ulong* address, Vector128 source) => Store(address, source); /// @@ -1743,7 +1706,6 @@ internal X64() { } /// VMOVUPD m128, xmm1 /// VMOVUPD m128 {k1}{z}, xmm1 /// - [RequiresUnsafe] public static unsafe void Store(double* address, Vector128 source) => Store(address, source); /// @@ -1752,7 +1714,6 @@ internal X64() { } /// VMOVDQA m128, xmm1 /// VMOVDQA32 m128 {k1}{z}, xmm1 /// - [RequiresUnsafe] public static unsafe void StoreAligned(sbyte* address, Vector128 source) => StoreAligned(address, source); /// @@ -1761,7 +1722,6 @@ internal X64() { } /// VMOVDQA m128, xmm1 /// VMOVDQA32 m128 {k1}{z}, xmm1 /// - [RequiresUnsafe] public static unsafe void StoreAligned(byte* address, Vector128 source) => StoreAligned(address, source); /// @@ -1770,7 +1730,6 @@ internal X64() { } /// VMOVDQA m128, xmm1 /// VMOVDQA32 m128 {k1}{z}, xmm1 /// - [RequiresUnsafe] public static unsafe void StoreAligned(short* address, Vector128 source) => StoreAligned(address, source); /// @@ -1779,7 +1738,6 @@ internal X64() { } /// VMOVDQA m128, xmm1 /// VMOVDQA32 m128 {k1}{z}, xmm1 /// - [RequiresUnsafe] public static unsafe void StoreAligned(ushort* address, Vector128 source) => StoreAligned(address, source); /// @@ -1788,7 +1746,6 @@ internal X64() { } /// VMOVDQA m128, xmm1 /// VMOVDQA32 m128 {k1}{z}, xmm1 /// - [RequiresUnsafe] public static unsafe void StoreAligned(int* address, Vector128 source) => StoreAligned(address, source); /// @@ -1797,7 +1754,6 @@ internal X64() { } /// VMOVDQA m128, xmm1 /// VMOVDQA32 m128 {k1}{z}, xmm1 /// - [RequiresUnsafe] public static unsafe void StoreAligned(uint* address, Vector128 source) => StoreAligned(address, source); /// @@ -1806,7 +1762,6 @@ internal X64() { } /// VMOVDQA m128, xmm1 /// VMOVDQA64 m128 {k1}{z}, xmm1 /// - [RequiresUnsafe] public static unsafe void StoreAligned(long* address, Vector128 source) => StoreAligned(address, source); /// @@ -1815,7 +1770,6 @@ internal X64() { } /// VMOVDQA m128, xmm1 /// VMOVDQA64 m128 {k1}{z}, xmm1 /// - [RequiresUnsafe] public static unsafe void StoreAligned(ulong* address, Vector128 source) => StoreAligned(address, source); /// @@ -1824,7 +1778,6 @@ internal X64() { } /// VMOVAPD m128, xmm1 /// VMOVAPD m128 {k1}{z}, xmm1 /// - [RequiresUnsafe] public static unsafe void StoreAligned(double* address, Vector128 source) => StoreAligned(address, source); /// @@ -1832,7 +1785,6 @@ internal X64() { } /// MOVNTDQ m128, xmm1 /// VMOVNTDQ m128, xmm1 /// - [RequiresUnsafe] public static unsafe void StoreAlignedNonTemporal(sbyte* address, Vector128 source) => StoreAlignedNonTemporal(address, source); /// @@ -1840,7 +1792,6 @@ internal X64() { } /// MOVNTDQ m128, xmm1 /// VMOVNTDQ m128, xmm1 /// - [RequiresUnsafe] public static unsafe void StoreAlignedNonTemporal(byte* address, Vector128 source) => StoreAlignedNonTemporal(address, source); /// @@ -1848,7 +1799,6 @@ internal X64() { } /// MOVNTDQ m128, xmm1 /// VMOVNTDQ m128, xmm1 /// - [RequiresUnsafe] public static unsafe void StoreAlignedNonTemporal(short* address, Vector128 source) => StoreAlignedNonTemporal(address, source); /// @@ -1856,7 +1806,6 @@ internal X64() { } /// MOVNTDQ m128, xmm1 /// VMOVNTDQ m128, xmm1 /// - [RequiresUnsafe] public static unsafe void StoreAlignedNonTemporal(ushort* address, Vector128 source) => StoreAlignedNonTemporal(address, source); /// @@ -1864,7 +1813,6 @@ internal X64() { } /// MOVNTDQ m128, xmm1 /// VMOVNTDQ m128, xmm1 /// - [RequiresUnsafe] public static unsafe void StoreAlignedNonTemporal(int* address, Vector128 source) => StoreAlignedNonTemporal(address, source); /// @@ -1872,7 +1820,6 @@ internal X64() { } /// MOVNTDQ m128, xmm1 /// VMOVNTDQ m128, xmm1 /// - [RequiresUnsafe] public static unsafe void StoreAlignedNonTemporal(uint* address, Vector128 source) => StoreAlignedNonTemporal(address, source); /// @@ -1880,7 +1827,6 @@ internal X64() { } /// MOVNTDQ m128, xmm1 /// VMOVNTDQ m128, xmm1 /// - [RequiresUnsafe] public static unsafe void StoreAlignedNonTemporal(long* address, Vector128 source) => StoreAlignedNonTemporal(address, source); /// @@ -1888,7 +1834,6 @@ internal X64() { } /// MOVNTDQ m128, xmm1 /// VMOVNTDQ m128, xmm1 /// - [RequiresUnsafe] public static unsafe void StoreAlignedNonTemporal(ulong* address, Vector128 source) => StoreAlignedNonTemporal(address, source); /// @@ -1896,7 +1841,6 @@ internal X64() { } /// MOVNTPD m128, xmm1 /// VMOVNTPD m128, xmm1 /// - [RequiresUnsafe] public static unsafe void StoreAlignedNonTemporal(double* address, Vector128 source) => StoreAlignedNonTemporal(address, source); /// @@ -1904,7 +1848,6 @@ internal X64() { } /// MOVHPD m64, xmm1 /// VMOVHPD m64, xmm1 /// - [RequiresUnsafe] public static unsafe void StoreHigh(double* address, Vector128 source) => StoreHigh(address, source); /// @@ -1912,21 +1855,18 @@ internal X64() { } /// MOVLPD m64, xmm1 /// VMOVLPD m64, xmm1 /// - [RequiresUnsafe] public static unsafe void StoreLow(double* address, Vector128 source) => StoreLow(address, source); /// /// void _mm_stream_si32(int *p, int a) /// MOVNTI m32, r32 /// - [RequiresUnsafe] public static unsafe void StoreNonTemporal(int* address, int value) => StoreNonTemporal(address, value); /// /// void _mm_stream_si32(int *p, int a) /// MOVNTI m32, r32 /// - [RequiresUnsafe] public static unsafe void StoreNonTemporal(uint* address, uint value) => StoreNonTemporal(address, value); /// @@ -1934,7 +1874,6 @@ internal X64() { } /// MOVD m32, xmm1 /// VMOVD m32, xmm1 /// - [RequiresUnsafe] public static unsafe void StoreScalar(int* address, Vector128 source) => StoreScalar(address, source); /// @@ -1942,7 +1881,6 @@ internal X64() { } /// MOVD m32, xmm1 /// VMOVD m32, xmm1 /// - [RequiresUnsafe] public static unsafe void StoreScalar(uint* address, Vector128 source) => StoreScalar(address, source); /// @@ -1950,7 +1888,6 @@ internal X64() { } /// MOVQ m64, xmm1 /// VMOVQ m64, xmm1 /// - [RequiresUnsafe] public static unsafe void StoreScalar(long* address, Vector128 source) => StoreScalar(address, source); /// @@ -1958,7 +1895,6 @@ internal X64() { } /// MOVQ m64, xmm1 /// VMOVQ m64, xmm1 /// - [RequiresUnsafe] public static unsafe void StoreScalar(ulong* address, Vector128 source) => StoreScalar(address, source); /// @@ -1967,7 +1903,6 @@ internal X64() { } /// VMOVSD m64, xmm1 /// VMOVSD m64 {k1}, xmm1 /// - [RequiresUnsafe] public static unsafe void StoreScalar(double* address, Vector128 source) => StoreScalar(address, source); /// diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Sse3.PlatformNotSupported.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Sse3.PlatformNotSupported.cs index 3ab324f1642767..a82aff0cfcb634 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Sse3.PlatformNotSupported.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Sse3.PlatformNotSupported.cs @@ -75,7 +75,6 @@ internal X64() { } /// VMOVDDUP xmm1, m64 /// VMOVDDUP xmm1 {k1}{z}, m64 /// - [RequiresUnsafe] public static unsafe Vector128 LoadAndDuplicateToVector128(double* address) { throw new PlatformNotSupportedException(); } /// @@ -83,56 +82,48 @@ internal X64() { } /// LDDQU xmm1, m128 /// VLDDQU xmm1, m128 /// - [RequiresUnsafe] public static unsafe Vector128 LoadDquVector128(sbyte* address) { throw new PlatformNotSupportedException(); } /// /// __m128i _mm_lddqu_si128 (__m128i const* mem_addr) /// LDDQU xmm1, m128 /// VLDDQU xmm1, m128 /// - [RequiresUnsafe] public static unsafe Vector128 LoadDquVector128(byte* address) { throw new PlatformNotSupportedException(); } /// /// __m128i _mm_lddqu_si128 (__m128i const* mem_addr) /// LDDQU xmm1, m128 /// VLDDQU xmm1, m128 /// - [RequiresUnsafe] public static unsafe Vector128 LoadDquVector128(short* address) { throw new PlatformNotSupportedException(); } /// /// __m128i _mm_lddqu_si128 (__m128i const* mem_addr) /// LDDQU xmm1, m128 /// VLDDQU xmm1, m128 /// - [RequiresUnsafe] public static unsafe Vector128 LoadDquVector128(ushort* address) { throw new PlatformNotSupportedException(); } /// /// __m128i _mm_lddqu_si128 (__m128i const* mem_addr) /// LDDQU xmm1, m128 /// VLDDQU xmm1, m128 /// - [RequiresUnsafe] public static unsafe Vector128 LoadDquVector128(int* address) { throw new PlatformNotSupportedException(); } /// /// __m128i _mm_lddqu_si128 (__m128i const* mem_addr) /// LDDQU xmm1, m128 /// VLDDQU xmm1, m128 /// - [RequiresUnsafe] public static unsafe Vector128 LoadDquVector128(uint* address) { throw new PlatformNotSupportedException(); } /// /// __m128i _mm_lddqu_si128 (__m128i const* mem_addr) /// LDDQU xmm1, m128 /// VLDDQU xmm1, m128 /// - [RequiresUnsafe] public static unsafe Vector128 LoadDquVector128(long* address) { throw new PlatformNotSupportedException(); } /// /// __m128i _mm_lddqu_si128 (__m128i const* mem_addr) /// LDDQU xmm1, m128 /// VLDDQU xmm1, m128 /// - [RequiresUnsafe] public static unsafe Vector128 LoadDquVector128(ulong* address) { throw new PlatformNotSupportedException(); } /// diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Sse3.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Sse3.cs index 3e494c57e843cf..7a168bfdab0018 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Sse3.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Sse3.cs @@ -75,7 +75,6 @@ internal X64() { } /// VMOVDDUP xmm1, m64 /// VMOVDDUP xmm1 {k1}{z}, m64 /// - [RequiresUnsafe] public static unsafe Vector128 LoadAndDuplicateToVector128(double* address) => LoadAndDuplicateToVector128(address); /// @@ -83,7 +82,6 @@ internal X64() { } /// LDDQU xmm1, m128 /// VLDDQU xmm1, m128 /// - [RequiresUnsafe] public static unsafe Vector128 LoadDquVector128(sbyte* address) => LoadDquVector128(address); /// @@ -91,7 +89,6 @@ internal X64() { } /// LDDQU xmm1, m128 /// VLDDQU xmm1, m128 /// - [RequiresUnsafe] public static unsafe Vector128 LoadDquVector128(byte* address) => LoadDquVector128(address); /// @@ -99,7 +96,6 @@ internal X64() { } /// LDDQU xmm1, m128 /// VLDDQU xmm1, m128 /// - [RequiresUnsafe] public static unsafe Vector128 LoadDquVector128(short* address) => LoadDquVector128(address); /// @@ -107,7 +103,6 @@ internal X64() { } /// LDDQU xmm1, m128 /// VLDDQU xmm1, m128 /// - [RequiresUnsafe] public static unsafe Vector128 LoadDquVector128(ushort* address) => LoadDquVector128(address); /// @@ -115,7 +110,6 @@ internal X64() { } /// LDDQU xmm1, m128 /// VLDDQU xmm1, m128 /// - [RequiresUnsafe] public static unsafe Vector128 LoadDquVector128(int* address) => LoadDquVector128(address); /// @@ -123,7 +117,6 @@ internal X64() { } /// LDDQU xmm1, m128 /// VLDDQU xmm1, m128 /// - [RequiresUnsafe] public static unsafe Vector128 LoadDquVector128(uint* address) => LoadDquVector128(address); /// @@ -131,7 +124,6 @@ internal X64() { } /// LDDQU xmm1, m128 /// VLDDQU xmm1, m128 /// - [RequiresUnsafe] public static unsafe Vector128 LoadDquVector128(long* address) => LoadDquVector128(address); /// @@ -139,7 +131,6 @@ internal X64() { } /// LDDQU xmm1, m128 /// VLDDQU xmm1, m128 /// - [RequiresUnsafe] public static unsafe Vector128 LoadDquVector128(ulong* address) => LoadDquVector128(address); /// diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Sse41.PlatformNotSupported.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Sse41.PlatformNotSupported.cs index 9b2bb6a04483d9..a9f765ea1ca1fb 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Sse41.PlatformNotSupported.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Sse41.PlatformNotSupported.cs @@ -296,7 +296,6 @@ internal X64() { } /// VPMOVSXBW xmm1 {k1}{z}, m64 /// The native signature does not exist. We provide this additional overload for completeness. /// - [RequiresUnsafe] public static unsafe Vector128 ConvertToVector128Int16(sbyte* address) { throw new PlatformNotSupportedException(); } /// /// PMOVZXBW xmm1, m64 @@ -304,7 +303,6 @@ internal X64() { } /// VPMOVZXBW xmm1 {k1}{z}, m64 /// The native signature does not exist. We provide this additional overload for completeness. /// - [RequiresUnsafe] public static unsafe Vector128 ConvertToVector128Int16(byte* address) { throw new PlatformNotSupportedException(); } /// /// PMOVSXBD xmm1, m32 @@ -312,7 +310,6 @@ internal X64() { } /// VPMOVSXBD xmm1 {k1}{z}, m32 /// The native signature does not exist. We provide this additional overload for completeness. /// - [RequiresUnsafe] public static unsafe Vector128 ConvertToVector128Int32(sbyte* address) { throw new PlatformNotSupportedException(); } /// /// PMOVZXBD xmm1, m32 @@ -320,7 +317,6 @@ internal X64() { } /// VPMOVZXBD xmm1 {k1}{z}, m32 /// The native signature does not exist. We provide this additional overload for completeness. /// - [RequiresUnsafe] public static unsafe Vector128 ConvertToVector128Int32(byte* address) { throw new PlatformNotSupportedException(); } /// /// PMOVSXWD xmm1, m64 @@ -328,7 +324,6 @@ internal X64() { } /// VPMOVSXWD xmm1 {k1}{z}, m64 /// The native signature does not exist. We provide this additional overload for completeness. /// - [RequiresUnsafe] public static unsafe Vector128 ConvertToVector128Int32(short* address) { throw new PlatformNotSupportedException(); } /// /// PMOVZXWD xmm1, m64 @@ -336,7 +331,6 @@ internal X64() { } /// VPMOVZXWD xmm1 {k1}{z}, m64 /// The native signature does not exist. We provide this additional overload for completeness. /// - [RequiresUnsafe] public static unsafe Vector128 ConvertToVector128Int32(ushort* address) { throw new PlatformNotSupportedException(); } /// /// PMOVSXBQ xmm1, m16 @@ -344,7 +338,6 @@ internal X64() { } /// VPMOVSXBQ xmm1 {k1}{z}, m16 /// The native signature does not exist. We provide this additional overload for completeness. /// - [RequiresUnsafe] public static unsafe Vector128 ConvertToVector128Int64(sbyte* address) { throw new PlatformNotSupportedException(); } /// /// PMOVZXBQ xmm1, m16 @@ -352,7 +345,6 @@ internal X64() { } /// VPMOVZXBQ xmm1 {k1}{z}, m16 /// The native signature does not exist. We provide this additional overload for completeness. /// - [RequiresUnsafe] public static unsafe Vector128 ConvertToVector128Int64(byte* address) { throw new PlatformNotSupportedException(); } /// /// PMOVSXWQ xmm1, m32 @@ -360,7 +352,6 @@ internal X64() { } /// VPMOVSXWQ xmm1 {k1}{z}, m32 /// The native signature does not exist. We provide this additional overload for completeness. /// - [RequiresUnsafe] public static unsafe Vector128 ConvertToVector128Int64(short* address) { throw new PlatformNotSupportedException(); } /// /// PMOVZXWQ xmm1, m32 @@ -368,7 +359,6 @@ internal X64() { } /// VPMOVZXWQ xmm1 {k1}{z}, m32 /// The native signature does not exist. We provide this additional overload for completeness. /// - [RequiresUnsafe] public static unsafe Vector128 ConvertToVector128Int64(ushort* address) { throw new PlatformNotSupportedException(); } /// /// PMOVSXDQ xmm1, m64 @@ -376,7 +366,6 @@ internal X64() { } /// VPMOVSXDQ xmm1 {k1}{z}, m64 /// The native signature does not exist. We provide this additional overload for completeness. /// - [RequiresUnsafe] public static unsafe Vector128 ConvertToVector128Int64(int* address) { throw new PlatformNotSupportedException(); } /// /// PMOVZXDQ xmm1, m64 @@ -384,7 +373,6 @@ internal X64() { } /// VPMOVZXDQ xmm1 {k1}{z}, m64 /// The native signature does not exist. We provide this additional overload for completeness. /// - [RequiresUnsafe] public static unsafe Vector128 ConvertToVector128Int64(uint* address) { throw new PlatformNotSupportedException(); } /// @@ -501,56 +489,48 @@ internal X64() { } /// MOVNTDQA xmm1, m128 /// VMOVNTDQA xmm1, m128 /// - [RequiresUnsafe] public static unsafe Vector128 LoadAlignedVector128NonTemporal(sbyte* address) { throw new PlatformNotSupportedException(); } /// /// __m128i _mm_stream_load_si128 (const __m128i* mem_addr) /// MOVNTDQA xmm1, m128 /// VMOVNTDQA xmm1, m128 /// - [RequiresUnsafe] public static unsafe Vector128 LoadAlignedVector128NonTemporal(byte* address) { throw new PlatformNotSupportedException(); } /// /// __m128i _mm_stream_load_si128 (const __m128i* mem_addr) /// MOVNTDQA xmm1, m128 /// VMOVNTDQA xmm1, m128 /// - [RequiresUnsafe] public static unsafe Vector128 LoadAlignedVector128NonTemporal(short* address) { throw new PlatformNotSupportedException(); } /// /// __m128i _mm_stream_load_si128 (const __m128i* mem_addr) /// MOVNTDQA xmm1, m128 /// VMOVNTDQA xmm1, m128 /// - [RequiresUnsafe] public static unsafe Vector128 LoadAlignedVector128NonTemporal(ushort* address) { throw new PlatformNotSupportedException(); } /// /// __m128i _mm_stream_load_si128 (const __m128i* mem_addr) /// MOVNTDQA xmm1, m128 /// VMOVNTDQA xmm1, m128 /// - [RequiresUnsafe] public static unsafe Vector128 LoadAlignedVector128NonTemporal(int* address) { throw new PlatformNotSupportedException(); } /// /// __m128i _mm_stream_load_si128 (const __m128i* mem_addr) /// MOVNTDQA xmm1, m128 /// VMOVNTDQA xmm1, m128 /// - [RequiresUnsafe] public static unsafe Vector128 LoadAlignedVector128NonTemporal(uint* address) { throw new PlatformNotSupportedException(); } /// /// __m128i _mm_stream_load_si128 (const __m128i* mem_addr) /// MOVNTDQA xmm1, m128 /// VMOVNTDQA xmm1, m128 /// - [RequiresUnsafe] public static unsafe Vector128 LoadAlignedVector128NonTemporal(long* address) { throw new PlatformNotSupportedException(); } /// /// __m128i _mm_stream_load_si128 (const __m128i* mem_addr) /// MOVNTDQA xmm1, m128 /// VMOVNTDQA xmm1, m128 /// - [RequiresUnsafe] public static unsafe Vector128 LoadAlignedVector128NonTemporal(ulong* address) { throw new PlatformNotSupportedException(); } /// diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Sse41.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Sse41.cs index 8d438194e37b59..124f0958adfbbd 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Sse41.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Sse41.cs @@ -296,7 +296,6 @@ internal X64() { } /// VPMOVSXBW xmm1 {k1}{z}, m64 /// The native signature does not exist. We provide this additional overload for completeness. /// - [RequiresUnsafe] public static unsafe Vector128 ConvertToVector128Int16(sbyte* address) => ConvertToVector128Int16(address); /// @@ -305,7 +304,6 @@ internal X64() { } /// VPMOVZXBW xmm1 {k1}{z}, m64 /// The native signature does not exist. We provide this additional overload for completeness. /// - [RequiresUnsafe] public static unsafe Vector128 ConvertToVector128Int16(byte* address) => ConvertToVector128Int16(address); /// @@ -314,7 +312,6 @@ internal X64() { } /// VPMOVSXBD xmm1 {k1}{z}, m32 /// The native signature does not exist. We provide this additional overload for completeness. /// - [RequiresUnsafe] public static unsafe Vector128 ConvertToVector128Int32(sbyte* address) => ConvertToVector128Int32(address); /// @@ -323,7 +320,6 @@ internal X64() { } /// VPMOVZXBD xmm1 {k1}{z}, m32 /// The native signature does not exist. We provide this additional overload for completeness. /// - [RequiresUnsafe] public static unsafe Vector128 ConvertToVector128Int32(byte* address) => ConvertToVector128Int32(address); /// @@ -332,7 +328,6 @@ internal X64() { } /// VPMOVSXWD xmm1 {k1}{z}, m64 /// The native signature does not exist. We provide this additional overload for completeness. /// - [RequiresUnsafe] public static unsafe Vector128 ConvertToVector128Int32(short* address) => ConvertToVector128Int32(address); /// @@ -341,7 +336,6 @@ internal X64() { } /// VPMOVZXWD xmm1 {k1}{z}, m64 /// The native signature does not exist. We provide this additional overload for completeness. /// - [RequiresUnsafe] public static unsafe Vector128 ConvertToVector128Int32(ushort* address) => ConvertToVector128Int32(address); /// @@ -350,7 +344,6 @@ internal X64() { } /// VPMOVSXBQ xmm1 {k1}{z}, m16 /// The native signature does not exist. We provide this additional overload for completeness. /// - [RequiresUnsafe] public static unsafe Vector128 ConvertToVector128Int64(sbyte* address) => ConvertToVector128Int64(address); /// @@ -359,7 +352,6 @@ internal X64() { } /// VPMOVZXBQ xmm1 {k1}{z}, m16 /// The native signature does not exist. We provide this additional overload for completeness. /// - [RequiresUnsafe] public static unsafe Vector128 ConvertToVector128Int64(byte* address) => ConvertToVector128Int64(address); /// @@ -368,7 +360,6 @@ internal X64() { } /// VPMOVSXWQ xmm1 {k1}{z}, m32 /// The native signature does not exist. We provide this additional overload for completeness. /// - [RequiresUnsafe] public static unsafe Vector128 ConvertToVector128Int64(short* address) => ConvertToVector128Int64(address); /// @@ -377,7 +368,6 @@ internal X64() { } /// VPMOVZXWQ xmm1 {k1}{z}, m32 /// The native signature does not exist. We provide this additional overload for completeness. /// - [RequiresUnsafe] public static unsafe Vector128 ConvertToVector128Int64(ushort* address) => ConvertToVector128Int64(address); /// @@ -386,7 +376,6 @@ internal X64() { } /// VPMOVSXDQ xmm1 {k1}{z}, m64 /// The native signature does not exist. We provide this additional overload for completeness. /// - [RequiresUnsafe] public static unsafe Vector128 ConvertToVector128Int64(int* address) => ConvertToVector128Int64(address); /// @@ -395,7 +384,6 @@ internal X64() { } /// VPMOVZXDQ xmm1 {k1}{z}, m64 /// The native signature does not exist. We provide this additional overload for completeness. /// - [RequiresUnsafe] public static unsafe Vector128 ConvertToVector128Int64(uint* address) => ConvertToVector128Int64(address); /// @@ -512,7 +500,6 @@ internal X64() { } /// MOVNTDQA xmm1, m128 /// VMOVNTDQA xmm1, m128 /// - [RequiresUnsafe] public static unsafe Vector128 LoadAlignedVector128NonTemporal(sbyte* address) => LoadAlignedVector128NonTemporal(address); /// @@ -520,7 +507,6 @@ internal X64() { } /// MOVNTDQA xmm1, m128 /// VMOVNTDQA xmm1, m128 /// - [RequiresUnsafe] public static unsafe Vector128 LoadAlignedVector128NonTemporal(byte* address) => LoadAlignedVector128NonTemporal(address); /// @@ -528,7 +514,6 @@ internal X64() { } /// MOVNTDQA xmm1, m128 /// VMOVNTDQA xmm1, m128 /// - [RequiresUnsafe] public static unsafe Vector128 LoadAlignedVector128NonTemporal(short* address) => LoadAlignedVector128NonTemporal(address); /// @@ -536,7 +521,6 @@ internal X64() { } /// MOVNTDQA xmm1, m128 /// VMOVNTDQA xmm1, m128 /// - [RequiresUnsafe] public static unsafe Vector128 LoadAlignedVector128NonTemporal(ushort* address) => LoadAlignedVector128NonTemporal(address); /// @@ -544,7 +528,6 @@ internal X64() { } /// MOVNTDQA xmm1, m128 /// VMOVNTDQA xmm1, m128 /// - [RequiresUnsafe] public static unsafe Vector128 LoadAlignedVector128NonTemporal(int* address) => LoadAlignedVector128NonTemporal(address); /// @@ -552,7 +535,6 @@ internal X64() { } /// MOVNTDQA xmm1, m128 /// VMOVNTDQA xmm1, m128 /// - [RequiresUnsafe] public static unsafe Vector128 LoadAlignedVector128NonTemporal(uint* address) => LoadAlignedVector128NonTemporal(address); /// @@ -560,7 +542,6 @@ internal X64() { } /// MOVNTDQA xmm1, m128 /// VMOVNTDQA xmm1, m128 /// - [RequiresUnsafe] public static unsafe Vector128 LoadAlignedVector128NonTemporal(long* address) => LoadAlignedVector128NonTemporal(address); /// @@ -568,7 +549,6 @@ internal X64() { } /// MOVNTDQA xmm1, m128 /// VMOVNTDQA xmm1, m128 /// - [RequiresUnsafe] public static unsafe Vector128 LoadAlignedVector128NonTemporal(ulong* address) => LoadAlignedVector128NonTemporal(address); /// diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/X86Base.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/X86Base.cs index 4136d73dec770b..b73e804f70c36b 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/X86Base.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/X86Base.cs @@ -106,7 +106,6 @@ public static unsafe (int Eax, int Ebx, int Ecx, int Edx) CpuId(int functionId, private static extern unsafe void CpuId(int* cpuInfo, int functionId, int subFunctionId); #else [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "X86Base_CpuId")] - [RequiresUnsafe] private static unsafe partial void CpuId(int* cpuInfo, int functionId, int subFunctionId); #endif diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Loader/AssemblyLoadContext.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Loader/AssemblyLoadContext.cs index 77ded38e110557..3f6bc66656ff64 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Loader/AssemblyLoadContext.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Loader/AssemblyLoadContext.cs @@ -740,7 +740,6 @@ internal static void InvokeAssemblyLoadEvent(Assembly assembly) // These methods provide efficient reverse P/Invoke entry points for the VM. [UnmanagedCallersOnly] - [RequiresUnsafe] private static unsafe void OnAssemblyLoad(RuntimeAssembly* pAssembly, Exception* pException) { try @@ -754,7 +753,6 @@ private static unsafe void OnAssemblyLoad(RuntimeAssembly* pAssembly, Exception* } [UnmanagedCallersOnly] - [RequiresUnsafe] private static unsafe void OnTypeResolve(RuntimeAssembly* pAssembly, byte* typeName, RuntimeAssembly* ppResult, Exception* pException) { try @@ -769,7 +767,6 @@ private static unsafe void OnTypeResolve(RuntimeAssembly* pAssembly, byte* typeN } [UnmanagedCallersOnly] - [RequiresUnsafe] private static unsafe void OnResourceResolve(RuntimeAssembly* pAssembly, byte* resourceName, RuntimeAssembly* ppResult, Exception* pException) { try @@ -784,7 +781,6 @@ private static unsafe void OnResourceResolve(RuntimeAssembly* pAssembly, byte* r } [UnmanagedCallersOnly] - [RequiresUnsafe] private static unsafe void OnAssemblyResolve(RuntimeAssembly* pAssembly, char* assemblyFullName, RuntimeAssembly* ppResult, Exception* pException) { try @@ -798,7 +794,6 @@ private static unsafe void OnAssemblyResolve(RuntimeAssembly* pAssembly, char* a } [UnmanagedCallersOnly] - [RequiresUnsafe] private static unsafe void Resolve(IntPtr gchAssemblyLoadContext, AssemblyName* pAssemblyName, Assembly* ppResult, Exception* pException) { try @@ -813,7 +808,6 @@ private static unsafe void Resolve(IntPtr gchAssemblyLoadContext, AssemblyName* } [UnmanagedCallersOnly] - [RequiresUnsafe] private static unsafe void ResolveSatelliteAssembly(IntPtr gchAssemblyLoadContext, AssemblyName* pAssemblyName, Assembly* ppResult, Exception* pException) { try @@ -828,7 +822,6 @@ private static unsafe void ResolveSatelliteAssembly(IntPtr gchAssemblyLoadContex } [UnmanagedCallersOnly] - [RequiresUnsafe] private static unsafe void ResolveUsingEvent(IntPtr gchAssemblyLoadContext, AssemblyName* pAssemblyName, Assembly* ppResult, Exception* pException) { try diff --git a/src/libraries/System.Private.CoreLib/src/System/SearchValues/IndexOfAnyAsciiSearcher.cs b/src/libraries/System.Private.CoreLib/src/System/SearchValues/IndexOfAnyAsciiSearcher.cs index bc3cdfb9928ae7..179155cee5ea55 100644 --- a/src/libraries/System.Private.CoreLib/src/System/SearchValues/IndexOfAnyAsciiSearcher.cs +++ b/src/libraries/System.Private.CoreLib/src/System/SearchValues/IndexOfAnyAsciiSearcher.cs @@ -34,7 +34,6 @@ public readonly struct AnyByteState(Vector128 bitmap0, Vector128 bit internal static bool IsVectorizationSupported => Ssse3.IsSupported || AdvSimd.Arm64.IsSupported || PackedSimd.IsSupported; [MethodImpl(MethodImplOptions.AggressiveInlining)] - [RequiresUnsafe] private static unsafe void SetBitmapBit(byte* bitmap, int value) { Debug.Assert((uint)value <= 127); @@ -171,7 +170,6 @@ public static void ComputeUniqueLowNibbleState(ReadOnlySpan values, out As } [MethodImpl(MethodImplOptions.AggressiveInlining)] - [RequiresUnsafe] private static unsafe bool TryComputeBitmap(ReadOnlySpan values, byte* bitmap, out bool needleContainsZero) { byte* bitmapLocal = bitmap; // https://github.com/dotnet/runtime/issues/9040 diff --git a/src/libraries/System.Private.CoreLib/src/System/SearchValues/ProbabilisticMapState.cs b/src/libraries/System.Private.CoreLib/src/System/SearchValues/ProbabilisticMapState.cs index 934f34ecceb7c4..9d3f5bdab68e0d 100644 --- a/src/libraries/System.Private.CoreLib/src/System/SearchValues/ProbabilisticMapState.cs +++ b/src/libraries/System.Private.CoreLib/src/System/SearchValues/ProbabilisticMapState.cs @@ -52,7 +52,6 @@ public ProbabilisticMapState(ReadOnlySpan values, int maxInclusive) } // valuesPtr must remain valid for as long as this ProbabilisticMapState is used. - [RequiresUnsafe] public ProbabilisticMapState(ReadOnlySpan* valuesPtr) { Debug.Assert((IntPtr)valuesPtr != IntPtr.Zero); diff --git a/src/libraries/System.Private.CoreLib/src/System/Security/SecureString.cs b/src/libraries/System.Private.CoreLib/src/System/Security/SecureString.cs index bdb0d3dba5e985..94220b165bed0e 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Security/SecureString.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Security/SecureString.cs @@ -23,7 +23,6 @@ public SecureString() } [CLSCompliant(false)] - [RequiresUnsafe] public unsafe SecureString(char* value, int length) { ArgumentNullException.ThrowIfNull(value); diff --git a/src/libraries/System.Private.CoreLib/src/System/Span.cs b/src/libraries/System.Private.CoreLib/src/System/Span.cs index 399e82f5a541cb..979eee3d5d9536 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Span.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Span.cs @@ -106,7 +106,6 @@ public Span(T[]? array, int start, int length) /// [CLSCompliant(false)] [MethodImpl(MethodImplOptions.AggressiveInlining)] - [RequiresUnsafe] public unsafe Span(void* pointer, int length) { if (RuntimeHelpers.IsReferenceOrContainsReferences()) diff --git a/src/libraries/System.Private.CoreLib/src/System/SpanHelpers.Byte.cs b/src/libraries/System.Private.CoreLib/src/System/SpanHelpers.Byte.cs index e7194f4098ed50..31f9ba48151b8c 100644 --- a/src/libraries/System.Private.CoreLib/src/System/SpanHelpers.Byte.cs +++ b/src/libraries/System.Private.CoreLib/src/System/SpanHelpers.Byte.cs @@ -450,7 +450,6 @@ private static void ThrowMustBeNullTerminatedString() // IndexOfNullByte processes memory in aligned chunks, and thus it won't crash even if it accesses memory beyond the null terminator. // This behavior is an implementation detail of the runtime and callers outside System.Private.CoreLib must not depend on it. - [RequiresUnsafe] internal static unsafe int IndexOfNullByte(byte* searchSpace) { const int Length = int.MaxValue; diff --git a/src/libraries/System.Private.CoreLib/src/System/SpanHelpers.ByteMemOps.cs b/src/libraries/System.Private.CoreLib/src/System/SpanHelpers.ByteMemOps.cs index 1a40b32c6d0ca0..eba91cc493502a 100644 --- a/src/libraries/System.Private.CoreLib/src/System/SpanHelpers.ByteMemOps.cs +++ b/src/libraries/System.Private.CoreLib/src/System/SpanHelpers.ByteMemOps.cs @@ -262,7 +262,6 @@ private static unsafe void MemmoveNative(ref byte dest, ref byte src, nuint len) #pragma warning disable CS3016 // Arrays as attribute arguments is not CLS-compliant [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "memmove")] [UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])] - [RequiresUnsafe] private static unsafe partial void* memmove(void* dest, void* src, nuint len); #pragma warning restore CS3016 #endif @@ -486,7 +485,6 @@ private static unsafe void ZeroMemoryNative(ref byte b, nuint byteLength) #pragma warning disable CS3016 // Arrays as attribute arguments is not CLS-compliant [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "memset")] [UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])] - [RequiresUnsafe] private static unsafe partial void* memset(void* dest, int value, nuint len); #pragma warning restore CS3016 #endif diff --git a/src/libraries/System.Private.CoreLib/src/System/SpanHelpers.Char.cs b/src/libraries/System.Private.CoreLib/src/System/SpanHelpers.Char.cs index a2b5ff8456c87f..2715e1d9e6d16c 100644 --- a/src/libraries/System.Private.CoreLib/src/System/SpanHelpers.Char.cs +++ b/src/libraries/System.Private.CoreLib/src/System/SpanHelpers.Char.cs @@ -529,7 +529,6 @@ public static unsafe int SequenceCompareTo(ref char first, int firstLength, ref // IndexOfNullCharacter processes memory in aligned chunks, and thus it won't crash even if it accesses memory beyond the null terminator. // This behavior is an implementation detail of the runtime and callers outside System.Private.CoreLib must not depend on it. - [RequiresUnsafe] public static unsafe int IndexOfNullCharacter(char* searchSpace) { const char value = '\0'; diff --git a/src/libraries/System.Private.CoreLib/src/System/StartupHookProvider.cs b/src/libraries/System.Private.CoreLib/src/System/StartupHookProvider.cs index 83360801a6dc08..5d56c15849c1c4 100644 --- a/src/libraries/System.Private.CoreLib/src/System/StartupHookProvider.cs +++ b/src/libraries/System.Private.CoreLib/src/System/StartupHookProvider.cs @@ -71,7 +71,6 @@ private static void ProcessStartupHooks(string diagnosticStartupHooks) // and call the hook. [UnconditionalSuppressMessageAttribute("ReflectionAnalysis", "IL2026:RequiresUnreferencedCode", Justification = "An ILLink warning when trimming an app with System.StartupHookProvider.IsSupported=true already exists for ProcessStartupHooks.")] - [RequiresUnsafe] private static unsafe void CallStartupHook(char* pStartupHookPart) { if (!IsSupported) @@ -88,7 +87,6 @@ private static unsafe void CallStartupHook(char* pStartupHookPart) #if CORECLR [UnmanagedCallersOnly] - [RequiresUnsafe] private static unsafe void CallStartupHook(char* pStartupHookPart, Exception* pException) { try diff --git a/src/libraries/System.Private.CoreLib/src/System/String.Manipulation.cs b/src/libraries/System.Private.CoreLib/src/System/String.Manipulation.cs index 343cf7bc9734d8..d9d03cf0666b54 100644 --- a/src/libraries/System.Private.CoreLib/src/System/String.Manipulation.cs +++ b/src/libraries/System.Private.CoreLib/src/System/String.Manipulation.cs @@ -2662,7 +2662,6 @@ private string TrimWhiteSpaceHelper(TrimType trimType) return CreateTrimmedString(start, end); } - [RequiresUnsafe] private unsafe string TrimHelper(char* trimChars, int trimCharsLength, TrimType trimType) { Debug.Assert(trimChars != null); diff --git a/src/libraries/System.Private.CoreLib/src/System/String.cs b/src/libraries/System.Private.CoreLib/src/System/String.cs index 8121cab2050dfc..234f5e61529ad2 100644 --- a/src/libraries/System.Private.CoreLib/src/System/String.cs +++ b/src/libraries/System.Private.CoreLib/src/System/String.cs @@ -116,13 +116,11 @@ private static string Ctor(char[] value, int startIndex, int length) [CLSCompliant(false)] [MethodImpl(MethodImplOptions.InternalCall)] - [RequiresUnsafe] #if MONO [DynamicDependency("Ctor(System.Char*)")] #endif public extern unsafe String(char* value); - [RequiresUnsafe] private static unsafe string Ctor(char* ptr) { if (ptr == null) @@ -144,13 +142,11 @@ private static unsafe string Ctor(char* ptr) [CLSCompliant(false)] [MethodImpl(MethodImplOptions.InternalCall)] - [RequiresUnsafe] #if MONO [DynamicDependency("Ctor(System.Char*,System.Int32,System.Int32)")] #endif public extern unsafe String(char* value, int startIndex, int length); - [RequiresUnsafe] private static unsafe string Ctor(char* ptr, int startIndex, int length) { ArgumentOutOfRangeException.ThrowIfNegative(length); @@ -180,13 +176,11 @@ private static unsafe string Ctor(char* ptr, int startIndex, int length) [CLSCompliant(false)] [MethodImpl(MethodImplOptions.InternalCall)] - [RequiresUnsafe] #if MONO [DynamicDependency("Ctor(System.SByte*)")] #endif public extern unsafe String(sbyte* value); - [RequiresUnsafe] private static unsafe string Ctor(sbyte* value) { byte* pb = (byte*)value; @@ -200,13 +194,11 @@ private static unsafe string Ctor(sbyte* value) [CLSCompliant(false)] [MethodImpl(MethodImplOptions.InternalCall)] - [RequiresUnsafe] #if MONO [DynamicDependency("Ctor(System.SByte*,System.Int32,System.Int32)")] #endif public extern unsafe String(sbyte* value, int startIndex, int length); - [RequiresUnsafe] private static unsafe string Ctor(sbyte* value, int startIndex, int length) { ArgumentOutOfRangeException.ThrowIfNegative(startIndex); @@ -230,7 +222,6 @@ private static unsafe string Ctor(sbyte* value, int startIndex, int length) } // Encoder for String..ctor(sbyte*) and String..ctor(sbyte*, int, int) - [RequiresUnsafe] private static unsafe string CreateStringForSByteConstructor(byte* pb, int numBytes) { Debug.Assert(numBytes >= 0); @@ -259,13 +250,11 @@ private static unsafe string CreateStringForSByteConstructor(byte* pb, int numBy [CLSCompliant(false)] [MethodImpl(MethodImplOptions.InternalCall)] - [RequiresUnsafe] #if MONO [DynamicDependency("Ctor(System.SByte*,System.Int32,System.Int32,System.Text.Encoding)")] #endif public extern unsafe String(sbyte* value, int startIndex, int length, Encoding enc); - [RequiresUnsafe] private static unsafe string Ctor(sbyte* value, int startIndex, int length, Encoding? enc) { if (enc == null) @@ -541,7 +530,6 @@ public static bool IsNullOrWhiteSpace([NotNullWhen(false)] string? value) // Helper for encodings so they can talk to our buffer directly // stringLength must be the exact size we'll expect - [RequiresUnsafe] internal static unsafe string CreateStringFromEncoding( byte* bytes, int byteLength, Encoding encoding) { @@ -624,10 +612,8 @@ public StringRuneEnumerator EnumerateRunes() return new StringRuneEnumerator(this); } - [RequiresUnsafe] internal static unsafe int wcslen(char* ptr) => SpanHelpers.IndexOfNullCharacter(ptr); - [RequiresUnsafe] internal static unsafe int strlen(byte* ptr) => SpanHelpers.IndexOfNullByte(ptr); // diff --git a/src/libraries/System.Private.CoreLib/src/System/Text/ASCIIEncoding.cs b/src/libraries/System.Private.CoreLib/src/System/Text/ASCIIEncoding.cs index dbc7404a44aca8..7c8a7aff98d520 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Text/ASCIIEncoding.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Text/ASCIIEncoding.cs @@ -123,7 +123,6 @@ public override unsafe int GetByteCount(string chars) // EncodingNLS, UTF7Encoding, UTF8Encoding, UTF32Encoding, ASCIIEncoding, UnicodeEncoding [CLSCompliant(false)] - [RequiresUnsafe] public override unsafe int GetByteCount(char* chars, int count) { if (chars is null) @@ -150,7 +149,6 @@ public override unsafe int GetByteCount(ReadOnlySpan chars) } [MethodImpl(MethodImplOptions.AggressiveInlining)] - [RequiresUnsafe] private unsafe int GetByteCountCommon(char* pChars, int charCount) { // Common helper method for all non-EncoderNLS entry points to GetByteCount. @@ -180,7 +178,6 @@ private unsafe int GetByteCountCommon(char* pChars, int charCount) } [MethodImpl(MethodImplOptions.AggressiveInlining)] // called directly by GetByteCountCommon - [RequiresUnsafe] private protected sealed override unsafe int GetByteCountFast(char* pChars, int charsLength, EncoderFallback? fallback, out int charsConsumed) { // First: Can we short-circuit the entire calculation? @@ -296,7 +293,6 @@ public override unsafe int GetBytes(char[] chars, int charIndex, int charCount, // EncodingNLS, UTF7Encoding, UTF8Encoding, UTF32Encoding, ASCIIEncoding, UnicodeEncoding [CLSCompliant(false)] - [RequiresUnsafe] public override unsafe int GetBytes(char* chars, int charCount, byte* bytes, int byteCount) { if (chars is null || bytes is null) @@ -346,7 +342,6 @@ public override unsafe bool TryGetBytes(ReadOnlySpan chars, Span byt } [MethodImpl(MethodImplOptions.AggressiveInlining)] - [RequiresUnsafe] private unsafe int GetBytesCommon(char* pChars, int charCount, byte* pBytes, int byteCount, bool throwForDestinationOverflow = true) { // Common helper method for all non-EncoderNLS entry points to GetBytes. @@ -376,7 +371,6 @@ private unsafe int GetBytesCommon(char* pChars, int charCount, byte* pBytes, int } [MethodImpl(MethodImplOptions.AggressiveInlining)] // called directly by GetBytesCommon - [RequiresUnsafe] private protected sealed override unsafe int GetBytesFast(char* pChars, int charsLength, byte* pBytes, int bytesLength, out int charsConsumed) { int bytesWritten = (int)Ascii.NarrowUtf16ToAscii(pChars, pBytes, (uint)Math.Min(charsLength, bytesLength)); @@ -471,7 +465,6 @@ public override unsafe int GetCharCount(byte[] bytes, int index, int count) // EncodingNLS, UTF7Encoding, UTF8Encoding, UTF32Encoding, ASCIIEncoding, UnicodeEncoding [CLSCompliant(false)] - [RequiresUnsafe] public override unsafe int GetCharCount(byte* bytes, int count) { if (bytes is null) @@ -498,7 +491,6 @@ public override unsafe int GetCharCount(ReadOnlySpan bytes) } [MethodImpl(MethodImplOptions.AggressiveInlining)] - [RequiresUnsafe] private unsafe int GetCharCountCommon(byte* pBytes, int byteCount) { // Common helper method for all non-DecoderNLS entry points to GetCharCount. @@ -528,7 +520,6 @@ private unsafe int GetCharCountCommon(byte* pBytes, int byteCount) } [MethodImpl(MethodImplOptions.AggressiveInlining)] // called directly by GetCharCountCommon - [RequiresUnsafe] private protected sealed override unsafe int GetCharCountFast(byte* pBytes, int bytesLength, DecoderFallback? fallback, out int bytesConsumed) { // First: Can we short-circuit the entire calculation? @@ -593,7 +584,6 @@ public override unsafe int GetChars(byte[] bytes, int byteIndex, int byteCount, // EncodingNLS, UTF7Encoding, UTF8Encoding, UTF32Encoding, ASCIIEncoding, UnicodeEncoding [CLSCompliant(false)] - [RequiresUnsafe] public override unsafe int GetChars(byte* bytes, int byteCount, char* chars, int charCount) { if (bytes is null || chars is null) @@ -643,7 +633,6 @@ public override unsafe bool TryGetChars(ReadOnlySpan bytes, Span cha } [MethodImpl(MethodImplOptions.AggressiveInlining)] - [RequiresUnsafe] private unsafe int GetCharsCommon(byte* pBytes, int byteCount, char* pChars, int charCount, bool throwForDestinationOverflow = true) { // Common helper method for all non-DecoderNLS entry points to GetChars. @@ -673,7 +662,6 @@ private unsafe int GetCharsCommon(byte* pBytes, int byteCount, char* pChars, int } [MethodImpl(MethodImplOptions.AggressiveInlining)] // called directly by GetCharsCommon - [RequiresUnsafe] private protected sealed override unsafe int GetCharsFast(byte* pBytes, int bytesLength, char* pChars, int charsLength, out int bytesConsumed) { bytesConsumed = (int)Ascii.WidenAsciiToUtf16(pBytes, pChars, (uint)Math.Min(charsLength, bytesLength)); diff --git a/src/libraries/System.Private.CoreLib/src/System/Text/Ascii.CaseConversion.cs b/src/libraries/System.Private.CoreLib/src/System/Text/Ascii.CaseConversion.cs index 2cda2c3971adc5..bfb98d524e273c 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Text/Ascii.CaseConversion.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Text/Ascii.CaseConversion.cs @@ -204,7 +204,6 @@ private static unsafe OperationStatus ChangeCase(Span buffer, out } } - [RequiresUnsafe] private static unsafe nuint ChangeCase(TFrom* pSrc, TTo* pDest, nuint elementCount) where TFrom : unmanaged, IBinaryInteger where TTo : unmanaged, IBinaryInteger @@ -466,7 +465,6 @@ private static unsafe nuint ChangeCase(TFrom* pSrc, TTo* pD } [MethodImpl(MethodImplOptions.AggressiveInlining)] - [RequiresUnsafe] private static unsafe void ChangeWidthAndWriteTo(Vector128 vector, TTo* pDest, nuint elementOffset) where TFrom : unmanaged where TTo : unmanaged diff --git a/src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs b/src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs index dfe3a7636f5476..92b4468a79d246 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs @@ -105,7 +105,6 @@ private static bool FirstCharInUInt32IsAscii(uint value) /// /// An ASCII byte is defined as 0x00 - 0x7F, inclusive. [MethodImpl(MethodImplOptions.AggressiveInlining)] - [RequiresUnsafe] internal static unsafe nuint GetIndexOfFirstNonAsciiByte(byte* pBuffer, nuint bufferLength) { // If 256/512-bit aren't supported but SSE2 is supported, use those specific intrinsics instead of @@ -128,7 +127,6 @@ internal static unsafe nuint GetIndexOfFirstNonAsciiByte(byte* pBuffer, nuint bu } } - [RequiresUnsafe] private static unsafe nuint GetIndexOfFirstNonAsciiByte_Vector(byte* pBuffer, nuint bufferLength) { // Squirrel away the original buffer reference. This method works by determining the exact @@ -365,7 +363,6 @@ private static bool ContainsNonAsciiByte_AdvSimd(uint advSimdIndex) return advSimdIndex < 16; } - [RequiresUnsafe] private static unsafe nuint GetIndexOfFirstNonAsciiByte_Intrinsified(byte* pBuffer, nuint bufferLength) { // JIT turns the below into constants @@ -731,7 +728,6 @@ private static unsafe nuint GetIndexOfFirstNonAsciiByte_Intrinsified(byte* pBuff /// /// An ASCII char is defined as 0x0000 - 0x007F, inclusive. [MethodImpl(MethodImplOptions.AggressiveInlining)] - [RequiresUnsafe] internal static unsafe nuint GetIndexOfFirstNonAsciiChar(char* pBuffer, nuint bufferLength /* in chars */) { // If 256/512-bit aren't supported but SSE2/ASIMD is supported, use those specific intrinsics instead of @@ -754,7 +750,6 @@ internal static unsafe nuint GetIndexOfFirstNonAsciiChar(char* pBuffer, nuint bu } } - [RequiresUnsafe] private static unsafe nuint GetIndexOfFirstNonAsciiChar_Vector(char* pBuffer, nuint bufferLength /* in chars */) { // Squirrel away the original buffer reference.This method works by determining the exact @@ -960,7 +955,6 @@ private static unsafe nuint GetIndexOfFirstNonAsciiChar_Vector(char* pBuffer, nu } #if NET - [RequiresUnsafe] private static unsafe nuint GetIndexOfFirstNonAsciiChar_Intrinsified(char* pBuffer, nuint bufferLength /* in chars */) { // This method contains logic optimized using vector instructions for both x64 and Arm64. @@ -1349,7 +1343,6 @@ private static void NarrowTwoUtf16CharsToAsciiAndWriteToBuffer(ref byte outputBu /// or once elements have been converted. Returns the total number /// of elements that were able to be converted. /// - [RequiresUnsafe] internal static unsafe nuint NarrowUtf16ToAscii(char* pUtf16Buffer, byte* pAsciiBuffer, nuint elementCount) { nuint currentOffset = 0; @@ -1716,7 +1709,6 @@ internal static Vector512 ExtractAsciiVector(Vector512 vectorFirst } [MethodImpl(MethodImplOptions.AggressiveInlining)] - [RequiresUnsafe] private static unsafe nuint NarrowUtf16ToAscii_Intrinsified(char* pUtf16Buffer, byte* pAsciiBuffer, nuint elementCount) { // This method contains logic optimized using vector instructions for both x64 and Arm64. @@ -1836,7 +1828,6 @@ private static unsafe nuint NarrowUtf16ToAscii_Intrinsified(char* pUtf16Buffer, } [MethodImpl(MethodImplOptions.AggressiveInlining)] - [RequiresUnsafe] private static unsafe nuint NarrowUtf16ToAscii_Intrinsified_256(char* pUtf16Buffer, byte* pAsciiBuffer, nuint elementCount) { // This method contains logic optimized using vector instructions for x64 only. @@ -1954,7 +1945,6 @@ private static unsafe nuint NarrowUtf16ToAscii_Intrinsified_256(char* pUtf16Buff } [MethodImpl(MethodImplOptions.AggressiveInlining)] - [RequiresUnsafe] private static unsafe nuint NarrowUtf16ToAscii_Intrinsified_512(char* pUtf16Buffer, byte* pAsciiBuffer, nuint elementCount) { // This method contains logic optimized using vector instructions for x64 only. @@ -2079,7 +2069,6 @@ private static unsafe nuint NarrowUtf16ToAscii_Intrinsified_512(char* pUtf16Buff /// or once elements have been converted. Returns the total number /// of elements that were able to be converted. /// - [RequiresUnsafe] internal static unsafe nuint WidenAsciiToUtf16(byte* pAsciiBuffer, char* pUtf16Buffer, nuint elementCount) { // Intrinsified in mono interpreter @@ -2203,7 +2192,6 @@ internal static unsafe nuint WidenAsciiToUtf16(byte* pAsciiBuffer, char* pUtf16B #if NET [MethodImpl(MethodImplOptions.AggressiveInlining)] - [RequiresUnsafe] private static unsafe void WidenAsciiToUtf1_Vector(byte* pAsciiBuffer, char* pUtf16Buffer, ref nuint currentOffset, nuint elementCount) where TVectorByte : unmanaged, ISimdVector where TVectorUInt16 : unmanaged, ISimdVector diff --git a/src/libraries/System.Private.CoreLib/src/System/Text/Decoder.cs b/src/libraries/System.Private.CoreLib/src/System/Text/Decoder.cs index 7d07dc2c5a10cb..45470e8c52d5aa 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Text/Decoder.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Text/Decoder.cs @@ -95,7 +95,6 @@ public virtual int GetCharCount(byte[] bytes, int index, int count, bool flush) // We expect this to be the workhorse for NLS Encodings, but for existing // ones we need a working (if slow) default implementation) [CLSCompliant(false)] - [RequiresUnsafe] public virtual unsafe int GetCharCount(byte* bytes, int count, bool flush) { ArgumentNullException.ThrowIfNull(bytes); @@ -157,7 +156,6 @@ public virtual int GetChars(byte[] bytes, int byteIndex, int byteCount, // could easily overflow our output buffer. Therefore we do an extra test // when we copy the buffer so that we don't overflow charCount either. [CLSCompliant(false)] - [RequiresUnsafe] public virtual unsafe int GetChars(byte* bytes, int byteCount, char* chars, int charCount, bool flush) { @@ -269,7 +267,6 @@ public virtual void Convert(byte[] bytes, int byteIndex, int byteCount, // that its likely that we didn't consume as many bytes as we could have. For some // applications this could be slow. (Like trying to exactly fill an output buffer from a bigger stream) [CLSCompliant(false)] - [RequiresUnsafe] public virtual unsafe void Convert(byte* bytes, int byteCount, char* chars, int charCount, bool flush, out int bytesUsed, out int charsUsed, out bool completed) diff --git a/src/libraries/System.Private.CoreLib/src/System/Text/DecoderFallback.cs b/src/libraries/System.Private.CoreLib/src/System/Text/DecoderFallback.cs index 7423d471f9f0a9..9fc078443f6902 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Text/DecoderFallback.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Text/DecoderFallback.cs @@ -74,7 +74,6 @@ internal unsafe void InternalReset() // Set the above values // This can't be part of the constructor because DecoderFallbacks would have to know how to implement these. - [RequiresUnsafe] internal unsafe void InternalInitialize(byte* byteStart, char* charEnd) { this.byteStart = byteStart; @@ -105,7 +104,6 @@ internal static DecoderFallbackBuffer CreateAndInitialize(Encoding encoding, Dec // Right now this has both bytes and bytes[], since we might have extra bytes, hence the // array, and we might need the index, hence the byte* // Don't touch ref chars unless we succeed - [RequiresUnsafe] internal unsafe bool InternalFallback(byte[] bytes, byte* pBytes, ref char* chars) { Debug.Assert(byteStart != null, "[DecoderFallback.InternalFallback]Used InternalFallback without calling InternalInitialize"); @@ -159,7 +157,6 @@ internal unsafe bool InternalFallback(byte[] bytes, byte* pBytes, ref char* char } // This version just counts the fallback and doesn't actually copy anything. - [RequiresUnsafe] internal virtual unsafe int InternalFallback(byte[] bytes, byte* pBytes) // Right now this has both bytes and bytes[], since we might have extra bytes, hence the // array, and we might need the index, hence the byte* diff --git a/src/libraries/System.Private.CoreLib/src/System/Text/DecoderNLS.cs b/src/libraries/System.Private.CoreLib/src/System/Text/DecoderNLS.cs index 046683d16a8e68..374d17de4a448a 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Text/DecoderNLS.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Text/DecoderNLS.cs @@ -63,7 +63,6 @@ public override unsafe int GetCharCount(byte[] bytes, int index, int count, bool return GetCharCount(pBytes + index, count, flush); } - [RequiresUnsafe] public override unsafe int GetCharCount(byte* bytes, int count, bool flush) { ArgumentNullException.ThrowIfNull(bytes); @@ -114,7 +113,6 @@ public override unsafe int GetChars(byte[] bytes, int byteIndex, int byteCount, } } - [RequiresUnsafe] public override unsafe int GetChars(byte* bytes, int byteCount, char* chars, int charCount, bool flush) { @@ -167,7 +165,6 @@ public override unsafe void Convert(byte[] bytes, int byteIndex, int byteCount, // This is the version that used pointers. We call the base encoding worker function // after setting our appropriate internal variables. This is getting chars - [RequiresUnsafe] public override unsafe void Convert(byte* bytes, int byteCount, char* chars, int charCount, bool flush, out int bytesUsed, out int charsUsed, out bool completed) diff --git a/src/libraries/System.Private.CoreLib/src/System/Text/DecoderReplacementFallback.cs b/src/libraries/System.Private.CoreLib/src/System/Text/DecoderReplacementFallback.cs index e46dd9f93a5848..4849b738529a4f 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Text/DecoderReplacementFallback.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Text/DecoderReplacementFallback.cs @@ -163,7 +163,6 @@ public override unsafe void Reset() } // This version just counts the fallback and doesn't actually copy anything. - [RequiresUnsafe] internal override unsafe int InternalFallback(byte[] bytes, byte* pBytes) => // Right now this has both bytes and bytes[], since we might have extra bytes, // hence the array, and we might need the index, hence the byte*. diff --git a/src/libraries/System.Private.CoreLib/src/System/Text/Encoder.cs b/src/libraries/System.Private.CoreLib/src/System/Text/Encoder.cs index 12e1e406ccbed1..ff99ee4f7907ca 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Text/Encoder.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Text/Encoder.cs @@ -92,7 +92,6 @@ public virtual void Reset() // unfortunately for existing overrides, it has to call the [] version, // which is really slow, so avoid this method if you might be calling external encodings. [CLSCompliant(false)] - [RequiresUnsafe] public virtual unsafe int GetByteCount(char* chars, int count, bool flush) { ArgumentNullException.ThrowIfNull(chars); @@ -154,7 +153,6 @@ public abstract int GetBytes(char[] chars, int charIndex, int charCount, // could easily overflow our output buffer. Therefore we do an extra test // when we copy the buffer so that we don't overflow byteCount either. [CLSCompliant(false)] - [RequiresUnsafe] public virtual unsafe int GetBytes(char* chars, int charCount, byte* bytes, int byteCount, bool flush) { @@ -268,7 +266,6 @@ public virtual void Convert(char[] chars, int charIndex, int charCount, // that its likely that we didn't consume as many chars as we could have. For some // applications this could be slow. (Like trying to exactly fill an output buffer from a bigger stream) [CLSCompliant(false)] - [RequiresUnsafe] public virtual unsafe void Convert(char* chars, int charCount, byte* bytes, int byteCount, bool flush, out int charsUsed, out int bytesUsed, out bool completed) diff --git a/src/libraries/System.Private.CoreLib/src/System/Text/EncoderFallback.cs b/src/libraries/System.Private.CoreLib/src/System/Text/EncoderFallback.cs index 89c73fdb1d5c7b..fdd585b02334ba 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Text/EncoderFallback.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Text/EncoderFallback.cs @@ -293,7 +293,6 @@ private Rune GetNextRune() // Note that this could also change the contents of this.encoder, which is the same // object that the caller is using, so the caller could mess up the encoder for us // if they aren't careful. - [RequiresUnsafe] internal unsafe bool InternalFallback(char ch, ref char* chars) { // Shouldn't have null charStart diff --git a/src/libraries/System.Private.CoreLib/src/System/Text/EncoderNLS.cs b/src/libraries/System.Private.CoreLib/src/System/Text/EncoderNLS.cs index 637fad44eecf33..9bb2a59ba28af3 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Text/EncoderNLS.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Text/EncoderNLS.cs @@ -62,7 +62,6 @@ public override unsafe int GetByteCount(char[] chars, int index, int count, bool return result; } - [RequiresUnsafe] public override unsafe int GetByteCount(char* chars, int count, bool flush) { ArgumentNullException.ThrowIfNull(chars); @@ -104,7 +103,6 @@ public override unsafe int GetBytes(char[] chars, int charIndex, int charCount, } } - [RequiresUnsafe] public override unsafe int GetBytes(char* chars, int charCount, byte* bytes, int byteCount, bool flush) { ArgumentNullException.ThrowIfNull(chars); @@ -153,7 +151,6 @@ public override unsafe void Convert(char[] chars, int charIndex, int charCount, // This is the version that uses pointers. We call the base encoding worker function // after setting our appropriate internal variables. This is getting bytes - [RequiresUnsafe] public override unsafe void Convert(char* chars, int charCount, byte* bytes, int byteCount, bool flush, out int charsUsed, out int bytesUsed, out bool completed) diff --git a/src/libraries/System.Private.CoreLib/src/System/Text/Encoding.Internal.cs b/src/libraries/System.Private.CoreLib/src/System/Text/Encoding.Internal.cs index 814f3f03cf894d..6230cf13e66708 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Text/Encoding.Internal.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Text/Encoding.Internal.cs @@ -119,7 +119,6 @@ internal virtual bool TryGetByteCount(Rune value, out int byteCount) /// /// Entry point from . /// - [RequiresUnsafe] internal virtual unsafe int GetByteCount(char* pChars, int charCount, EncoderNLS? encoder) { Debug.Assert(encoder != null, "This code path should only be called from EncoderNLS."); @@ -173,7 +172,6 @@ internal virtual unsafe int GetByteCount(char* pChars, int charCount, EncoderNLS /// The implementation should not attempt to perform any sort of fallback behavior. /// If custom fallback behavior is necessary, override . /// - [RequiresUnsafe] private protected virtual unsafe int GetByteCountFast(char* pChars, int charsLength, EncoderFallback? fallback, out int charsConsumed) { // Any production-quality type would override this method and provide a real @@ -225,7 +223,6 @@ private protected virtual unsafe int GetByteCountFast(char* pChars, int charsLen /// (Implementation should call .) /// [MethodImpl(MethodImplOptions.NoInlining)] // don't stack spill spans into our caller - [RequiresUnsafe] private protected unsafe int GetByteCountWithFallback(char* pCharsOriginal, int originalCharCount, int charsConsumedSoFar) { // This is a stub method that's marked "no-inlining" so that it we don't stack-spill spans @@ -256,7 +253,6 @@ private protected unsafe int GetByteCountWithFallback(char* pCharsOriginal, int /// If the return value would exceed . /// (The implementation should call .) /// - [RequiresUnsafe] private unsafe int GetByteCountWithFallback(char* pOriginalChars, int originalCharCount, int charsConsumedSoFar, EncoderNLS encoder) { Debug.Assert(encoder != null, "This code path should only be called from EncoderNLS."); @@ -400,7 +396,6 @@ private protected virtual unsafe int GetByteCountWithFallback(ReadOnlySpan /// /// Entry point from and . /// - [RequiresUnsafe] internal virtual unsafe int GetBytes(char* pChars, int charCount, byte* pBytes, int byteCount, EncoderNLS? encoder) { Debug.Assert(encoder != null, "This code path should only be called from EncoderNLS."); @@ -445,7 +440,6 @@ internal virtual unsafe int GetBytes(char* pChars, int charCount, byte* pBytes, /// The implementation should not attempt to perform any sort of fallback behavior. /// If custom fallback behavior is necessary, override . /// - [RequiresUnsafe] private protected virtual unsafe int GetBytesFast(char* pChars, int charsLength, byte* pBytes, int bytesLength, out int charsConsumed) { // Any production-quality type would override this method and provide a real @@ -492,7 +486,6 @@ private protected virtual unsafe int GetBytesFast(char* pChars, int charsLength, /// If the destination buffer is not large enough to hold the entirety of the transcoded data. /// [MethodImpl(MethodImplOptions.NoInlining)] - [RequiresUnsafe] private protected unsafe int GetBytesWithFallback(char* pOriginalChars, int originalCharCount, byte* pOriginalBytes, int originalByteCount, int charsConsumedSoFar, int bytesWrittenSoFar, bool throwForDestinationOverflow = true) { // This is a stub method that's marked "no-inlining" so that it we don't stack-spill spans @@ -527,7 +520,6 @@ private protected unsafe int GetBytesWithFallback(char* pOriginalChars, int orig /// too small to contain the entirety of the transcoded data and the instance disallows /// partial transcoding. /// - [RequiresUnsafe] private unsafe int GetBytesWithFallback(char* pOriginalChars, int originalCharCount, byte* pOriginalBytes, int originalByteCount, int charsConsumedSoFar, int bytesWrittenSoFar, EncoderNLS encoder) { Debug.Assert(encoder != null, "This code path should only be called from EncoderNLS."); @@ -720,7 +712,6 @@ private protected virtual unsafe int GetBytesWithFallback(ReadOnlySpan cha /// /// Entry point from . /// - [RequiresUnsafe] internal virtual unsafe int GetCharCount(byte* pBytes, int byteCount, DecoderNLS? decoder) { Debug.Assert(decoder != null, "This code path should only be called from DecoderNLS."); @@ -776,7 +767,6 @@ internal virtual unsafe int GetCharCount(byte* pBytes, int byteCount, DecoderNLS /// The implementation should not attempt to perform any sort of fallback behavior. /// If custom fallback behavior is necessary, override . /// - [RequiresUnsafe] private protected virtual unsafe int GetCharCountFast(byte* pBytes, int bytesLength, DecoderFallback? fallback, out int bytesConsumed) { // Any production-quality type would override this method and provide a real @@ -827,7 +817,6 @@ private protected virtual unsafe int GetCharCountFast(byte* pBytes, int bytesLen /// (Implementation should call .) /// [MethodImpl(MethodImplOptions.NoInlining)] // don't stack spill spans into our caller - [RequiresUnsafe] private protected unsafe int GetCharCountWithFallback(byte* pBytesOriginal, int originalByteCount, int bytesConsumedSoFar) { // This is a stub method that's marked "no-inlining" so that it we don't stack-spill spans @@ -858,7 +847,6 @@ private protected unsafe int GetCharCountWithFallback(byte* pBytesOriginal, int /// If the return value would exceed . /// (The implementation should call .) /// - [RequiresUnsafe] private unsafe int GetCharCountWithFallback(byte* pOriginalBytes, int originalByteCount, int bytesConsumedSoFar, DecoderNLS decoder) { Debug.Assert(decoder != null, "This code path should only be called from DecoderNLS."); @@ -1004,7 +992,6 @@ private unsafe int GetCharCountWithFallback(ReadOnlySpan bytes, int origin /// /// Entry point from and . /// - [RequiresUnsafe] internal virtual unsafe int GetChars(byte* pBytes, int byteCount, char* pChars, int charCount, DecoderNLS? decoder) { Debug.Assert(decoder != null, "This code path should only be called from DecoderNLS."); @@ -1049,7 +1036,6 @@ internal virtual unsafe int GetChars(byte* pBytes, int byteCount, char* pChars, /// The implementation should not attempt to perform any sort of fallback behavior. /// If custom fallback behavior is necessary, override . /// - [RequiresUnsafe] private protected virtual unsafe int GetCharsFast(byte* pBytes, int bytesLength, char* pChars, int charsLength, out int bytesConsumed) { // Any production-quality type would override this method and provide a real @@ -1096,7 +1082,6 @@ private protected virtual unsafe int GetCharsFast(byte* pBytes, int bytesLength, /// If the destination buffer is not large enough to hold the entirety of the transcoded data. /// [MethodImpl(MethodImplOptions.NoInlining)] - [RequiresUnsafe] private protected unsafe int GetCharsWithFallback(byte* pOriginalBytes, int originalByteCount, char* pOriginalChars, int originalCharCount, int bytesConsumedSoFar, int charsWrittenSoFar, bool throwForDestinationOverflow = true) { // This is a stub method that's marked "no-inlining" so that it we don't stack-spill spans @@ -1131,7 +1116,6 @@ private protected unsafe int GetCharsWithFallback(byte* pOriginalBytes, int orig /// too small to contain the entirety of the transcoded data and the instance disallows /// partial transcoding. /// - [RequiresUnsafe] private protected unsafe int GetCharsWithFallback(byte* pOriginalBytes, int originalByteCount, char* pOriginalChars, int originalCharCount, int bytesConsumedSoFar, int charsWrittenSoFar, DecoderNLS decoder) { Debug.Assert(decoder != null, "This code path should only be called from DecoderNLS."); diff --git a/src/libraries/System.Private.CoreLib/src/System/Text/Encoding.cs b/src/libraries/System.Private.CoreLib/src/System/Text/Encoding.cs index 6b5a1bae54e3a1..97282df181bbb6 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Text/Encoding.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Text/Encoding.cs @@ -568,7 +568,6 @@ public int GetByteCount(string s, int index, int count) // which is really slow, so this method should be avoided if you're calling // a 3rd party encoding. [CLSCompliant(false)] - [RequiresUnsafe] public virtual unsafe int GetByteCount(char* chars, int count) { ArgumentNullException.ThrowIfNull(chars); @@ -691,7 +690,6 @@ public virtual int GetBytes(string s, int charIndex, int charCount, // when we copy the buffer so that we don't overflow byteCount either. [CLSCompliant(false)] - [RequiresUnsafe] public virtual unsafe int GetBytes(char* chars, int charCount, byte* bytes, int byteCount) { @@ -771,7 +769,6 @@ public virtual int GetCharCount(byte[] bytes) // We expect this to be the workhorse for NLS Encodings, but for existing // ones we need a working (if slow) default implementation) [CLSCompliant(false)] - [RequiresUnsafe] public virtual unsafe int GetCharCount(byte* bytes, int count) { ArgumentNullException.ThrowIfNull(bytes); @@ -842,7 +839,6 @@ public abstract int GetChars(byte[] bytes, int byteIndex, int byteCount, // when we copy the buffer so that we don't overflow charCount either. [CLSCompliant(false)] - [RequiresUnsafe] public virtual unsafe int GetChars(byte* bytes, int byteCount, char* chars, int charCount) { @@ -905,7 +901,6 @@ public virtual bool TryGetChars(ReadOnlySpan bytes, Span chars, out } [CLSCompliant(false)] - [RequiresUnsafe] public unsafe string GetString(byte* bytes, int byteCount) { ArgumentNullException.ThrowIfNull(bytes); @@ -1167,7 +1162,6 @@ public DefaultEncoder(Encoding encoding) public override int GetByteCount(char[] chars, int index, int count, bool flush) => _encoding.GetByteCount(chars, index, count); - [RequiresUnsafe] public override unsafe int GetByteCount(char* chars, int count, bool flush) => _encoding.GetByteCount(chars, count); @@ -1195,7 +1189,6 @@ public override int GetBytes(char[] chars, int charIndex, int charCount, byte[] bytes, int byteIndex, bool flush) => _encoding.GetBytes(chars, charIndex, charCount, bytes, byteIndex); - [RequiresUnsafe] public override unsafe int GetBytes(char* chars, int charCount, byte* bytes, int byteCount, bool flush) => _encoding.GetBytes(chars, charCount, bytes, byteCount); @@ -1223,7 +1216,6 @@ public override int GetCharCount(byte[] bytes, int index, int count) => public override int GetCharCount(byte[] bytes, int index, int count, bool flush) => _encoding.GetCharCount(bytes, index, count); - [RequiresUnsafe] public override unsafe int GetCharCount(byte* bytes, int count, bool flush) => // By default just call the encoding version, no flush by default _encoding.GetCharCount(bytes, count); @@ -1253,7 +1245,6 @@ public override int GetChars(byte[] bytes, int byteIndex, int byteCount, char[] chars, int charIndex, bool flush) => _encoding.GetChars(bytes, byteIndex, byteCount, chars, charIndex); - [RequiresUnsafe] public override unsafe int GetChars(byte* bytes, int byteCount, char* chars, int charCount, bool flush) => // By default just call the encoding's version @@ -1273,7 +1264,6 @@ internal sealed class EncodingCharBuffer private unsafe byte* _bytes; private readonly DecoderFallbackBuffer _fallbackBuffer; - [RequiresUnsafe] internal unsafe EncodingCharBuffer(Encoding enc, DecoderNLS? decoder, char* charStart, int charCount, byte* byteStart, int byteCount) { @@ -1421,7 +1411,6 @@ internal sealed class EncodingByteBuffer private readonly EncoderNLS? _encoder; internal EncoderFallbackBuffer fallbackBuffer; - [RequiresUnsafe] internal unsafe EncodingByteBuffer(Encoding inEncoding, EncoderNLS? inEncoder, byte* inByteStart, int inByteCount, char* inCharStart, int inCharCount) { diff --git a/src/libraries/System.Private.CoreLib/src/System/Text/Latin1Encoding.cs b/src/libraries/System.Private.CoreLib/src/System/Text/Latin1Encoding.cs index eb0582b3835870..21c8cf5c339098 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Text/Latin1Encoding.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Text/Latin1Encoding.cs @@ -39,7 +39,6 @@ internal sealed override void SetDefaultFallbacks() * but fallback mechanism must be consulted for non-Latin-1 chars. */ - [RequiresUnsafe] public override unsafe int GetByteCount(char* chars, int count) { if (chars is null) @@ -102,7 +101,6 @@ public override unsafe int GetByteCount(string s) } [MethodImpl(MethodImplOptions.AggressiveInlining)] - [RequiresUnsafe] private unsafe int GetByteCountCommon(char* pChars, int charCount) { // Common helper method for all non-EncoderNLS entry points to GetByteCount. @@ -133,7 +131,6 @@ private unsafe int GetByteCountCommon(char* pChars, int charCount) } [MethodImpl(MethodImplOptions.AggressiveInlining)] // called directly by GetByteCountCommon - [RequiresUnsafe] private protected sealed override unsafe int GetByteCountFast(char* pChars, int charsLength, EncoderFallback? fallback, out int charsConsumed) { // Can we short-circuit the entire calculation? If so, the output byte count @@ -175,7 +172,6 @@ public override int GetMaxByteCount(int charCount) * but fallback mechanism must be consulted for non-Latin-1 chars. */ - [RequiresUnsafe] public override unsafe int GetBytes(char* chars, int charCount, byte* bytes, int byteCount) { if (chars is null || bytes is null) @@ -292,7 +288,6 @@ public override unsafe int GetBytes(string s, int charIndex, int charCount, byte [MethodImpl(MethodImplOptions.AggressiveInlining)] - [RequiresUnsafe] private unsafe int GetBytesCommon(char* pChars, int charCount, byte* pBytes, int byteCount, bool throwForDestinationOverflow = true) { // Common helper method for all non-EncoderNLS entry points to GetBytes. @@ -322,7 +317,6 @@ private unsafe int GetBytesCommon(char* pChars, int charCount, byte* pBytes, int } [MethodImpl(MethodImplOptions.AggressiveInlining)] // called directly by GetBytesCommon - [RequiresUnsafe] private protected sealed override unsafe int GetBytesFast(char* pChars, int charsLength, byte* pBytes, int bytesLength, out int charsConsumed) { int bytesWritten = (int)Latin1Utility.NarrowUtf16ToLatin1(pChars, pBytes, (uint)Math.Min(charsLength, bytesLength)); @@ -337,7 +331,6 @@ private protected sealed override unsafe int GetBytesFast(char* pChars, int char * We never consult the fallback mechanism during decoding. */ - [RequiresUnsafe] public override unsafe int GetCharCount(byte* bytes, int count) { if (bytes is null) @@ -388,7 +381,6 @@ public override int GetCharCount(ReadOnlySpan bytes) return bytes.Length; } - [RequiresUnsafe] private protected override unsafe int GetCharCountFast(byte* pBytes, int bytesLength, DecoderFallback? fallback, out int bytesConsumed) { // We never consult the fallback mechanism during GetChars. @@ -416,7 +408,6 @@ public override int GetMaxCharCount(int byteCount) * We never consult the fallback mechanism during decoding. */ - [RequiresUnsafe] public override unsafe int GetChars(byte* bytes, int byteCount, char* chars, int charCount) { if (bytes is null || chars is null) @@ -603,7 +594,6 @@ public override unsafe string GetString(byte[] bytes, int index, int count) } [MethodImpl(MethodImplOptions.AggressiveInlining)] - [RequiresUnsafe] private unsafe int GetCharsCommon(byte* pBytes, int byteCount, char* pChars, int charCount) { // Common helper method for all non-DecoderNLS entry points to GetChars. @@ -627,7 +617,6 @@ private unsafe int GetCharsCommon(byte* pBytes, int byteCount, char* pChars, int } // called by the fallback mechanism - [RequiresUnsafe] private protected sealed override unsafe int GetCharsFast(byte* pBytes, int bytesLength, char* pChars, int charsLength, out int bytesConsumed) { int charsWritten = Math.Min(bytesLength, charsLength); diff --git a/src/libraries/System.Private.CoreLib/src/System/Text/Latin1Utility.cs b/src/libraries/System.Private.CoreLib/src/System/Text/Latin1Utility.cs index 81465bf382373a..827bddce35eb5f 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Text/Latin1Utility.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Text/Latin1Utility.cs @@ -18,7 +18,6 @@ internal static partial class Latin1Utility /// /// A Latin-1 char is defined as 0x0000 - 0x00FF, inclusive. [MethodImpl(MethodImplOptions.AggressiveInlining)] - [RequiresUnsafe] public static unsafe nuint GetIndexOfFirstNonLatin1Char(char* pBuffer, nuint bufferLength /* in chars */) { // If SSE2 is supported, use those specific intrinsics instead of the generic vectorized @@ -31,7 +30,6 @@ public static unsafe nuint GetIndexOfFirstNonLatin1Char(char* pBuffer, nuint buf : GetIndexOfFirstNonLatin1Char_Default(pBuffer, bufferLength); } - [RequiresUnsafe] private static unsafe nuint GetIndexOfFirstNonLatin1Char_Default(char* pBuffer, nuint bufferLength /* in chars */) { // Squirrel away the original buffer reference.This method works by determining the exact @@ -167,7 +165,6 @@ private static unsafe nuint GetIndexOfFirstNonLatin1Char_Default(char* pBuffer, } [CompExactlyDependsOn(typeof(Sse2))] - [RequiresUnsafe] private static unsafe nuint GetIndexOfFirstNonLatin1Char_Sse2(char* pBuffer, nuint bufferLength /* in chars */) { // This method contains logic optimized for both SSE2 and SSE41. Much of the logic in this method @@ -537,7 +534,6 @@ private static unsafe nuint GetIndexOfFirstNonLatin1Char_Sse2(char* pBuffer, nui /// or once elements have been converted. Returns the total number /// of elements that were able to be converted. /// - [RequiresUnsafe] public static unsafe nuint NarrowUtf16ToLatin1(char* pUtf16Buffer, byte* pLatin1Buffer, nuint elementCount) { nuint currentOffset = 0; @@ -767,7 +763,6 @@ public static unsafe nuint NarrowUtf16ToLatin1(char* pUtf16Buffer, byte* pLatin1 } [CompExactlyDependsOn(typeof(Sse2))] - [RequiresUnsafe] private static unsafe nuint NarrowUtf16ToLatin1_Sse2(char* pUtf16Buffer, byte* pLatin1Buffer, nuint elementCount) { // This method contains logic optimized for both SSE2 and SSE41. Much of the logic in this method @@ -949,7 +944,6 @@ private static unsafe nuint NarrowUtf16ToLatin1_Sse2(char* pUtf16Buffer, byte* p /// buffer , widening data while copying. /// specifies the element count of both the source and destination buffers. /// - [RequiresUnsafe] public static unsafe void WidenLatin1ToUtf16(byte* pLatin1Buffer, char* pUtf16Buffer, nuint elementCount) { // If SSE2 is supported, use those specific intrinsics instead of the generic vectorized @@ -968,7 +962,6 @@ public static unsafe void WidenLatin1ToUtf16(byte* pLatin1Buffer, char* pUtf16Bu } [CompExactlyDependsOn(typeof(Sse2))] - [RequiresUnsafe] private static unsafe void WidenLatin1ToUtf16_Sse2(byte* pLatin1Buffer, char* pUtf16Buffer, nuint elementCount) { // JIT turns the below into constants @@ -1074,7 +1067,6 @@ private static unsafe void WidenLatin1ToUtf16_Sse2(byte* pLatin1Buffer, char* pU } } - [RequiresUnsafe] private static unsafe void WidenLatin1ToUtf16_Fallback(byte* pLatin1Buffer, char* pUtf16Buffer, nuint elementCount) { Debug.Assert(!Sse2.IsSupported); diff --git a/src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs b/src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs index 0535ab1e2c87fc..83f9306b16ee71 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs @@ -2323,7 +2323,6 @@ public StringBuilder Replace(Rune oldRune, Rune newRune, int startIndex, int cou /// The pointer to the start of the buffer. /// The number of characters in the buffer. [CLSCompliant(false)] - [RequiresUnsafe] public unsafe StringBuilder Append(char* value, int valueCount) { // We don't check null value as this case will throw null reference exception anyway diff --git a/src/libraries/System.Private.CoreLib/src/System/Text/UTF32Encoding.cs b/src/libraries/System.Private.CoreLib/src/System/Text/UTF32Encoding.cs index 97c80e5b7ce4e2..c635e0fab3846c 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Text/UTF32Encoding.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Text/UTF32Encoding.cs @@ -130,7 +130,6 @@ public override unsafe int GetByteCount(string s) // EncodingNLS, UTF7Encoding, UTF8Encoding, UTF32Encoding, ASCIIEncoding, UnicodeEncoding [CLSCompliant(false)] - [RequiresUnsafe] public override unsafe int GetByteCount(char* chars, int count) { ArgumentNullException.ThrowIfNull(chars); @@ -219,7 +218,6 @@ public override unsafe int GetBytes(char[] chars, int charIndex, int charCount, // EncodingNLS, UTF7Encoding, UTF8Encoding, UTF32Encoding, ASCIIEncoding, UnicodeEncoding [CLSCompliant(false)] - [RequiresUnsafe] public override unsafe int GetBytes(char* chars, int charCount, byte* bytes, int byteCount) { ArgumentNullException.ThrowIfNull(chars); @@ -263,7 +261,6 @@ public override unsafe int GetCharCount(byte[] bytes, int index, int count) // EncodingNLS, UTF7Encoding, UTF8Encoding, UTF32Encoding, ASCIIEncoding, UnicodeEncoding [CLSCompliant(false)] - [RequiresUnsafe] public override unsafe int GetCharCount(byte* bytes, int count) { ArgumentNullException.ThrowIfNull(bytes); @@ -313,7 +310,6 @@ public override unsafe int GetChars(byte[] bytes, int byteIndex, int byteCount, // EncodingNLS, UTF7Encoding, UTF8Encoding, UTF32Encoding, ASCIIEncoding, UnicodeEncoding [CLSCompliant(false)] - [RequiresUnsafe] public override unsafe int GetChars(byte* bytes, int byteCount, char* chars, int charCount) { ArgumentNullException.ThrowIfNull(bytes); @@ -354,7 +350,6 @@ public override unsafe string GetString(byte[] bytes, int index, int count) // // End of standard methods copied from EncodingNLS.cs // - [RequiresUnsafe] internal override unsafe int GetByteCount(char* chars, int count, EncoderNLS? encoder) { Debug.Assert(chars is not null, "[UTF32Encoding.GetByteCount]chars!=null"); @@ -486,7 +481,6 @@ internal override unsafe int GetByteCount(char* chars, int count, EncoderNLS? en return byteCount; } - [RequiresUnsafe] internal override unsafe int GetBytes(char* chars, int charCount, byte* bytes, int byteCount, EncoderNLS? encoder) { @@ -689,7 +683,6 @@ internal override unsafe int GetBytes(char* chars, int charCount, return (int)(bytes - byteStart); } - [RequiresUnsafe] internal override unsafe int GetCharCount(byte* bytes, int count, DecoderNLS? baseDecoder) { Debug.Assert(bytes is not null, "[UTF32Encoding.GetCharCount]bytes!=null"); @@ -832,7 +825,6 @@ internal override unsafe int GetCharCount(byte* bytes, int count, DecoderNLS? ba return charCount; } - [RequiresUnsafe] internal override unsafe int GetChars(byte* bytes, int byteCount, char* chars, int charCount, DecoderNLS? baseDecoder) { diff --git a/src/libraries/System.Private.CoreLib/src/System/Text/UTF7Encoding.cs b/src/libraries/System.Private.CoreLib/src/System/Text/UTF7Encoding.cs index 94d9ffa2a06a55..1ae72a0fbd3931 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Text/UTF7Encoding.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Text/UTF7Encoding.cs @@ -166,7 +166,6 @@ public override unsafe int GetByteCount(string s) // EncodingNLS, UTF7Encoding, UTF8Encoding, UTF32Encoding, ASCIIEncoding, UnicodeEncoding [CLSCompliant(false)] - [RequiresUnsafe] public override unsafe int GetByteCount(char* chars, int count) { ArgumentNullException.ThrowIfNull(chars); @@ -255,7 +254,6 @@ public override unsafe int GetBytes(char[] chars, int charIndex, int charCount, // EncodingNLS, UTF7Encoding, UTF8Encoding, UTF32Encoding, ASCIIEncoding, UnicodeEncoding [CLSCompliant(false)] - [RequiresUnsafe] public override unsafe int GetBytes(char* chars, int charCount, byte* bytes, int byteCount) { ArgumentNullException.ThrowIfNull(chars); @@ -299,7 +297,6 @@ public override unsafe int GetCharCount(byte[] bytes, int index, int count) // EncodingNLS, UTF7Encoding, UTF8Encoding, UTF32Encoding, ASCIIEncoding, UnicodeEncoding [CLSCompliant(false)] - [RequiresUnsafe] public override unsafe int GetCharCount(byte* bytes, int count) { ArgumentNullException.ThrowIfNull(bytes); @@ -349,7 +346,6 @@ public override unsafe int GetChars(byte[] bytes, int byteIndex, int byteCount, // EncodingNLS, UTF7Encoding, UTF8Encoding, UTF32Encoding, ASCIIEncoding, UnicodeEncoding [CLSCompliant(false)] - [RequiresUnsafe] public override unsafe int GetChars(byte* bytes, int byteCount, char* chars, int charCount) { ArgumentNullException.ThrowIfNull(bytes); @@ -390,7 +386,6 @@ public override unsafe string GetString(byte[] bytes, int index, int count) // // End of standard methods copied from EncodingNLS.cs // - [RequiresUnsafe] internal sealed override unsafe int GetByteCount(char* chars, int count, EncoderNLS? baseEncoder) { Debug.Assert(chars is not null, "[UTF7Encoding.GetByteCount]chars!=null"); @@ -400,7 +395,6 @@ internal sealed override unsafe int GetByteCount(char* chars, int count, Encoder return GetBytes(chars, count, null, 0, baseEncoder); } - [RequiresUnsafe] internal sealed override unsafe int GetBytes( char* chars, int charCount, byte* bytes, int byteCount, EncoderNLS? baseEncoder) { @@ -541,7 +535,6 @@ internal sealed override unsafe int GetBytes( return buffer.Count; } - [RequiresUnsafe] internal sealed override unsafe int GetCharCount(byte* bytes, int count, DecoderNLS? baseDecoder) { Debug.Assert(count >= 0, "[UTF7Encoding.GetCharCount]count >=0"); @@ -551,7 +544,6 @@ internal sealed override unsafe int GetCharCount(byte* bytes, int count, Decoder return GetChars(bytes, count, null, 0, baseDecoder); } - [RequiresUnsafe] internal sealed override unsafe int GetChars( byte* bytes, int byteCount, char* chars, int charCount, DecoderNLS? baseDecoder) { @@ -902,7 +894,6 @@ public override unsafe void Reset() } // This version just counts the fallback and doesn't actually copy anything. - [RequiresUnsafe] internal override unsafe int InternalFallback(byte[] bytes, byte* pBytes) // Right now this has both bytes and bytes[], since we might have extra bytes, hence the // array, and we might need the index, hence the byte* diff --git a/src/libraries/System.Private.CoreLib/src/System/Text/UTF8Encoding.cs b/src/libraries/System.Private.CoreLib/src/System/Text/UTF8Encoding.cs index 6a6b0a60f43a74..1e92750495e402 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Text/UTF8Encoding.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Text/UTF8Encoding.cs @@ -172,7 +172,6 @@ public override unsafe int GetByteCount(string chars) // EncodingNLS, UTF7Encoding, UTF8Encoding, UTF32Encoding, ASCIIEncoding, UnicodeEncoding [CLSCompliant(false)] - [RequiresUnsafe] public override unsafe int GetByteCount(char* chars, int count) { if (chars is null) @@ -199,7 +198,6 @@ public override unsafe int GetByteCount(ReadOnlySpan chars) } [MethodImpl(MethodImplOptions.AggressiveInlining)] - [RequiresUnsafe] private unsafe int GetByteCountCommon(char* pChars, int charCount) { // Common helper method for all non-EncoderNLS entry points to GetByteCount. @@ -230,7 +228,6 @@ private unsafe int GetByteCountCommon(char* pChars, int charCount) } [MethodImpl(MethodImplOptions.AggressiveInlining)] // called directly by GetCharCountCommon - [RequiresUnsafe] private protected sealed override unsafe int GetByteCountFast(char* pChars, int charsLength, EncoderFallback? fallback, out int charsConsumed) { // The number of UTF-8 code units may exceed the number of UTF-16 code units, @@ -342,7 +339,6 @@ public override unsafe int GetBytes(char[] chars, int charIndex, int charCount, // EncodingNLS, UTF7Encoding, UTF8Encoding, UTF32Encoding, ASCIIEncoding, UnicodeEncoding [CLSCompliant(false)] - [RequiresUnsafe] public override unsafe int GetBytes(char* chars, int charCount, byte* bytes, int byteCount) { if (chars is null || bytes is null) @@ -392,7 +388,6 @@ public override unsafe bool TryGetBytes(ReadOnlySpan chars, Span byt } [MethodImpl(MethodImplOptions.AggressiveInlining)] - [RequiresUnsafe] private unsafe int GetBytesCommon(char* pChars, int charCount, byte* pBytes, int byteCount, bool throwForDestinationOverflow = true) { // Common helper method for all non-EncoderNLS entry points to GetBytes. @@ -422,7 +417,6 @@ private unsafe int GetBytesCommon(char* pChars, int charCount, byte* pBytes, int } [MethodImpl(MethodImplOptions.AggressiveInlining)] // called directly by GetBytesCommon - [RequiresUnsafe] private protected sealed override unsafe int GetBytesFast(char* pChars, int charsLength, byte* pBytes, int bytesLength, out int charsConsumed) { // We don't care about the exact OperationStatus value returned by the workhorse routine; we only @@ -471,7 +465,6 @@ public override unsafe int GetCharCount(byte[] bytes, int index, int count) // EncodingNLS, UTF7Encoding, UTF8Encoding, UTF32Encoding, ASCIIEncoding, UnicodeEncoding [CLSCompliant(false)] - [RequiresUnsafe] public override unsafe int GetCharCount(byte* bytes, int count) { if (bytes is null) @@ -541,7 +534,6 @@ public override unsafe int GetChars(byte[] bytes, int byteIndex, int byteCount, // EncodingNLS, UTF7Encoding, UTF8Encoding, UTF32Encoding, ASCIIEncoding, UnicodeEncoding [CLSCompliant(false)] - [RequiresUnsafe] public override unsafe int GetChars(byte* bytes, int byteCount, char* chars, int charCount) { if (bytes is null || chars is null) @@ -598,7 +590,6 @@ public override unsafe bool TryGetChars(ReadOnlySpan bytes, Span cha // Note: We throw exceptions on individually encoded surrogates and other non-shortest forms. // If exceptions aren't turned on, then we drop all non-shortest &individual surrogates. [MethodImpl(MethodImplOptions.AggressiveInlining)] - [RequiresUnsafe] private unsafe int GetCharsCommon(byte* pBytes, int byteCount, char* pChars, int charCount, bool throwForDestinationOverflow = true) { // Common helper method for all non-DecoderNLS entry points to GetChars. @@ -628,7 +619,6 @@ private unsafe int GetCharsCommon(byte* pBytes, int byteCount, char* pChars, int } [MethodImpl(MethodImplOptions.AggressiveInlining)] // called directly by GetCharsCommon - [RequiresUnsafe] private protected sealed override unsafe int GetCharsFast(byte* pBytes, int bytesLength, char* pChars, int charsLength, out int bytesConsumed) { // We don't care about the exact OperationStatus value returned by the workhorse routine; we only @@ -718,7 +708,6 @@ public override unsafe string GetString(byte[] bytes, int index, int count) // [MethodImpl(MethodImplOptions.AggressiveInlining)] - [RequiresUnsafe] private unsafe int GetCharCountCommon(byte* pBytes, int byteCount) { // Common helper method for all non-DecoderNLS entry points to GetCharCount. @@ -749,7 +738,6 @@ private unsafe int GetCharCountCommon(byte* pBytes, int byteCount) } [MethodImpl(MethodImplOptions.AggressiveInlining)] // called directly by GetCharCountCommon - [RequiresUnsafe] private protected sealed override unsafe int GetCharCountFast(byte* pBytes, int bytesLength, DecoderFallback? fallback, out int bytesConsumed) { // The number of UTF-16 code units will never exceed the number of UTF-8 code units, diff --git a/src/libraries/System.Private.CoreLib/src/System/Text/Unicode/Utf16Utility.Validation.cs b/src/libraries/System.Private.CoreLib/src/System/Text/Unicode/Utf16Utility.Validation.cs index 524e6a2f504dd3..28bd9b4161941b 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Text/Unicode/Utf16Utility.Validation.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Text/Unicode/Utf16Utility.Validation.cs @@ -70,7 +70,6 @@ private static bool IsLastCharHighSurrogate(nuint maskHigh) /// /// Returns a pointer to the end of if the buffer is well-formed. /// - [RequiresUnsafe] public static char* GetPointerToFirstInvalidChar(char* pInputBuffer, int inputLength, out long utf8CodeUnitCountAdjustment, out int scalarCountAdjustment) { Debug.Assert(inputLength >= 0, "Input length must not be negative."); diff --git a/src/libraries/System.Private.CoreLib/src/System/Text/Unicode/Utf8Utility.Transcoding.cs b/src/libraries/System.Private.CoreLib/src/System/Text/Unicode/Utf8Utility.Transcoding.cs index 1905339cccc376..ff095110653805 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Text/Unicode/Utf8Utility.Transcoding.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Text/Unicode/Utf8Utility.Transcoding.cs @@ -20,7 +20,6 @@ internal static unsafe partial class Utf8Utility // On method return, pInputBufferRemaining and pOutputBufferRemaining will both point to where // the next byte would have been consumed from / the next char would have been written to. // inputLength in bytes, outputCharsRemaining in chars. - [RequiresUnsafe] public static OperationStatus TranscodeToUtf16(byte* pInputBuffer, int inputLength, char* pOutputBuffer, int outputCharsRemaining, out byte* pInputBufferRemaining, out char* pOutputBufferRemaining) { Debug.Assert(inputLength >= 0, "Input length must not be negative."); @@ -839,7 +838,6 @@ public static OperationStatus TranscodeToUtf16(byte* pInputBuffer, int inputLeng // On method return, pInputBufferRemaining and pOutputBufferRemaining will both point to where // the next char would have been consumed from / the next byte would have been written to. // inputLength in chars, outputBytesRemaining in bytes. - [RequiresUnsafe] public static OperationStatus TranscodeToUtf8(char* pInputBuffer, int inputLength, byte* pOutputBuffer, int outputBytesRemaining, out char* pInputBufferRemaining, out byte* pOutputBufferRemaining) { const int CharsPerDWord = sizeof(uint) / sizeof(char); diff --git a/src/libraries/System.Private.CoreLib/src/System/Text/Unicode/Utf8Utility.Validation.cs b/src/libraries/System.Private.CoreLib/src/System/Text/Unicode/Utf8Utility.Validation.cs index 4fbc51c8521106..0717ed348af4ed 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Text/Unicode/Utf8Utility.Validation.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Text/Unicode/Utf8Utility.Validation.cs @@ -24,7 +24,6 @@ internal static unsafe partial class Utf8Utility /// /// Returns a pointer to the end of if the buffer is well-formed. /// - [RequiresUnsafe] public static byte* GetPointerToFirstInvalidByte(byte* pInputBuffer, int inputLength, out int utf16CodeUnitCountAdjustment, out int scalarCountAdjustment) { Debug.Assert(inputLength >= 0, "Input length must not be negative."); diff --git a/src/libraries/System.Private.CoreLib/src/System/Text/UnicodeEncoding.cs b/src/libraries/System.Private.CoreLib/src/System/Text/UnicodeEncoding.cs index 431dfbb3c90a6f..b43fcff0e6fdbd 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Text/UnicodeEncoding.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Text/UnicodeEncoding.cs @@ -122,7 +122,6 @@ public override unsafe int GetByteCount(string s) // EncodingNLS, UTF7Encoding, UTF8Encoding, UTF32Encoding, ASCIIEncoding, UnicodeEncoding [CLSCompliant(false)] - [RequiresUnsafe] public override unsafe int GetByteCount(char* chars, int count) { ArgumentNullException.ThrowIfNull(chars); @@ -211,7 +210,6 @@ public override unsafe int GetBytes(char[] chars, int charIndex, int charCount, // EncodingNLS, UTF7Encoding, UTF8Encoding, UTF32Encoding, ASCIIEncoding, UnicodeEncoding [CLSCompliant(false)] - [RequiresUnsafe] public override unsafe int GetBytes(char* chars, int charCount, byte* bytes, int byteCount) { ArgumentNullException.ThrowIfNull(chars); @@ -255,7 +253,6 @@ public override unsafe int GetCharCount(byte[] bytes, int index, int count) // EncodingNLS, UTF7Encoding, UTF8Encoding, UTF32Encoding, ASCIIEncoding, UnicodeEncoding [CLSCompliant(false)] - [RequiresUnsafe] public override unsafe int GetCharCount(byte* bytes, int count) { ArgumentNullException.ThrowIfNull(bytes); @@ -305,7 +302,6 @@ public override unsafe int GetChars(byte[] bytes, int byteIndex, int byteCount, // EncodingNLS, UTF7Encoding, UTF8Encoding, UTF32Encoding, ASCIIEncoding, UnicodeEncoding [CLSCompliant(false)] - [RequiresUnsafe] public override unsafe int GetChars(byte* bytes, int byteCount, char* chars, int charCount) { ArgumentNullException.ThrowIfNull(bytes); @@ -346,7 +342,6 @@ public override unsafe string GetString(byte[] bytes, int index, int count) // // End of standard methods copied from EncodingNLS.cs // - [RequiresUnsafe] internal sealed override unsafe int GetByteCount(char* chars, int count, EncoderNLS? encoder) { Debug.Assert(chars is not null, "[UnicodeEncoding.GetByteCount]chars!=null"); @@ -635,7 +630,6 @@ internal sealed override unsafe int GetByteCount(char* chars, int count, Encoder return byteCount; } - [RequiresUnsafe] internal sealed override unsafe int GetBytes( char* chars, int charCount, byte* bytes, int byteCount, EncoderNLS? encoder) { @@ -988,7 +982,6 @@ internal sealed override unsafe int GetBytes( return (int)(bytes - byteStart); } - [RequiresUnsafe] internal sealed override unsafe int GetCharCount(byte* bytes, int count, DecoderNLS? baseDecoder) { Debug.Assert(bytes is not null, "[UnicodeEncoding.GetCharCount]bytes!=null"); @@ -1303,7 +1296,6 @@ internal sealed override unsafe int GetCharCount(byte* bytes, int count, Decoder return charCount; } - [RequiresUnsafe] internal sealed override unsafe int GetChars( byte* bytes, int byteCount, char* chars, int charCount, DecoderNLS? baseDecoder) { diff --git a/src/libraries/System.Private.CoreLib/src/System/Threading/AutoreleasePool.cs b/src/libraries/System.Private.CoreLib/src/System/Threading/AutoreleasePool.cs index ea3e899db2b6e5..70328afaa50237 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Threading/AutoreleasePool.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Threading/AutoreleasePool.cs @@ -54,7 +54,6 @@ internal static void DrainAutoreleasePool() #if CORECLR [System.Runtime.InteropServices.UnmanagedCallersOnly] - [RequiresUnsafe] private static unsafe void CreateAutoreleasePool(Exception* pException) { try @@ -68,7 +67,6 @@ private static unsafe void CreateAutoreleasePool(Exception* pException) } [System.Runtime.InteropServices.UnmanagedCallersOnly] - [RequiresUnsafe] private static unsafe void DrainAutoreleasePool(Exception* pException) { try diff --git a/src/libraries/System.Private.CoreLib/src/System/Threading/IOCompletionCallbackHelper.cs b/src/libraries/System.Private.CoreLib/src/System/Threading/IOCompletionCallbackHelper.cs index efbc5f79042533..a367662975a95f 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Threading/IOCompletionCallbackHelper.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Threading/IOCompletionCallbackHelper.cs @@ -30,7 +30,6 @@ private static void IOCompletionCallback_Context(object? state) helper._ioCompletionCallback(helper._errorCode, helper._numBytes, helper._pNativeOverlapped); } - [RequiresUnsafe] public static void PerformSingleIOCompletionCallback(uint errorCode, uint numBytes, NativeOverlapped* pNativeOverlapped) { Debug.Assert(pNativeOverlapped != null); diff --git a/src/libraries/System.Private.CoreLib/src/System/Threading/Lock.cs b/src/libraries/System.Private.CoreLib/src/System/Threading/Lock.cs index 2efdad100f59c8..f050a4c64b9bfa 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Threading/Lock.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Threading/Lock.cs @@ -879,7 +879,6 @@ internal void InitializeForMonitor(int managedThreadId, uint recursionCount) #if CORECLR [System.Runtime.InteropServices.UnmanagedCallersOnly] - [RequiresUnsafe] private static unsafe void InitializeForMonitor(Lock* pLock, int managedThreadId, uint recursionCount, Exception* pException) { try diff --git a/src/libraries/System.Private.CoreLib/src/System/Threading/NamedMutex.Unix.cs b/src/libraries/System.Private.CoreLib/src/System/Threading/NamedMutex.Unix.cs index c6771d8909ca67..f1086e17582688 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Threading/NamedMutex.Unix.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Threading/NamedMutex.Unix.cs @@ -262,7 +262,6 @@ public void Abandon(NamedMutexOwnershipChain chain, Thread abandonedThread) } } - [RequiresUnsafe] private static unsafe void InitializeSharedData(void* v) { if (UsePThreadMutexes) diff --git a/src/libraries/System.Private.CoreLib/src/System/Threading/Overlapped.cs b/src/libraries/System.Private.CoreLib/src/System/Threading/Overlapped.cs index 13b8eec743e5fc..ccf3fd63eee2bb 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Threading/Overlapped.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Threading/Overlapped.cs @@ -112,7 +112,6 @@ public IntPtr EventHandleIntPtr * Unpins the native Overlapped struct ====================================================================*/ [CLSCompliant(false)] - [RequiresUnsafe] public static Overlapped Unpack(NativeOverlapped* nativeOverlappedPtr) { ArgumentNullException.ThrowIfNull(nativeOverlappedPtr); @@ -121,7 +120,6 @@ public static Overlapped Unpack(NativeOverlapped* nativeOverlappedPtr) } [CLSCompliant(false)] - [RequiresUnsafe] public static void Free(NativeOverlapped* nativeOverlappedPtr) { ArgumentNullException.ThrowIfNull(nativeOverlappedPtr); @@ -205,7 +203,6 @@ public static void Free(NativeOverlapped* nativeOverlappedPtr) } } - [RequiresUnsafe] internal static void FreeNativeOverlapped(NativeOverlapped* pNativeOverlapped) { nuint handleCount = GCHandleCountRef(pNativeOverlapped); @@ -219,15 +216,12 @@ internal static void FreeNativeOverlapped(NativeOverlapped* pNativeOverlapped) // // The NativeOverlapped structure is followed by GC handle count and inline array of GC handles // - [RequiresUnsafe] private static ref nuint GCHandleCountRef(NativeOverlapped* pNativeOverlapped) => ref *(nuint*)(pNativeOverlapped + 1); - [RequiresUnsafe] private static ref GCHandle GCHandleRef(NativeOverlapped* pNativeOverlapped, nuint index) => ref *((GCHandle*)((nuint*)(pNativeOverlapped + 1) + 1) + index); - [RequiresUnsafe] internal static Overlapped GetOverlappedFromNative(NativeOverlapped* pNativeOverlapped) { object? target = GCHandleRef(pNativeOverlapped, 0).Target; diff --git a/src/libraries/System.Private.CoreLib/src/System/Threading/ThreadBlockingInfo.cs b/src/libraries/System.Private.CoreLib/src/System/Threading/ThreadBlockingInfo.cs index c87b6b06151f0d..15155433ed50d7 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Threading/ThreadBlockingInfo.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Threading/ThreadBlockingInfo.cs @@ -48,7 +48,6 @@ internal unsafe struct ThreadBlockingInfo // Points to the next-most-recent blocking info for the thread private ThreadBlockingInfo* _next; // may be used by debuggers - [RequiresUnsafe] private void Push(void* objectPtr, ObjectKind objectKind, int timeoutMs) { Debug.Assert(objectPtr != null); diff --git a/src/libraries/System.Private.CoreLib/src/System/Threading/ThreadPool.Browser.cs b/src/libraries/System.Private.CoreLib/src/System/Threading/ThreadPool.Browser.cs index d234bd0a97b29e..3d1428d0c53b62 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Threading/ThreadPool.Browser.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Threading/ThreadPool.Browser.cs @@ -151,7 +151,6 @@ private static unsafe void NativeOverlappedCallback(nint overlappedPtr) => [CLSCompliant(false)] [SupportedOSPlatform("windows")] - [RequiresUnsafe] public static unsafe bool UnsafeQueueNativeOverlapped(NativeOverlapped* overlapped) { if (overlapped == null) diff --git a/src/libraries/System.Private.CoreLib/src/System/Threading/ThreadPool.Unix.cs b/src/libraries/System.Private.CoreLib/src/System/Threading/ThreadPool.Unix.cs index d83693ba4fca8e..b32478fdf76c62 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Threading/ThreadPool.Unix.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Threading/ThreadPool.Unix.cs @@ -96,7 +96,6 @@ internal static RegisteredWaitHandle RegisterWaitForSingleObject( [CLSCompliant(false)] [SupportedOSPlatform("windows")] - [RequiresUnsafe] public static unsafe bool UnsafeQueueNativeOverlapped(NativeOverlapped* overlapped) => throw new PlatformNotSupportedException(SR.PlatformNotSupported_OverlappedIO); diff --git a/src/libraries/System.Private.CoreLib/src/System/Threading/ThreadPool.Wasi.cs b/src/libraries/System.Private.CoreLib/src/System/Threading/ThreadPool.Wasi.cs index 8f0d1196fd15f5..5f983e1d3c4389 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Threading/ThreadPool.Wasi.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Threading/ThreadPool.Wasi.cs @@ -111,7 +111,6 @@ private static unsafe void NativeOverlappedCallback(nint overlappedPtr) => [CLSCompliant(false)] [SupportedOSPlatform("windows")] - [RequiresUnsafe] public static unsafe bool UnsafeQueueNativeOverlapped(NativeOverlapped* overlapped) { throw new PlatformNotSupportedException(); diff --git a/src/libraries/System.Private.CoreLib/src/System/Threading/ThreadPool.Windows.cs b/src/libraries/System.Private.CoreLib/src/System/Threading/ThreadPool.Windows.cs index 97e661ed696f77..223cea9c318e4e 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Threading/ThreadPool.Windows.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Threading/ThreadPool.Windows.cs @@ -46,7 +46,6 @@ internal static bool YieldFromDispatchLoop(int currentTickCount) [CLSCompliant(false)] [SupportedOSPlatform("windows")] - [RequiresUnsafe] public static unsafe bool UnsafeQueueNativeOverlapped(NativeOverlapped* overlapped) => ThreadPool.UseWindowsThreadPool ? WindowsThreadPool.UnsafeQueueNativeOverlapped(overlapped) : diff --git a/src/libraries/System.Private.CoreLib/src/System/Threading/ThreadPoolBoundHandle.Portable.cs b/src/libraries/System.Private.CoreLib/src/System/Threading/ThreadPoolBoundHandle.Portable.cs index 030092d9d6e16e..faa1ae96fc0ed6 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Threading/ThreadPoolBoundHandle.Portable.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Threading/ThreadPoolBoundHandle.Portable.cs @@ -57,7 +57,6 @@ public sealed partial class ThreadPoolBoundHandle : IDisposable } } - [RequiresUnsafe] private unsafe void FreeNativeOverlappedPortableCore(NativeOverlapped* overlapped) { ArgumentNullException.ThrowIfNull(overlapped); @@ -75,7 +74,6 @@ private unsafe void FreeNativeOverlappedPortableCore(NativeOverlapped* overlappe Overlapped.Free(overlapped); } - [RequiresUnsafe] private static unsafe object? GetNativeOverlappedStatePortableCore(NativeOverlapped* overlapped) { ArgumentNullException.ThrowIfNull(overlapped); @@ -85,7 +83,6 @@ private unsafe void FreeNativeOverlappedPortableCore(NativeOverlapped* overlappe return wrapper._userState; } - [RequiresUnsafe] private static unsafe ThreadPoolBoundHandleOverlapped GetOverlappedWrapper(NativeOverlapped* overlapped) { ThreadPoolBoundHandleOverlapped wrapper; diff --git a/src/libraries/System.Private.CoreLib/src/System/Threading/ThreadPoolBoundHandleOverlapped.cs b/src/libraries/System.Private.CoreLib/src/System/Threading/ThreadPoolBoundHandleOverlapped.cs index 18ca08a9b858a2..218cf953e3c1a3 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Threading/ThreadPoolBoundHandleOverlapped.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Threading/ThreadPoolBoundHandleOverlapped.cs @@ -33,7 +33,6 @@ public ThreadPoolBoundHandleOverlapped(IOCompletionCallback callback, object? st _nativeOverlapped->OffsetHigh = 0; } - [RequiresUnsafe] private static void CompletionCallback(uint errorCode, uint numBytes, NativeOverlapped* nativeOverlapped) { ThreadPoolBoundHandleOverlapped overlapped = (ThreadPoolBoundHandleOverlapped)Unpack(nativeOverlapped); diff --git a/src/libraries/System.Private.CoreLib/src/System/Threading/Win32ThreadPoolNativeOverlapped.cs b/src/libraries/System.Private.CoreLib/src/System/Threading/Win32ThreadPoolNativeOverlapped.cs index 71541e383dadb1..6abdd10476f231 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Threading/Win32ThreadPoolNativeOverlapped.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Threading/Win32ThreadPoolNativeOverlapped.cs @@ -29,7 +29,6 @@ internal OverlappedData Data get { return s_dataArray![_dataIndex]; } } - [RequiresUnsafe] internal static unsafe Win32ThreadPoolNativeOverlapped* Allocate(IOCompletionCallback callback, object? state, object? pinData, PreAllocatedOverlapped? preAllocated, bool flowExecutionControl) { Win32ThreadPoolNativeOverlapped* overlapped = AllocateNew(); @@ -45,7 +44,6 @@ internal OverlappedData Data return overlapped; } - [RequiresUnsafe] private static unsafe Win32ThreadPoolNativeOverlapped* AllocateNew() { IntPtr freePtr; @@ -157,7 +155,6 @@ private void SetData(IOCompletionCallback callback, object? state, object? pinDa } } - [RequiresUnsafe] internal static unsafe void Free(Win32ThreadPoolNativeOverlapped* overlapped) { // Reset all data. @@ -185,7 +182,6 @@ internal static unsafe void Free(Win32ThreadPoolNativeOverlapped* overlapped) return (Win32ThreadPoolNativeOverlapped*)overlapped; } - [RequiresUnsafe] internal static unsafe void CompleteWithCallback(uint errorCode, uint bytesWritten, Win32ThreadPoolNativeOverlapped* overlapped) { OverlappedData data = overlapped->Data; diff --git a/src/libraries/System.Reflection.Emit.Lightweight/ref/System.Reflection.Emit.Lightweight.cs b/src/libraries/System.Reflection.Emit.Lightweight/ref/System.Reflection.Emit.Lightweight.cs index 40b02f13ef531e..f0d25faacd7b29 100644 --- a/src/libraries/System.Reflection.Emit.Lightweight/ref/System.Reflection.Emit.Lightweight.cs +++ b/src/libraries/System.Reflection.Emit.Lightweight/ref/System.Reflection.Emit.Lightweight.cs @@ -19,15 +19,12 @@ internal DynamicILInfo() { } public int GetTokenFor(System.RuntimeTypeHandle type) { throw null; } public int GetTokenFor(string literal) { throw null; } [System.CLSCompliantAttribute(false)] - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public unsafe void SetCode(byte* code, int codeSize, int maxStackSize) { } public void SetCode(byte[]? code, int maxStackSize) { } [System.CLSCompliantAttribute(false)] - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public unsafe void SetExceptions(byte* exceptions, int exceptionsSize) { } public void SetExceptions(byte[]? exceptions) { } [System.CLSCompliantAttribute(false)] - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public unsafe void SetLocalSignature(byte* localSignature, int signatureSize) { } public void SetLocalSignature(byte[]? localSignature) { } } diff --git a/src/libraries/System.Runtime.InteropServices/ref/System.Runtime.InteropServices.cs b/src/libraries/System.Runtime.InteropServices/ref/System.Runtime.InteropServices.cs index 55f5b7a0cb1226..07ef66f0e6a62d 100644 --- a/src/libraries/System.Runtime.InteropServices/ref/System.Runtime.InteropServices.cs +++ b/src/libraries/System.Runtime.InteropServices/ref/System.Runtime.InteropServices.cs @@ -489,7 +489,6 @@ public partial class StrategyBasedComWrappers : System.Runtime.InteropServices.C public StrategyBasedComWrappers() { } public static System.Runtime.InteropServices.Marshalling.IIUnknownInterfaceDetailsStrategy DefaultIUnknownInterfaceDetailsStrategy { get { throw null; } } public static System.Runtime.InteropServices.Marshalling.IIUnknownStrategy DefaultIUnknownStrategy { get { throw null; } } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] protected unsafe sealed override System.Runtime.InteropServices.ComWrappers.ComInterfaceEntry* ComputeVtables(object obj, System.Runtime.InteropServices.CreateComInterfaceFlags flags, out int count) { throw null; } protected virtual System.Runtime.InteropServices.Marshalling.IIUnknownCacheStrategy CreateCacheStrategy() { throw null; } protected static System.Runtime.InteropServices.Marshalling.IIUnknownCacheStrategy CreateDefaultCacheStrategy() { throw null; } @@ -768,11 +767,9 @@ public struct ComInterfaceEntry public struct ComInterfaceDispatch { public System.IntPtr Vtable; - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public unsafe static T GetInstance(ComInterfaceDispatch* dispatchPtr) where T : class { throw null; } } public System.IntPtr GetOrCreateComInterfaceForObject(object instance, System.Runtime.InteropServices.CreateComInterfaceFlags flags) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] protected unsafe abstract ComInterfaceEntry* ComputeVtables(object obj, System.Runtime.InteropServices.CreateComInterfaceFlags flags, out int count); public object GetOrCreateObjectForComInstance(System.IntPtr externalComObject, System.Runtime.InteropServices.CreateObjectFlags flags) { throw null; } public object GetOrCreateObjectForComInstance(System.IntPtr externalComObject, System.Runtime.InteropServices.CreateObjectFlags flags, object? userState) { throw null; } @@ -1300,10 +1297,8 @@ public static unsafe partial class NativeMemory [System.CLSCompliantAttribute(false)] public static void* AlignedAlloc(nuint byteCount, nuint alignment) { throw null; } [System.CLSCompliantAttribute(false)] - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static void AlignedFree(void* ptr) { } [System.CLSCompliantAttribute(false)] - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static void* AlignedRealloc(void* ptr, nuint byteCount, nuint alignment) { throw null; } [System.CLSCompliantAttribute(false)] public static void* Alloc(nuint byteCount) { throw null; } @@ -1314,19 +1309,14 @@ public static void AlignedFree(void* ptr) { } [System.CLSCompliantAttribute(false)] public static void* AllocZeroed(nuint elementCount, nuint elementSize) { throw null; } [System.CLSCompliantAttribute(false)] - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static void Free(void* ptr) { } [System.CLSCompliantAttribute(false)] - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static void* Realloc(void* ptr, nuint byteCount) { throw null; } [System.CLSCompliantAttribute(false)] - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static void Clear(void* ptr, nuint byteCount) { throw null; } [System.CLSCompliantAttribute(false)] - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static void Copy(void* source, void* destination, nuint byteCount) { throw null; } [System.CLSCompliantAttribute(false)] - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static void Fill(void* ptr, nuint byteCount, byte value) { throw null; } } public readonly partial struct NFloat : System.IComparable, System.IComparable, System.IEquatable, System.IFormattable, System.IParsable, System.ISpanFormattable, System.ISpanParsable, System.Numerics.IAdditionOperators, System.Numerics.IAdditiveIdentity, System.Numerics.IBinaryFloatingPointIeee754, System.Numerics.IBinaryNumber, System.Numerics.IBitwiseOperators, System.Numerics.IComparisonOperators, System.Numerics.IDecrementOperators, System.Numerics.IDivisionOperators, System.Numerics.IEqualityOperators, System.Numerics.IExponentialFunctions, System.Numerics.IFloatingPoint, System.Numerics.IFloatingPointConstants, System.Numerics.IFloatingPointIeee754, System.Numerics.IHyperbolicFunctions, System.Numerics.IIncrementOperators, System.Numerics.ILogarithmicFunctions, System.Numerics.IMinMaxValue, System.Numerics.IModulusOperators, System.Numerics.IMultiplicativeIdentity, System.Numerics.IMultiplyOperators, System.Numerics.INumber, System.Numerics.INumberBase, System.Numerics.IPowerFunctions, System.Numerics.IRootFunctions, System.Numerics.ISignedNumber, System.Numerics.ISubtractionOperators, System.Numerics.ITrigonometricFunctions, System.Numerics.IUnaryNegationOperators, System.Numerics.IUnaryPlusOperators, System.IUtf8SpanFormattable @@ -2408,13 +2398,9 @@ public struct ComponentCrossReference [System.CLSCompliantAttribute(false)] public static class JavaMarshal { - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Initialize(delegate* unmanaged markCrossReferences) => throw null; - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe GCHandle CreateReferenceTrackingHandle(object obj, void* context) => throw null; - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void* GetContext(GCHandle obj) => throw null; - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void FinishCrossReferenceProcessing( MarkCrossReferencesArgs* crossReferences, System.ReadOnlySpan unreachableObjectHandles) => throw null; @@ -2454,7 +2440,6 @@ public static class ObjectiveCMarshal System.Exception exception, System.RuntimeMethodHandle lastMethod, out System.IntPtr context); - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Initialize( delegate* unmanaged beginEndCallback, delegate* unmanaged isReferencedCallback, @@ -2486,18 +2471,14 @@ namespace System.Runtime.InteropServices.Marshalling typeof(System.Runtime.InteropServices.Marshalling.AnsiStringMarshaller.ManagedToUnmanagedIn))] public static unsafe class AnsiStringMarshaller { - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static byte* ConvertToUnmanaged(string? managed) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static string? ConvertToManaged(byte* unmanaged) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static void Free(byte* unmanaged) { throw null; } public ref struct ManagedToUnmanagedIn { public static int BufferSize { get { throw null; } } public void FromManaged(string? managed, System.Span buffer) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public byte* ToUnmanaged() { throw null; } public void Free() { throw null; } } @@ -2514,16 +2495,12 @@ public ref struct ManagedToUnmanagedIn public static unsafe class ArrayMarshaller where TUnmanagedElement : unmanaged { - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static TUnmanagedElement* AllocateContainerForUnmanagedElements(T[]? managed, out int numElements) { throw null; } public static System.ReadOnlySpan GetManagedValuesSource(T[]? managed) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static System.Span GetUnmanagedValuesDestination(TUnmanagedElement* unmanaged, int numElements) { throw null; } public static T[]? AllocateContainerForManagedElements(TUnmanagedElement* unmanaged, int numElements) { throw null; } public static System.Span GetManagedValuesDestination(T[]? managed) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static System.ReadOnlySpan GetUnmanagedValuesSource(TUnmanagedElement* unmanagedValue, int numElements) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static void Free(TUnmanagedElement* unmanaged) { } public unsafe ref struct ManagedToUnmanagedIn @@ -2536,7 +2513,6 @@ public void FromManaged(T[]? array, System.Span buffer) { } public System.Span GetUnmanagedValuesDestination() { throw null; } public ref TUnmanagedElement GetPinnableReference() { throw null; } public static ref T GetPinnableReference(T[]? array) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public TUnmanagedElement* ToUnmanaged() { throw null; } public void Free() { } } @@ -2551,16 +2527,13 @@ public void Free() { } public static unsafe class BStrStringMarshaller { public static ushort* ConvertToUnmanaged(string? managed) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static string? ConvertToManaged(ushort* unmanaged) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static void Free(ushort* unmanaged) { throw null; } public ref struct ManagedToUnmanagedIn { public static int BufferSize { get { throw null; } } public void FromManaged(string? managed, System.Span buffer) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public ushort* ToUnmanaged() { throw null; } public void Free() { throw null; } } @@ -2590,14 +2563,10 @@ public static unsafe class PointerArrayMarshaller { public static TUnmanagedElement* AllocateContainerForUnmanagedElements(T*[]? managed, out int numElements) { throw null; } public static System.ReadOnlySpan GetManagedValuesSource(T*[]? managed) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static System.Span GetUnmanagedValuesDestination(TUnmanagedElement* unmanaged, int numElements) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static T*[]? AllocateContainerForManagedElements(TUnmanagedElement* unmanaged, int numElements) { throw null; } public static System.Span GetManagedValuesDestination(T*[]? managed) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static System.ReadOnlySpan GetUnmanagedValuesSource(TUnmanagedElement* unmanagedValue, int numElements) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static void Free(TUnmanagedElement* unmanaged) { } public unsafe ref struct ManagedToUnmanagedIn @@ -2610,7 +2579,6 @@ public void FromManaged(T*[]? array, System.Span buffer) { } public System.Span GetUnmanagedValuesDestination() { throw null; } public ref TUnmanagedElement GetPinnableReference() { throw null; } public static ref byte GetPinnableReference(T*[]? array) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public TUnmanagedElement* ToUnmanaged() { throw null; } public void Free() { } } @@ -2624,18 +2592,14 @@ public void Free() { } typeof(System.Runtime.InteropServices.Marshalling.Utf8StringMarshaller.ManagedToUnmanagedIn))] public static unsafe class Utf8StringMarshaller { - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static byte* ConvertToUnmanaged(string? managed) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static string? ConvertToManaged(byte* unmanaged) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static void Free(byte* unmanaged) { throw null; } public ref struct ManagedToUnmanagedIn { public static int BufferSize { get { throw null; } } public void FromManaged(string? managed, System.Span buffer) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public byte* ToUnmanaged() { throw null; } public void Free() { throw null; } } @@ -2647,9 +2611,7 @@ public ref struct ManagedToUnmanagedIn public static unsafe class Utf16StringMarshaller { public static ushort* ConvertToUnmanaged(string? managed) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static string? ConvertToManaged(ushort* unmanaged) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static void Free(ushort* unmanaged) { throw null; } public static ref readonly char GetPinnableReference(string? str) { throw null; } } @@ -2673,7 +2635,6 @@ public sealed partial class SecureString : System.IDisposable { public SecureString() { } [System.CLSCompliantAttribute(false)] - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public unsafe SecureString(char* value, int length) { } public int Length { get { throw null; } } public void AppendChar(char c) { } diff --git a/src/libraries/System.Runtime.InteropServices/src/System/Runtime/InteropServices/Marshalling/StrategyBasedComWrappers.cs b/src/libraries/System.Runtime.InteropServices/src/System/Runtime/InteropServices/Marshalling/StrategyBasedComWrappers.cs index 689af605a2b7a9..74c147a5c2c21f 100644 --- a/src/libraries/System.Runtime.InteropServices/src/System/Runtime/InteropServices/Marshalling/StrategyBasedComWrappers.cs +++ b/src/libraries/System.Runtime.InteropServices/src/System/Runtime/InteropServices/Marshalling/StrategyBasedComWrappers.cs @@ -79,7 +79,6 @@ static IIUnknownInterfaceDetailsStrategy GetInteropStrategy() protected virtual IIUnknownCacheStrategy CreateCacheStrategy() => CreateDefaultCacheStrategy(); /// - [RequiresUnsafe] protected sealed override unsafe ComInterfaceEntry* ComputeVtables(object obj, CreateComInterfaceFlags flags, out int count) { if (GetOrCreateInterfaceDetailsStrategy().GetComExposedTypeDetails(obj.GetType().TypeHandle) is { } details) diff --git a/src/libraries/System.Runtime.Intrinsics/ref/System.Runtime.Intrinsics.cs b/src/libraries/System.Runtime.Intrinsics/ref/System.Runtime.Intrinsics.cs index de7788351ca6da..855363fbe75383 100644 --- a/src/libraries/System.Runtime.Intrinsics/ref/System.Runtime.Intrinsics.cs +++ b/src/libraries/System.Runtime.Intrinsics/ref/System.Runtime.Intrinsics.cs @@ -230,13 +230,10 @@ public static void CopyTo(this System.Runtime.Intrinsics.Vector128 vector, public static System.Runtime.Intrinsics.Vector128 LessThanOrEqual(System.Runtime.Intrinsics.Vector128 left, System.Runtime.Intrinsics.Vector128 right) { throw null; } public static System.Runtime.Intrinsics.Vector128 LessThan(System.Runtime.Intrinsics.Vector128 left, System.Runtime.Intrinsics.Vector128 right) { throw null; } [System.CLSCompliantAttribute(false)] - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 Load(T* source) { throw null; } [System.CLSCompliantAttribute(false)] - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 LoadAligned(T* source) { throw null; } [System.CLSCompliantAttribute(false)] - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 LoadAlignedNonTemporal(T* source) { throw null; } public static System.Runtime.Intrinsics.Vector128 LoadUnsafe(ref readonly T source) { throw null; } [System.CLSCompliantAttribute(false)] @@ -362,13 +359,10 @@ public static void CopyTo(this System.Runtime.Intrinsics.Vector128 vector, public static (System.Runtime.Intrinsics.Vector128 Sin, System.Runtime.Intrinsics.Vector128 Cos) SinCos(System.Runtime.Intrinsics.Vector128 vector) { throw null; } public static System.Runtime.Intrinsics.Vector128 Sqrt(System.Runtime.Intrinsics.Vector128 vector) { throw null; } [System.CLSCompliantAttribute(false)] - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Store(this System.Runtime.Intrinsics.Vector128 source, T* destination) { throw null; } [System.CLSCompliantAttribute(false)] - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreAligned(this System.Runtime.Intrinsics.Vector128 source, T* destination) { throw null; } [System.CLSCompliantAttribute(false)] - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreAlignedNonTemporal(this System.Runtime.Intrinsics.Vector128 source, T* destination) { throw null; } public static void StoreUnsafe(this System.Runtime.Intrinsics.Vector128 source, ref T destination) { throw null; } [System.CLSCompliantAttribute(false)] @@ -682,13 +676,10 @@ public static void CopyTo(this System.Runtime.Intrinsics.Vector256 vector, public static System.Runtime.Intrinsics.Vector256 LessThanOrEqual(System.Runtime.Intrinsics.Vector256 left, System.Runtime.Intrinsics.Vector256 right) { throw null; } public static System.Runtime.Intrinsics.Vector256 LessThan(System.Runtime.Intrinsics.Vector256 left, System.Runtime.Intrinsics.Vector256 right) { throw null; } [System.CLSCompliantAttribute(false)] - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector256 Load(T* source) { throw null; } [System.CLSCompliantAttribute(false)] - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector256 LoadAligned(T* source) { throw null; } [System.CLSCompliantAttribute(false)] - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector256 LoadAlignedNonTemporal(T* source) { throw null; } public static System.Runtime.Intrinsics.Vector256 LoadUnsafe(ref readonly T source) { throw null; } [System.CLSCompliantAttribute(false)] @@ -814,13 +805,10 @@ public static void CopyTo(this System.Runtime.Intrinsics.Vector256 vector, public static (System.Runtime.Intrinsics.Vector256 Sin, System.Runtime.Intrinsics.Vector256 Cos) SinCos(System.Runtime.Intrinsics.Vector256 vector) { throw null; } public static System.Runtime.Intrinsics.Vector256 Sqrt(System.Runtime.Intrinsics.Vector256 vector) { throw null; } [System.CLSCompliantAttribute(false)] - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Store(this System.Runtime.Intrinsics.Vector256 source, T* destination) { throw null; } [System.CLSCompliantAttribute(false)] - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreAligned(this System.Runtime.Intrinsics.Vector256 source, T* destination) { throw null; } [System.CLSCompliantAttribute(false)] - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreAlignedNonTemporal(this System.Runtime.Intrinsics.Vector256 source, T* destination) { throw null; } public static void StoreUnsafe(this System.Runtime.Intrinsics.Vector256 source, ref T destination) { throw null; } [System.CLSCompliantAttribute(false)] @@ -1135,13 +1123,10 @@ public static void CopyTo(this System.Runtime.Intrinsics.Vector512 vector, public static System.Runtime.Intrinsics.Vector512 LessThanOrEqual(System.Runtime.Intrinsics.Vector512 left, System.Runtime.Intrinsics.Vector512 right) { throw null; } public static System.Runtime.Intrinsics.Vector512 LessThan(System.Runtime.Intrinsics.Vector512 left, System.Runtime.Intrinsics.Vector512 right) { throw null; } [System.CLSCompliantAttribute(false)] - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector512 Load(T* source) { throw null; } [System.CLSCompliantAttribute(false)] - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector512 LoadAligned(T* source) { throw null; } [System.CLSCompliantAttribute(false)] - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector512 LoadAlignedNonTemporal(T* source) { throw null; } public static System.Runtime.Intrinsics.Vector512 LoadUnsafe(ref readonly T source) { throw null; } [System.CLSCompliantAttribute(false)] @@ -1267,13 +1252,10 @@ public static void CopyTo(this System.Runtime.Intrinsics.Vector512 vector, public static (System.Runtime.Intrinsics.Vector512 Sin, System.Runtime.Intrinsics.Vector512 Cos) SinCos(System.Runtime.Intrinsics.Vector512 vector) { throw null; } public static System.Runtime.Intrinsics.Vector512 Sqrt(System.Runtime.Intrinsics.Vector512 vector) { throw null; } [System.CLSCompliantAttribute(false)] - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Store(this System.Runtime.Intrinsics.Vector512 source, T* destination) { throw null; } [System.CLSCompliantAttribute(false)] - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreAligned(this System.Runtime.Intrinsics.Vector512 source, T* destination) { throw null; } [System.CLSCompliantAttribute(false)] - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreAlignedNonTemporal(this System.Runtime.Intrinsics.Vector512 source, T* destination) { throw null; } public static void StoreUnsafe(this System.Runtime.Intrinsics.Vector512 source, ref T destination) { throw null; } [System.CLSCompliantAttribute(false)] @@ -1557,13 +1539,10 @@ public static void CopyTo(this System.Runtime.Intrinsics.Vector64 vector, public static System.Runtime.Intrinsics.Vector64 LessThanOrEqual(System.Runtime.Intrinsics.Vector64 left, System.Runtime.Intrinsics.Vector64 right) { throw null; } public static System.Runtime.Intrinsics.Vector64 LessThan(System.Runtime.Intrinsics.Vector64 left, System.Runtime.Intrinsics.Vector64 right) { throw null; } [System.CLSCompliantAttribute(false)] - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector64 Load(T* source) { throw null; } [System.CLSCompliantAttribute(false)] - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector64 LoadAligned(T* source) { throw null; } [System.CLSCompliantAttribute(false)] - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector64 LoadAlignedNonTemporal(T* source) { throw null; } public static System.Runtime.Intrinsics.Vector64 LoadUnsafe(ref readonly T source) { throw null; } [System.CLSCompliantAttribute(false)] @@ -1681,13 +1660,10 @@ public static void CopyTo(this System.Runtime.Intrinsics.Vector64 vector, public static (System.Runtime.Intrinsics.Vector64 Sin, System.Runtime.Intrinsics.Vector64 Cos) SinCos(System.Runtime.Intrinsics.Vector64 vector) { throw null; } public static System.Runtime.Intrinsics.Vector64 Sqrt(System.Runtime.Intrinsics.Vector64 vector) { throw null; } [System.CLSCompliantAttribute(false)] - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Store(this System.Runtime.Intrinsics.Vector64 source, T* destination) { throw null; } [System.CLSCompliantAttribute(false)] - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreAligned(this System.Runtime.Intrinsics.Vector64 source, T* destination) { throw null; } [System.CLSCompliantAttribute(false)] - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreAlignedNonTemporal(this System.Runtime.Intrinsics.Vector64 source, T* destination) { throw null; } public static void StoreUnsafe(this System.Runtime.Intrinsics.Vector64 source, ref T destination) { throw null; } [System.CLSCompliantAttribute(false)] @@ -2367,275 +2343,140 @@ internal AdvSimd() { } public static System.Runtime.Intrinsics.Vector64 LeadingZeroCount(System.Runtime.Intrinsics.Vector64 value) { throw null; } public static System.Runtime.Intrinsics.Vector64 LeadingZeroCount(System.Runtime.Intrinsics.Vector64 value) { throw null; } public static System.Runtime.Intrinsics.Vector64 LeadingZeroCount(System.Runtime.Intrinsics.Vector64 value) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 LoadAndInsertScalar(System.Runtime.Intrinsics.Vector128 value, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Max = (byte)(15))] byte index, byte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 LoadAndInsertScalar(System.Runtime.Intrinsics.Vector128 value, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Max = (byte)(1))] byte index, double* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 LoadAndInsertScalar(System.Runtime.Intrinsics.Vector128 value, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Max = (byte)(7))] byte index, short* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 LoadAndInsertScalar(System.Runtime.Intrinsics.Vector128 value, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Max = (byte)(3))] byte index, int* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 LoadAndInsertScalar(System.Runtime.Intrinsics.Vector128 value, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Max = (byte)(1))] byte index, long* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 LoadAndInsertScalar(System.Runtime.Intrinsics.Vector128 value, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Max = (byte)(15))] byte index, sbyte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 LoadAndInsertScalar(System.Runtime.Intrinsics.Vector128 value, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Max = (byte)(3))] byte index, float* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 LoadAndInsertScalar(System.Runtime.Intrinsics.Vector128 value, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Max = (byte)(7))] byte index, ushort* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 LoadAndInsertScalar(System.Runtime.Intrinsics.Vector128 value, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Max = (byte)(3))] byte index, uint* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 LoadAndInsertScalar(System.Runtime.Intrinsics.Vector128 value, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Max = (byte)(1))] byte index, ulong* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector64 LoadAndInsertScalar(System.Runtime.Intrinsics.Vector64 value, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Max = (byte)(7))] byte index, byte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector64 LoadAndInsertScalar(System.Runtime.Intrinsics.Vector64 value, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Max = (byte)(3))] byte index, short* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector64 LoadAndInsertScalar(System.Runtime.Intrinsics.Vector64 value, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Max = (byte)(1))] byte index, int* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector64 LoadAndInsertScalar(System.Runtime.Intrinsics.Vector64 value, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Max = (byte)(7))] byte index, sbyte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector64 LoadAndInsertScalar(System.Runtime.Intrinsics.Vector64 value, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Max = (byte)(1))] byte index, float* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector64 LoadAndInsertScalar(System.Runtime.Intrinsics.Vector64 value, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Max = (byte)(3))] byte index, ushort* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector64 LoadAndInsertScalar(System.Runtime.Intrinsics.Vector64 value, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Max = (byte)(1))] byte index, uint* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2) LoadAndInsertScalar((System.Runtime.Intrinsics.Vector64, System.Runtime.Intrinsics.Vector64) values, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Max = (byte)(7))] byte index, byte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2) LoadAndInsertScalar((System.Runtime.Intrinsics.Vector64, System.Runtime.Intrinsics.Vector64) values, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Max = (byte)(7))] byte index, sbyte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2) LoadAndInsertScalar((System.Runtime.Intrinsics.Vector64, System.Runtime.Intrinsics.Vector64) values, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Max = (byte)(3))] byte index, short* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2) LoadAndInsertScalar((System.Runtime.Intrinsics.Vector64, System.Runtime.Intrinsics.Vector64) values, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Max = (byte)(3))] byte index, ushort* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2) LoadAndInsertScalar((System.Runtime.Intrinsics.Vector64, System.Runtime.Intrinsics.Vector64) values, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Max = (byte)(1))] byte index, int* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2) LoadAndInsertScalar((System.Runtime.Intrinsics.Vector64, System.Runtime.Intrinsics.Vector64) values, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Max = (byte)(1))] byte index, uint* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2) LoadAndInsertScalar((System.Runtime.Intrinsics.Vector64, System.Runtime.Intrinsics.Vector64) values, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Max = (byte)(1))] byte index, float* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3) LoadAndInsertScalar((System.Runtime.Intrinsics.Vector64, System.Runtime.Intrinsics.Vector64, System.Runtime.Intrinsics.Vector64) values, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Max = (byte)(7))] byte index, byte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3) LoadAndInsertScalar((System.Runtime.Intrinsics.Vector64, System.Runtime.Intrinsics.Vector64, System.Runtime.Intrinsics.Vector64) values, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Max = (byte)(7))] byte index, sbyte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3) LoadAndInsertScalar((System.Runtime.Intrinsics.Vector64, System.Runtime.Intrinsics.Vector64, System.Runtime.Intrinsics.Vector64) values, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Max = (byte)(3))] byte index, short* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3) LoadAndInsertScalar((System.Runtime.Intrinsics.Vector64, System.Runtime.Intrinsics.Vector64, System.Runtime.Intrinsics.Vector64) values, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Max = (byte)(3))] byte index, ushort* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3) LoadAndInsertScalar((System.Runtime.Intrinsics.Vector64, System.Runtime.Intrinsics.Vector64, System.Runtime.Intrinsics.Vector64) values, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Max = (byte)(1))] byte index, int* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3) LoadAndInsertScalar((System.Runtime.Intrinsics.Vector64, System.Runtime.Intrinsics.Vector64, System.Runtime.Intrinsics.Vector64) values, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Max = (byte)(1))] byte index, uint* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3) LoadAndInsertScalar((System.Runtime.Intrinsics.Vector64, System.Runtime.Intrinsics.Vector64, System.Runtime.Intrinsics.Vector64) values, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Max = (byte)(1))] byte index, float* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3, System.Runtime.Intrinsics.Vector64 Value4) LoadAndInsertScalar((System.Runtime.Intrinsics.Vector64, System.Runtime.Intrinsics.Vector64, System.Runtime.Intrinsics.Vector64, System.Runtime.Intrinsics.Vector64) values, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Max = (byte)(7))] byte index, byte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3, System.Runtime.Intrinsics.Vector64 Value4) LoadAndInsertScalar((System.Runtime.Intrinsics.Vector64, System.Runtime.Intrinsics.Vector64, System.Runtime.Intrinsics.Vector64, System.Runtime.Intrinsics.Vector64) values, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Max = (byte)(7))] byte index, sbyte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3, System.Runtime.Intrinsics.Vector64 Value4) LoadAndInsertScalar((System.Runtime.Intrinsics.Vector64, System.Runtime.Intrinsics.Vector64, System.Runtime.Intrinsics.Vector64, System.Runtime.Intrinsics.Vector64) values, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Max = (byte)(3))] byte index, short* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3, System.Runtime.Intrinsics.Vector64 Value4) LoadAndInsertScalar((System.Runtime.Intrinsics.Vector64, System.Runtime.Intrinsics.Vector64, System.Runtime.Intrinsics.Vector64, System.Runtime.Intrinsics.Vector64) values, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Max = (byte)(3))] byte index, ushort* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3, System.Runtime.Intrinsics.Vector64 Value4) LoadAndInsertScalar((System.Runtime.Intrinsics.Vector64, System.Runtime.Intrinsics.Vector64, System.Runtime.Intrinsics.Vector64, System.Runtime.Intrinsics.Vector64) values, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Max = (byte)(1))] byte index, int* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3, System.Runtime.Intrinsics.Vector64 Value4) LoadAndInsertScalar((System.Runtime.Intrinsics.Vector64, System.Runtime.Intrinsics.Vector64, System.Runtime.Intrinsics.Vector64, System.Runtime.Intrinsics.Vector64) values, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Max = (byte)(1))] byte index, uint* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3, System.Runtime.Intrinsics.Vector64 Value4) LoadAndInsertScalar((System.Runtime.Intrinsics.Vector64, System.Runtime.Intrinsics.Vector64, System.Runtime.Intrinsics.Vector64, System.Runtime.Intrinsics.Vector64) values, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Max = (byte)(1))] byte index, float* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 LoadAndReplicateToVector128(byte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 LoadAndReplicateToVector128(short* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 LoadAndReplicateToVector128(int* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 LoadAndReplicateToVector128(sbyte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 LoadAndReplicateToVector128(float* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 LoadAndReplicateToVector128(ushort* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 LoadAndReplicateToVector128(uint* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector64 LoadAndReplicateToVector64(byte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector64 LoadAndReplicateToVector64(short* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector64 LoadAndReplicateToVector64(int* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector64 LoadAndReplicateToVector64(sbyte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector64 LoadAndReplicateToVector64(float* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector64 LoadAndReplicateToVector64(ushort* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector64 LoadAndReplicateToVector64(uint* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2) LoadAndReplicateToVector64x2(byte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2) LoadAndReplicateToVector64x2(sbyte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2) LoadAndReplicateToVector64x2(short* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2) LoadAndReplicateToVector64x2(ushort* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2) LoadAndReplicateToVector64x2(int* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2) LoadAndReplicateToVector64x2(uint* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2) LoadAndReplicateToVector64x2(float* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3) LoadAndReplicateToVector64x3(byte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3) LoadAndReplicateToVector64x3(sbyte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3) LoadAndReplicateToVector64x3(short* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3) LoadAndReplicateToVector64x3(ushort* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3) LoadAndReplicateToVector64x3(int* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3) LoadAndReplicateToVector64x3(uint* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3) LoadAndReplicateToVector64x3(float* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3, System.Runtime.Intrinsics.Vector64 Value4) LoadAndReplicateToVector64x4(byte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3, System.Runtime.Intrinsics.Vector64 Value4) LoadAndReplicateToVector64x4(sbyte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3, System.Runtime.Intrinsics.Vector64 Value4) LoadAndReplicateToVector64x4(short* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3, System.Runtime.Intrinsics.Vector64 Value4) LoadAndReplicateToVector64x4(ushort* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3, System.Runtime.Intrinsics.Vector64 Value4) LoadAndReplicateToVector64x4(int* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3, System.Runtime.Intrinsics.Vector64 Value4) LoadAndReplicateToVector64x4(uint* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3, System.Runtime.Intrinsics.Vector64 Value4) LoadAndReplicateToVector64x4(float* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 LoadVector128(byte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 LoadVector128(double* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 LoadVector128(short* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 LoadVector128(int* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 LoadVector128(long* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 LoadVector128(sbyte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 LoadVector128(float* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 LoadVector128(ushort* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 LoadVector128(uint* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 LoadVector128(ulong* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector64 LoadVector64(byte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector64 LoadVector64(double* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector64 LoadVector64(short* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector64 LoadVector64(int* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector64 LoadVector64(long* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector64 LoadVector64(sbyte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector64 LoadVector64(float* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector64 LoadVector64(ushort* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector64 LoadVector64(uint* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector64 LoadVector64(ulong* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2) Load2xVector64AndUnzip(byte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2) Load2xVector64AndUnzip(sbyte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2) Load2xVector64AndUnzip(short* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2) Load2xVector64AndUnzip(ushort* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2) Load2xVector64AndUnzip(int* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2) Load2xVector64AndUnzip(uint* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2) Load2xVector64AndUnzip(float* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3) Load3xVector64AndUnzip(byte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3) Load3xVector64AndUnzip(sbyte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3) Load3xVector64AndUnzip(short* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3) Load3xVector64AndUnzip(ushort* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3) Load3xVector64AndUnzip(int* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3) Load3xVector64AndUnzip(uint* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3) Load3xVector64AndUnzip(float* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3, System.Runtime.Intrinsics.Vector64 Value4) Load4xVector64AndUnzip(byte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3, System.Runtime.Intrinsics.Vector64 Value4) Load4xVector64AndUnzip(sbyte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3, System.Runtime.Intrinsics.Vector64 Value4) Load4xVector64AndUnzip(short* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3, System.Runtime.Intrinsics.Vector64 Value4) Load4xVector64AndUnzip(ushort* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3, System.Runtime.Intrinsics.Vector64 Value4) Load4xVector64AndUnzip(int* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3, System.Runtime.Intrinsics.Vector64 Value4) Load4xVector64AndUnzip(uint* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3, System.Runtime.Intrinsics.Vector64 Value4) Load4xVector64AndUnzip(float* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2) Load2xVector64(byte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2) Load2xVector64(sbyte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2) Load2xVector64(short* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2) Load2xVector64(ushort* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2) Load2xVector64(int* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2) Load2xVector64(uint* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2) Load2xVector64(float* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3) Load3xVector64(byte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3) Load3xVector64(sbyte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3) Load3xVector64(short* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3) Load3xVector64(ushort* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3) Load3xVector64(int* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3) Load3xVector64(uint* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3) Load3xVector64(float* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3, System.Runtime.Intrinsics.Vector64 Value4) Load4xVector64(byte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3, System.Runtime.Intrinsics.Vector64 Value4) Load4xVector64(sbyte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3, System.Runtime.Intrinsics.Vector64 Value4) Load4xVector64(short* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3, System.Runtime.Intrinsics.Vector64 Value4) Load4xVector64(ushort* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3, System.Runtime.Intrinsics.Vector64 Value4) Load4xVector64(int* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3, System.Runtime.Intrinsics.Vector64 Value4) Load4xVector64(uint* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3, System.Runtime.Intrinsics.Vector64 Value4) Load4xVector64(float* address) { throw null; } public static System.Runtime.Intrinsics.Vector128 Max(System.Runtime.Intrinsics.Vector128 left, System.Runtime.Intrinsics.Vector128 right) { throw null; } public static System.Runtime.Intrinsics.Vector128 Max(System.Runtime.Intrinsics.Vector128 left, System.Runtime.Intrinsics.Vector128 right) { throw null; } @@ -3476,205 +3317,105 @@ internal AdvSimd() { } public static System.Runtime.Intrinsics.Vector128 SignExtendWideningUpper(System.Runtime.Intrinsics.Vector128 value) { throw null; } public static System.Runtime.Intrinsics.Vector64 SqrtScalar(System.Runtime.Intrinsics.Vector64 value) { throw null; } public static System.Runtime.Intrinsics.Vector64 SqrtScalar(System.Runtime.Intrinsics.Vector64 value) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Store(byte* address, System.Runtime.Intrinsics.Vector128 source) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Store(byte* address, System.Runtime.Intrinsics.Vector64 source) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Store(double* address, System.Runtime.Intrinsics.Vector128 source) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Store(double* address, System.Runtime.Intrinsics.Vector64 source) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Store(short* address, System.Runtime.Intrinsics.Vector128 source) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Store(short* address, System.Runtime.Intrinsics.Vector64 source) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Store(int* address, System.Runtime.Intrinsics.Vector128 source) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Store(int* address, System.Runtime.Intrinsics.Vector64 source) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Store(long* address, System.Runtime.Intrinsics.Vector128 source) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Store(long* address, System.Runtime.Intrinsics.Vector64 source) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Store(sbyte* address, System.Runtime.Intrinsics.Vector128 source) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Store(sbyte* address, System.Runtime.Intrinsics.Vector64 source) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Store(float* address, System.Runtime.Intrinsics.Vector128 source) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Store(float* address, System.Runtime.Intrinsics.Vector64 source) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Store(ushort* address, System.Runtime.Intrinsics.Vector128 source) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Store(ushort* address, System.Runtime.Intrinsics.Vector64 source) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Store(uint* address, System.Runtime.Intrinsics.Vector128 source) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Store(uint* address, System.Runtime.Intrinsics.Vector64 source) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Store(ulong* address, System.Runtime.Intrinsics.Vector128 source) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Store(ulong* address, System.Runtime.Intrinsics.Vector64 source) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreSelectedScalar(byte* address, System.Runtime.Intrinsics.Vector128 value, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Max = (byte)(15))] byte index) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreSelectedScalar(byte* address, System.Runtime.Intrinsics.Vector64 value, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Max = (byte)(7))] byte index) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreSelectedScalar(double* address, System.Runtime.Intrinsics.Vector128 value, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Max = (byte)(1))] byte index) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreSelectedScalar(short* address, System.Runtime.Intrinsics.Vector128 value, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Max = (byte)(7))] byte index) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreSelectedScalar(short* address, System.Runtime.Intrinsics.Vector64 value, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Max = (byte)(3))] byte index) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreSelectedScalar(int* address, System.Runtime.Intrinsics.Vector128 value, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Max = (byte)(3))] byte index) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreSelectedScalar(int* address, System.Runtime.Intrinsics.Vector64 value, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Max = (byte)(1))] byte index) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreSelectedScalar(long* address, System.Runtime.Intrinsics.Vector128 value, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Max = (byte)(1))] byte index) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreSelectedScalar(sbyte* address, System.Runtime.Intrinsics.Vector128 value, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Max = (byte)(15))] byte index) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreSelectedScalar(sbyte* address, System.Runtime.Intrinsics.Vector64 value, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Max = (byte)(7))] byte index) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreSelectedScalar(float* address, System.Runtime.Intrinsics.Vector128 value, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Max = (byte)(3))] byte index) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreSelectedScalar(float* address, System.Runtime.Intrinsics.Vector64 value, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Max = (byte)(1))] byte index) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreSelectedScalar(ushort* address, System.Runtime.Intrinsics.Vector128 value, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Max = (byte)(7))] byte index) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreSelectedScalar(ushort* address, System.Runtime.Intrinsics.Vector64 value, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Max = (byte)(3))] byte index) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreSelectedScalar(uint* address, System.Runtime.Intrinsics.Vector128 value, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Max = (byte)(3))] byte index) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreSelectedScalar(uint* address, System.Runtime.Intrinsics.Vector64 value, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Max = (byte)(1))] byte index) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreSelectedScalar(ulong* address, System.Runtime.Intrinsics.Vector128 value, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Max = (byte)(1))] byte index) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreSelectedScalar(byte* address, (System.Runtime.Intrinsics.Vector64 value1, System.Runtime.Intrinsics.Vector64 value2) value, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Max = (byte)(7))] byte index) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreSelectedScalar(sbyte* address, (System.Runtime.Intrinsics.Vector64 value1, System.Runtime.Intrinsics.Vector64 value2) value, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Max = (byte)(7))] byte index) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreSelectedScalar(short* address, (System.Runtime.Intrinsics.Vector64 value1, System.Runtime.Intrinsics.Vector64 value2) value, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Max = (byte)(3))] byte index) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreSelectedScalar(ushort* address, (System.Runtime.Intrinsics.Vector64 value1, System.Runtime.Intrinsics.Vector64 value2) value, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Max = (byte)(3))] byte index) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreSelectedScalar(int* address, (System.Runtime.Intrinsics.Vector64 value1, System.Runtime.Intrinsics.Vector64 value2) value, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Max = (byte)(1))] byte index) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreSelectedScalar(uint* address, (System.Runtime.Intrinsics.Vector64 value1, System.Runtime.Intrinsics.Vector64 value2) value, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Max = (byte)(1))] byte index) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreSelectedScalar(float* address, (System.Runtime.Intrinsics.Vector64 value1, System.Runtime.Intrinsics.Vector64 value2) value, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Max = (byte)(1))] byte index) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreSelectedScalar(byte* address, (System.Runtime.Intrinsics.Vector64 value1, System.Runtime.Intrinsics.Vector64 value2, System.Runtime.Intrinsics.Vector64 value3) value, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Max = (byte)(7))] byte index) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreSelectedScalar(sbyte* address, (System.Runtime.Intrinsics.Vector64 value1, System.Runtime.Intrinsics.Vector64 value2, System.Runtime.Intrinsics.Vector64 value3) value, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Max = (byte)(7))] byte index) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreSelectedScalar(short* address, (System.Runtime.Intrinsics.Vector64 value1, System.Runtime.Intrinsics.Vector64 value2, System.Runtime.Intrinsics.Vector64 value3) value, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Max = (byte)(3))] byte index) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreSelectedScalar(ushort* address, (System.Runtime.Intrinsics.Vector64 value1, System.Runtime.Intrinsics.Vector64 value2, System.Runtime.Intrinsics.Vector64 value3) value, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Max = (byte)(3))] byte index) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreSelectedScalar(int* address, (System.Runtime.Intrinsics.Vector64 value1, System.Runtime.Intrinsics.Vector64 value2, System.Runtime.Intrinsics.Vector64 value3) value, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Max = (byte)(1))] byte index) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreSelectedScalar(uint* address, (System.Runtime.Intrinsics.Vector64 value1, System.Runtime.Intrinsics.Vector64 value2, System.Runtime.Intrinsics.Vector64 value3) value, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Max = (byte)(1))] byte index) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreSelectedScalar(float* address, (System.Runtime.Intrinsics.Vector64 value1, System.Runtime.Intrinsics.Vector64 value2, System.Runtime.Intrinsics.Vector64 value3) value, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Max = (byte)(1))] byte index) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreSelectedScalar(byte* address, (System.Runtime.Intrinsics.Vector64 value1, System.Runtime.Intrinsics.Vector64 value2, System.Runtime.Intrinsics.Vector64 value3, System.Runtime.Intrinsics.Vector64 value4) value, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Max = (byte)(7))] byte index) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreSelectedScalar(sbyte* address, (System.Runtime.Intrinsics.Vector64 value1, System.Runtime.Intrinsics.Vector64 value2, System.Runtime.Intrinsics.Vector64 value3, System.Runtime.Intrinsics.Vector64 value4) value, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Max = (byte)(7))] byte index) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreSelectedScalar(short* address, (System.Runtime.Intrinsics.Vector64 value1, System.Runtime.Intrinsics.Vector64 value2, System.Runtime.Intrinsics.Vector64 value3, System.Runtime.Intrinsics.Vector64 value4) value, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Max = (byte)(3))] byte index) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreSelectedScalar(ushort* address, (System.Runtime.Intrinsics.Vector64 value1, System.Runtime.Intrinsics.Vector64 value2, System.Runtime.Intrinsics.Vector64 value3, System.Runtime.Intrinsics.Vector64 value4) value, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Max = (byte)(3))] byte index) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreSelectedScalar(int* address, (System.Runtime.Intrinsics.Vector64 value1, System.Runtime.Intrinsics.Vector64 value2, System.Runtime.Intrinsics.Vector64 value3, System.Runtime.Intrinsics.Vector64 value4) value, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Max = (byte)(1))] byte index) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreSelectedScalar(uint* address, (System.Runtime.Intrinsics.Vector64 value1, System.Runtime.Intrinsics.Vector64 value2, System.Runtime.Intrinsics.Vector64 value3, System.Runtime.Intrinsics.Vector64 value4) value, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Max = (byte)(1))] byte index) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreSelectedScalar(float* address, (System.Runtime.Intrinsics.Vector64 value1, System.Runtime.Intrinsics.Vector64 value2, System.Runtime.Intrinsics.Vector64 value3, System.Runtime.Intrinsics.Vector64 value4) value, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Max = (byte)(1))] byte index) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public unsafe static void StoreVectorAndZip(byte* address, (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2) value) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public unsafe static void StoreVectorAndZip(sbyte* address, (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2) value) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public unsafe static void StoreVectorAndZip(short* address, (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2) value) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public unsafe static void StoreVectorAndZip(ushort* address, (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2) value) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public unsafe static void StoreVectorAndZip(int* address, (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2) value) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public unsafe static void StoreVectorAndZip(uint* address, (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2) value) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public unsafe static void StoreVectorAndZip(float* address, (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2) value) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreVectorAndZip(sbyte* address, (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3) value) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreVectorAndZip(short* address, (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3) value) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreVectorAndZip(ushort* address, (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3) value) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreVectorAndZip(byte* address, (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3) value) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreVectorAndZip(int* address, (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3) value) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreVectorAndZip(uint* address, (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3) value) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreVectorAndZip(float* address, (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3) value) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreVectorAndZip(byte* address, (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3, System.Runtime.Intrinsics.Vector64 Value4) value) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreVectorAndZip(sbyte* address, (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3, System.Runtime.Intrinsics.Vector64 Value4) value) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreVectorAndZip(short* address, (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3, System.Runtime.Intrinsics.Vector64 Value4) value) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreVectorAndZip(ushort* address, (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3, System.Runtime.Intrinsics.Vector64 Value4) value) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreVectorAndZip(int* address, (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3, System.Runtime.Intrinsics.Vector64 Value4) value) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreVectorAndZip(uint* address, (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3, System.Runtime.Intrinsics.Vector64 Value4) value) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreVectorAndZip(float* address, (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3, System.Runtime.Intrinsics.Vector64 Value4) value) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public unsafe static void Store(byte* address, (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2) value) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public unsafe static void Store(sbyte* address, (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2) value) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public unsafe static void Store(short* address, (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2) value) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public unsafe static void Store(ushort* address, (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2) value) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public unsafe static void Store(int* address, (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2) value) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public unsafe static void Store(uint* address, (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2) value) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public unsafe static void Store(float* address, (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2) value) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Store(byte* address, (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3) value) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Store(sbyte* address, (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3) value) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Store(short* address, (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3) value) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Store(ushort* address, (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3) value) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Store(int* address, (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3) value) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Store(uint* address, (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3) value) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Store(float* address, (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3) value) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Store(byte* address, (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3, System.Runtime.Intrinsics.Vector64 Value4) value) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Store(sbyte* address, (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3, System.Runtime.Intrinsics.Vector64 Value4) value) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Store(short* address, (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3, System.Runtime.Intrinsics.Vector64 Value4) value) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Store(ushort* address, (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3, System.Runtime.Intrinsics.Vector64 Value4) value) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Store(int* address, (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3, System.Runtime.Intrinsics.Vector64 Value4) value) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Store(uint* address, (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3, System.Runtime.Intrinsics.Vector64 Value4) value) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Store(float* address, (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3, System.Runtime.Intrinsics.Vector64 Value4) value) { throw null; } public static System.Runtime.Intrinsics.Vector128 Subtract(System.Runtime.Intrinsics.Vector128 left, System.Runtime.Intrinsics.Vector128 right) { throw null; } public static System.Runtime.Intrinsics.Vector128 Subtract(System.Runtime.Intrinsics.Vector128 left, System.Runtime.Intrinsics.Vector128 right) { throw null; } @@ -4044,343 +3785,174 @@ internal Arm64() { } public static System.Runtime.Intrinsics.Vector64 InsertSelectedScalar(System.Runtime.Intrinsics.Vector64 result, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Max = (byte)(3))] byte resultIndex, System.Runtime.Intrinsics.Vector64 value, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Max = (byte)(3))] byte valueIndex) { throw null; } public static System.Runtime.Intrinsics.Vector64 InsertSelectedScalar(System.Runtime.Intrinsics.Vector64 result, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Max = (byte)(1))] byte resultIndex, System.Runtime.Intrinsics.Vector128 value, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Max = (byte)(3))] byte valueIndex) { throw null; } public static System.Runtime.Intrinsics.Vector64 InsertSelectedScalar(System.Runtime.Intrinsics.Vector64 result, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Max = (byte)(1))] byte resultIndex, System.Runtime.Intrinsics.Vector64 value, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Max = (byte)(1))] byte valueIndex) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2) LoadAndInsertScalar((System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128) values, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Max = (byte)(15))] byte index, byte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2) LoadAndInsertScalar((System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128) values, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Max = (byte)(15))] byte index, sbyte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2) LoadAndInsertScalar((System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128) values, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Max = (byte)(7))] byte index, short* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2) LoadAndInsertScalar((System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128) values, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Max = (byte)(7))] byte index, ushort* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2) LoadAndInsertScalar((System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128) values, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Max = (byte)(3))] byte index, int* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2) LoadAndInsertScalar((System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128) values, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Max = (byte)(3))] byte index, uint* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2) LoadAndInsertScalar((System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128) values, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Max = (byte)(1))] byte index, long* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2) LoadAndInsertScalar((System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128) values, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Max = (byte)(1))] byte index, ulong* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2) LoadAndInsertScalar((System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128) values, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Max = (byte)(3))] byte index, float* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2) LoadAndInsertScalar((System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128) values, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Max = (byte)(1))] byte index, double* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3) LoadAndInsertScalar((System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128) values, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Max = (byte)(15))] byte index, byte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3) LoadAndInsertScalar((System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128) values, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Max = (byte)(15))] byte index, sbyte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3) LoadAndInsertScalar((System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128) values, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Max = (byte)(7))] byte index, short* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3) LoadAndInsertScalar((System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128) values, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Max = (byte)(7))] byte index, ushort* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3) LoadAndInsertScalar((System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128) values, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Max = (byte)(3))] byte index, int* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3) LoadAndInsertScalar((System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128) values, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Max = (byte)(3))] byte index, uint* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3) LoadAndInsertScalar((System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128) values, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Max = (byte)(1))] byte index, long* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3) LoadAndInsertScalar((System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128) values, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Max = (byte)(1))] byte index, ulong* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3) LoadAndInsertScalar((System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128) values, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Max = (byte)(3))] byte index, float* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3) LoadAndInsertScalar((System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128) values, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Max = (byte)(1))] byte index, double* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3, System.Runtime.Intrinsics.Vector128 Value4) LoadAndInsertScalar((System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128) values, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Max = (byte)(15))] byte index, byte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3, System.Runtime.Intrinsics.Vector128 Value4) LoadAndInsertScalar((System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128) values, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Max = (byte)(15))] byte index, sbyte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3, System.Runtime.Intrinsics.Vector128 Value4) LoadAndInsertScalar((System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128) values, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Max = (byte)(7))] byte index, short* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3, System.Runtime.Intrinsics.Vector128 Value4) LoadAndInsertScalar((System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128) values, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Max = (byte)(7))] byte index, ushort* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3, System.Runtime.Intrinsics.Vector128 Value4) LoadAndInsertScalar((System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128) values, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Max = (byte)(3))] byte index, int* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3, System.Runtime.Intrinsics.Vector128 Value4) LoadAndInsertScalar((System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128) values, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Max = (byte)(3))] byte index, uint* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3, System.Runtime.Intrinsics.Vector128 Value4) LoadAndInsertScalar((System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128) values, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Max = (byte)(1))] byte index, long* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3, System.Runtime.Intrinsics.Vector128 Value4) LoadAndInsertScalar((System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128) values, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Max = (byte)(1))] byte index, ulong* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3, System.Runtime.Intrinsics.Vector128 Value4) LoadAndInsertScalar((System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128) values, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Max = (byte)(3))] byte index, float* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3, System.Runtime.Intrinsics.Vector128 Value4) LoadAndInsertScalar((System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128) values, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Max = (byte)(1))] byte index, double* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 LoadAndReplicateToVector128(double* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 LoadAndReplicateToVector128(long* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 LoadAndReplicateToVector128(ulong* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2) LoadAndReplicateToVector128x2(byte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2) LoadAndReplicateToVector128x2(sbyte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2) LoadAndReplicateToVector128x2(short* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2) LoadAndReplicateToVector128x2(ushort* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2) LoadAndReplicateToVector128x2(int* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2) LoadAndReplicateToVector128x2(uint* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2) LoadAndReplicateToVector128x2(long* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2) LoadAndReplicateToVector128x2(ulong* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2) LoadAndReplicateToVector128x2(float* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2) LoadAndReplicateToVector128x2(double* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3) LoadAndReplicateToVector128x3(byte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3) LoadAndReplicateToVector128x3(sbyte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3) LoadAndReplicateToVector128x3(short* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3) LoadAndReplicateToVector128x3(ushort* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3) LoadAndReplicateToVector128x3(int* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3) LoadAndReplicateToVector128x3(uint* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3) LoadAndReplicateToVector128x3(long* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3) LoadAndReplicateToVector128x3(ulong* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3) LoadAndReplicateToVector128x3(float* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3) LoadAndReplicateToVector128x3(double* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3, System.Runtime.Intrinsics.Vector128 Value4) LoadAndReplicateToVector128x4(byte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3, System.Runtime.Intrinsics.Vector128 Value4) LoadAndReplicateToVector128x4(sbyte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3, System.Runtime.Intrinsics.Vector128 Value4) LoadAndReplicateToVector128x4(short* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3, System.Runtime.Intrinsics.Vector128 Value4) LoadAndReplicateToVector128x4(ushort* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3, System.Runtime.Intrinsics.Vector128 Value4) LoadAndReplicateToVector128x4(int* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3, System.Runtime.Intrinsics.Vector128 Value4) LoadAndReplicateToVector128x4(uint* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3, System.Runtime.Intrinsics.Vector128 Value4) LoadAndReplicateToVector128x4(long* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3, System.Runtime.Intrinsics.Vector128 Value4) LoadAndReplicateToVector128x4(ulong* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3, System.Runtime.Intrinsics.Vector128 Value4) LoadAndReplicateToVector128x4(float* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3, System.Runtime.Intrinsics.Vector128 Value4) LoadAndReplicateToVector128x4(double* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2) LoadPairScalarVector64(int* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2) LoadPairScalarVector64(float* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2) LoadPairScalarVector64(uint* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2) LoadPairScalarVector64NonTemporal(int* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2) LoadPairScalarVector64NonTemporal(float* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2) LoadPairScalarVector64NonTemporal(uint* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2) LoadPairVector128(byte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2) LoadPairVector128(double* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2) LoadPairVector128(short* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2) LoadPairVector128(int* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2) LoadPairVector128(long* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2) LoadPairVector128(sbyte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2) LoadPairVector128(float* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2) LoadPairVector128(ushort* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2) LoadPairVector128(uint* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2) LoadPairVector128(ulong* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2) LoadPairVector128NonTemporal(byte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2) LoadPairVector128NonTemporal(double* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2) LoadPairVector128NonTemporal(short* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2) LoadPairVector128NonTemporal(int* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2) LoadPairVector128NonTemporal(long* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2) LoadPairVector128NonTemporal(sbyte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2) LoadPairVector128NonTemporal(float* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2) LoadPairVector128NonTemporal(ushort* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2) LoadPairVector128NonTemporal(uint* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2) LoadPairVector128NonTemporal(ulong* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2) LoadPairVector64(byte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2) LoadPairVector64(double* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2) LoadPairVector64(short* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2) LoadPairVector64(int* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2) LoadPairVector64(long* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2) LoadPairVector64(sbyte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2) LoadPairVector64(float* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2) LoadPairVector64(ushort* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2) LoadPairVector64(uint* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2) LoadPairVector64(ulong* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2) LoadPairVector64NonTemporal(byte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2) LoadPairVector64NonTemporal(double* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2) LoadPairVector64NonTemporal(short* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2) LoadPairVector64NonTemporal(int* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2) LoadPairVector64NonTemporal(long* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2) LoadPairVector64NonTemporal(sbyte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2) LoadPairVector64NonTemporal(float* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2) LoadPairVector64NonTemporal(ushort* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2) LoadPairVector64NonTemporal(uint* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2) LoadPairVector64NonTemporal(ulong* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2) Load2xVector128AndUnzip(byte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2) Load2xVector128AndUnzip(sbyte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2) Load2xVector128AndUnzip(short* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2) Load2xVector128AndUnzip(ushort* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2) Load2xVector128AndUnzip(int* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2) Load2xVector128AndUnzip(uint* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2) Load2xVector128AndUnzip(long* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2) Load2xVector128AndUnzip(ulong* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2) Load2xVector128AndUnzip(float* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2) Load2xVector128AndUnzip(double* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3) Load3xVector128AndUnzip(byte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3) Load3xVector128AndUnzip(sbyte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3) Load3xVector128AndUnzip(short* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3) Load3xVector128AndUnzip(ushort* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3) Load3xVector128AndUnzip(int* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3) Load3xVector128AndUnzip(uint* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3) Load3xVector128AndUnzip(long* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3) Load3xVector128AndUnzip(ulong* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3) Load3xVector128AndUnzip(float* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3) Load3xVector128AndUnzip(double* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3, System.Runtime.Intrinsics.Vector128 Value4) Load4xVector128AndUnzip(byte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3, System.Runtime.Intrinsics.Vector128 Value4) Load4xVector128AndUnzip(sbyte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3, System.Runtime.Intrinsics.Vector128 Value4) Load4xVector128AndUnzip(short* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3, System.Runtime.Intrinsics.Vector128 Value4) Load4xVector128AndUnzip(ushort* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3, System.Runtime.Intrinsics.Vector128 Value4) Load4xVector128AndUnzip(int* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3, System.Runtime.Intrinsics.Vector128 Value4) Load4xVector128AndUnzip(uint* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3, System.Runtime.Intrinsics.Vector128 Value4) Load4xVector128AndUnzip(long* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3, System.Runtime.Intrinsics.Vector128 Value4) Load4xVector128AndUnzip(ulong* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3, System.Runtime.Intrinsics.Vector128 Value4) Load4xVector128AndUnzip(float* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3, System.Runtime.Intrinsics.Vector128 Value4) Load4xVector128AndUnzip(double* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2) Load2xVector128(byte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2) Load2xVector128(sbyte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2) Load2xVector128(short* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2) Load2xVector128(ushort* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2) Load2xVector128(int* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2) Load2xVector128(uint* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2) Load2xVector128(long* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2) Load2xVector128(ulong* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2) Load2xVector128(float* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2) Load2xVector128(double* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3) Load3xVector128(byte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3) Load3xVector128(sbyte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3) Load3xVector128(short* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3) Load3xVector128(ushort* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3) Load3xVector128(int* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3) Load3xVector128(uint* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3) Load3xVector128(long* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3) Load3xVector128(ulong* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3) Load3xVector128(float* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3) Load3xVector128(double* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3, System.Runtime.Intrinsics.Vector128 Value4) Load4xVector128(byte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3, System.Runtime.Intrinsics.Vector128 Value4) Load4xVector128(sbyte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3, System.Runtime.Intrinsics.Vector128 Value4) Load4xVector128(short* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3, System.Runtime.Intrinsics.Vector128 Value4) Load4xVector128(ushort* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3, System.Runtime.Intrinsics.Vector128 Value4) Load4xVector128(int* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3, System.Runtime.Intrinsics.Vector128 Value4) Load4xVector128(uint* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3, System.Runtime.Intrinsics.Vector128 Value4) Load4xVector128(long* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3, System.Runtime.Intrinsics.Vector128 Value4) Load4xVector128(ulong* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3, System.Runtime.Intrinsics.Vector128 Value4) Load4xVector128(float* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3, System.Runtime.Intrinsics.Vector128 Value4) Load4xVector128(double* address) { throw null; } public static System.Runtime.Intrinsics.Vector128 Max(System.Runtime.Intrinsics.Vector128 left, System.Runtime.Intrinsics.Vector128 right) { throw null; } public static System.Runtime.Intrinsics.Vector64 MaxAcross(System.Runtime.Intrinsics.Vector128 value) { throw null; } @@ -4580,277 +4152,141 @@ internal Arm64() { } public static System.Runtime.Intrinsics.Vector128 Sqrt(System.Runtime.Intrinsics.Vector128 value) { throw null; } public static System.Runtime.Intrinsics.Vector128 Sqrt(System.Runtime.Intrinsics.Vector128 value) { throw null; } public static System.Runtime.Intrinsics.Vector64 Sqrt(System.Runtime.Intrinsics.Vector64 value) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StorePair(byte* address, System.Runtime.Intrinsics.Vector128 value1, System.Runtime.Intrinsics.Vector128 value2) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StorePair(byte* address, System.Runtime.Intrinsics.Vector64 value1, System.Runtime.Intrinsics.Vector64 value2) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StorePair(double* address, System.Runtime.Intrinsics.Vector128 value1, System.Runtime.Intrinsics.Vector128 value2) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StorePair(double* address, System.Runtime.Intrinsics.Vector64 value1, System.Runtime.Intrinsics.Vector64 value2) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StorePair(short* address, System.Runtime.Intrinsics.Vector128 value1, System.Runtime.Intrinsics.Vector128 value2) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StorePair(short* address, System.Runtime.Intrinsics.Vector64 value1, System.Runtime.Intrinsics.Vector64 value2) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StorePair(int* address, System.Runtime.Intrinsics.Vector128 value1, System.Runtime.Intrinsics.Vector128 value2) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StorePair(int* address, System.Runtime.Intrinsics.Vector64 value1, System.Runtime.Intrinsics.Vector64 value2) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StorePair(long* address, System.Runtime.Intrinsics.Vector128 value1, System.Runtime.Intrinsics.Vector128 value2) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StorePair(long* address, System.Runtime.Intrinsics.Vector64 value1, System.Runtime.Intrinsics.Vector64 value2) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StorePair(sbyte* address, System.Runtime.Intrinsics.Vector128 value1, System.Runtime.Intrinsics.Vector128 value2) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StorePair(sbyte* address, System.Runtime.Intrinsics.Vector64 value1, System.Runtime.Intrinsics.Vector64 value2) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StorePair(float* address, System.Runtime.Intrinsics.Vector128 value1, System.Runtime.Intrinsics.Vector128 value2) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StorePair(float* address, System.Runtime.Intrinsics.Vector64 value1, System.Runtime.Intrinsics.Vector64 value2) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StorePair(ushort* address, System.Runtime.Intrinsics.Vector128 value1, System.Runtime.Intrinsics.Vector128 value2) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StorePair(ushort* address, System.Runtime.Intrinsics.Vector64 value1, System.Runtime.Intrinsics.Vector64 value2) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StorePair(uint* address, System.Runtime.Intrinsics.Vector128 value1, System.Runtime.Intrinsics.Vector128 value2) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StorePair(uint* address, System.Runtime.Intrinsics.Vector64 value1, System.Runtime.Intrinsics.Vector64 value2) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StorePair(ulong* address, System.Runtime.Intrinsics.Vector128 value1, System.Runtime.Intrinsics.Vector128 value2) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StorePair(ulong* address, System.Runtime.Intrinsics.Vector64 value1, System.Runtime.Intrinsics.Vector64 value2) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StorePairNonTemporal(byte* address, System.Runtime.Intrinsics.Vector128 value1, System.Runtime.Intrinsics.Vector128 value2) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StorePairNonTemporal(byte* address, System.Runtime.Intrinsics.Vector64 value1, System.Runtime.Intrinsics.Vector64 value2) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StorePairNonTemporal(double* address, System.Runtime.Intrinsics.Vector128 value1, System.Runtime.Intrinsics.Vector128 value2) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StorePairNonTemporal(double* address, System.Runtime.Intrinsics.Vector64 value1, System.Runtime.Intrinsics.Vector64 value2) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StorePairNonTemporal(short* address, System.Runtime.Intrinsics.Vector128 value1, System.Runtime.Intrinsics.Vector128 value2) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StorePairNonTemporal(short* address, System.Runtime.Intrinsics.Vector64 value1, System.Runtime.Intrinsics.Vector64 value2) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StorePairNonTemporal(int* address, System.Runtime.Intrinsics.Vector128 value1, System.Runtime.Intrinsics.Vector128 value2) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StorePairNonTemporal(int* address, System.Runtime.Intrinsics.Vector64 value1, System.Runtime.Intrinsics.Vector64 value2) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StorePairNonTemporal(long* address, System.Runtime.Intrinsics.Vector128 value1, System.Runtime.Intrinsics.Vector128 value2) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StorePairNonTemporal(long* address, System.Runtime.Intrinsics.Vector64 value1, System.Runtime.Intrinsics.Vector64 value2) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StorePairNonTemporal(sbyte* address, System.Runtime.Intrinsics.Vector128 value1, System.Runtime.Intrinsics.Vector128 value2) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StorePairNonTemporal(sbyte* address, System.Runtime.Intrinsics.Vector64 value1, System.Runtime.Intrinsics.Vector64 value2) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StorePairNonTemporal(float* address, System.Runtime.Intrinsics.Vector128 value1, System.Runtime.Intrinsics.Vector128 value2) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StorePairNonTemporal(float* address, System.Runtime.Intrinsics.Vector64 value1, System.Runtime.Intrinsics.Vector64 value2) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StorePairNonTemporal(ushort* address, System.Runtime.Intrinsics.Vector128 value1, System.Runtime.Intrinsics.Vector128 value2) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StorePairNonTemporal(ushort* address, System.Runtime.Intrinsics.Vector64 value1, System.Runtime.Intrinsics.Vector64 value2) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StorePairNonTemporal(uint* address, System.Runtime.Intrinsics.Vector128 value1, System.Runtime.Intrinsics.Vector128 value2) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StorePairNonTemporal(uint* address, System.Runtime.Intrinsics.Vector64 value1, System.Runtime.Intrinsics.Vector64 value2) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StorePairNonTemporal(ulong* address, System.Runtime.Intrinsics.Vector128 value1, System.Runtime.Intrinsics.Vector128 value2) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StorePairNonTemporal(ulong* address, System.Runtime.Intrinsics.Vector64 value1, System.Runtime.Intrinsics.Vector64 value2) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StorePairScalar(int* address, System.Runtime.Intrinsics.Vector64 value1, System.Runtime.Intrinsics.Vector64 value2) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StorePairScalar(float* address, System.Runtime.Intrinsics.Vector64 value1, System.Runtime.Intrinsics.Vector64 value2) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StorePairScalar(uint* address, System.Runtime.Intrinsics.Vector64 value1, System.Runtime.Intrinsics.Vector64 value2) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StorePairScalarNonTemporal(int* address, System.Runtime.Intrinsics.Vector64 value1, System.Runtime.Intrinsics.Vector64 value2) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StorePairScalarNonTemporal(float* address, System.Runtime.Intrinsics.Vector64 value1, System.Runtime.Intrinsics.Vector64 value2) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StorePairScalarNonTemporal(uint* address, System.Runtime.Intrinsics.Vector64 value1, System.Runtime.Intrinsics.Vector64 value2) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreSelectedScalar(byte* address, (System.Runtime.Intrinsics.Vector128 value1, System.Runtime.Intrinsics.Vector128 value2) value, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Max = (byte)(15))] byte index) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreSelectedScalar(sbyte* address, (System.Runtime.Intrinsics.Vector128 value1, System.Runtime.Intrinsics.Vector128 value2) value, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Max = (byte)(15))] byte index) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreSelectedScalar(short* address, (System.Runtime.Intrinsics.Vector128 value1, System.Runtime.Intrinsics.Vector128 value2) value, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Max = (byte)(7))] byte index) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreSelectedScalar(ushort* address, (System.Runtime.Intrinsics.Vector128 value1, System.Runtime.Intrinsics.Vector128 value2) value, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Max = (byte)(7))] byte index) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreSelectedScalar(int* address, (System.Runtime.Intrinsics.Vector128 value1, System.Runtime.Intrinsics.Vector128 value2) value, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Max = (byte)(3))] byte index) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreSelectedScalar(uint* address, (System.Runtime.Intrinsics.Vector128 value1, System.Runtime.Intrinsics.Vector128 value2) value, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Max = (byte)(3))] byte index) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreSelectedScalar(long* address, (System.Runtime.Intrinsics.Vector128 value1, System.Runtime.Intrinsics.Vector128 value2) value, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Max = (byte)(1))] byte index) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreSelectedScalar(ulong* address, (System.Runtime.Intrinsics.Vector128 value1, System.Runtime.Intrinsics.Vector128 value2) value, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Max = (byte)(1))] byte index) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreSelectedScalar(float* address, (System.Runtime.Intrinsics.Vector128 value1, System.Runtime.Intrinsics.Vector128 value2) value, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Max = (byte)(3))] byte index) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreSelectedScalar(double* address, (System.Runtime.Intrinsics.Vector128 value1, System.Runtime.Intrinsics.Vector128 value2) value, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Max = (byte)(1))] byte index) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreSelectedScalar(byte* address, (System.Runtime.Intrinsics.Vector128 value1, System.Runtime.Intrinsics.Vector128 value2, System.Runtime.Intrinsics.Vector128 value3) value, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Max = (byte)(15))] byte index) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreSelectedScalar(sbyte* address, (System.Runtime.Intrinsics.Vector128 value1, System.Runtime.Intrinsics.Vector128 value2, System.Runtime.Intrinsics.Vector128 value3) value, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Max = (byte)(15))] byte index) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreSelectedScalar(short* address, (System.Runtime.Intrinsics.Vector128 value1, System.Runtime.Intrinsics.Vector128 value2, System.Runtime.Intrinsics.Vector128 value3) value, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Max = (byte)(7))] byte index) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreSelectedScalar(ushort* address, (System.Runtime.Intrinsics.Vector128 value1, System.Runtime.Intrinsics.Vector128 value2, System.Runtime.Intrinsics.Vector128 value3) value, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Max = (byte)(7))] byte index) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreSelectedScalar(int* address, (System.Runtime.Intrinsics.Vector128 value1, System.Runtime.Intrinsics.Vector128 value2, System.Runtime.Intrinsics.Vector128 value3) value, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Max = (byte)(3))] byte index) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreSelectedScalar(uint* address, (System.Runtime.Intrinsics.Vector128 value1, System.Runtime.Intrinsics.Vector128 value2, System.Runtime.Intrinsics.Vector128 value3) value, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Max = (byte)(3))] byte index) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreSelectedScalar(long* address, (System.Runtime.Intrinsics.Vector128 value1, System.Runtime.Intrinsics.Vector128 value2, System.Runtime.Intrinsics.Vector128 value3) value, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Max = (byte)(1))] byte index) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreSelectedScalar(ulong* address, (System.Runtime.Intrinsics.Vector128 value1, System.Runtime.Intrinsics.Vector128 value2, System.Runtime.Intrinsics.Vector128 value3) value, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Max = (byte)(1))] byte index) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreSelectedScalar(float* address, (System.Runtime.Intrinsics.Vector128 value1, System.Runtime.Intrinsics.Vector128 value2, System.Runtime.Intrinsics.Vector128 value3) value, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Max = (byte)(3))] byte index) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreSelectedScalar(double* address, (System.Runtime.Intrinsics.Vector128 value1, System.Runtime.Intrinsics.Vector128 value2, System.Runtime.Intrinsics.Vector128 value3) value, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Max = (byte)(1))] byte index) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreSelectedScalar(byte* address, (System.Runtime.Intrinsics.Vector128 value1, System.Runtime.Intrinsics.Vector128 value2, System.Runtime.Intrinsics.Vector128 value3, System.Runtime.Intrinsics.Vector128 value4) value, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Max = (byte)(15))] byte index) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreSelectedScalar(sbyte* address, (System.Runtime.Intrinsics.Vector128 value1, System.Runtime.Intrinsics.Vector128 value2, System.Runtime.Intrinsics.Vector128 value3, System.Runtime.Intrinsics.Vector128 value4) value, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Max = (byte)(15))] byte index) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreSelectedScalar(short* address, (System.Runtime.Intrinsics.Vector128 value1, System.Runtime.Intrinsics.Vector128 value2, System.Runtime.Intrinsics.Vector128 value3, System.Runtime.Intrinsics.Vector128 value4) value, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Max = (byte)(7))] byte index) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreSelectedScalar(ushort* address, (System.Runtime.Intrinsics.Vector128 value1, System.Runtime.Intrinsics.Vector128 value2, System.Runtime.Intrinsics.Vector128 value3, System.Runtime.Intrinsics.Vector128 value4) value, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Max = (byte)(7))] byte index) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreSelectedScalar(int* address, (System.Runtime.Intrinsics.Vector128 value1, System.Runtime.Intrinsics.Vector128 value2, System.Runtime.Intrinsics.Vector128 value3, System.Runtime.Intrinsics.Vector128 value4) value, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Max = (byte)(3))] byte index) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreSelectedScalar(uint* address, (System.Runtime.Intrinsics.Vector128 value1, System.Runtime.Intrinsics.Vector128 value2, System.Runtime.Intrinsics.Vector128 value3, System.Runtime.Intrinsics.Vector128 value4) value, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Max = (byte)(3))] byte index) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreSelectedScalar(long* address, (System.Runtime.Intrinsics.Vector128 value1, System.Runtime.Intrinsics.Vector128 value2, System.Runtime.Intrinsics.Vector128 value3, System.Runtime.Intrinsics.Vector128 value4) value, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Max = (byte)(1))] byte index) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreSelectedScalar(ulong* address, (System.Runtime.Intrinsics.Vector128 value1, System.Runtime.Intrinsics.Vector128 value2, System.Runtime.Intrinsics.Vector128 value3, System.Runtime.Intrinsics.Vector128 value4) value, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Max = (byte)(1))] byte index) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreSelectedScalar(float* address, (System.Runtime.Intrinsics.Vector128 value1, System.Runtime.Intrinsics.Vector128 value2, System.Runtime.Intrinsics.Vector128 value3, System.Runtime.Intrinsics.Vector128 value4) value, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Max = (byte)(3))] byte index) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreSelectedScalar(double* address, (System.Runtime.Intrinsics.Vector128 value1, System.Runtime.Intrinsics.Vector128 value2, System.Runtime.Intrinsics.Vector128 value3, System.Runtime.Intrinsics.Vector128 value4) value, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Max = (byte)(1))] byte index) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public unsafe static void StoreVectorAndZip(byte* address, (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2) value) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public unsafe static void StoreVectorAndZip(sbyte* address, (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2) value) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public unsafe static void StoreVectorAndZip(short* address, (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2) value) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public unsafe static void StoreVectorAndZip(ushort* address, (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2) value) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public unsafe static void StoreVectorAndZip(int* address, (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2) value) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public unsafe static void StoreVectorAndZip(uint* address, (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2) value) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public unsafe static void StoreVectorAndZip(long* address, (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2) value) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public unsafe static void StoreVectorAndZip(ulong* address, (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2) value) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public unsafe static void StoreVectorAndZip(float* address, (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2) value) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public unsafe static void StoreVectorAndZip(double* address, (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2) value) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreVectorAndZip(byte* address, (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3) value) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreVectorAndZip(sbyte* address, (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3) value) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreVectorAndZip(short* address, (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3) value) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreVectorAndZip(ushort* address, (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3) value) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreVectorAndZip(int* address, (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3) value) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreVectorAndZip(uint* address, (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3) value) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreVectorAndZip(long* address, (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3) value) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreVectorAndZip(ulong* address, (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3) value) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreVectorAndZip(float* address, (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3) value) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreVectorAndZip(double* address, (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3) value) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreVectorAndZip(byte* address, (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3, System.Runtime.Intrinsics.Vector128 Value4) value) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreVectorAndZip(sbyte* address, (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3, System.Runtime.Intrinsics.Vector128 Value4) value) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreVectorAndZip(short* address, (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, Vector128 Value3, System.Runtime.Intrinsics.Vector128 Value4) value) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreVectorAndZip(ushort* address, (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3, System.Runtime.Intrinsics.Vector128 Value4) value) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreVectorAndZip(int* address, (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3, System.Runtime.Intrinsics.Vector128 Value4) value) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreVectorAndZip(uint* address, (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3, System.Runtime.Intrinsics.Vector128 Value4) value) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreVectorAndZip(long* address, (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3, System.Runtime.Intrinsics.Vector128 Value4) value) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreVectorAndZip(ulong* address, (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3, System.Runtime.Intrinsics.Vector128 Value4) value) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreVectorAndZip(float* address, (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3, System.Runtime.Intrinsics.Vector128 Value4) value) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreVectorAndZip(double* address, (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3, System.Runtime.Intrinsics.Vector128 Value4) value) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public unsafe static void Store(byte* address, (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2) value) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public unsafe static void Store(sbyte* address, (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2) value) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public unsafe static void Store(short* address, (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2) value) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public unsafe static void Store(ushort* address, (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2) value) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public unsafe static void Store(int* address, (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2) value) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public unsafe static void Store(uint* address, (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2) value) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public unsafe static void Store(long* address, (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2) value) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public unsafe static void Store(ulong* address, (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2) value) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public unsafe static void Store(float* address, (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2) value) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public unsafe static void Store(double* address, (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2) value) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Store(byte* address, (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3) value) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Store(sbyte* address, (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3) value) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Store(short* address, (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3) value) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Store(ushort* address, (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3) value) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Store(int* address, (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3) value) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Store(uint* address, (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3) value) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Store(long* address, (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3) value) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Store(ulong* address, (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3) value) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Store(float* address, (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3) value) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Store(double* address, (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3) value) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Store(byte* address, (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3, System.Runtime.Intrinsics.Vector128 Value4) value) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Store(sbyte* address, (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3, System.Runtime.Intrinsics.Vector128 Value4) value) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Store(short* address, (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, Vector128 Value3, System.Runtime.Intrinsics.Vector128 Value4) value) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Store(ushort* address, (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3, System.Runtime.Intrinsics.Vector128 Value4) value) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Store(int* address, (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3, System.Runtime.Intrinsics.Vector128 Value4) value) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Store(uint* address, (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3, System.Runtime.Intrinsics.Vector128 Value4) value) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Store(long* address, (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3, System.Runtime.Intrinsics.Vector128 Value4) value) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Store(ulong* address, (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3, System.Runtime.Intrinsics.Vector128 Value4) value) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Store(float* address, (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3, System.Runtime.Intrinsics.Vector128 Value4) value) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Store(double* address, (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3, System.Runtime.Intrinsics.Vector128 Value4) value) { throw null; } public static System.Runtime.Intrinsics.Vector128 Subtract(System.Runtime.Intrinsics.Vector128 left, System.Runtime.Intrinsics.Vector128 right) { throw null; } public static System.Runtime.Intrinsics.Vector64 SubtractSaturateScalar(System.Runtime.Intrinsics.Vector64 left, System.Runtime.Intrinsics.Vector64 right) { throw null; } @@ -5703,489 +5139,281 @@ internal Arm64() { } public static System.Numerics.Vector FusedMultiplySubtractBySelectedScalar(System.Numerics.Vector minuend, System.Numerics.Vector left, System.Numerics.Vector right, [ConstantExpected] byte rightIndex) { throw null; } public static System.Numerics.Vector FusedMultiplySubtractNegated(System.Numerics.Vector minuend, System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } public static System.Numerics.Vector FusedMultiplySubtractNegated(System.Numerics.Vector minuend, System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void GatherPrefetch16Bit(System.Numerics.Vector mask, void* address, System.Numerics.Vector indices, [ConstantExpected] SvePrefetchType prefetchType) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void GatherPrefetch16Bit(System.Numerics.Vector mask, void* address, System.Numerics.Vector indices, [ConstantExpected] SvePrefetchType prefetchType) { throw null; } // public static void GatherPrefetch16Bit(System.Numerics.Vector mask, System.Numerics.Vector addresses, [ConstantExpected] SvePrefetchType prefetchType) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void GatherPrefetch16Bit(System.Numerics.Vector mask, void* address, System.Numerics.Vector indices, [ConstantExpected] SvePrefetchType prefetchType) { throw null; } public static void GatherPrefetch16Bit(System.Numerics.Vector mask, System.Numerics.Vector addresses, [ConstantExpected] SvePrefetchType prefetchType) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void GatherPrefetch16Bit(System.Numerics.Vector mask, void* address, System.Numerics.Vector indices, [ConstantExpected] SvePrefetchType prefetchType) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void GatherPrefetch16Bit(System.Numerics.Vector mask, void* address, System.Numerics.Vector indices, [ConstantExpected] SvePrefetchType prefetchType) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void GatherPrefetch16Bit(System.Numerics.Vector mask, void* address, System.Numerics.Vector indices, [ConstantExpected] SvePrefetchType prefetchType) { throw null; } // public static void GatherPrefetch16Bit(System.Numerics.Vector mask, System.Numerics.Vector addresses, [ConstantExpected] SvePrefetchType prefetchType) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void GatherPrefetch16Bit(System.Numerics.Vector mask, void* address, System.Numerics.Vector indices, [ConstantExpected] SvePrefetchType prefetchType) { throw null; } public static void GatherPrefetch16Bit(System.Numerics.Vector mask, System.Numerics.Vector addresses, [ConstantExpected] SvePrefetchType prefetchType) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void GatherPrefetch16Bit(System.Numerics.Vector mask, void* address, System.Numerics.Vector indices, [ConstantExpected] SvePrefetchType prefetchType) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void GatherPrefetch32Bit(System.Numerics.Vector mask, void* address, System.Numerics.Vector indices, [ConstantExpected] SvePrefetchType prefetchType) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void GatherPrefetch32Bit(System.Numerics.Vector mask, void* address, System.Numerics.Vector indices, [ConstantExpected] SvePrefetchType prefetchType) { throw null; } // public static void GatherPrefetch32Bit(System.Numerics.Vector mask, System.Numerics.Vector addresses, [ConstantExpected] SvePrefetchType prefetchType) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void GatherPrefetch32Bit(System.Numerics.Vector mask, void* address, System.Numerics.Vector indices, [ConstantExpected] SvePrefetchType prefetchType) { throw null; } public static void GatherPrefetch32Bit(System.Numerics.Vector mask, System.Numerics.Vector addresses, [ConstantExpected] SvePrefetchType prefetchType) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void GatherPrefetch32Bit(System.Numerics.Vector mask, void* address, System.Numerics.Vector indices, [ConstantExpected] SvePrefetchType prefetchType) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void GatherPrefetch32Bit(System.Numerics.Vector mask, void* address, System.Numerics.Vector indices, [ConstantExpected] SvePrefetchType prefetchType) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void GatherPrefetch32Bit(System.Numerics.Vector mask, void* address, System.Numerics.Vector indices, [ConstantExpected] SvePrefetchType prefetchType) { throw null; } // public static void GatherPrefetch32Bit(System.Numerics.Vector mask, System.Numerics.Vector addresses, [ConstantExpected] SvePrefetchType prefetchType) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void GatherPrefetch32Bit(System.Numerics.Vector mask, void* address, System.Numerics.Vector indices, [ConstantExpected] SvePrefetchType prefetchType) { throw null; } public static void GatherPrefetch32Bit(System.Numerics.Vector mask, System.Numerics.Vector addresses, [ConstantExpected] SvePrefetchType prefetchType) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void GatherPrefetch32Bit(System.Numerics.Vector mask, void* address, System.Numerics.Vector indices, [ConstantExpected] SvePrefetchType prefetchType) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void GatherPrefetch64Bit(System.Numerics.Vector mask, void* address, System.Numerics.Vector indices, [ConstantExpected] SvePrefetchType prefetchType) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void GatherPrefetch64Bit(System.Numerics.Vector mask, void* address, System.Numerics.Vector indices, [ConstantExpected] SvePrefetchType prefetchType) { throw null; } // public static void GatherPrefetch64Bit(System.Numerics.Vector mask, System.Numerics.Vector addresses, [ConstantExpected] SvePrefetchType prefetchType) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void GatherPrefetch64Bit(System.Numerics.Vector mask, void* address, System.Numerics.Vector indices, [ConstantExpected] SvePrefetchType prefetchType) { throw null; } public static void GatherPrefetch64Bit(System.Numerics.Vector mask, System.Numerics.Vector addresses, [ConstantExpected] SvePrefetchType prefetchType) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void GatherPrefetch64Bit(System.Numerics.Vector mask, void* address, System.Numerics.Vector indices, [ConstantExpected] SvePrefetchType prefetchType) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void GatherPrefetch64Bit(System.Numerics.Vector mask, void* address, System.Numerics.Vector indices, [ConstantExpected] SvePrefetchType prefetchType) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void GatherPrefetch64Bit(System.Numerics.Vector mask, void* address, System.Numerics.Vector indices, [ConstantExpected] SvePrefetchType prefetchType) { throw null; } // public static void GatherPrefetch64Bit(System.Numerics.Vector mask, System.Numerics.Vector addresses, [ConstantExpected] SvePrefetchType prefetchType) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void GatherPrefetch64Bit(System.Numerics.Vector mask, void* address, System.Numerics.Vector indices, [ConstantExpected] SvePrefetchType prefetchType) { throw null; } public static void GatherPrefetch64Bit(System.Numerics.Vector mask, System.Numerics.Vector addresses, [ConstantExpected] SvePrefetchType prefetchType) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void GatherPrefetch64Bit(System.Numerics.Vector mask, void* address, System.Numerics.Vector indices, [ConstantExpected] SvePrefetchType prefetchType) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void GatherPrefetch8Bit(System.Numerics.Vector mask, void* address, System.Numerics.Vector offsets, [ConstantExpected] SvePrefetchType prefetchType) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void GatherPrefetch8Bit(System.Numerics.Vector mask, void* address, System.Numerics.Vector offsets, [ConstantExpected] SvePrefetchType prefetchType) { throw null; } // public static void GatherPrefetch8Bit(System.Numerics.Vector mask, System.Numerics.Vector addresses, [ConstantExpected] SvePrefetchType prefetchType) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void GatherPrefetch8Bit(System.Numerics.Vector mask, void* address, System.Numerics.Vector offsets, [ConstantExpected] SvePrefetchType prefetchType) { throw null; } public static void GatherPrefetch8Bit(System.Numerics.Vector mask, System.Numerics.Vector addresses, [ConstantExpected] SvePrefetchType prefetchType) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void GatherPrefetch8Bit(System.Numerics.Vector mask, void* address, System.Numerics.Vector offsets, [ConstantExpected] SvePrefetchType prefetchType) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void GatherPrefetch8Bit(System.Numerics.Vector mask, void* address, System.Numerics.Vector offsets, [ConstantExpected] SvePrefetchType prefetchType) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void GatherPrefetch8Bit(System.Numerics.Vector mask, void* address, System.Numerics.Vector offsets, [ConstantExpected] SvePrefetchType prefetchType) { throw null; } // public static void GatherPrefetch8Bit(System.Numerics.Vector mask, System.Numerics.Vector addresses, [ConstantExpected] SvePrefetchType prefetchType) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void GatherPrefetch8Bit(System.Numerics.Vector mask, void* address, System.Numerics.Vector offsets, [ConstantExpected] SvePrefetchType prefetchType) { throw null; } public static void GatherPrefetch8Bit(System.Numerics.Vector mask, System.Numerics.Vector addresses, [ConstantExpected] SvePrefetchType prefetchType) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void GatherPrefetch8Bit(System.Numerics.Vector mask, void* address, System.Numerics.Vector offsets, [ConstantExpected] SvePrefetchType prefetchType) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVector(System.Numerics.Vector mask, double* address, System.Numerics.Vector indices) { throw null; } public static System.Numerics.Vector GatherVector(System.Numerics.Vector mask, System.Numerics.Vector addresses) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVector(System.Numerics.Vector mask, double* address, System.Numerics.Vector indices) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVector(System.Numerics.Vector mask, int* address, System.Numerics.Vector indices) { throw null; } // public static System.Numerics.Vector GatherVector(System.Numerics.Vector mask, System.Numerics.Vector addresses) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVector(System.Numerics.Vector mask, int* address, System.Numerics.Vector indices) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVector(System.Numerics.Vector mask, long* address, System.Numerics.Vector indices) { throw null; } public static System.Numerics.Vector GatherVector(System.Numerics.Vector mask, System.Numerics.Vector addresses) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVector(System.Numerics.Vector mask, long* address, System.Numerics.Vector indices) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVector(System.Numerics.Vector mask, float* address, System.Numerics.Vector indices) { throw null; } // public static System.Numerics.Vector GatherVector(System.Numerics.Vector mask, System.Numerics.Vector addresses) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVector(System.Numerics.Vector mask, float* address, System.Numerics.Vector indices) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVector(System.Numerics.Vector mask, uint* address, System.Numerics.Vector indices) { throw null; } // public static System.Numerics.Vector GatherVector(System.Numerics.Vector mask, System.Numerics.Vector addresses) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVector(System.Numerics.Vector mask, uint* address, System.Numerics.Vector indices) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVector(System.Numerics.Vector mask, ulong* address, System.Numerics.Vector indices) { throw null; } public static System.Numerics.Vector GatherVector(System.Numerics.Vector mask, System.Numerics.Vector addresses) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVector(System.Numerics.Vector mask, ulong* address, System.Numerics.Vector indices) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorByteZeroExtend(System.Numerics.Vector mask, byte* address, System.Numerics.Vector indices) { throw null; } // public static System.Numerics.Vector GatherVectorByteZeroExtend(System.Numerics.Vector mask, System.Numerics.Vector addresses) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorByteZeroExtend(System.Numerics.Vector mask, byte* address, System.Numerics.Vector indices) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorByteZeroExtend(System.Numerics.Vector mask, byte* address, System.Numerics.Vector indices) { throw null; } public static System.Numerics.Vector GatherVectorByteZeroExtend(System.Numerics.Vector mask, System.Numerics.Vector addresses) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorByteZeroExtend(System.Numerics.Vector mask, byte* address, System.Numerics.Vector indices) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorByteZeroExtend(System.Numerics.Vector mask, byte* address, System.Numerics.Vector indices) { throw null; } // public static System.Numerics.Vector GatherVectorByteZeroExtend(System.Numerics.Vector mask, System.Numerics.Vector addresses) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorByteZeroExtend(System.Numerics.Vector mask, byte* address, System.Numerics.Vector indices) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorByteZeroExtend(System.Numerics.Vector mask, byte* address, System.Numerics.Vector indices) { throw null; } public static System.Numerics.Vector GatherVectorByteZeroExtend(System.Numerics.Vector mask, System.Numerics.Vector addresses) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorByteZeroExtend(System.Numerics.Vector mask, byte* address, System.Numerics.Vector indices) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorByteZeroExtendFirstFaulting(System.Numerics.Vector mask, byte* address, System.Numerics.Vector offsets) { throw null; } // public static System.Numerics.Vector GatherVectorByteZeroExtendFirstFaulting(System.Numerics.Vector mask, System.Numerics.Vector addresses) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorByteZeroExtendFirstFaulting(System.Numerics.Vector mask, byte* address, System.Numerics.Vector offsets) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorByteZeroExtendFirstFaulting(System.Numerics.Vector mask, byte* address, System.Numerics.Vector offsets) { throw null; } public static System.Numerics.Vector GatherVectorByteZeroExtendFirstFaulting(System.Numerics.Vector mask, System.Numerics.Vector addresses) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorByteZeroExtendFirstFaulting(System.Numerics.Vector mask, byte* address, System.Numerics.Vector offsets) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorByteZeroExtendFirstFaulting(System.Numerics.Vector mask, byte* address, System.Numerics.Vector offsets) { throw null; } // public static System.Numerics.Vector GatherVectorByteZeroExtendFirstFaulting(System.Numerics.Vector mask, System.Numerics.Vector addresses) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorByteZeroExtendFirstFaulting(System.Numerics.Vector mask, byte* address, System.Numerics.Vector offsets) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorByteZeroExtendFirstFaulting(System.Numerics.Vector mask, byte* address, System.Numerics.Vector offsets) { throw null; } public static System.Numerics.Vector GatherVectorByteZeroExtendFirstFaulting(System.Numerics.Vector mask, System.Numerics.Vector addresses) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorByteZeroExtendFirstFaulting(System.Numerics.Vector mask, byte* address, System.Numerics.Vector offsets) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorFirstFaulting(System.Numerics.Vector mask, double* address, System.Numerics.Vector indices) { throw null; } public static System.Numerics.Vector GatherVectorFirstFaulting(System.Numerics.Vector mask, System.Numerics.Vector addresses) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorFirstFaulting(System.Numerics.Vector mask, double* address, System.Numerics.Vector indices) { throw null; } // public static System.Numerics.Vector GatherVectorFirstFaulting(System.Numerics.Vector mask, System.Numerics.Vector addresses) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorFirstFaulting(System.Numerics.Vector mask, int* address, System.Numerics.Vector indices) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorFirstFaulting(System.Numerics.Vector mask, int* address, System.Numerics.Vector indices) { throw null; } public static System.Numerics.Vector GatherVectorFirstFaulting(System.Numerics.Vector mask, System.Numerics.Vector addresses) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorFirstFaulting(System.Numerics.Vector mask, long* address, System.Numerics.Vector indices) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorFirstFaulting(System.Numerics.Vector mask, long* address, System.Numerics.Vector indices) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorFirstFaulting(System.Numerics.Vector mask, float* address, System.Numerics.Vector indices) { throw null; } // public static System.Numerics.Vector GatherVectorFirstFaulting(System.Numerics.Vector mask, System.Numerics.Vector addresses) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorFirstFaulting(System.Numerics.Vector mask, float* address, System.Numerics.Vector indices) { throw null; } // public static System.Numerics.Vector GatherVectorFirstFaulting(System.Numerics.Vector mask, System.Numerics.Vector addresses) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorFirstFaulting(System.Numerics.Vector mask, uint* address, System.Numerics.Vector indices) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorFirstFaulting(System.Numerics.Vector mask, uint* address, System.Numerics.Vector indices) { throw null; } public static System.Numerics.Vector GatherVectorFirstFaulting(System.Numerics.Vector mask, System.Numerics.Vector addresses) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorFirstFaulting(System.Numerics.Vector mask, ulong* address, System.Numerics.Vector indices) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorFirstFaulting(System.Numerics.Vector mask, ulong* address, System.Numerics.Vector indices) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorInt16SignExtend(System.Numerics.Vector mask, short* address, System.Numerics.Vector indices) { throw null; } // public static System.Numerics.Vector GatherVectorInt16SignExtend(System.Numerics.Vector mask, System.Numerics.Vector addresses) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorInt16SignExtend(System.Numerics.Vector mask, short* address, System.Numerics.Vector indices) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorInt16SignExtend(System.Numerics.Vector mask, short* address, System.Numerics.Vector indices) { throw null; } public static System.Numerics.Vector GatherVectorInt16SignExtend(System.Numerics.Vector mask, System.Numerics.Vector addresses) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorInt16SignExtend(System.Numerics.Vector mask, short* address, System.Numerics.Vector indices) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorInt16SignExtend(System.Numerics.Vector mask, short* address, System.Numerics.Vector indices) { throw null; } // public static System.Numerics.Vector GatherVectorInt16SignExtend(System.Numerics.Vector mask, System.Numerics.Vector addresses) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorInt16SignExtend(System.Numerics.Vector mask, short* address, System.Numerics.Vector indices) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorInt16SignExtend(System.Numerics.Vector mask, short* address, System.Numerics.Vector indices) { throw null; } public static System.Numerics.Vector GatherVectorInt16SignExtend(System.Numerics.Vector mask, System.Numerics.Vector addresses) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorInt16SignExtend(System.Numerics.Vector mask, short* address, System.Numerics.Vector indices) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorInt16SignExtendFirstFaulting(System.Numerics.Vector mask, short* address, System.Numerics.Vector indices) { throw null; } // public static System.Numerics.Vector GatherVectorInt16SignExtendFirstFaulting(System.Numerics.Vector mask, System.Numerics.Vector addresses) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorInt16SignExtendFirstFaulting(System.Numerics.Vector mask, short* address, System.Numerics.Vector indices) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorInt16SignExtendFirstFaulting(System.Numerics.Vector mask, short* address, System.Numerics.Vector indices) { throw null; } public static System.Numerics.Vector GatherVectorInt16SignExtendFirstFaulting(System.Numerics.Vector mask, System.Numerics.Vector addresses) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorInt16SignExtendFirstFaulting(System.Numerics.Vector mask, short* address, System.Numerics.Vector indices) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorInt16SignExtendFirstFaulting(System.Numerics.Vector mask, short* address, System.Numerics.Vector indices) { throw null; } // public static System.Numerics.Vector GatherVectorInt16SignExtendFirstFaulting(System.Numerics.Vector mask, System.Numerics.Vector addresses) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorInt16SignExtendFirstFaulting(System.Numerics.Vector mask, short* address, System.Numerics.Vector indices) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorInt16SignExtendFirstFaulting(System.Numerics.Vector mask, short* address, System.Numerics.Vector indices) { throw null; } public static System.Numerics.Vector GatherVectorInt16SignExtendFirstFaulting(System.Numerics.Vector mask, System.Numerics.Vector addresses) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorInt16SignExtendFirstFaulting(System.Numerics.Vector mask, short* address, System.Numerics.Vector indices) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorInt16WithByteOffsetsSignExtend(System.Numerics.Vector mask, short* address, System.Numerics.Vector offsets) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorInt16WithByteOffsetsSignExtend(System.Numerics.Vector mask, short* address, System.Numerics.Vector offsets) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorInt16WithByteOffsetsSignExtend(System.Numerics.Vector mask, short* address, System.Numerics.Vector offsets) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorInt16WithByteOffsetsSignExtend(System.Numerics.Vector mask, short* address, System.Numerics.Vector offsets) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorInt16WithByteOffsetsSignExtend(System.Numerics.Vector mask, short* address, System.Numerics.Vector offsets) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorInt16WithByteOffsetsSignExtend(System.Numerics.Vector mask, short* address, System.Numerics.Vector offsets) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorInt16WithByteOffsetsSignExtend(System.Numerics.Vector mask, short* address, System.Numerics.Vector offsets) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorInt16WithByteOffsetsSignExtend(System.Numerics.Vector mask, short* address, System.Numerics.Vector offsets) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorInt32SignExtend(System.Numerics.Vector mask, int* address, System.Numerics.Vector indices) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorInt16WithByteOffsetsSignExtendFirstFaulting(System.Numerics.Vector mask, short* address, System.Numerics.Vector offsets) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorInt16WithByteOffsetsSignExtendFirstFaulting(System.Numerics.Vector mask, short* address, System.Numerics.Vector offsets) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorInt16WithByteOffsetsSignExtendFirstFaulting(System.Numerics.Vector mask, short* address, System.Numerics.Vector offsets) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorInt16WithByteOffsetsSignExtendFirstFaulting(System.Numerics.Vector mask, short* address, System.Numerics.Vector offsets) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorInt16WithByteOffsetsSignExtendFirstFaulting(System.Numerics.Vector mask, short* address, System.Numerics.Vector offsets) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorInt16WithByteOffsetsSignExtendFirstFaulting(System.Numerics.Vector mask, short* address, System.Numerics.Vector offsets) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorInt16WithByteOffsetsSignExtendFirstFaulting(System.Numerics.Vector mask, short* address, System.Numerics.Vector offsets) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorInt16WithByteOffsetsSignExtendFirstFaulting(System.Numerics.Vector mask, short* address, System.Numerics.Vector offsets) { throw null; } public static System.Numerics.Vector GatherVectorInt32SignExtend(System.Numerics.Vector mask, System.Numerics.Vector addresses) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorInt32SignExtend(System.Numerics.Vector mask, int* address, System.Numerics.Vector indices) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorInt32SignExtend(System.Numerics.Vector mask, int* address, System.Numerics.Vector indices) { throw null; } public static System.Numerics.Vector GatherVectorInt32SignExtend(System.Numerics.Vector mask, System.Numerics.Vector addresses) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorInt32SignExtend(System.Numerics.Vector mask, int* address, System.Numerics.Vector indices) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorInt32SignExtendFirstFaulting(System.Numerics.Vector mask, int* address, System.Numerics.Vector indices) { throw null; } public static unsafe System.Numerics.Vector GatherVectorInt32SignExtendFirstFaulting(System.Numerics.Vector mask, System.Numerics.Vector addresses) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorInt32SignExtendFirstFaulting(System.Numerics.Vector mask, int* address, System.Numerics.Vector indices) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorInt32SignExtendFirstFaulting(System.Numerics.Vector mask, int* address, System.Numerics.Vector indices) { throw null; } public static System.Numerics.Vector GatherVectorInt32SignExtendFirstFaulting(System.Numerics.Vector mask, System.Numerics.Vector addresses) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorInt32SignExtendFirstFaulting(System.Numerics.Vector mask, int* address, System.Numerics.Vector indices) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorInt32WithByteOffsetsSignExtend(System.Numerics.Vector mask, int* address, System.Numerics.Vector offsets) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorInt32WithByteOffsetsSignExtend(System.Numerics.Vector mask, int* address, System.Numerics.Vector offsets) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorInt32WithByteOffsetsSignExtend(System.Numerics.Vector mask, int* address, System.Numerics.Vector offsets) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorInt32WithByteOffsetsSignExtend(System.Numerics.Vector mask, int* address, System.Numerics.Vector offsets) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorInt32WithByteOffsetsSignExtendFirstFaulting(System.Numerics.Vector mask, int* address, System.Numerics.Vector offsets) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorInt32WithByteOffsetsSignExtendFirstFaulting(System.Numerics.Vector mask, int* address, System.Numerics.Vector offsets) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorInt32WithByteOffsetsSignExtendFirstFaulting(System.Numerics.Vector mask, int* address, System.Numerics.Vector offsets) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorInt32WithByteOffsetsSignExtendFirstFaulting(System.Numerics.Vector mask, int* address, System.Numerics.Vector offsets) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorSByteSignExtend(System.Numerics.Vector mask, sbyte* address, System.Numerics.Vector indices) { throw null; } // public static System.Numerics.Vector GatherVectorSByteSignExtend(System.Numerics.Vector mask, System.Numerics.Vector addresses) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorSByteSignExtend(System.Numerics.Vector mask, sbyte* address, System.Numerics.Vector indices) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorSByteSignExtend(System.Numerics.Vector mask, sbyte* address, System.Numerics.Vector indices) { throw null; } public static System.Numerics.Vector GatherVectorSByteSignExtend(System.Numerics.Vector mask, System.Numerics.Vector addresses) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorSByteSignExtend(System.Numerics.Vector mask, sbyte* address, System.Numerics.Vector indices) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorSByteSignExtend(System.Numerics.Vector mask, sbyte* address, System.Numerics.Vector indices) { throw null; } // public static System.Numerics.Vector GatherVectorSByteSignExtend(System.Numerics.Vector mask, System.Numerics.Vector addresses) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorSByteSignExtend(System.Numerics.Vector mask, sbyte* address, System.Numerics.Vector indices) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorSByteSignExtend(System.Numerics.Vector mask, sbyte* address, System.Numerics.Vector indices) { throw null; } public static System.Numerics.Vector GatherVectorSByteSignExtend(System.Numerics.Vector mask, System.Numerics.Vector addresses) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorSByteSignExtend(System.Numerics.Vector mask, sbyte* address, System.Numerics.Vector indices) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorSByteSignExtendFirstFaulting(System.Numerics.Vector mask, sbyte* address, System.Numerics.Vector offsets) { throw null; } // public static System.Numerics.Vector GatherVectorSByteSignExtendFirstFaulting(System.Numerics.Vector mask, System.Numerics.Vector addresses) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorSByteSignExtendFirstFaulting(System.Numerics.Vector mask, sbyte* address, System.Numerics.Vector offsets) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorSByteSignExtendFirstFaulting(System.Numerics.Vector mask, sbyte* address, System.Numerics.Vector offsets) { throw null; } public static System.Numerics.Vector GatherVectorSByteSignExtendFirstFaulting(System.Numerics.Vector mask, System.Numerics.Vector addresses) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorSByteSignExtendFirstFaulting(System.Numerics.Vector mask, sbyte* address, System.Numerics.Vector offsets) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorSByteSignExtendFirstFaulting(System.Numerics.Vector mask, sbyte* address, System.Numerics.Vector offsets) { throw null; } // public static System.Numerics.Vector GatherVectorSByteSignExtendFirstFaulting(System.Numerics.Vector mask, System.Numerics.Vector addresses) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorSByteSignExtendFirstFaulting(System.Numerics.Vector mask, sbyte* address, System.Numerics.Vector offsets) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorSByteSignExtendFirstFaulting(System.Numerics.Vector mask, sbyte* address, System.Numerics.Vector offsets) { throw null; } public static System.Numerics.Vector GatherVectorSByteSignExtendFirstFaulting(System.Numerics.Vector mask, System.Numerics.Vector addresses) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorSByteSignExtendFirstFaulting(System.Numerics.Vector mask, sbyte* address, System.Numerics.Vector offsets) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorUInt16WithByteOffsetsZeroExtend(System.Numerics.Vector mask, ushort* address, System.Numerics.Vector offsets) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorUInt16WithByteOffsetsZeroExtend(System.Numerics.Vector mask, ushort* address, System.Numerics.Vector offsets) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorUInt16WithByteOffsetsZeroExtend(System.Numerics.Vector mask, ushort* address, System.Numerics.Vector offsets) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorUInt16WithByteOffsetsZeroExtend(System.Numerics.Vector mask, ushort* address, System.Numerics.Vector offsets) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorUInt16WithByteOffsetsZeroExtend(System.Numerics.Vector mask, ushort* address, System.Numerics.Vector offsets) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorUInt16WithByteOffsetsZeroExtend(System.Numerics.Vector mask, ushort* address, System.Numerics.Vector offsets) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorUInt16WithByteOffsetsZeroExtend(System.Numerics.Vector mask, ushort* address, System.Numerics.Vector offsets) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorUInt16WithByteOffsetsZeroExtend(System.Numerics.Vector mask, ushort* address, System.Numerics.Vector offsets) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorUInt16WithByteOffsetsZeroExtendFirstFaulting(System.Numerics.Vector mask, ushort* address, System.Numerics.Vector offsets) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorUInt16WithByteOffsetsZeroExtendFirstFaulting(System.Numerics.Vector mask, ushort* address, System.Numerics.Vector offsets) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorUInt16WithByteOffsetsZeroExtendFirstFaulting(System.Numerics.Vector mask, ushort* address, System.Numerics.Vector offsets) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorUInt16WithByteOffsetsZeroExtendFirstFaulting(System.Numerics.Vector mask, ushort* address, System.Numerics.Vector offsets) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorUInt16WithByteOffsetsZeroExtendFirstFaulting(System.Numerics.Vector mask, ushort* address, System.Numerics.Vector offsets) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorUInt16WithByteOffsetsZeroExtendFirstFaulting(System.Numerics.Vector mask, ushort* address, System.Numerics.Vector offsets) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorUInt16WithByteOffsetsZeroExtendFirstFaulting(System.Numerics.Vector mask, ushort* address, System.Numerics.Vector offsets) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorUInt16WithByteOffsetsZeroExtendFirstFaulting(System.Numerics.Vector mask, ushort* address, System.Numerics.Vector offsets) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorUInt16ZeroExtend(System.Numerics.Vector mask, ushort* address, System.Numerics.Vector indices) { throw null; } // public static System.Numerics.Vector GatherVectorUInt16ZeroExtend(System.Numerics.Vector mask, System.Numerics.Vector addresses) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorUInt16ZeroExtend(System.Numerics.Vector mask, ushort* address, System.Numerics.Vector indices) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorUInt16ZeroExtend(System.Numerics.Vector mask, ushort* address, System.Numerics.Vector indices) { throw null; } public static System.Numerics.Vector GatherVectorUInt16ZeroExtend(System.Numerics.Vector mask, System.Numerics.Vector addresses) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorUInt16ZeroExtend(System.Numerics.Vector mask, ushort* address, System.Numerics.Vector indices) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorUInt16ZeroExtend(System.Numerics.Vector mask, ushort* address, System.Numerics.Vector indices) { throw null; } // public static System.Numerics.Vector GatherVectorUInt16ZeroExtend(System.Numerics.Vector mask, System.Numerics.Vector addresses) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorUInt16ZeroExtend(System.Numerics.Vector mask, ushort* address, System.Numerics.Vector indices) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorUInt16ZeroExtend(System.Numerics.Vector mask, ushort* address, System.Numerics.Vector indices) { throw null; } public static System.Numerics.Vector GatherVectorUInt16ZeroExtend(System.Numerics.Vector mask, System.Numerics.Vector addresses) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorUInt16ZeroExtend(System.Numerics.Vector mask, ushort* address, System.Numerics.Vector indices) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorUInt16ZeroExtendFirstFaulting(System.Numerics.Vector mask, ushort* address, System.Numerics.Vector indices) { throw null; } // public static System.Numerics.Vector GatherVectorUInt16ZeroExtendFirstFaulting(System.Numerics.Vector mask, System.Numerics.Vector addresses) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorUInt16ZeroExtendFirstFaulting(System.Numerics.Vector mask, ushort* address, System.Numerics.Vector indices) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorUInt16ZeroExtendFirstFaulting(System.Numerics.Vector mask, ushort* address, System.Numerics.Vector indices) { throw null; } public static System.Numerics.Vector GatherVectorUInt16ZeroExtendFirstFaulting(System.Numerics.Vector mask, System.Numerics.Vector addresses) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorUInt16ZeroExtendFirstFaulting(System.Numerics.Vector mask, ushort* address, System.Numerics.Vector indices) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorUInt16ZeroExtendFirstFaulting(System.Numerics.Vector mask, ushort* address, System.Numerics.Vector indices) { throw null; } // public static unsafe System.Numerics.Vector GatherVectorUInt16ZeroExtendFirstFaulting(System.Numerics.Vector mask, System.Numerics.Vector addresses) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorUInt16ZeroExtendFirstFaulting(System.Numerics.Vector mask, ushort* address, System.Numerics.Vector indices) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorUInt16ZeroExtendFirstFaulting(System.Numerics.Vector mask, ushort* address, System.Numerics.Vector indices) { throw null; } public static System.Numerics.Vector GatherVectorUInt16ZeroExtendFirstFaulting(System.Numerics.Vector mask, System.Numerics.Vector addresses) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorUInt16ZeroExtendFirstFaulting(System.Numerics.Vector mask, ushort* address, System.Numerics.Vector indices) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorUInt32WithByteOffsetsZeroExtend(System.Numerics.Vector mask, uint* address, System.Numerics.Vector offsets) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorUInt32WithByteOffsetsZeroExtend(System.Numerics.Vector mask, uint* address, System.Numerics.Vector offsets) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorUInt32WithByteOffsetsZeroExtend(System.Numerics.Vector mask, uint* address, System.Numerics.Vector offsets) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorUInt32WithByteOffsetsZeroExtend(System.Numerics.Vector mask, uint* address, System.Numerics.Vector offsets) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorUInt32WithByteOffsetsZeroExtendFirstFaulting(System.Numerics.Vector mask, uint* address, System.Numerics.Vector offsets) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorUInt32WithByteOffsetsZeroExtendFirstFaulting(System.Numerics.Vector mask, uint* address, System.Numerics.Vector offsets) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorUInt32WithByteOffsetsZeroExtendFirstFaulting(System.Numerics.Vector mask, uint* address, System.Numerics.Vector offsets) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorUInt32WithByteOffsetsZeroExtendFirstFaulting(System.Numerics.Vector mask, uint* address, System.Numerics.Vector offsets) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorUInt32ZeroExtend(System.Numerics.Vector mask, uint* address, System.Numerics.Vector indices) { throw null; } public static System.Numerics.Vector GatherVectorUInt32ZeroExtend(System.Numerics.Vector mask, System.Numerics.Vector addresses) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorUInt32ZeroExtend(System.Numerics.Vector mask, uint* address, System.Numerics.Vector indices) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorUInt32ZeroExtend(System.Numerics.Vector mask, uint* address, System.Numerics.Vector indices) { throw null; } public static System.Numerics.Vector GatherVectorUInt32ZeroExtend(System.Numerics.Vector mask, System.Numerics.Vector addresses) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorUInt32ZeroExtend(System.Numerics.Vector mask, uint* address, System.Numerics.Vector indices) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorUInt32ZeroExtendFirstFaulting(System.Numerics.Vector mask, uint* address, System.Numerics.Vector indices) { throw null; } public static System.Numerics.Vector GatherVectorUInt32ZeroExtendFirstFaulting(System.Numerics.Vector mask, System.Numerics.Vector addresses) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorUInt32ZeroExtendFirstFaulting(System.Numerics.Vector mask, uint* address, System.Numerics.Vector indices) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorUInt32ZeroExtendFirstFaulting(System.Numerics.Vector mask, uint* address, System.Numerics.Vector indices) { throw null; } public static System.Numerics.Vector GatherVectorUInt32ZeroExtendFirstFaulting(System.Numerics.Vector mask, System.Numerics.Vector addresses) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorUInt32ZeroExtendFirstFaulting(System.Numerics.Vector mask, uint* address, System.Numerics.Vector indices) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorWithByteOffsetFirstFaulting(System.Numerics.Vector mask, double* address, System.Numerics.Vector offsets) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorWithByteOffsetFirstFaulting(System.Numerics.Vector mask, double* address, System.Numerics.Vector offsets) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorWithByteOffsetFirstFaulting(System.Numerics.Vector mask, int* address, System.Numerics.Vector offsets) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorWithByteOffsetFirstFaulting(System.Numerics.Vector mask, int* address, System.Numerics.Vector offsets) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorWithByteOffsetFirstFaulting(System.Numerics.Vector mask, long* address, System.Numerics.Vector offsets) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorWithByteOffsetFirstFaulting(System.Numerics.Vector mask, long* address, System.Numerics.Vector offsets) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorWithByteOffsetFirstFaulting(System.Numerics.Vector mask, float* address, System.Numerics.Vector offsets) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorWithByteOffsetFirstFaulting(System.Numerics.Vector mask, float* address, System.Numerics.Vector offsets) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorWithByteOffsetFirstFaulting(System.Numerics.Vector mask, uint* address, System.Numerics.Vector offsets) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorWithByteOffsetFirstFaulting(System.Numerics.Vector mask, uint* address, System.Numerics.Vector offsets) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorWithByteOffsetFirstFaulting(System.Numerics.Vector mask, ulong* address, System.Numerics.Vector offsets) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorWithByteOffsetFirstFaulting(System.Numerics.Vector mask, ulong* address, System.Numerics.Vector offsets) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorWithByteOffsets(System.Numerics.Vector mask, double* address, System.Numerics.Vector offsets) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorWithByteOffsets(System.Numerics.Vector mask, double* address, System.Numerics.Vector offsets) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorWithByteOffsets(System.Numerics.Vector mask, int* address, System.Numerics.Vector offsets) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorWithByteOffsets(System.Numerics.Vector mask, int* address, System.Numerics.Vector offsets) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorWithByteOffsets(System.Numerics.Vector mask, long* address, System.Numerics.Vector offsets) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorWithByteOffsets(System.Numerics.Vector mask, long* address, System.Numerics.Vector offsets) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorWithByteOffsets(System.Numerics.Vector mask, float* address, System.Numerics.Vector offsets) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorWithByteOffsets(System.Numerics.Vector mask, float* address, System.Numerics.Vector offsets) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorWithByteOffsets(System.Numerics.Vector mask, uint* address, System.Numerics.Vector offsets) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorWithByteOffsets(System.Numerics.Vector mask, uint* address, System.Numerics.Vector offsets) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorWithByteOffsets(System.Numerics.Vector mask, ulong* address, System.Numerics.Vector offsets) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector GatherVectorWithByteOffsets(System.Numerics.Vector mask, ulong* address, System.Numerics.Vector offsets) { throw null; } public static ulong GetActiveElementCount(System.Numerics.Vector mask, System.Numerics.Vector from) { throw null; } public static ulong GetActiveElementCount(System.Numerics.Vector mask, System.Numerics.Vector from) { throw null; } @@ -6229,309 +5457,157 @@ internal Arm64() { } public static System.Numerics.Vector LeadingZeroCount(System.Numerics.Vector value) { throw null; } public static System.Numerics.Vector LeadingZeroCount(System.Numerics.Vector value) { throw null; } public static System.Numerics.Vector LeadingZeroCount(System.Numerics.Vector value) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector LoadVector(System.Numerics.Vector mask, byte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector LoadVector(System.Numerics.Vector mask, double* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector LoadVector(System.Numerics.Vector mask, short* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector LoadVector(System.Numerics.Vector mask, int* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector LoadVector(System.Numerics.Vector mask, long* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector LoadVector(System.Numerics.Vector mask, sbyte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector LoadVector(System.Numerics.Vector mask, float* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector LoadVector(System.Numerics.Vector mask, ushort* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector LoadVector(System.Numerics.Vector mask, uint* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector LoadVector(System.Numerics.Vector mask, ulong* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector LoadVector128AndReplicateToVector(System.Numerics.Vector mask, byte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector LoadVector128AndReplicateToVector(System.Numerics.Vector mask, double* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector LoadVector128AndReplicateToVector(System.Numerics.Vector mask, short* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector LoadVector128AndReplicateToVector(System.Numerics.Vector mask, int* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector LoadVector128AndReplicateToVector(System.Numerics.Vector mask, long* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector LoadVector128AndReplicateToVector(System.Numerics.Vector mask, sbyte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector LoadVector128AndReplicateToVector(System.Numerics.Vector mask, float* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector LoadVector128AndReplicateToVector(System.Numerics.Vector mask, ushort* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector LoadVector128AndReplicateToVector(System.Numerics.Vector mask, uint* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector LoadVector128AndReplicateToVector(System.Numerics.Vector mask, ulong* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector LoadVectorByteNonFaultingZeroExtendToInt16(System.Numerics.Vector mask, byte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector LoadVectorByteNonFaultingZeroExtendToInt32(System.Numerics.Vector mask, byte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector LoadVectorByteNonFaultingZeroExtendToInt64(System.Numerics.Vector mask, byte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector LoadVectorByteNonFaultingZeroExtendToUInt16(System.Numerics.Vector mask, byte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector LoadVectorByteNonFaultingZeroExtendToUInt32(System.Numerics.Vector mask, byte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector LoadVectorByteNonFaultingZeroExtendToUInt64(System.Numerics.Vector mask, byte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector LoadVectorByteZeroExtendFirstFaulting(System.Numerics.Vector mask, byte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector LoadVectorByteZeroExtendFirstFaulting(System.Numerics.Vector mask, byte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector LoadVectorByteZeroExtendFirstFaulting(System.Numerics.Vector mask, byte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector LoadVectorByteZeroExtendFirstFaulting(System.Numerics.Vector mask, byte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector LoadVectorByteZeroExtendFirstFaulting(System.Numerics.Vector mask, byte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector LoadVectorByteZeroExtendFirstFaulting(System.Numerics.Vector mask, byte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector LoadVectorByteZeroExtendToInt16(System.Numerics.Vector mask, byte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector LoadVectorByteZeroExtendToInt32(System.Numerics.Vector mask, byte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector LoadVectorByteZeroExtendToInt64(System.Numerics.Vector mask, byte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector LoadVectorByteZeroExtendToUInt16(System.Numerics.Vector mask, byte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector LoadVectorByteZeroExtendToUInt32(System.Numerics.Vector mask, byte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector LoadVectorByteZeroExtendToUInt64(System.Numerics.Vector mask, byte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector LoadVectorInt16NonFaultingSignExtendToInt32(System.Numerics.Vector mask, short* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector LoadVectorInt16NonFaultingSignExtendToInt64(System.Numerics.Vector mask, short* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector LoadVectorInt16NonFaultingSignExtendToUInt32(System.Numerics.Vector mask, short* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector LoadVectorInt16NonFaultingSignExtendToUInt64(System.Numerics.Vector mask, short* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector LoadVectorInt16SignExtendFirstFaulting(System.Numerics.Vector mask, short* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector LoadVectorInt16SignExtendFirstFaulting(System.Numerics.Vector mask, short* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector LoadVectorInt16SignExtendFirstFaulting(System.Numerics.Vector mask, short* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector LoadVectorInt16SignExtendFirstFaulting(System.Numerics.Vector mask, short* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector LoadVectorInt16SignExtendToInt32(System.Numerics.Vector mask, short* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector LoadVectorInt16SignExtendToInt64(System.Numerics.Vector mask, short* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector LoadVectorInt16SignExtendToUInt32(System.Numerics.Vector mask, short* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector LoadVectorInt16SignExtendToUInt64(System.Numerics.Vector mask, short* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector LoadVectorInt32NonFaultingSignExtendToInt64(System.Numerics.Vector mask, int* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector LoadVectorInt32NonFaultingSignExtendToUInt64(System.Numerics.Vector mask, int* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector LoadVectorInt32SignExtendFirstFaulting(System.Numerics.Vector mask, int* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector LoadVectorInt32SignExtendFirstFaulting(System.Numerics.Vector mask, int* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector LoadVectorInt32SignExtendToInt64(System.Numerics.Vector mask, int* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector LoadVectorInt32SignExtendToUInt64(System.Numerics.Vector mask, int* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector LoadVectorNonFaulting(System.Numerics.Vector mask, byte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector LoadVectorNonFaulting(System.Numerics.Vector mask, double* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector LoadVectorNonFaulting(System.Numerics.Vector mask, short* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector LoadVectorNonFaulting(System.Numerics.Vector mask, int* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector LoadVectorNonFaulting(System.Numerics.Vector mask, long* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector LoadVectorNonFaulting(System.Numerics.Vector mask, sbyte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector LoadVectorNonFaulting(System.Numerics.Vector mask, float* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector LoadVectorNonFaulting(System.Numerics.Vector mask, ushort* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector LoadVectorNonFaulting(System.Numerics.Vector mask, uint* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector LoadVectorNonFaulting(System.Numerics.Vector mask, ulong* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector LoadVectorNonTemporal(System.Numerics.Vector mask, byte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector LoadVectorNonTemporal(System.Numerics.Vector mask, double* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector LoadVectorNonTemporal(System.Numerics.Vector mask, short* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector LoadVectorNonTemporal(System.Numerics.Vector mask, int* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector LoadVectorNonTemporal(System.Numerics.Vector mask, long* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector LoadVectorNonTemporal(System.Numerics.Vector mask, sbyte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector LoadVectorNonTemporal(System.Numerics.Vector mask, float* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector LoadVectorNonTemporal(System.Numerics.Vector mask, ushort* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector LoadVectorNonTemporal(System.Numerics.Vector mask, uint* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector LoadVectorNonTemporal(System.Numerics.Vector mask, ulong* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector LoadVectorFirstFaulting(System.Numerics.Vector mask, byte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector LoadVectorFirstFaulting(System.Numerics.Vector mask, double* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector LoadVectorFirstFaulting(System.Numerics.Vector mask, short* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector LoadVectorFirstFaulting(System.Numerics.Vector mask, int* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector LoadVectorFirstFaulting(System.Numerics.Vector mask, long* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector LoadVectorFirstFaulting(System.Numerics.Vector mask, sbyte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector LoadVectorFirstFaulting(System.Numerics.Vector mask, float* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector LoadVectorFirstFaulting(System.Numerics.Vector mask, ushort* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector LoadVectorFirstFaulting(System.Numerics.Vector mask, uint* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector LoadVectorFirstFaulting(System.Numerics.Vector mask, ulong* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector LoadVectorSByteNonFaultingSignExtendToInt16(System.Numerics.Vector mask, sbyte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector LoadVectorSByteNonFaultingSignExtendToInt32(System.Numerics.Vector mask, sbyte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector LoadVectorSByteNonFaultingSignExtendToInt64(System.Numerics.Vector mask, sbyte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector LoadVectorSByteNonFaultingSignExtendToUInt16(System.Numerics.Vector mask, sbyte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector LoadVectorSByteNonFaultingSignExtendToUInt32(System.Numerics.Vector mask, sbyte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector LoadVectorSByteNonFaultingSignExtendToUInt64(System.Numerics.Vector mask, sbyte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector LoadVectorSByteSignExtendFirstFaulting(System.Numerics.Vector mask, sbyte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector LoadVectorSByteSignExtendFirstFaulting(System.Numerics.Vector mask, sbyte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector LoadVectorSByteSignExtendFirstFaulting(System.Numerics.Vector mask, sbyte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector LoadVectorSByteSignExtendFirstFaulting(System.Numerics.Vector mask, sbyte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector LoadVectorSByteSignExtendFirstFaulting(System.Numerics.Vector mask, sbyte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector LoadVectorSByteSignExtendFirstFaulting(System.Numerics.Vector mask, sbyte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector LoadVectorSByteSignExtendToInt16(System.Numerics.Vector mask, sbyte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector LoadVectorSByteSignExtendToInt32(System.Numerics.Vector mask, sbyte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector LoadVectorSByteSignExtendToInt64(System.Numerics.Vector mask, sbyte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector LoadVectorSByteSignExtendToUInt16(System.Numerics.Vector mask, sbyte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector LoadVectorSByteSignExtendToUInt32(System.Numerics.Vector mask, sbyte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector LoadVectorSByteSignExtendToUInt64(System.Numerics.Vector mask, sbyte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector LoadVectorUInt16NonFaultingZeroExtendToInt32(System.Numerics.Vector mask, ushort* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector LoadVectorUInt16NonFaultingZeroExtendToInt64(System.Numerics.Vector mask, ushort* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector LoadVectorUInt16NonFaultingZeroExtendToUInt32(System.Numerics.Vector mask, ushort* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector LoadVectorUInt16NonFaultingZeroExtendToUInt64(System.Numerics.Vector mask, ushort* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector LoadVectorUInt16ZeroExtendFirstFaulting(System.Numerics.Vector mask, ushort* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector LoadVectorUInt16ZeroExtendFirstFaulting(System.Numerics.Vector mask, ushort* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector LoadVectorUInt16ZeroExtendFirstFaulting(System.Numerics.Vector mask, ushort* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector LoadVectorUInt16ZeroExtendFirstFaulting(System.Numerics.Vector mask, ushort* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector LoadVectorUInt16ZeroExtendToInt32(System.Numerics.Vector mask, ushort* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector LoadVectorUInt16ZeroExtendToInt64(System.Numerics.Vector mask, ushort* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector LoadVectorUInt16ZeroExtendToUInt32(System.Numerics.Vector mask, ushort* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector LoadVectorUInt16ZeroExtendToUInt64(System.Numerics.Vector mask, ushort* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector LoadVectorUInt32NonFaultingZeroExtendToInt64(System.Numerics.Vector mask, uint* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector LoadVectorUInt32NonFaultingZeroExtendToUInt64(System.Numerics.Vector mask, uint* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector LoadVectorUInt32ZeroExtendFirstFaulting(System.Numerics.Vector mask, uint* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector LoadVectorUInt32ZeroExtendFirstFaulting(System.Numerics.Vector mask, uint* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector LoadVectorUInt32ZeroExtendToInt64(System.Numerics.Vector mask, uint* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Numerics.Vector LoadVectorUInt32ZeroExtendToUInt64(System.Numerics.Vector mask, uint* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Numerics.Vector, System.Numerics.Vector) Load2xVectorAndUnzip(System.Numerics.Vector mask, byte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Numerics.Vector, System.Numerics.Vector) Load2xVectorAndUnzip(System.Numerics.Vector mask, double* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Numerics.Vector, System.Numerics.Vector) Load2xVectorAndUnzip(System.Numerics.Vector mask, short* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Numerics.Vector, System.Numerics.Vector) Load2xVectorAndUnzip(System.Numerics.Vector mask, int* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Numerics.Vector, System.Numerics.Vector) Load2xVectorAndUnzip(System.Numerics.Vector mask, long* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Numerics.Vector, System.Numerics.Vector) Load2xVectorAndUnzip(System.Numerics.Vector mask, sbyte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Numerics.Vector, System.Numerics.Vector) Load2xVectorAndUnzip(System.Numerics.Vector mask, float* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Numerics.Vector, System.Numerics.Vector) Load2xVectorAndUnzip(System.Numerics.Vector mask, ushort* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Numerics.Vector, System.Numerics.Vector) Load2xVectorAndUnzip(System.Numerics.Vector mask, uint* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Numerics.Vector, System.Numerics.Vector) Load2xVectorAndUnzip(System.Numerics.Vector mask, ulong* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Numerics.Vector, System.Numerics.Vector, System.Numerics.Vector) Load3xVectorAndUnzip(System.Numerics.Vector mask, byte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Numerics.Vector, System.Numerics.Vector, System.Numerics.Vector) Load3xVectorAndUnzip(System.Numerics.Vector mask, double* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Numerics.Vector, System.Numerics.Vector, System.Numerics.Vector) Load3xVectorAndUnzip(System.Numerics.Vector mask, short* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Numerics.Vector, System.Numerics.Vector, System.Numerics.Vector) Load3xVectorAndUnzip(System.Numerics.Vector mask, int* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Numerics.Vector, System.Numerics.Vector, System.Numerics.Vector) Load3xVectorAndUnzip(System.Numerics.Vector mask, long* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Numerics.Vector, System.Numerics.Vector, System.Numerics.Vector) Load3xVectorAndUnzip(System.Numerics.Vector mask, sbyte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Numerics.Vector, System.Numerics.Vector, System.Numerics.Vector) Load3xVectorAndUnzip(System.Numerics.Vector mask, float* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Numerics.Vector, System.Numerics.Vector, System.Numerics.Vector) Load3xVectorAndUnzip(System.Numerics.Vector mask, ushort* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Numerics.Vector, System.Numerics.Vector, System.Numerics.Vector) Load3xVectorAndUnzip(System.Numerics.Vector mask, uint* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Numerics.Vector, System.Numerics.Vector, System.Numerics.Vector) Load3xVectorAndUnzip(System.Numerics.Vector mask, ulong* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Numerics.Vector, System.Numerics.Vector, System.Numerics.Vector, System.Numerics.Vector) Load4xVectorAndUnzip(System.Numerics.Vector mask, byte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Numerics.Vector, System.Numerics.Vector, System.Numerics.Vector, System.Numerics.Vector) Load4xVectorAndUnzip(System.Numerics.Vector mask, double* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Numerics.Vector, System.Numerics.Vector, System.Numerics.Vector, System.Numerics.Vector) Load4xVectorAndUnzip(System.Numerics.Vector mask, short* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Numerics.Vector, System.Numerics.Vector, System.Numerics.Vector, System.Numerics.Vector) Load4xVectorAndUnzip(System.Numerics.Vector mask, int* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Numerics.Vector, System.Numerics.Vector, System.Numerics.Vector, System.Numerics.Vector) Load4xVectorAndUnzip(System.Numerics.Vector mask, long* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Numerics.Vector, System.Numerics.Vector, System.Numerics.Vector, System.Numerics.Vector) Load4xVectorAndUnzip(System.Numerics.Vector mask, sbyte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Numerics.Vector, System.Numerics.Vector, System.Numerics.Vector, System.Numerics.Vector) Load4xVectorAndUnzip(System.Numerics.Vector mask, float* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Numerics.Vector, System.Numerics.Vector, System.Numerics.Vector, System.Numerics.Vector) Load4xVectorAndUnzip(System.Numerics.Vector mask, ushort* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Numerics.Vector, System.Numerics.Vector, System.Numerics.Vector, System.Numerics.Vector) Load4xVectorAndUnzip(System.Numerics.Vector mask, uint* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe (System.Numerics.Vector, System.Numerics.Vector, System.Numerics.Vector, System.Numerics.Vector) Load4xVectorAndUnzip(System.Numerics.Vector mask, ulong* address) { throw null; } public static System.Numerics.Vector Max(System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } public static System.Numerics.Vector Max(System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } @@ -6654,13 +5730,9 @@ internal Arm64() { } public static System.Numerics.Vector PopCount(System.Numerics.Vector value) { throw null; } public static System.Numerics.Vector PopCount(System.Numerics.Vector value) { throw null; } public static System.Numerics.Vector PopCount(System.Numerics.Vector value) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Prefetch16Bit(System.Numerics.Vector mask, void* address, [ConstantExpected] SvePrefetchType prefetchType) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Prefetch32Bit(System.Numerics.Vector mask, void* address, [ConstantExpected] SvePrefetchType prefetchType) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Prefetch64Bit(System.Numerics.Vector mask, void* address, [ConstantExpected] SvePrefetchType prefetchType) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Prefetch8Bit(System.Numerics.Vector mask, void* address, [ConstantExpected] SvePrefetchType prefetchType) { throw null; } public static System.Numerics.Vector ReciprocalEstimate(System.Numerics.Vector value) { throw null; } public static System.Numerics.Vector ReciprocalEstimate(System.Numerics.Vector value) { throw null; } @@ -6802,133 +5874,77 @@ internal Arm64() { } public static System.Numerics.Vector SaturatingIncrementByActiveElementCount(System.Numerics.Vector value, System.Numerics.Vector from) { throw null; } public static System.Numerics.Vector Scale(System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } public static System.Numerics.Vector Scale(System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Scatter(System.Numerics.Vector mask, double* address, System.Numerics.Vector indicies, System.Numerics.Vector data) { throw null; } public static unsafe void Scatter(System.Numerics.Vector mask, System.Numerics.Vector addresses, System.Numerics.Vector data) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Scatter(System.Numerics.Vector mask, double* address, System.Numerics.Vector indicies, System.Numerics.Vector data) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Scatter(System.Numerics.Vector mask, int* address, System.Numerics.Vector indicies, System.Numerics.Vector data) { throw null; } // public static void Scatter(System.Numerics.Vector mask, System.Numerics.Vector addresses, System.Numerics.Vector data) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Scatter(System.Numerics.Vector mask, int* address, System.Numerics.Vector indicies, System.Numerics.Vector data) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Scatter(System.Numerics.Vector mask, long* address, System.Numerics.Vector indicies, System.Numerics.Vector data) { throw null; } public static void Scatter(System.Numerics.Vector mask, System.Numerics.Vector addresses, System.Numerics.Vector data) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Scatter(System.Numerics.Vector mask, long* address, System.Numerics.Vector indicies, System.Numerics.Vector data) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Scatter(System.Numerics.Vector mask, float* address, System.Numerics.Vector indicies, System.Numerics.Vector data) { throw null; } // public static void Scatter(System.Numerics.Vector mask, System.Numerics.Vector addresses, System.Numerics.Vector data) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Scatter(System.Numerics.Vector mask, float* address, System.Numerics.Vector indicies, System.Numerics.Vector data) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Scatter(System.Numerics.Vector mask, uint* address, System.Numerics.Vector indicies, System.Numerics.Vector data) { throw null; } // public static void Scatter(System.Numerics.Vector mask, System.Numerics.Vector addresses, System.Numerics.Vector data) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Scatter(System.Numerics.Vector mask, uint* address, System.Numerics.Vector indicies, System.Numerics.Vector data) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Scatter(System.Numerics.Vector mask, ulong* address, System.Numerics.Vector indicies, System.Numerics.Vector data) { throw null; } public static void Scatter(System.Numerics.Vector mask, System.Numerics.Vector addresses, System.Numerics.Vector data) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Scatter(System.Numerics.Vector mask, ulong* address, System.Numerics.Vector indicies, System.Numerics.Vector data) { throw null; } // public static void Scatter16BitNarrowing(System.Numerics.Vector mask, System.Numerics.Vector addresses, System.Numerics.Vector data) { throw null; } public static void Scatter16BitNarrowing(System.Numerics.Vector mask, System.Numerics.Vector addresses, System.Numerics.Vector data) { throw null; } // public static void Scatter16BitNarrowing(System.Numerics.Vector mask, System.Numerics.Vector addresses, System.Numerics.Vector data) { throw null; } public static unsafe void Scatter16BitNarrowing(System.Numerics.Vector mask, System.Numerics.Vector addresses, System.Numerics.Vector data) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Scatter16BitNarrowing(System.Numerics.Vector mask, short* address, System.Numerics.Vector indices, System.Numerics.Vector data) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Scatter16BitNarrowing(System.Numerics.Vector mask, short* address, System.Numerics.Vector indices, System.Numerics.Vector data) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Scatter16BitNarrowing(System.Numerics.Vector mask, short* address, System.Numerics.Vector indices, System.Numerics.Vector data) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Scatter16BitNarrowing(System.Numerics.Vector mask, short* address, System.Numerics.Vector indices, System.Numerics.Vector data) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Scatter16BitNarrowing(System.Numerics.Vector mask, ushort* address, System.Numerics.Vector indices, System.Numerics.Vector data) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Scatter16BitNarrowing(System.Numerics.Vector mask, ushort* address, System.Numerics.Vector indices, System.Numerics.Vector data) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Scatter16BitNarrowing(System.Numerics.Vector mask, ushort* address, System.Numerics.Vector indices, System.Numerics.Vector data) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Scatter16BitNarrowing(System.Numerics.Vector mask, ushort* address, System.Numerics.Vector indices, System.Numerics.Vector data) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Scatter16BitWithByteOffsetsNarrowing(System.Numerics.Vector mask, short* address, System.Numerics.Vector offsets, System.Numerics.Vector data) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Scatter16BitWithByteOffsetsNarrowing(System.Numerics.Vector mask, short* address, System.Numerics.Vector offsets, System.Numerics.Vector data) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Scatter16BitWithByteOffsetsNarrowing(System.Numerics.Vector mask, short* address, System.Numerics.Vector offsets, System.Numerics.Vector data) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Scatter16BitWithByteOffsetsNarrowing(System.Numerics.Vector mask, short* address, System.Numerics.Vector offsets, System.Numerics.Vector data) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Scatter16BitWithByteOffsetsNarrowing(System.Numerics.Vector mask, ushort* address, System.Numerics.Vector offsets, System.Numerics.Vector data) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Scatter16BitWithByteOffsetsNarrowing(System.Numerics.Vector mask, ushort* address, System.Numerics.Vector offsets, System.Numerics.Vector data) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Scatter16BitWithByteOffsetsNarrowing(System.Numerics.Vector mask, ushort* address, System.Numerics.Vector offsets, System.Numerics.Vector data) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Scatter16BitWithByteOffsetsNarrowing(System.Numerics.Vector mask, ushort* address, System.Numerics.Vector offsets, System.Numerics.Vector data) { throw null; } public static unsafe void Scatter32BitNarrowing(System.Numerics.Vector mask, System.Numerics.Vector addresses, System.Numerics.Vector data) { throw null; } public static unsafe void Scatter32BitNarrowing(System.Numerics.Vector mask, System.Numerics.Vector addresses, System.Numerics.Vector data) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Scatter32BitNarrowing(System.Numerics.Vector mask, int* address, System.Numerics.Vector indices, System.Numerics.Vector data) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Scatter32BitNarrowing(System.Numerics.Vector mask, int* address, System.Numerics.Vector indices, System.Numerics.Vector data) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Scatter32BitNarrowing(System.Numerics.Vector mask, uint* address, System.Numerics.Vector indices, System.Numerics.Vector data) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Scatter32BitNarrowing(System.Numerics.Vector mask, uint* address, System.Numerics.Vector indices, System.Numerics.Vector data) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Scatter32BitWithByteOffsetsNarrowing(System.Numerics.Vector mask, int* address, System.Numerics.Vector offsets, System.Numerics.Vector data) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Scatter32BitWithByteOffsetsNarrowing(System.Numerics.Vector mask, int* address, System.Numerics.Vector offsets, System.Numerics.Vector data) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Scatter32BitWithByteOffsetsNarrowing(System.Numerics.Vector mask, uint* address, System.Numerics.Vector offsets, System.Numerics.Vector data) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Scatter32BitWithByteOffsetsNarrowing(System.Numerics.Vector mask, uint* address, System.Numerics.Vector offsets, System.Numerics.Vector data) { throw null; } // public static void Scatter8BitNarrowing(System.Numerics.Vector mask, System.Numerics.Vector addresses, System.Numerics.Vector data) { throw null; } public static void Scatter8BitNarrowing(System.Numerics.Vector mask, System.Numerics.Vector addresses, System.Numerics.Vector data) { throw null; } // public static void Scatter8BitNarrowing(System.Numerics.Vector mask, System.Numerics.Vector addresses, System.Numerics.Vector data) { throw null; } public static void Scatter8BitNarrowing(System.Numerics.Vector mask, System.Numerics.Vector addresses, System.Numerics.Vector data) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Scatter8BitWithByteOffsetsNarrowing(System.Numerics.Vector mask, sbyte* address, System.Numerics.Vector offsets, System.Numerics.Vector data) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Scatter8BitWithByteOffsetsNarrowing(System.Numerics.Vector mask, sbyte* address, System.Numerics.Vector offsets, System.Numerics.Vector data) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Scatter8BitWithByteOffsetsNarrowing(System.Numerics.Vector mask, sbyte* address, System.Numerics.Vector offsets, System.Numerics.Vector data) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Scatter8BitWithByteOffsetsNarrowing(System.Numerics.Vector mask, sbyte* address, System.Numerics.Vector offsets, System.Numerics.Vector data) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Scatter8BitWithByteOffsetsNarrowing(System.Numerics.Vector mask, byte* address, System.Numerics.Vector offsets, System.Numerics.Vector data) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Scatter8BitWithByteOffsetsNarrowing(System.Numerics.Vector mask, byte* address, System.Numerics.Vector offsets, System.Numerics.Vector data) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Scatter8BitWithByteOffsetsNarrowing(System.Numerics.Vector mask, byte* address, System.Numerics.Vector offsets, System.Numerics.Vector data) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Scatter8BitWithByteOffsetsNarrowing(System.Numerics.Vector mask, byte* address, System.Numerics.Vector offsets, System.Numerics.Vector data) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void ScatterWithByteOffsets(System.Numerics.Vector mask, double* address, System.Numerics.Vector offsets, System.Numerics.Vector data) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void ScatterWithByteOffsets(System.Numerics.Vector mask, double* address, System.Numerics.Vector offsets, System.Numerics.Vector data) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void ScatterWithByteOffsets(System.Numerics.Vector mask, int* address, System.Numerics.Vector offsets, System.Numerics.Vector data) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void ScatterWithByteOffsets(System.Numerics.Vector mask, int* address, System.Numerics.Vector offsets, System.Numerics.Vector data) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void ScatterWithByteOffsets(System.Numerics.Vector mask, long* address, System.Numerics.Vector offsets, System.Numerics.Vector data) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void ScatterWithByteOffsets(System.Numerics.Vector mask, long* address, System.Numerics.Vector offsets, System.Numerics.Vector data) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void ScatterWithByteOffsets(System.Numerics.Vector mask, float* address, System.Numerics.Vector offsets, System.Numerics.Vector data) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void ScatterWithByteOffsets(System.Numerics.Vector mask, float* address, System.Numerics.Vector offsets, System.Numerics.Vector data) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void ScatterWithByteOffsets(System.Numerics.Vector mask, uint* address, System.Numerics.Vector offsets, System.Numerics.Vector data) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void ScatterWithByteOffsets(System.Numerics.Vector mask, uint* address, System.Numerics.Vector offsets, System.Numerics.Vector data) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void ScatterWithByteOffsets(System.Numerics.Vector mask, ulong* address, System.Numerics.Vector offsets, System.Numerics.Vector data) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void ScatterWithByteOffsets(System.Numerics.Vector mask, ulong* address, System.Numerics.Vector offsets, System.Numerics.Vector data) { throw null; } public static void SetFfr(System.Numerics.Vector value) { throw null; } public static void SetFfr(System.Numerics.Vector value) { throw null; } @@ -6996,129 +6012,67 @@ internal Arm64() { } public static System.Numerics.Vector Splice(System.Numerics.Vector mask, System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } public static System.Numerics.Vector Sqrt(System.Numerics.Vector value) { throw null; } public static System.Numerics.Vector Sqrt(System.Numerics.Vector value) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreAndZip(System.Numerics.Vector mask, byte* address, System.Numerics.Vector data) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreAndZip(System.Numerics.Vector mask, byte* address, (System.Numerics.Vector Value1, System.Numerics.Vector Value2) data) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreAndZip(System.Numerics.Vector mask, byte* address, (System.Numerics.Vector Value1, System.Numerics.Vector Value2, System.Numerics.Vector Value3) data) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreAndZip(System.Numerics.Vector mask, byte* address, (System.Numerics.Vector Value1, System.Numerics.Vector Value2, System.Numerics.Vector Value3, System.Numerics.Vector Value4) data) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreAndZip(System.Numerics.Vector mask, double* address, System.Numerics.Vector data) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreAndZip(System.Numerics.Vector mask, double* address, (System.Numerics.Vector Value1, System.Numerics.Vector Value2) data) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreAndZip(System.Numerics.Vector mask, double* address, (System.Numerics.Vector Value1, System.Numerics.Vector Value2, System.Numerics.Vector Value3) data) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreAndZip(System.Numerics.Vector mask, double* address, (System.Numerics.Vector Value1, System.Numerics.Vector Value2, System.Numerics.Vector Value3, System.Numerics.Vector Value4) data) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreAndZip(System.Numerics.Vector mask, short* address, System.Numerics.Vector data) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreAndZip(System.Numerics.Vector mask, short* address, (System.Numerics.Vector Value1, System.Numerics.Vector Value2) data) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreAndZip(System.Numerics.Vector mask, short* address, (System.Numerics.Vector Value1, System.Numerics.Vector Value2, System.Numerics.Vector Value3) data) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreAndZip(System.Numerics.Vector mask, short* address, (System.Numerics.Vector Value1, System.Numerics.Vector Value2, System.Numerics.Vector Value3, System.Numerics.Vector Value4) data) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreAndZip(System.Numerics.Vector mask, int* address, System.Numerics.Vector data) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreAndZip(System.Numerics.Vector mask, int* address, (System.Numerics.Vector Value1, System.Numerics.Vector Value2) data) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreAndZip(System.Numerics.Vector mask, int* address, (System.Numerics.Vector Value1, System.Numerics.Vector Value2, System.Numerics.Vector Value3) data) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreAndZip(System.Numerics.Vector mask, int* address, (System.Numerics.Vector Value1, System.Numerics.Vector Value2, System.Numerics.Vector Value3, System.Numerics.Vector Value4) data) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreAndZip(System.Numerics.Vector mask, long* address, System.Numerics.Vector data) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreAndZip(System.Numerics.Vector mask, long* address, (System.Numerics.Vector Value1, System.Numerics.Vector Value2) data) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreAndZip(System.Numerics.Vector mask, long* address, (System.Numerics.Vector Value1, System.Numerics.Vector Value2, System.Numerics.Vector Value3) data) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreAndZip(System.Numerics.Vector mask, long* address, (System.Numerics.Vector Value1, System.Numerics.Vector Value2, System.Numerics.Vector Value3, System.Numerics.Vector Value4) data) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreAndZip(System.Numerics.Vector mask, sbyte* address, System.Numerics.Vector data) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreAndZip(System.Numerics.Vector mask, sbyte* address, (System.Numerics.Vector Value1, System.Numerics.Vector Value2) data) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreAndZip(System.Numerics.Vector mask, sbyte* address, (System.Numerics.Vector Value1, System.Numerics.Vector Value2, System.Numerics.Vector Value3) data) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreAndZip(System.Numerics.Vector mask, sbyte* address, (System.Numerics.Vector Value1, System.Numerics.Vector Value2, System.Numerics.Vector Value3, System.Numerics.Vector Value4) data) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreAndZip(System.Numerics.Vector mask, float* address, System.Numerics.Vector data) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreAndZip(System.Numerics.Vector mask, float* address, (System.Numerics.Vector Value1, System.Numerics.Vector Value2) data) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreAndZip(System.Numerics.Vector mask, float* address, (System.Numerics.Vector Value1, System.Numerics.Vector Value2, System.Numerics.Vector Value3) data) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreAndZip(System.Numerics.Vector mask, float* address, (System.Numerics.Vector Value1, System.Numerics.Vector Value2, System.Numerics.Vector Value3, System.Numerics.Vector Value4) data) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreAndZip(System.Numerics.Vector mask, ushort* address, System.Numerics.Vector data) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreAndZip(System.Numerics.Vector mask, ushort* address, (System.Numerics.Vector Value1, System.Numerics.Vector Value2) data) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreAndZip(System.Numerics.Vector mask, ushort* address, (System.Numerics.Vector Value1, System.Numerics.Vector Value2, System.Numerics.Vector Value3) data) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreAndZip(System.Numerics.Vector mask, ushort* address, (System.Numerics.Vector Value1, System.Numerics.Vector Value2, System.Numerics.Vector Value3, System.Numerics.Vector Value4) data) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreAndZip(System.Numerics.Vector mask, uint* address, System.Numerics.Vector data) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreAndZip(System.Numerics.Vector mask, uint* address, (System.Numerics.Vector Value1, System.Numerics.Vector Value2) data) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreAndZip(System.Numerics.Vector mask, uint* address, (System.Numerics.Vector Value1, System.Numerics.Vector Value2, System.Numerics.Vector Value3) data) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreAndZip(System.Numerics.Vector mask, uint* address, (System.Numerics.Vector Value1, System.Numerics.Vector Value2, System.Numerics.Vector Value3, System.Numerics.Vector Value4) data) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreAndZip(System.Numerics.Vector mask, ulong* address, System.Numerics.Vector data) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreAndZip(System.Numerics.Vector mask, ulong* address, (System.Numerics.Vector Value1, System.Numerics.Vector Value2) data) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreAndZip(System.Numerics.Vector mask, ulong* address, (System.Numerics.Vector Value1, System.Numerics.Vector Value2, System.Numerics.Vector Value3) data) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreAndZip(System.Numerics.Vector mask, ulong* address, (System.Numerics.Vector Value1, System.Numerics.Vector Value2, System.Numerics.Vector Value3, System.Numerics.Vector Value4) data) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreNarrowing(System.Numerics.Vector mask, sbyte* address, System.Numerics.Vector data) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreNarrowing(System.Numerics.Vector mask, sbyte* address, System.Numerics.Vector data) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreNarrowing(System.Numerics.Vector mask, short* address, System.Numerics.Vector data) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreNarrowing(System.Numerics.Vector mask, sbyte* address, System.Numerics.Vector data) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreNarrowing(System.Numerics.Vector mask, short* address, System.Numerics.Vector data) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreNarrowing(System.Numerics.Vector mask, int* address, System.Numerics.Vector data) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreNarrowing(System.Numerics.Vector mask, byte* address, System.Numerics.Vector data) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreNarrowing(System.Numerics.Vector mask, byte* address, System.Numerics.Vector data) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreNarrowing(System.Numerics.Vector mask, ushort* address, System.Numerics.Vector data) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreNarrowing(System.Numerics.Vector mask, byte* address, System.Numerics.Vector data) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreNarrowing(System.Numerics.Vector mask, ushort* address, System.Numerics.Vector data) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreNarrowing(System.Numerics.Vector mask, uint* address, System.Numerics.Vector data) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreNonTemporal(System.Numerics.Vector mask, byte* address, System.Numerics.Vector data) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreNonTemporal(System.Numerics.Vector mask, double* address, System.Numerics.Vector data) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreNonTemporal(System.Numerics.Vector mask, short* address, System.Numerics.Vector data) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreNonTemporal(System.Numerics.Vector mask, int* address, System.Numerics.Vector data) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreNonTemporal(System.Numerics.Vector mask, long* address, System.Numerics.Vector data) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreNonTemporal(System.Numerics.Vector mask, sbyte* address, System.Numerics.Vector data) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreNonTemporal(System.Numerics.Vector mask, float* address, System.Numerics.Vector data) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreNonTemporal(System.Numerics.Vector mask, ushort* address, System.Numerics.Vector data) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreNonTemporal(System.Numerics.Vector mask, uint* address, System.Numerics.Vector data) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreNonTemporal(System.Numerics.Vector mask, ulong* address, System.Numerics.Vector data) { throw null; } public static System.Numerics.Vector Subtract(System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } public static System.Numerics.Vector Subtract(System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } @@ -7816,59 +6770,35 @@ internal Arm64() { } public static unsafe void Scatter16BitNarrowingNonTemporal(System.Numerics.Vector mask, System.Numerics.Vector addresses, System.Numerics.Vector data) { throw null; } // public static unsafe void Scatter16BitNarrowingNonTemporal(System.Numerics.Vector mask, System.Numerics.Vector addresses, System.Numerics.Vector data) { throw null; } public static unsafe void Scatter16BitNarrowingNonTemporal(System.Numerics.Vector mask, System.Numerics.Vector addresses, System.Numerics.Vector data) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Scatter16BitNarrowingNonTemporal(System.Numerics.Vector mask, short* address, System.Numerics.Vector indices, System.Numerics.Vector data) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Scatter16BitNarrowingNonTemporal(System.Numerics.Vector mask, short* address, System.Numerics.Vector indices, System.Numerics.Vector data) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Scatter16BitNarrowingNonTemporal(System.Numerics.Vector mask, ushort* address, System.Numerics.Vector indices, System.Numerics.Vector data) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Scatter16BitNarrowingNonTemporal(System.Numerics.Vector mask, ushort* address, System.Numerics.Vector indices, System.Numerics.Vector data) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Scatter16BitWithByteOffsetsNarrowingNonTemporal(System.Numerics.Vector mask, short* address, System.Numerics.Vector offsets, System.Numerics.Vector data) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Scatter16BitWithByteOffsetsNarrowingNonTemporal(System.Numerics.Vector mask, short* address, System.Numerics.Vector offsets, System.Numerics.Vector data) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Scatter16BitWithByteOffsetsNarrowingNonTemporal(System.Numerics.Vector mask, short* address, System.Numerics.Vector offsets, System.Numerics.Vector data) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Scatter16BitWithByteOffsetsNarrowingNonTemporal(System.Numerics.Vector mask, ushort* address, System.Numerics.Vector offsets, System.Numerics.Vector data) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Scatter16BitWithByteOffsetsNarrowingNonTemporal(System.Numerics.Vector mask, ushort* address, System.Numerics.Vector offsets, System.Numerics.Vector data) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Scatter16BitWithByteOffsetsNarrowingNonTemporal(System.Numerics.Vector mask, ushort* address, System.Numerics.Vector offsets, System.Numerics.Vector data) { throw null; } public static unsafe void Scatter32BitNarrowingNonTemporal(System.Numerics.Vector mask, System.Numerics.Vector addresses, System.Numerics.Vector data) { throw null; } public static unsafe void Scatter32BitNarrowingNonTemporal(System.Numerics.Vector mask, System.Numerics.Vector addresses, System.Numerics.Vector data) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Scatter32BitNarrowingNonTemporal(System.Numerics.Vector mask, int* address, System.Numerics.Vector indices, System.Numerics.Vector data) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Scatter32BitNarrowingNonTemporal(System.Numerics.Vector mask, int* address, System.Numerics.Vector indices, System.Numerics.Vector data) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Scatter32BitNarrowingNonTemporal(System.Numerics.Vector mask, uint* address, System.Numerics.Vector indices, System.Numerics.Vector data) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Scatter32BitNarrowingNonTemporal(System.Numerics.Vector mask, uint* address, System.Numerics.Vector indices, System.Numerics.Vector data) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Scatter32BitWithByteOffsetsNarrowingNonTemporal(System.Numerics.Vector mask, int* address, System.Numerics.Vector offsets, System.Numerics.Vector data) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Scatter32BitWithByteOffsetsNarrowingNonTemporal(System.Numerics.Vector mask, int* address, System.Numerics.Vector offsets, System.Numerics.Vector data) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Scatter32BitWithByteOffsetsNarrowingNonTemporal(System.Numerics.Vector mask, uint* address, System.Numerics.Vector offsets, System.Numerics.Vector data) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Scatter32BitWithByteOffsetsNarrowingNonTemporal(System.Numerics.Vector mask, uint* address, System.Numerics.Vector offsets, System.Numerics.Vector data) { throw null; } // public static unsafe void Scatter8BitNarrowingNonTemporal(System.Numerics.Vector mask, System.Numerics.Vector addresses, System.Numerics.Vector data) { throw null; } public static unsafe void Scatter8BitNarrowingNonTemporal(System.Numerics.Vector mask, System.Numerics.Vector addresses, System.Numerics.Vector data) { throw null; } // public static unsafe void Scatter8BitNarrowingNonTemporal(System.Numerics.Vector mask, System.Numerics.Vector addresses, System.Numerics.Vector data) { throw null; } public static unsafe void Scatter8BitNarrowingNonTemporal(System.Numerics.Vector mask, System.Numerics.Vector addresses, System.Numerics.Vector data) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Scatter8BitWithByteOffsetsNarrowingNonTemporal(System.Numerics.Vector mask, sbyte* address, System.Numerics.Vector offsets, System.Numerics.Vector data) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Scatter8BitWithByteOffsetsNarrowingNonTemporal(System.Numerics.Vector mask, sbyte* address, System.Numerics.Vector offsets, System.Numerics.Vector data) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Scatter8BitWithByteOffsetsNarrowingNonTemporal(System.Numerics.Vector mask, sbyte* address, System.Numerics.Vector offsets, System.Numerics.Vector data) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Scatter8BitWithByteOffsetsNarrowingNonTemporal(System.Numerics.Vector mask, byte* address, System.Numerics.Vector offsets, System.Numerics.Vector data) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Scatter8BitWithByteOffsetsNarrowingNonTemporal(System.Numerics.Vector mask, byte* address, System.Numerics.Vector offsets, System.Numerics.Vector data) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Scatter8BitWithByteOffsetsNarrowingNonTemporal(System.Numerics.Vector mask, byte* address, System.Numerics.Vector offsets, System.Numerics.Vector data) { throw null; } public static unsafe void ScatterNonTemporal(System.Numerics.Vector mask, System.Numerics.Vector addresses, System.Numerics.Vector data) { throw null; } // public static unsafe void ScatterNonTemporal(System.Numerics.Vector mask, System.Numerics.Vector addresses, System.Numerics.Vector data) { throw null; } @@ -7876,35 +6806,20 @@ internal Arm64() { } // public static unsafe void ScatterNonTemporal(System.Numerics.Vector mask, System.Numerics.Vector addresses, System.Numerics.Vector data) { throw null; } // public static unsafe void ScatterNonTemporal(System.Numerics.Vector mask, System.Numerics.Vector addresses, System.Numerics.Vector data) { throw null; } public static unsafe void ScatterNonTemporal(System.Numerics.Vector mask, System.Numerics.Vector addresses, System.Numerics.Vector data) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void ScatterNonTemporal(System.Numerics.Vector mask, double* address, System.Numerics.Vector indices, System.Numerics.Vector data) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void ScatterNonTemporal(System.Numerics.Vector mask, double* address, System.Numerics.Vector indices, System.Numerics.Vector data) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void ScatterNonTemporal(System.Numerics.Vector mask, long* address, System.Numerics.Vector indices, System.Numerics.Vector data) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void ScatterNonTemporal(System.Numerics.Vector mask, long* address, System.Numerics.Vector indices, System.Numerics.Vector data) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void ScatterNonTemporal(System.Numerics.Vector mask, ulong* address, System.Numerics.Vector indices, System.Numerics.Vector data) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void ScatterNonTemporal(System.Numerics.Vector mask, ulong* address, System.Numerics.Vector indices, System.Numerics.Vector data) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void ScatterWithByteOffsetsNonTemporal(System.Numerics.Vector mask, double* address, System.Numerics.Vector offsets, System.Numerics.Vector data) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void ScatterWithByteOffsetsNonTemporal(System.Numerics.Vector mask, double* address, System.Numerics.Vector offsets, System.Numerics.Vector data) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void ScatterWithByteOffsetsNonTemporal(System.Numerics.Vector mask, int* address, System.Numerics.Vector offsets, System.Numerics.Vector data) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void ScatterWithByteOffsetsNonTemporal(System.Numerics.Vector mask, long* address, System.Numerics.Vector offsets, System.Numerics.Vector data) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void ScatterWithByteOffsetsNonTemporal(System.Numerics.Vector mask, long* address, System.Numerics.Vector offsets, System.Numerics.Vector data) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void ScatterWithByteOffsetsNonTemporal(System.Numerics.Vector mask, float* address, System.Numerics.Vector offsets, System.Numerics.Vector data) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void ScatterWithByteOffsetsNonTemporal(System.Numerics.Vector mask, uint* address, System.Numerics.Vector offsets, System.Numerics.Vector data) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void ScatterWithByteOffsetsNonTemporal(System.Numerics.Vector mask, ulong* address, System.Numerics.Vector offsets, System.Numerics.Vector data) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void ScatterWithByteOffsetsNonTemporal(System.Numerics.Vector mask, ulong* address, System.Numerics.Vector offsets, System.Numerics.Vector data) { throw null; } public static System.Numerics.Vector ShiftArithmeticRounded(System.Numerics.Vector value, System.Numerics.Vector count) { throw null; } public static System.Numerics.Vector ShiftArithmeticRounded(System.Numerics.Vector value, System.Numerics.Vector count) { throw null; } @@ -8223,15 +7138,10 @@ internal Avx() { } public static System.Runtime.Intrinsics.Vector256 Blend(System.Runtime.Intrinsics.Vector256 left, System.Runtime.Intrinsics.Vector256 right, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute] byte control) { throw null; } public static System.Runtime.Intrinsics.Vector256 BlendVariable(System.Runtime.Intrinsics.Vector256 left, System.Runtime.Intrinsics.Vector256 right, System.Runtime.Intrinsics.Vector256 mask) { throw null; } public static System.Runtime.Intrinsics.Vector256 BlendVariable(System.Runtime.Intrinsics.Vector256 left, System.Runtime.Intrinsics.Vector256 right, System.Runtime.Intrinsics.Vector256 mask) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 BroadcastScalarToVector128(float* source) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector256 BroadcastScalarToVector256(double* source) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector256 BroadcastScalarToVector256(float* source) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector256 BroadcastVector128ToVector256(double* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector256 BroadcastVector128ToVector256(float* address) { throw null; } public static System.Runtime.Intrinsics.Vector256 Ceiling(System.Runtime.Intrinsics.Vector256 value) { throw null; } public static System.Runtime.Intrinsics.Vector256 Ceiling(System.Runtime.Intrinsics.Vector256 value) { throw null; } @@ -8305,77 +7215,41 @@ internal Avx() { } public static System.Runtime.Intrinsics.Vector256 InsertVector128(System.Runtime.Intrinsics.Vector256 value, System.Runtime.Intrinsics.Vector128 data, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute] byte index) { throw null; } public static System.Runtime.Intrinsics.Vector256 InsertVector128(System.Runtime.Intrinsics.Vector256 value, System.Runtime.Intrinsics.Vector128 data, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute] byte index) { throw null; } public static System.Runtime.Intrinsics.Vector256 InsertVector128(System.Runtime.Intrinsics.Vector256 value, System.Runtime.Intrinsics.Vector128 data, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute] byte index) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector256 LoadAlignedVector256(byte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector256 LoadAlignedVector256(double* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector256 LoadAlignedVector256(short* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector256 LoadAlignedVector256(int* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector256 LoadAlignedVector256(long* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector256 LoadAlignedVector256(sbyte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector256 LoadAlignedVector256(float* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector256 LoadAlignedVector256(ushort* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector256 LoadAlignedVector256(uint* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector256 LoadAlignedVector256(ulong* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector256 LoadDquVector256(byte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector256 LoadDquVector256(short* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector256 LoadDquVector256(int* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector256 LoadDquVector256(long* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector256 LoadDquVector256(sbyte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector256 LoadDquVector256(ushort* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector256 LoadDquVector256(uint* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector256 LoadDquVector256(ulong* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector256 LoadVector256(byte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector256 LoadVector256(double* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector256 LoadVector256(short* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector256 LoadVector256(int* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector256 LoadVector256(long* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector256 LoadVector256(sbyte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector256 LoadVector256(float* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector256 LoadVector256(ushort* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector256 LoadVector256(uint* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector256 LoadVector256(ulong* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 MaskLoad(double* address, System.Runtime.Intrinsics.Vector128 mask) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector256 MaskLoad(double* address, System.Runtime.Intrinsics.Vector256 mask) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 MaskLoad(float* address, System.Runtime.Intrinsics.Vector128 mask) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector256 MaskLoad(float* address, System.Runtime.Intrinsics.Vector256 mask) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void MaskStore(double* address, System.Runtime.Intrinsics.Vector128 mask, System.Runtime.Intrinsics.Vector128 source) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void MaskStore(double* address, System.Runtime.Intrinsics.Vector256 mask, System.Runtime.Intrinsics.Vector256 source) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void MaskStore(float* address, System.Runtime.Intrinsics.Vector128 mask, System.Runtime.Intrinsics.Vector128 source) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void MaskStore(float* address, System.Runtime.Intrinsics.Vector256 mask, System.Runtime.Intrinsics.Vector256 source) { } public static System.Runtime.Intrinsics.Vector256 Max(System.Runtime.Intrinsics.Vector256 left, System.Runtime.Intrinsics.Vector256 right) { throw null; } public static System.Runtime.Intrinsics.Vector256 Max(System.Runtime.Intrinsics.Vector256 left, System.Runtime.Intrinsics.Vector256 right) { throw null; } @@ -8421,65 +7295,35 @@ public static unsafe void MaskStore(float* address, System.Runtime.Intrinsics.Ve public static System.Runtime.Intrinsics.Vector256 Shuffle(System.Runtime.Intrinsics.Vector256 value, System.Runtime.Intrinsics.Vector256 right, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute] byte control) { throw null; } public static System.Runtime.Intrinsics.Vector256 Sqrt(System.Runtime.Intrinsics.Vector256 value) { throw null; } public static System.Runtime.Intrinsics.Vector256 Sqrt(System.Runtime.Intrinsics.Vector256 value) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Store(byte* address, System.Runtime.Intrinsics.Vector256 source) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Store(double* address, System.Runtime.Intrinsics.Vector256 source) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Store(short* address, System.Runtime.Intrinsics.Vector256 source) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Store(int* address, System.Runtime.Intrinsics.Vector256 source) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Store(long* address, System.Runtime.Intrinsics.Vector256 source) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Store(sbyte* address, System.Runtime.Intrinsics.Vector256 source) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Store(float* address, System.Runtime.Intrinsics.Vector256 source) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Store(ushort* address, System.Runtime.Intrinsics.Vector256 source) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Store(uint* address, System.Runtime.Intrinsics.Vector256 source) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Store(ulong* address, System.Runtime.Intrinsics.Vector256 source) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreAligned(byte* address, System.Runtime.Intrinsics.Vector256 source) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreAligned(double* address, System.Runtime.Intrinsics.Vector256 source) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreAligned(short* address, System.Runtime.Intrinsics.Vector256 source) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreAligned(int* address, System.Runtime.Intrinsics.Vector256 source) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreAligned(long* address, System.Runtime.Intrinsics.Vector256 source) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreAligned(sbyte* address, System.Runtime.Intrinsics.Vector256 source) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreAligned(float* address, System.Runtime.Intrinsics.Vector256 source) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreAligned(ushort* address, System.Runtime.Intrinsics.Vector256 source) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreAligned(uint* address, System.Runtime.Intrinsics.Vector256 source) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreAligned(ulong* address, System.Runtime.Intrinsics.Vector256 source) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreAlignedNonTemporal(byte* address, System.Runtime.Intrinsics.Vector256 source) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreAlignedNonTemporal(double* address, System.Runtime.Intrinsics.Vector256 source) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreAlignedNonTemporal(short* address, System.Runtime.Intrinsics.Vector256 source) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreAlignedNonTemporal(int* address, System.Runtime.Intrinsics.Vector256 source) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreAlignedNonTemporal(long* address, System.Runtime.Intrinsics.Vector256 source) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreAlignedNonTemporal(sbyte* address, System.Runtime.Intrinsics.Vector256 source) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreAlignedNonTemporal(float* address, System.Runtime.Intrinsics.Vector256 source) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreAlignedNonTemporal(ushort* address, System.Runtime.Intrinsics.Vector256 source) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreAlignedNonTemporal(uint* address, System.Runtime.Intrinsics.Vector256 source) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreAlignedNonTemporal(ulong* address, System.Runtime.Intrinsics.Vector256 source) { } public static System.Runtime.Intrinsics.Vector256 Subtract(System.Runtime.Intrinsics.Vector256 left, System.Runtime.Intrinsics.Vector256 right) { throw null; } public static System.Runtime.Intrinsics.Vector256 Subtract(System.Runtime.Intrinsics.Vector256 left, System.Runtime.Intrinsics.Vector256 right) { throw null; } @@ -8591,13 +7435,9 @@ internal Avx2() { } public static System.Runtime.Intrinsics.Vector256 BlendVariable(System.Runtime.Intrinsics.Vector256 left, System.Runtime.Intrinsics.Vector256 right, System.Runtime.Intrinsics.Vector256 mask) { throw null; } public static System.Runtime.Intrinsics.Vector256 BlendVariable(System.Runtime.Intrinsics.Vector256 left, System.Runtime.Intrinsics.Vector256 right, System.Runtime.Intrinsics.Vector256 mask) { throw null; } public static System.Runtime.Intrinsics.Vector256 BlendVariable(System.Runtime.Intrinsics.Vector256 left, System.Runtime.Intrinsics.Vector256 right, System.Runtime.Intrinsics.Vector256 mask) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 BroadcastScalarToVector128(byte* source) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 BroadcastScalarToVector128(short* source) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 BroadcastScalarToVector128(int* source) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 BroadcastScalarToVector128(long* source) { throw null; } public static System.Runtime.Intrinsics.Vector128 BroadcastScalarToVector128(System.Runtime.Intrinsics.Vector128 value) { throw null; } public static System.Runtime.Intrinsics.Vector128 BroadcastScalarToVector128(System.Runtime.Intrinsics.Vector128 value) { throw null; } @@ -8609,21 +7449,13 @@ internal Avx2() { } public static System.Runtime.Intrinsics.Vector128 BroadcastScalarToVector128(System.Runtime.Intrinsics.Vector128 value) { throw null; } public static System.Runtime.Intrinsics.Vector128 BroadcastScalarToVector128(System.Runtime.Intrinsics.Vector128 value) { throw null; } public static System.Runtime.Intrinsics.Vector128 BroadcastScalarToVector128(System.Runtime.Intrinsics.Vector128 value) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 BroadcastScalarToVector128(sbyte* source) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 BroadcastScalarToVector128(ushort* source) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 BroadcastScalarToVector128(uint* source) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 BroadcastScalarToVector128(ulong* source) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector256 BroadcastScalarToVector256(byte* source) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector256 BroadcastScalarToVector256(short* source) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector256 BroadcastScalarToVector256(int* source) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector256 BroadcastScalarToVector256(long* source) { throw null; } public static System.Runtime.Intrinsics.Vector256 BroadcastScalarToVector256(System.Runtime.Intrinsics.Vector128 value) { throw null; } public static System.Runtime.Intrinsics.Vector256 BroadcastScalarToVector256(System.Runtime.Intrinsics.Vector128 value) { throw null; } @@ -8635,29 +7467,17 @@ internal Avx2() { } public static System.Runtime.Intrinsics.Vector256 BroadcastScalarToVector256(System.Runtime.Intrinsics.Vector128 value) { throw null; } public static System.Runtime.Intrinsics.Vector256 BroadcastScalarToVector256(System.Runtime.Intrinsics.Vector128 value) { throw null; } public static System.Runtime.Intrinsics.Vector256 BroadcastScalarToVector256(System.Runtime.Intrinsics.Vector128 value) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector256 BroadcastScalarToVector256(sbyte* source) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector256 BroadcastScalarToVector256(ushort* source) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector256 BroadcastScalarToVector256(uint* source) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector256 BroadcastScalarToVector256(ulong* source) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector256 BroadcastVector128ToVector256(byte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector256 BroadcastVector128ToVector256(short* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector256 BroadcastVector128ToVector256(int* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector256 BroadcastVector128ToVector256(long* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector256 BroadcastVector128ToVector256(sbyte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector256 BroadcastVector128ToVector256(ushort* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector256 BroadcastVector128ToVector256(uint* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector256 BroadcastVector128ToVector256(ulong* address) { throw null; } public static System.Runtime.Intrinsics.Vector256 CompareEqual(System.Runtime.Intrinsics.Vector256 left, System.Runtime.Intrinsics.Vector256 right) { throw null; } public static System.Runtime.Intrinsics.Vector256 CompareEqual(System.Runtime.Intrinsics.Vector256 left, System.Runtime.Intrinsics.Vector256 right) { throw null; } @@ -8673,29 +7493,20 @@ internal Avx2() { } public static System.Runtime.Intrinsics.Vector256 CompareGreaterThan(System.Runtime.Intrinsics.Vector256 left, System.Runtime.Intrinsics.Vector256 right) { throw null; } public static int ConvertToInt32(System.Runtime.Intrinsics.Vector256 value) { throw null; } public static uint ConvertToUInt32(System.Runtime.Intrinsics.Vector256 value) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector256 ConvertToVector256Int16(byte* address) { throw null; } public static System.Runtime.Intrinsics.Vector256 ConvertToVector256Int16(System.Runtime.Intrinsics.Vector128 value) { throw null; } public static System.Runtime.Intrinsics.Vector256 ConvertToVector256Int16(System.Runtime.Intrinsics.Vector128 value) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector256 ConvertToVector256Int16(sbyte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector256 ConvertToVector256Int32(byte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector256 ConvertToVector256Int32(short* address) { throw null; } public static System.Runtime.Intrinsics.Vector256 ConvertToVector256Int32(System.Runtime.Intrinsics.Vector128 value) { throw null; } public static System.Runtime.Intrinsics.Vector256 ConvertToVector256Int32(System.Runtime.Intrinsics.Vector128 value) { throw null; } public static System.Runtime.Intrinsics.Vector256 ConvertToVector256Int32(System.Runtime.Intrinsics.Vector128 value) { throw null; } public static System.Runtime.Intrinsics.Vector256 ConvertToVector256Int32(System.Runtime.Intrinsics.Vector128 value) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector256 ConvertToVector256Int32(sbyte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector256 ConvertToVector256Int32(ushort* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector256 ConvertToVector256Int64(byte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector256 ConvertToVector256Int64(short* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector256 ConvertToVector256Int64(int* address) { throw null; } public static System.Runtime.Intrinsics.Vector256 ConvertToVector256Int64(System.Runtime.Intrinsics.Vector128 value) { throw null; } public static System.Runtime.Intrinsics.Vector256 ConvertToVector256Int64(System.Runtime.Intrinsics.Vector128 value) { throw null; } @@ -8703,11 +7514,8 @@ internal Avx2() { } public static System.Runtime.Intrinsics.Vector256 ConvertToVector256Int64(System.Runtime.Intrinsics.Vector128 value) { throw null; } public static System.Runtime.Intrinsics.Vector256 ConvertToVector256Int64(System.Runtime.Intrinsics.Vector128 value) { throw null; } public static System.Runtime.Intrinsics.Vector256 ConvertToVector256Int64(System.Runtime.Intrinsics.Vector128 value) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector256 ConvertToVector256Int64(sbyte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector256 ConvertToVector256Int64(ushort* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector256 ConvertToVector256Int64(uint* address) { throw null; } public static new System.Runtime.Intrinsics.Vector128 ExtractVector128(System.Runtime.Intrinsics.Vector256 value, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute] byte index) { throw null; } public static new System.Runtime.Intrinsics.Vector128 ExtractVector128(System.Runtime.Intrinsics.Vector256 value, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute] byte index) { throw null; } @@ -8717,101 +7525,53 @@ internal Avx2() { } public static new System.Runtime.Intrinsics.Vector128 ExtractVector128(System.Runtime.Intrinsics.Vector256 value, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute] byte index) { throw null; } public static new System.Runtime.Intrinsics.Vector128 ExtractVector128(System.Runtime.Intrinsics.Vector256 value, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute] byte index) { throw null; } public static new System.Runtime.Intrinsics.Vector128 ExtractVector128(System.Runtime.Intrinsics.Vector256 value, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute] byte index) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 GatherMaskVector128(System.Runtime.Intrinsics.Vector128 source, double* baseAddress, System.Runtime.Intrinsics.Vector128 index, System.Runtime.Intrinsics.Vector128 mask, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Min = (byte)(1), Max = (byte)(8))] byte scale) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 GatherMaskVector128(System.Runtime.Intrinsics.Vector128 source, double* baseAddress, System.Runtime.Intrinsics.Vector128 index, System.Runtime.Intrinsics.Vector128 mask, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Min = (byte)(1), Max = (byte)(8))] byte scale) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 GatherMaskVector128(System.Runtime.Intrinsics.Vector128 source, int* baseAddress, System.Runtime.Intrinsics.Vector128 index, System.Runtime.Intrinsics.Vector128 mask, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Min = (byte)(1), Max = (byte)(8))] byte scale) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 GatherMaskVector128(System.Runtime.Intrinsics.Vector128 source, int* baseAddress, System.Runtime.Intrinsics.Vector128 index, System.Runtime.Intrinsics.Vector128 mask, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Min = (byte)(1), Max = (byte)(8))] byte scale) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 GatherMaskVector128(System.Runtime.Intrinsics.Vector128 source, int* baseAddress, System.Runtime.Intrinsics.Vector256 index, System.Runtime.Intrinsics.Vector128 mask, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Min = (byte)(1), Max = (byte)(8))] byte scale) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 GatherMaskVector128(System.Runtime.Intrinsics.Vector128 source, long* baseAddress, System.Runtime.Intrinsics.Vector128 index, System.Runtime.Intrinsics.Vector128 mask, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Min = (byte)(1), Max = (byte)(8))] byte scale) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 GatherMaskVector128(System.Runtime.Intrinsics.Vector128 source, long* baseAddress, System.Runtime.Intrinsics.Vector128 index, System.Runtime.Intrinsics.Vector128 mask, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Min = (byte)(1), Max = (byte)(8))] byte scale) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 GatherMaskVector128(System.Runtime.Intrinsics.Vector128 source, float* baseAddress, System.Runtime.Intrinsics.Vector128 index, System.Runtime.Intrinsics.Vector128 mask, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Min = (byte)(1), Max = (byte)(8))] byte scale) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 GatherMaskVector128(System.Runtime.Intrinsics.Vector128 source, float* baseAddress, System.Runtime.Intrinsics.Vector128 index, System.Runtime.Intrinsics.Vector128 mask, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Min = (byte)(1), Max = (byte)(8))] byte scale) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 GatherMaskVector128(System.Runtime.Intrinsics.Vector128 source, float* baseAddress, System.Runtime.Intrinsics.Vector256 index, System.Runtime.Intrinsics.Vector128 mask, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Min = (byte)(1), Max = (byte)(8))] byte scale) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 GatherMaskVector128(System.Runtime.Intrinsics.Vector128 source, uint* baseAddress, System.Runtime.Intrinsics.Vector128 index, System.Runtime.Intrinsics.Vector128 mask, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Min = (byte)(1), Max = (byte)(8))] byte scale) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 GatherMaskVector128(System.Runtime.Intrinsics.Vector128 source, uint* baseAddress, System.Runtime.Intrinsics.Vector128 index, System.Runtime.Intrinsics.Vector128 mask, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Min = (byte)(1), Max = (byte)(8))] byte scale) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 GatherMaskVector128(System.Runtime.Intrinsics.Vector128 source, uint* baseAddress, System.Runtime.Intrinsics.Vector256 index, System.Runtime.Intrinsics.Vector128 mask, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Min = (byte)(1), Max = (byte)(8))] byte scale) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 GatherMaskVector128(System.Runtime.Intrinsics.Vector128 source, ulong* baseAddress, System.Runtime.Intrinsics.Vector128 index, System.Runtime.Intrinsics.Vector128 mask, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Min = (byte)(1), Max = (byte)(8))] byte scale) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 GatherMaskVector128(System.Runtime.Intrinsics.Vector128 source, ulong* baseAddress, System.Runtime.Intrinsics.Vector128 index, System.Runtime.Intrinsics.Vector128 mask, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Min = (byte)(1), Max = (byte)(8))] byte scale) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector256 GatherMaskVector256(System.Runtime.Intrinsics.Vector256 source, double* baseAddress, System.Runtime.Intrinsics.Vector128 index, System.Runtime.Intrinsics.Vector256 mask, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Min = (byte)(1), Max = (byte)(8))] byte scale) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector256 GatherMaskVector256(System.Runtime.Intrinsics.Vector256 source, double* baseAddress, System.Runtime.Intrinsics.Vector256 index, System.Runtime.Intrinsics.Vector256 mask, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Min = (byte)(1), Max = (byte)(8))] byte scale) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector256 GatherMaskVector256(System.Runtime.Intrinsics.Vector256 source, int* baseAddress, System.Runtime.Intrinsics.Vector256 index, System.Runtime.Intrinsics.Vector256 mask, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Min = (byte)(1), Max = (byte)(8))] byte scale) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector256 GatherMaskVector256(System.Runtime.Intrinsics.Vector256 source, long* baseAddress, System.Runtime.Intrinsics.Vector128 index, System.Runtime.Intrinsics.Vector256 mask, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Min = (byte)(1), Max = (byte)(8))] byte scale) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector256 GatherMaskVector256(System.Runtime.Intrinsics.Vector256 source, long* baseAddress, System.Runtime.Intrinsics.Vector256 index, System.Runtime.Intrinsics.Vector256 mask, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Min = (byte)(1), Max = (byte)(8))] byte scale) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector256 GatherMaskVector256(System.Runtime.Intrinsics.Vector256 source, float* baseAddress, System.Runtime.Intrinsics.Vector256 index, System.Runtime.Intrinsics.Vector256 mask, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Min = (byte)(1), Max = (byte)(8))] byte scale) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector256 GatherMaskVector256(System.Runtime.Intrinsics.Vector256 source, uint* baseAddress, System.Runtime.Intrinsics.Vector256 index, System.Runtime.Intrinsics.Vector256 mask, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Min = (byte)(1), Max = (byte)(8))] byte scale) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector256 GatherMaskVector256(System.Runtime.Intrinsics.Vector256 source, ulong* baseAddress, System.Runtime.Intrinsics.Vector128 index, System.Runtime.Intrinsics.Vector256 mask, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Min = (byte)(1), Max = (byte)(8))] byte scale) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector256 GatherMaskVector256(System.Runtime.Intrinsics.Vector256 source, ulong* baseAddress, System.Runtime.Intrinsics.Vector256 index, System.Runtime.Intrinsics.Vector256 mask, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Min = (byte)(1), Max = (byte)(8))] byte scale) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 GatherVector128(double* baseAddress, System.Runtime.Intrinsics.Vector128 index, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Min = (byte)(1), Max = (byte)(8))] byte scale) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 GatherVector128(double* baseAddress, System.Runtime.Intrinsics.Vector128 index, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Min = (byte)(1), Max = (byte)(8))] byte scale) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 GatherVector128(int* baseAddress, System.Runtime.Intrinsics.Vector128 index, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Min = (byte)(1), Max = (byte)(8))] byte scale) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 GatherVector128(int* baseAddress, System.Runtime.Intrinsics.Vector128 index, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Min = (byte)(1), Max = (byte)(8))] byte scale) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 GatherVector128(int* baseAddress, System.Runtime.Intrinsics.Vector256 index, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Min = (byte)(1), Max = (byte)(8))] byte scale) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 GatherVector128(long* baseAddress, System.Runtime.Intrinsics.Vector128 index, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Min = (byte)(1), Max = (byte)(8))] byte scale) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 GatherVector128(long* baseAddress, System.Runtime.Intrinsics.Vector128 index, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Min = (byte)(1), Max = (byte)(8))] byte scale) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 GatherVector128(float* baseAddress, System.Runtime.Intrinsics.Vector128 index, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Min = (byte)(1), Max = (byte)(8))] byte scale) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 GatherVector128(float* baseAddress, System.Runtime.Intrinsics.Vector128 index, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Min = (byte)(1), Max = (byte)(8))] byte scale) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 GatherVector128(float* baseAddress, System.Runtime.Intrinsics.Vector256 index, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Min = (byte)(1), Max = (byte)(8))] byte scale) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 GatherVector128(uint* baseAddress, System.Runtime.Intrinsics.Vector128 index, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Min = (byte)(1), Max = (byte)(8))] byte scale) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 GatherVector128(uint* baseAddress, System.Runtime.Intrinsics.Vector128 index, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Min = (byte)(1), Max = (byte)(8))] byte scale) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 GatherVector128(uint* baseAddress, System.Runtime.Intrinsics.Vector256 index, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Min = (byte)(1), Max = (byte)(8))] byte scale) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 GatherVector128(ulong* baseAddress, System.Runtime.Intrinsics.Vector128 index, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Min = (byte)(1), Max = (byte)(8))] byte scale) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 GatherVector128(ulong* baseAddress, System.Runtime.Intrinsics.Vector128 index, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Min = (byte)(1), Max = (byte)(8))] byte scale) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector256 GatherVector256(double* baseAddress, System.Runtime.Intrinsics.Vector128 index, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Min = (byte)(1), Max = (byte)(8))] byte scale) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector256 GatherVector256(double* baseAddress, System.Runtime.Intrinsics.Vector256 index, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Min = (byte)(1), Max = (byte)(8))] byte scale) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector256 GatherVector256(int* baseAddress, System.Runtime.Intrinsics.Vector256 index, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Min = (byte)(1), Max = (byte)(8))] byte scale) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector256 GatherVector256(long* baseAddress, System.Runtime.Intrinsics.Vector128 index, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Min = (byte)(1), Max = (byte)(8))] byte scale) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector256 GatherVector256(long* baseAddress, System.Runtime.Intrinsics.Vector256 index, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Min = (byte)(1), Max = (byte)(8))] byte scale) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector256 GatherVector256(float* baseAddress, System.Runtime.Intrinsics.Vector256 index, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Min = (byte)(1), Max = (byte)(8))] byte scale) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector256 GatherVector256(uint* baseAddress, System.Runtime.Intrinsics.Vector256 index, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Min = (byte)(1), Max = (byte)(8))] byte scale) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector256 GatherVector256(ulong* baseAddress, System.Runtime.Intrinsics.Vector128 index, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Min = (byte)(1), Max = (byte)(8))] byte scale) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector256 GatherVector256(ulong* baseAddress, System.Runtime.Intrinsics.Vector256 index, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Min = (byte)(1), Max = (byte)(8))] byte scale) { throw null; } public static System.Runtime.Intrinsics.Vector256 HorizontalAdd(System.Runtime.Intrinsics.Vector256 left, System.Runtime.Intrinsics.Vector256 right) { throw null; } public static System.Runtime.Intrinsics.Vector256 HorizontalAdd(System.Runtime.Intrinsics.Vector256 left, System.Runtime.Intrinsics.Vector256 right) { throw null; } @@ -8827,53 +7587,29 @@ internal Avx2() { } public static new System.Runtime.Intrinsics.Vector256 InsertVector128(System.Runtime.Intrinsics.Vector256 value, System.Runtime.Intrinsics.Vector128 data, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute] byte index) { throw null; } public static new System.Runtime.Intrinsics.Vector256 InsertVector128(System.Runtime.Intrinsics.Vector256 value, System.Runtime.Intrinsics.Vector128 data, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute] byte index) { throw null; } public static new System.Runtime.Intrinsics.Vector256 InsertVector128(System.Runtime.Intrinsics.Vector256 value, System.Runtime.Intrinsics.Vector128 data, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute] byte index) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector256 LoadAlignedVector256NonTemporal(byte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector256 LoadAlignedVector256NonTemporal(short* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector256 LoadAlignedVector256NonTemporal(int* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector256 LoadAlignedVector256NonTemporal(long* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector256 LoadAlignedVector256NonTemporal(sbyte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector256 LoadAlignedVector256NonTemporal(ushort* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector256 LoadAlignedVector256NonTemporal(uint* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector256 LoadAlignedVector256NonTemporal(ulong* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 MaskLoad(int* address, System.Runtime.Intrinsics.Vector128 mask) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector256 MaskLoad(int* address, System.Runtime.Intrinsics.Vector256 mask) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 MaskLoad(long* address, System.Runtime.Intrinsics.Vector128 mask) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector256 MaskLoad(long* address, System.Runtime.Intrinsics.Vector256 mask) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 MaskLoad(uint* address, System.Runtime.Intrinsics.Vector128 mask) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector256 MaskLoad(uint* address, System.Runtime.Intrinsics.Vector256 mask) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 MaskLoad(ulong* address, System.Runtime.Intrinsics.Vector128 mask) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector256 MaskLoad(ulong* address, System.Runtime.Intrinsics.Vector256 mask) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void MaskStore(int* address, System.Runtime.Intrinsics.Vector128 mask, System.Runtime.Intrinsics.Vector128 source) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void MaskStore(int* address, System.Runtime.Intrinsics.Vector256 mask, System.Runtime.Intrinsics.Vector256 source) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void MaskStore(long* address, System.Runtime.Intrinsics.Vector128 mask, System.Runtime.Intrinsics.Vector128 source) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void MaskStore(long* address, System.Runtime.Intrinsics.Vector256 mask, System.Runtime.Intrinsics.Vector256 source) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void MaskStore(uint* address, System.Runtime.Intrinsics.Vector128 mask, System.Runtime.Intrinsics.Vector128 source) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void MaskStore(uint* address, System.Runtime.Intrinsics.Vector256 mask, System.Runtime.Intrinsics.Vector256 source) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void MaskStore(ulong* address, System.Runtime.Intrinsics.Vector128 mask, System.Runtime.Intrinsics.Vector128 source) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void MaskStore(ulong* address, System.Runtime.Intrinsics.Vector256 mask, System.Runtime.Intrinsics.Vector256 source) { } public static System.Runtime.Intrinsics.Vector256 Max(System.Runtime.Intrinsics.Vector256 left, System.Runtime.Intrinsics.Vector256 right) { throw null; } public static System.Runtime.Intrinsics.Vector256 Max(System.Runtime.Intrinsics.Vector256 left, System.Runtime.Intrinsics.Vector256 right) { throw null; } @@ -9260,45 +7996,25 @@ internal Avx10v1() { } public static System.Runtime.Intrinsics.Vector256 Compress(System.Runtime.Intrinsics.Vector256 merge, System.Runtime.Intrinsics.Vector256 mask, System.Runtime.Intrinsics.Vector256 value) { throw null; } public static System.Runtime.Intrinsics.Vector256 Compress(System.Runtime.Intrinsics.Vector256 merge, System.Runtime.Intrinsics.Vector256 mask, System.Runtime.Intrinsics.Vector256 value) { throw null; } public static System.Runtime.Intrinsics.Vector256 Compress(System.Runtime.Intrinsics.Vector256 merge, System.Runtime.Intrinsics.Vector256 mask, System.Runtime.Intrinsics.Vector256 value) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void CompressStore(byte* address, System.Runtime.Intrinsics.Vector128 mask, System.Runtime.Intrinsics.Vector128 source) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void CompressStore(double* address, System.Runtime.Intrinsics.Vector128 mask, System.Runtime.Intrinsics.Vector128 source) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void CompressStore(short* address, System.Runtime.Intrinsics.Vector128 mask, System.Runtime.Intrinsics.Vector128 source) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void CompressStore(int* address, System.Runtime.Intrinsics.Vector128 mask, System.Runtime.Intrinsics.Vector128 source) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void CompressStore(long* address, System.Runtime.Intrinsics.Vector128 mask, System.Runtime.Intrinsics.Vector128 source) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void CompressStore(sbyte* address, System.Runtime.Intrinsics.Vector128 mask, System.Runtime.Intrinsics.Vector128 source) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void CompressStore(float* address, System.Runtime.Intrinsics.Vector128 mask, System.Runtime.Intrinsics.Vector128 source) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void CompressStore(ushort* address, System.Runtime.Intrinsics.Vector128 mask, System.Runtime.Intrinsics.Vector128 source) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void CompressStore(uint* address, System.Runtime.Intrinsics.Vector128 mask, System.Runtime.Intrinsics.Vector128 source) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void CompressStore(ulong* address, System.Runtime.Intrinsics.Vector128 mask, System.Runtime.Intrinsics.Vector128 source) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void CompressStore(byte* address, System.Runtime.Intrinsics.Vector256 mask, System.Runtime.Intrinsics.Vector256 source) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void CompressStore(double* address, System.Runtime.Intrinsics.Vector256 mask, System.Runtime.Intrinsics.Vector256 source) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void CompressStore(short* address, System.Runtime.Intrinsics.Vector256 mask, System.Runtime.Intrinsics.Vector256 source) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void CompressStore(int* address, System.Runtime.Intrinsics.Vector256 mask, System.Runtime.Intrinsics.Vector256 source) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void CompressStore(long* address, System.Runtime.Intrinsics.Vector256 mask, System.Runtime.Intrinsics.Vector256 source) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void CompressStore(sbyte* address, System.Runtime.Intrinsics.Vector256 mask, System.Runtime.Intrinsics.Vector256 source) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void CompressStore(float* address, System.Runtime.Intrinsics.Vector256 mask, System.Runtime.Intrinsics.Vector256 source) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void CompressStore(ushort* address, System.Runtime.Intrinsics.Vector256 mask, System.Runtime.Intrinsics.Vector256 source) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void CompressStore(uint* address, System.Runtime.Intrinsics.Vector256 mask, System.Runtime.Intrinsics.Vector256 source) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void CompressStore(ulong* address, System.Runtime.Intrinsics.Vector256 mask, System.Runtime.Intrinsics.Vector256 source) { throw null; } public static System.Runtime.Intrinsics.Vector128 ConvertScalarToVector128Double(System.Runtime.Intrinsics.Vector128 upper, uint value) { throw null; } public static System.Runtime.Intrinsics.Vector128 ConvertScalarToVector128Single(System.Runtime.Intrinsics.Vector128 upper, uint value) { throw null; } @@ -9451,45 +8167,25 @@ internal Avx10v1() { } public static System.Runtime.Intrinsics.Vector256 Expand(System.Runtime.Intrinsics.Vector256 merge, System.Runtime.Intrinsics.Vector256 mask, System.Runtime.Intrinsics.Vector256 value) { throw null; } public static System.Runtime.Intrinsics.Vector256 Expand(System.Runtime.Intrinsics.Vector256 merge, System.Runtime.Intrinsics.Vector256 mask, System.Runtime.Intrinsics.Vector256 value) { throw null; } public static System.Runtime.Intrinsics.Vector256 Expand(System.Runtime.Intrinsics.Vector256 merge, System.Runtime.Intrinsics.Vector256 mask, System.Runtime.Intrinsics.Vector256 value) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 ExpandLoad(byte* address, System.Runtime.Intrinsics.Vector128 mask, System.Runtime.Intrinsics.Vector128 merge) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 ExpandLoad(double* address, System.Runtime.Intrinsics.Vector128 mask, System.Runtime.Intrinsics.Vector128 merge) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 ExpandLoad(short* address, System.Runtime.Intrinsics.Vector128 mask, System.Runtime.Intrinsics.Vector128 merge) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 ExpandLoad(int* address, System.Runtime.Intrinsics.Vector128 mask, System.Runtime.Intrinsics.Vector128 merge) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 ExpandLoad(long* address, System.Runtime.Intrinsics.Vector128 mask, System.Runtime.Intrinsics.Vector128 merge) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 ExpandLoad(sbyte* address, System.Runtime.Intrinsics.Vector128 mask, System.Runtime.Intrinsics.Vector128 merge) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 ExpandLoad(float* address, System.Runtime.Intrinsics.Vector128 mask, System.Runtime.Intrinsics.Vector128 merge) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 ExpandLoad(ushort* address, System.Runtime.Intrinsics.Vector128 mask, System.Runtime.Intrinsics.Vector128 merge) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 ExpandLoad(uint* address, System.Runtime.Intrinsics.Vector128 mask, System.Runtime.Intrinsics.Vector128 merge) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 ExpandLoad(ulong* address, System.Runtime.Intrinsics.Vector128 mask, System.Runtime.Intrinsics.Vector128 merge) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector256 ExpandLoad(byte* address, System.Runtime.Intrinsics.Vector256 mask, System.Runtime.Intrinsics.Vector256 merge) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector256 ExpandLoad(double* address, System.Runtime.Intrinsics.Vector256 mask, System.Runtime.Intrinsics.Vector256 merge) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector256 ExpandLoad(short* address, System.Runtime.Intrinsics.Vector256 mask, System.Runtime.Intrinsics.Vector256 merge) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector256 ExpandLoad(int* address, System.Runtime.Intrinsics.Vector256 mask, System.Runtime.Intrinsics.Vector256 merge) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector256 ExpandLoad(long* address, System.Runtime.Intrinsics.Vector256 mask, System.Runtime.Intrinsics.Vector256 merge) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector256 ExpandLoad(sbyte* address, System.Runtime.Intrinsics.Vector256 mask, System.Runtime.Intrinsics.Vector256 merge) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector256 ExpandLoad(float* address, System.Runtime.Intrinsics.Vector256 mask, System.Runtime.Intrinsics.Vector256 merge) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector256 ExpandLoad(ushort* address, System.Runtime.Intrinsics.Vector256 mask, System.Runtime.Intrinsics.Vector256 merge) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector256 ExpandLoad(uint* address, System.Runtime.Intrinsics.Vector256 mask, System.Runtime.Intrinsics.Vector256 merge) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector256 ExpandLoad(ulong* address, System.Runtime.Intrinsics.Vector256 mask, System.Runtime.Intrinsics.Vector256 merge) { throw null; } public static System.Runtime.Intrinsics.Vector128 Fixup(System.Runtime.Intrinsics.Vector128 left, System.Runtime.Intrinsics.Vector128 right, System.Runtime.Intrinsics.Vector128 table, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute] byte control) { throw null; } public static System.Runtime.Intrinsics.Vector128 Fixup(System.Runtime.Intrinsics.Vector128 left, System.Runtime.Intrinsics.Vector128 right, System.Runtime.Intrinsics.Vector128 table, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute] byte control) { throw null; } @@ -9529,133 +8225,69 @@ internal Avx10v1() { } public static System.Runtime.Intrinsics.Vector256 LeadingZeroCount(System.Runtime.Intrinsics.Vector256 value) { throw null; } public static System.Runtime.Intrinsics.Vector256 LeadingZeroCount(System.Runtime.Intrinsics.Vector256 value) { throw null; } public static System.Runtime.Intrinsics.Vector256 LeadingZeroCount(System.Runtime.Intrinsics.Vector256 value) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 MaskLoad(byte* address, System.Runtime.Intrinsics.Vector128 mask, System.Runtime.Intrinsics.Vector128 merge) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 MaskLoad(double* address, System.Runtime.Intrinsics.Vector128 mask, System.Runtime.Intrinsics.Vector128 merge) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 MaskLoad(short* address, System.Runtime.Intrinsics.Vector128 mask, System.Runtime.Intrinsics.Vector128 merge) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 MaskLoad(int* address, System.Runtime.Intrinsics.Vector128 mask, System.Runtime.Intrinsics.Vector128 merge) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 MaskLoad(long* address, System.Runtime.Intrinsics.Vector128 mask, System.Runtime.Intrinsics.Vector128 merge) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 MaskLoad(sbyte* address, System.Runtime.Intrinsics.Vector128 mask, System.Runtime.Intrinsics.Vector128 merge) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 MaskLoad(ushort* address, System.Runtime.Intrinsics.Vector128 mask, System.Runtime.Intrinsics.Vector128 merge) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 MaskLoad(float* address, System.Runtime.Intrinsics.Vector128 mask, System.Runtime.Intrinsics.Vector128 merge) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 MaskLoad(uint* address, System.Runtime.Intrinsics.Vector128 mask, System.Runtime.Intrinsics.Vector128 merge) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 MaskLoad(ulong* address, System.Runtime.Intrinsics.Vector128 mask, System.Runtime.Intrinsics.Vector128 merge) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector256 MaskLoad(byte* address, System.Runtime.Intrinsics.Vector256 mask, System.Runtime.Intrinsics.Vector256 merge) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector256 MaskLoad(double* address, System.Runtime.Intrinsics.Vector256 mask, System.Runtime.Intrinsics.Vector256 merge) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector256 MaskLoad(short* address, System.Runtime.Intrinsics.Vector256 mask, System.Runtime.Intrinsics.Vector256 merge) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector256 MaskLoad(int* address, System.Runtime.Intrinsics.Vector256 mask, System.Runtime.Intrinsics.Vector256 merge) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector256 MaskLoad(long* address, System.Runtime.Intrinsics.Vector256 mask, System.Runtime.Intrinsics.Vector256 merge) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector256 MaskLoad(sbyte* address, System.Runtime.Intrinsics.Vector256 mask, System.Runtime.Intrinsics.Vector256 merge) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector256 MaskLoad(ushort* address, System.Runtime.Intrinsics.Vector256 mask, System.Runtime.Intrinsics.Vector256 merge) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector256 MaskLoad(float* address, System.Runtime.Intrinsics.Vector256 mask, System.Runtime.Intrinsics.Vector256 merge) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector256 MaskLoad(uint* address, System.Runtime.Intrinsics.Vector256 mask, System.Runtime.Intrinsics.Vector256 merge) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector256 MaskLoad(ulong* address, System.Runtime.Intrinsics.Vector256 mask, System.Runtime.Intrinsics.Vector256 merge) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 MaskLoadAligned(double* address, System.Runtime.Intrinsics.Vector128 mask, System.Runtime.Intrinsics.Vector128 merge) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 MaskLoadAligned(int* address, System.Runtime.Intrinsics.Vector128 mask, System.Runtime.Intrinsics.Vector128 merge) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 MaskLoadAligned(long* address, System.Runtime.Intrinsics.Vector128 mask, System.Runtime.Intrinsics.Vector128 merge) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 MaskLoadAligned(float* address, System.Runtime.Intrinsics.Vector128 mask, System.Runtime.Intrinsics.Vector128 merge) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 MaskLoadAligned(uint* address, System.Runtime.Intrinsics.Vector128 mask, System.Runtime.Intrinsics.Vector128 merge) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 MaskLoadAligned(ulong* address, System.Runtime.Intrinsics.Vector128 mask, System.Runtime.Intrinsics.Vector128 merge) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector256 MaskLoadAligned(double* address, System.Runtime.Intrinsics.Vector256 mask, System.Runtime.Intrinsics.Vector256 merge) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector256 MaskLoadAligned(int* address, System.Runtime.Intrinsics.Vector256 mask, System.Runtime.Intrinsics.Vector256 merge) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector256 MaskLoadAligned(long* address, System.Runtime.Intrinsics.Vector256 mask, System.Runtime.Intrinsics.Vector256 merge) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector256 MaskLoadAligned(float* address, System.Runtime.Intrinsics.Vector256 mask, System.Runtime.Intrinsics.Vector256 merge) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector256 MaskLoadAligned(uint* address, System.Runtime.Intrinsics.Vector256 mask, System.Runtime.Intrinsics.Vector256 merge) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector256 MaskLoadAligned(ulong* address, System.Runtime.Intrinsics.Vector256 mask, System.Runtime.Intrinsics.Vector256 merge) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void MaskStore(byte* address, System.Runtime.Intrinsics.Vector128 mask, System.Runtime.Intrinsics.Vector128 source) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static new unsafe void MaskStore(double* address, System.Runtime.Intrinsics.Vector128 mask, System.Runtime.Intrinsics.Vector128 source) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void MaskStore(short* address, System.Runtime.Intrinsics.Vector128 mask, System.Runtime.Intrinsics.Vector128 source) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static new unsafe void MaskStore(int* address, System.Runtime.Intrinsics.Vector128 mask, System.Runtime.Intrinsics.Vector128 source) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static new unsafe void MaskStore(long* address, System.Runtime.Intrinsics.Vector128 mask, System.Runtime.Intrinsics.Vector128 source) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void MaskStore(sbyte* address, System.Runtime.Intrinsics.Vector128 mask, System.Runtime.Intrinsics.Vector128 source) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static new unsafe void MaskStore(float* address, System.Runtime.Intrinsics.Vector128 mask, System.Runtime.Intrinsics.Vector128 source) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void MaskStore(ushort* address, System.Runtime.Intrinsics.Vector128 mask, System.Runtime.Intrinsics.Vector128 source) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static new unsafe void MaskStore(uint* address, System.Runtime.Intrinsics.Vector128 mask, System.Runtime.Intrinsics.Vector128 source) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static new unsafe void MaskStore(ulong* address, System.Runtime.Intrinsics.Vector128 mask, System.Runtime.Intrinsics.Vector128 source) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void MaskStore(byte* address, System.Runtime.Intrinsics.Vector256 mask, System.Runtime.Intrinsics.Vector256 source) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static new unsafe void MaskStore(double* address, System.Runtime.Intrinsics.Vector256 mask, System.Runtime.Intrinsics.Vector256 source) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void MaskStore(short* address, System.Runtime.Intrinsics.Vector256 mask, System.Runtime.Intrinsics.Vector256 source) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static new unsafe void MaskStore(int* address, System.Runtime.Intrinsics.Vector256 mask, System.Runtime.Intrinsics.Vector256 source) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static new unsafe void MaskStore(long* address, System.Runtime.Intrinsics.Vector256 mask, System.Runtime.Intrinsics.Vector256 source) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void MaskStore(sbyte* address, System.Runtime.Intrinsics.Vector256 mask, System.Runtime.Intrinsics.Vector256 source) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static new unsafe void MaskStore(float* address, System.Runtime.Intrinsics.Vector256 mask, System.Runtime.Intrinsics.Vector256 source) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void MaskStore(ushort* address, System.Runtime.Intrinsics.Vector256 mask, System.Runtime.Intrinsics.Vector256 source) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static new unsafe void MaskStore(uint* address, System.Runtime.Intrinsics.Vector256 mask, System.Runtime.Intrinsics.Vector256 source) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static new unsafe void MaskStore(ulong* address, System.Runtime.Intrinsics.Vector256 mask, System.Runtime.Intrinsics.Vector256 source) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void MaskStoreAligned(double* address, System.Runtime.Intrinsics.Vector128 mask, System.Runtime.Intrinsics.Vector128 source) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void MaskStoreAligned(int* address, System.Runtime.Intrinsics.Vector128 mask, System.Runtime.Intrinsics.Vector128 source) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void MaskStoreAligned(long* address, System.Runtime.Intrinsics.Vector128 mask, System.Runtime.Intrinsics.Vector128 source) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void MaskStoreAligned(float* address, System.Runtime.Intrinsics.Vector128 mask, System.Runtime.Intrinsics.Vector128 source) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void MaskStoreAligned(uint* address, System.Runtime.Intrinsics.Vector128 mask, System.Runtime.Intrinsics.Vector128 source) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void MaskStoreAligned(ulong* address, System.Runtime.Intrinsics.Vector128 mask, System.Runtime.Intrinsics.Vector128 source) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void MaskStoreAligned(double* address, System.Runtime.Intrinsics.Vector256 mask, System.Runtime.Intrinsics.Vector256 source) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void MaskStoreAligned(int* address, System.Runtime.Intrinsics.Vector256 mask, System.Runtime.Intrinsics.Vector256 source) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void MaskStoreAligned(long* address, System.Runtime.Intrinsics.Vector256 mask, System.Runtime.Intrinsics.Vector256 source) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void MaskStoreAligned(float* address, System.Runtime.Intrinsics.Vector256 mask, System.Runtime.Intrinsics.Vector256 source) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void MaskStoreAligned(uint* address, System.Runtime.Intrinsics.Vector256 mask, System.Runtime.Intrinsics.Vector256 source) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void MaskStoreAligned(ulong* address, System.Runtime.Intrinsics.Vector256 mask, System.Runtime.Intrinsics.Vector256 source) { throw null; } public static System.Runtime.Intrinsics.Vector128 Max(System.Runtime.Intrinsics.Vector128 left, System.Runtime.Intrinsics.Vector128 right) { throw null; } public static System.Runtime.Intrinsics.Vector128 Max(System.Runtime.Intrinsics.Vector128 left, System.Runtime.Intrinsics.Vector128 right) { throw null; } @@ -9882,17 +8514,11 @@ internal V512() { } public static System.Runtime.Intrinsics.Vector512 BroadcastPairScalarToVector512(System.Runtime.Intrinsics.Vector128 value) { throw null; } public static System.Runtime.Intrinsics.Vector512 BroadcastPairScalarToVector512(System.Runtime.Intrinsics.Vector128 value) { throw null; } public static System.Runtime.Intrinsics.Vector512 BroadcastPairScalarToVector512(System.Runtime.Intrinsics.Vector128 value) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector512 BroadcastVector128ToVector512(long* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector512 BroadcastVector128ToVector512(ulong* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector512 BroadcastVector128ToVector512(double* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector512 BroadcastVector256ToVector512(int* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector512 BroadcastVector256ToVector512(uint* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector512 BroadcastVector256ToVector512(float* address) { throw null; } public static System.Runtime.Intrinsics.Vector512 Classify(System.Runtime.Intrinsics.Vector512 value, [System.Diagnostics.CodeAnalysis.ConstantExpected] byte control) { throw null; } public static System.Runtime.Intrinsics.Vector512 Classify(System.Runtime.Intrinsics.Vector512 value, [System.Diagnostics.CodeAnalysis.ConstantExpected] byte control) { throw null; } @@ -9900,13 +8526,9 @@ internal V512() { } public static System.Runtime.Intrinsics.Vector512 Compress(System.Runtime.Intrinsics.Vector512 merge, System.Runtime.Intrinsics.Vector512 mask, System.Runtime.Intrinsics.Vector512 value) { throw null; } public static System.Runtime.Intrinsics.Vector512 Compress(System.Runtime.Intrinsics.Vector512 merge, System.Runtime.Intrinsics.Vector512 mask, System.Runtime.Intrinsics.Vector512 value) { throw null; } public static System.Runtime.Intrinsics.Vector512 Compress(System.Runtime.Intrinsics.Vector512 merge, System.Runtime.Intrinsics.Vector512 mask, System.Runtime.Intrinsics.Vector512 value) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void CompressStore(byte* address, System.Runtime.Intrinsics.Vector512 mask, System.Runtime.Intrinsics.Vector512 source) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void CompressStore(short* address, System.Runtime.Intrinsics.Vector512 mask, System.Runtime.Intrinsics.Vector512 source) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void CompressStore(sbyte* address, System.Runtime.Intrinsics.Vector512 mask, System.Runtime.Intrinsics.Vector512 source) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void CompressStore(ushort* address, System.Runtime.Intrinsics.Vector512 mask, System.Runtime.Intrinsics.Vector512 source) { throw null; } public static System.Runtime.Intrinsics.Vector256 ConvertToVector256Single(System.Runtime.Intrinsics.Vector512 value) { throw null; } public static System.Runtime.Intrinsics.Vector256 ConvertToVector256Single(System.Runtime.Intrinsics.Vector512 value) { throw null; } @@ -9936,13 +8558,9 @@ internal V512() { } public static System.Runtime.Intrinsics.Vector512 Expand(System.Runtime.Intrinsics.Vector512 merge, System.Runtime.Intrinsics.Vector512 mask, System.Runtime.Intrinsics.Vector512 value) { throw null; } public static System.Runtime.Intrinsics.Vector512 Expand(System.Runtime.Intrinsics.Vector512 merge, System.Runtime.Intrinsics.Vector512 mask, System.Runtime.Intrinsics.Vector512 value) { throw null; } public static System.Runtime.Intrinsics.Vector512 Expand(System.Runtime.Intrinsics.Vector512 merge, System.Runtime.Intrinsics.Vector512 mask, System.Runtime.Intrinsics.Vector512 value) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector512 ExpandLoad(byte* address, System.Runtime.Intrinsics.Vector512 mask, System.Runtime.Intrinsics.Vector512 merge) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector512 ExpandLoad(short* address, System.Runtime.Intrinsics.Vector512 mask, System.Runtime.Intrinsics.Vector512 merge) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector512 ExpandLoad(sbyte* address, System.Runtime.Intrinsics.Vector512 mask, System.Runtime.Intrinsics.Vector512 merge) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector512 ExpandLoad(ushort* address, System.Runtime.Intrinsics.Vector512 mask, System.Runtime.Intrinsics.Vector512 merge) { throw null; } public static new System.Runtime.Intrinsics.Vector128 ExtractVector128(System.Runtime.Intrinsics.Vector512 value, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute] byte index) { throw null; } public static new System.Runtime.Intrinsics.Vector128 ExtractVector128(System.Runtime.Intrinsics.Vector512 value, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute] byte index) { throw null; } @@ -10010,9 +8628,7 @@ internal Avx10v2() { } public static System.Runtime.Intrinsics.Vector128 MoveScalar(System.Runtime.Intrinsics.Vector128 value) { throw null; } public static System.Runtime.Intrinsics.Vector128 MoveScalar(System.Runtime.Intrinsics.Vector128 value) { throw null; } public static System.Runtime.Intrinsics.Vector128 MoveScalar(System.Runtime.Intrinsics.Vector128 value) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreScalar(short* address, System.Runtime.Intrinsics.Vector128 source) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreScalar(ushort* address, System.Runtime.Intrinsics.Vector128 source) { throw null; } public new abstract partial class X64 : System.Runtime.Intrinsics.X86.Avx10v1.X64 { @@ -10190,29 +8806,17 @@ internal Avx512BW() { } public static System.Runtime.Intrinsics.Vector512 ConvertToVector512Int16(System.Runtime.Intrinsics.Vector256 value) { throw null; } public static System.Runtime.Intrinsics.Vector512 ConvertToVector512UInt16(System.Runtime.Intrinsics.Vector256 value) { throw null; } public static System.Runtime.Intrinsics.Vector512 ConvertToVector512UInt16(System.Runtime.Intrinsics.Vector256 value) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public new unsafe static System.Runtime.Intrinsics.Vector512 LoadVector512(byte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public new unsafe static System.Runtime.Intrinsics.Vector512 LoadVector512(short* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public new unsafe static System.Runtime.Intrinsics.Vector512 LoadVector512(sbyte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public new unsafe static System.Runtime.Intrinsics.Vector512 LoadVector512(ushort* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector512 MaskLoad(byte* address, System.Runtime.Intrinsics.Vector512 mask, System.Runtime.Intrinsics.Vector512 merge) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector512 MaskLoad(short* address, System.Runtime.Intrinsics.Vector512 mask, System.Runtime.Intrinsics.Vector512 merge) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector512 MaskLoad(sbyte* address, System.Runtime.Intrinsics.Vector512 mask, System.Runtime.Intrinsics.Vector512 merge) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector512 MaskLoad(ushort* address, System.Runtime.Intrinsics.Vector512 mask, System.Runtime.Intrinsics.Vector512 merge) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void MaskStore(byte* address, System.Runtime.Intrinsics.Vector512 mask, System.Runtime.Intrinsics.Vector512 source) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void MaskStore(short* address, System.Runtime.Intrinsics.Vector512 mask, System.Runtime.Intrinsics.Vector512 source) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void MaskStore(sbyte* address, System.Runtime.Intrinsics.Vector512 mask, System.Runtime.Intrinsics.Vector512 source) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void MaskStore(ushort* address, System.Runtime.Intrinsics.Vector512 mask, System.Runtime.Intrinsics.Vector512 source) { throw null; } public static System.Runtime.Intrinsics.Vector512 Max(System.Runtime.Intrinsics.Vector512 left, System.Runtime.Intrinsics.Vector512 right) { throw null; } public static System.Runtime.Intrinsics.Vector512 Max(System.Runtime.Intrinsics.Vector512 left, System.Runtime.Intrinsics.Vector512 right) { throw null; } @@ -10268,13 +8872,9 @@ internal Avx512BW() { } public static System.Runtime.Intrinsics.Vector512 ShuffleHigh(System.Runtime.Intrinsics.Vector512 value, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute] byte control) { throw null; } public static System.Runtime.Intrinsics.Vector512 ShuffleLow(System.Runtime.Intrinsics.Vector512 value, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute] byte control) { throw null; } public static System.Runtime.Intrinsics.Vector512 ShuffleLow(System.Runtime.Intrinsics.Vector512 value, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute] byte control) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public new unsafe static void Store(byte* address, System.Runtime.Intrinsics.Vector512 source) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public new unsafe static void Store(short* address, System.Runtime.Intrinsics.Vector512 source) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public new unsafe static void Store(sbyte* address, System.Runtime.Intrinsics.Vector512 source) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public new unsafe static void Store(ushort* address, System.Runtime.Intrinsics.Vector512 source) { } public static System.Runtime.Intrinsics.Vector512 Subtract(System.Runtime.Intrinsics.Vector512 left, System.Runtime.Intrinsics.Vector512 right) { throw null; } public static System.Runtime.Intrinsics.Vector512 Subtract(System.Runtime.Intrinsics.Vector512 left, System.Runtime.Intrinsics.Vector512 right) { throw null; } @@ -10366,37 +8966,21 @@ internal VL() { } public static System.Runtime.Intrinsics.Vector128 ConvertToVector128SByte(System.Runtime.Intrinsics.Vector256 value) { throw null; } public static System.Runtime.Intrinsics.Vector128 ConvertToVector128SByteWithSaturation(System.Runtime.Intrinsics.Vector128 value) { throw null; } public static System.Runtime.Intrinsics.Vector128 ConvertToVector128SByteWithSaturation(System.Runtime.Intrinsics.Vector256 value) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 MaskLoad(byte* address, System.Runtime.Intrinsics.Vector128 mask, System.Runtime.Intrinsics.Vector128 merge) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 MaskLoad(short* address, System.Runtime.Intrinsics.Vector128 mask, System.Runtime.Intrinsics.Vector128 merge) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 MaskLoad(sbyte* address, System.Runtime.Intrinsics.Vector128 mask, System.Runtime.Intrinsics.Vector128 merge) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 MaskLoad(ushort* address, System.Runtime.Intrinsics.Vector128 mask, System.Runtime.Intrinsics.Vector128 merge) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector256 MaskLoad(byte* address, System.Runtime.Intrinsics.Vector256 mask, System.Runtime.Intrinsics.Vector256 merge) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector256 MaskLoad(short* address, System.Runtime.Intrinsics.Vector256 mask, System.Runtime.Intrinsics.Vector256 merge) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector256 MaskLoad(sbyte* address, System.Runtime.Intrinsics.Vector256 mask, System.Runtime.Intrinsics.Vector256 merge) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector256 MaskLoad(ushort* address, System.Runtime.Intrinsics.Vector256 mask, System.Runtime.Intrinsics.Vector256 merge) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void MaskStore(byte* address, System.Runtime.Intrinsics.Vector128 mask, System.Runtime.Intrinsics.Vector128 source) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void MaskStore(short* address, System.Runtime.Intrinsics.Vector128 mask, System.Runtime.Intrinsics.Vector128 source) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void MaskStore(sbyte* address, System.Runtime.Intrinsics.Vector128 mask, System.Runtime.Intrinsics.Vector128 source) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void MaskStore(ushort* address, System.Runtime.Intrinsics.Vector128 mask, System.Runtime.Intrinsics.Vector128 source) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void MaskStore(byte* address, System.Runtime.Intrinsics.Vector256 mask, System.Runtime.Intrinsics.Vector256 source) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void MaskStore(short* address, System.Runtime.Intrinsics.Vector256 mask, System.Runtime.Intrinsics.Vector256 source) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void MaskStore(sbyte* address, System.Runtime.Intrinsics.Vector256 mask, System.Runtime.Intrinsics.Vector256 source) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void MaskStore(ushort* address, System.Runtime.Intrinsics.Vector256 mask, System.Runtime.Intrinsics.Vector256 source) { throw null; } public static System.Runtime.Intrinsics.Vector128 PermuteVar8x16(System.Runtime.Intrinsics.Vector128 left, System.Runtime.Intrinsics.Vector128 control) { throw null; } public static System.Runtime.Intrinsics.Vector128 PermuteVar8x16(System.Runtime.Intrinsics.Vector128 left, System.Runtime.Intrinsics.Vector128 control) { throw null; } @@ -10477,17 +9061,11 @@ internal Avx512DQ() { } public static System.Runtime.Intrinsics.Vector512 BroadcastPairScalarToVector512(System.Runtime.Intrinsics.Vector128 value) { throw null; } public static System.Runtime.Intrinsics.Vector512 BroadcastPairScalarToVector512(System.Runtime.Intrinsics.Vector128 value) { throw null; } public static System.Runtime.Intrinsics.Vector512 BroadcastPairScalarToVector512(System.Runtime.Intrinsics.Vector128 value) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector512 BroadcastVector128ToVector512(double* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector512 BroadcastVector128ToVector512(long* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector512 BroadcastVector128ToVector512(ulong* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector512 BroadcastVector256ToVector512(int* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector512 BroadcastVector256ToVector512(float* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector512 BroadcastVector256ToVector512(uint* address) { throw null; } public static System.Runtime.Intrinsics.Vector512 Classify(System.Runtime.Intrinsics.Vector512 value, [System.Diagnostics.CodeAnalysis.ConstantExpected] byte control) { throw null; } public static System.Runtime.Intrinsics.Vector512 Classify(System.Runtime.Intrinsics.Vector512 value, [System.Diagnostics.CodeAnalysis.ConstantExpected] byte control) { throw null; } @@ -10663,17 +9241,11 @@ internal Avx512F() { } public static System.Runtime.Intrinsics.Vector512 BroadcastScalarToVector512(System.Runtime.Intrinsics.Vector128 value) { throw null; } public static System.Runtime.Intrinsics.Vector512 BroadcastScalarToVector512(System.Runtime.Intrinsics.Vector128 value) { throw null; } public static System.Runtime.Intrinsics.Vector512 BroadcastScalarToVector512(System.Runtime.Intrinsics.Vector128 value) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector512 BroadcastVector128ToVector512(int* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector512 BroadcastVector128ToVector512(float* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector512 BroadcastVector128ToVector512(uint* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector512 BroadcastVector256ToVector512(double* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector512 BroadcastVector256ToVector512(long* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector512 BroadcastVector256ToVector512(ulong* address) { throw null; } public static System.Runtime.Intrinsics.Vector512 Compare(System.Runtime.Intrinsics.Vector512 left, System.Runtime.Intrinsics.Vector512 right, [System.Diagnostics.CodeAnalysis.ConstantExpected(Max = System.Runtime.Intrinsics.X86.FloatComparisonMode.UnorderedTrueSignaling)] System.Runtime.Intrinsics.X86.FloatComparisonMode mode) { throw null; } public static System.Runtime.Intrinsics.Vector512 Compare(System.Runtime.Intrinsics.Vector512 left, System.Runtime.Intrinsics.Vector512 right, [System.Diagnostics.CodeAnalysis.ConstantExpected(Max = System.Runtime.Intrinsics.X86.FloatComparisonMode.UnorderedTrueSignaling)] System.Runtime.Intrinsics.X86.FloatComparisonMode mode) { throw null; } @@ -10731,17 +9303,11 @@ internal Avx512F() { } public static System.Runtime.Intrinsics.Vector512 Compress(System.Runtime.Intrinsics.Vector512 merge, System.Runtime.Intrinsics.Vector512 mask, System.Runtime.Intrinsics.Vector512 value) { throw null; } public static System.Runtime.Intrinsics.Vector512 Compress(System.Runtime.Intrinsics.Vector512 merge, System.Runtime.Intrinsics.Vector512 mask, System.Runtime.Intrinsics.Vector512 value) { throw null; } public static System.Runtime.Intrinsics.Vector512 Compress(System.Runtime.Intrinsics.Vector512 merge, System.Runtime.Intrinsics.Vector512 mask, System.Runtime.Intrinsics.Vector512 value) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void CompressStore(double* address, System.Runtime.Intrinsics.Vector512 mask, System.Runtime.Intrinsics.Vector512 source) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void CompressStore(int* address, System.Runtime.Intrinsics.Vector512 mask, System.Runtime.Intrinsics.Vector512 source) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void CompressStore(long* address, System.Runtime.Intrinsics.Vector512 mask, System.Runtime.Intrinsics.Vector512 source) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void CompressStore(float* address, System.Runtime.Intrinsics.Vector512 mask, System.Runtime.Intrinsics.Vector512 source) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void CompressStore(uint* address, System.Runtime.Intrinsics.Vector512 mask, System.Runtime.Intrinsics.Vector512 source) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void CompressStore(ulong* address, System.Runtime.Intrinsics.Vector512 mask, System.Runtime.Intrinsics.Vector512 source) { throw null; } public static System.Runtime.Intrinsics.Vector128 ConvertScalarToVector128Double(System.Runtime.Intrinsics.Vector128 upper, uint value) { throw null; } public static System.Runtime.Intrinsics.Vector128 ConvertScalarToVector128Single(System.Runtime.Intrinsics.Vector128 upper, uint value) { throw null; } @@ -10842,17 +9408,11 @@ internal Avx512F() { } public static System.Runtime.Intrinsics.Vector512 Expand(System.Runtime.Intrinsics.Vector512 merge, System.Runtime.Intrinsics.Vector512 mask, System.Runtime.Intrinsics.Vector512 value) { throw null; } public static System.Runtime.Intrinsics.Vector512 Expand(System.Runtime.Intrinsics.Vector512 merge, System.Runtime.Intrinsics.Vector512 mask, System.Runtime.Intrinsics.Vector512 value) { throw null; } public static System.Runtime.Intrinsics.Vector512 Expand(System.Runtime.Intrinsics.Vector512 merge, System.Runtime.Intrinsics.Vector512 mask, System.Runtime.Intrinsics.Vector512 value) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector512 ExpandLoad(double* address, System.Runtime.Intrinsics.Vector512 mask, System.Runtime.Intrinsics.Vector512 merge) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector512 ExpandLoad(int* address, System.Runtime.Intrinsics.Vector512 mask, System.Runtime.Intrinsics.Vector512 merge) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector512 ExpandLoad(long* address, System.Runtime.Intrinsics.Vector512 mask, System.Runtime.Intrinsics.Vector512 merge) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector512 ExpandLoad(float* address, System.Runtime.Intrinsics.Vector512 mask, System.Runtime.Intrinsics.Vector512 merge) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector512 ExpandLoad(uint* address, System.Runtime.Intrinsics.Vector512 mask, System.Runtime.Intrinsics.Vector512 merge) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector512 ExpandLoad(ulong* address, System.Runtime.Intrinsics.Vector512 mask, System.Runtime.Intrinsics.Vector512 merge) { throw null; } public static System.Runtime.Intrinsics.Vector128 ExtractVector128(System.Runtime.Intrinsics.Vector512 value, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute] byte index) { throw null; } public static System.Runtime.Intrinsics.Vector128 ExtractVector128(System.Runtime.Intrinsics.Vector512 value, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute] byte index) { throw null; } @@ -10942,109 +9502,57 @@ internal Avx512F() { } public static System.Runtime.Intrinsics.Vector512 InsertVector256(System.Runtime.Intrinsics.Vector512 value, System.Runtime.Intrinsics.Vector256 data, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute] byte index) { throw null; } public static System.Runtime.Intrinsics.Vector512 InsertVector256(System.Runtime.Intrinsics.Vector512 value, System.Runtime.Intrinsics.Vector256 data, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute] byte index) { throw null; } public static System.Runtime.Intrinsics.Vector512 InsertVector256(System.Runtime.Intrinsics.Vector512 value, System.Runtime.Intrinsics.Vector256 data, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute] byte index) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector512 LoadAlignedVector512(byte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector512 LoadAlignedVector512(double* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector512 LoadAlignedVector512(short* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector512 LoadAlignedVector512(int* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector512 LoadAlignedVector512(long* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector512 LoadAlignedVector512(sbyte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector512 LoadAlignedVector512(float* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector512 LoadAlignedVector512(ushort* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector512 LoadAlignedVector512(uint* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector512 LoadAlignedVector512(ulong* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector512 LoadAlignedVector512NonTemporal(byte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector512 LoadAlignedVector512NonTemporal(short* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector512 LoadAlignedVector512NonTemporal(int* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector512 LoadAlignedVector512NonTemporal(long* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector512 LoadAlignedVector512NonTemporal(sbyte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector512 LoadAlignedVector512NonTemporal(ushort* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector512 LoadAlignedVector512NonTemporal(uint* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector512 LoadAlignedVector512NonTemporal(ulong* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector512 LoadVector512(byte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector512 LoadVector512(double* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector512 LoadVector512(short* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector512 LoadVector512(int* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector512 LoadVector512(long* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector512 LoadVector512(sbyte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector512 LoadVector512(float* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector512 LoadVector512(ushort* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector512 LoadVector512(uint* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector512 LoadVector512(ulong* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector512 MaskLoad(double* address, System.Runtime.Intrinsics.Vector512 mask, System.Runtime.Intrinsics.Vector512 merge) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector512 MaskLoad(int* address, System.Runtime.Intrinsics.Vector512 mask, System.Runtime.Intrinsics.Vector512 merge) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector512 MaskLoad(long* address, System.Runtime.Intrinsics.Vector512 mask, System.Runtime.Intrinsics.Vector512 merge) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector512 MaskLoad(float* address, System.Runtime.Intrinsics.Vector512 mask, System.Runtime.Intrinsics.Vector512 merge) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector512 MaskLoad(uint* address, System.Runtime.Intrinsics.Vector512 mask, System.Runtime.Intrinsics.Vector512 merge) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector512 MaskLoad(ulong* address, System.Runtime.Intrinsics.Vector512 mask, System.Runtime.Intrinsics.Vector512 merge) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector512 MaskLoadAligned(double* address, System.Runtime.Intrinsics.Vector512 mask, System.Runtime.Intrinsics.Vector512 merge) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector512 MaskLoadAligned(int* address, System.Runtime.Intrinsics.Vector512 mask, System.Runtime.Intrinsics.Vector512 merge) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector512 MaskLoadAligned(long* address, System.Runtime.Intrinsics.Vector512 mask, System.Runtime.Intrinsics.Vector512 merge) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector512 MaskLoadAligned(float* address, System.Runtime.Intrinsics.Vector512 mask, System.Runtime.Intrinsics.Vector512 merge) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector512 MaskLoadAligned(uint* address, System.Runtime.Intrinsics.Vector512 mask, System.Runtime.Intrinsics.Vector512 merge) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector512 MaskLoadAligned(ulong* address, System.Runtime.Intrinsics.Vector512 mask, System.Runtime.Intrinsics.Vector512 merge) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void MaskStore(double* address, System.Runtime.Intrinsics.Vector512 mask, System.Runtime.Intrinsics.Vector512 source) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void MaskStore(int* address, System.Runtime.Intrinsics.Vector512 mask, System.Runtime.Intrinsics.Vector512 source) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void MaskStore(long* address, System.Runtime.Intrinsics.Vector512 mask, System.Runtime.Intrinsics.Vector512 source) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void MaskStore(float* address, System.Runtime.Intrinsics.Vector512 mask, System.Runtime.Intrinsics.Vector512 source) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void MaskStore(uint* address, System.Runtime.Intrinsics.Vector512 mask, System.Runtime.Intrinsics.Vector512 source) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void MaskStore(ulong* address, System.Runtime.Intrinsics.Vector512 mask, System.Runtime.Intrinsics.Vector512 source) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void MaskStoreAligned(double* address, System.Runtime.Intrinsics.Vector512 mask, System.Runtime.Intrinsics.Vector512 source) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void MaskStoreAligned(int* address, System.Runtime.Intrinsics.Vector512 mask, System.Runtime.Intrinsics.Vector512 source) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void MaskStoreAligned(long* address, System.Runtime.Intrinsics.Vector512 mask, System.Runtime.Intrinsics.Vector512 source) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void MaskStoreAligned(float* address, System.Runtime.Intrinsics.Vector512 mask, System.Runtime.Intrinsics.Vector512 source) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void MaskStoreAligned(uint* address, System.Runtime.Intrinsics.Vector512 mask, System.Runtime.Intrinsics.Vector512 source) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void MaskStoreAligned(ulong* address, System.Runtime.Intrinsics.Vector512 mask, System.Runtime.Intrinsics.Vector512 source) { throw null; } public static System.Runtime.Intrinsics.Vector512 Max(System.Runtime.Intrinsics.Vector512 left, System.Runtime.Intrinsics.Vector512 right) { throw null; } public static System.Runtime.Intrinsics.Vector512 Max(System.Runtime.Intrinsics.Vector512 left, System.Runtime.Intrinsics.Vector512 right) { throw null; } @@ -11190,65 +9698,35 @@ internal Avx512F() { } public static System.Runtime.Intrinsics.Vector512 Sqrt(System.Runtime.Intrinsics.Vector512 value, [System.Diagnostics.CodeAnalysis.ConstantExpected(Max = System.Runtime.Intrinsics.X86.FloatRoundingMode.ToZero)] System.Runtime.Intrinsics.X86.FloatRoundingMode mode) { throw null; } public static System.Runtime.Intrinsics.Vector128 SqrtScalar(System.Runtime.Intrinsics.Vector128 upper, System.Runtime.Intrinsics.Vector128 value, [System.Diagnostics.CodeAnalysis.ConstantExpected(Max = System.Runtime.Intrinsics.X86.FloatRoundingMode.ToZero)] System.Runtime.Intrinsics.X86.FloatRoundingMode mode) { throw null; } public static System.Runtime.Intrinsics.Vector128 SqrtScalar(System.Runtime.Intrinsics.Vector128 upper, System.Runtime.Intrinsics.Vector128 value, [System.Diagnostics.CodeAnalysis.ConstantExpected(Max = System.Runtime.Intrinsics.X86.FloatRoundingMode.ToZero)] System.Runtime.Intrinsics.X86.FloatRoundingMode mode) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Store(byte* address, System.Runtime.Intrinsics.Vector512 source) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Store(double* address, System.Runtime.Intrinsics.Vector512 source) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Store(short* address, System.Runtime.Intrinsics.Vector512 source) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Store(int* address, System.Runtime.Intrinsics.Vector512 source) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Store(long* address, System.Runtime.Intrinsics.Vector512 source) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Store(sbyte* address, System.Runtime.Intrinsics.Vector512 source) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Store(float* address, System.Runtime.Intrinsics.Vector512 source) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Store(ushort* address, System.Runtime.Intrinsics.Vector512 source) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Store(uint* address, System.Runtime.Intrinsics.Vector512 source) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Store(ulong* address, System.Runtime.Intrinsics.Vector512 source) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreAligned(byte* address, System.Runtime.Intrinsics.Vector512 source) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreAligned(double* address, System.Runtime.Intrinsics.Vector512 source) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreAligned(short* address, System.Runtime.Intrinsics.Vector512 source) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreAligned(int* address, System.Runtime.Intrinsics.Vector512 source) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreAligned(long* address, System.Runtime.Intrinsics.Vector512 source) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreAligned(sbyte* address, System.Runtime.Intrinsics.Vector512 source) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreAligned(float* address, System.Runtime.Intrinsics.Vector512 source) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreAligned(ushort* address, System.Runtime.Intrinsics.Vector512 source) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreAligned(uint* address, System.Runtime.Intrinsics.Vector512 source) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreAligned(ulong* address, System.Runtime.Intrinsics.Vector512 source) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreAlignedNonTemporal(byte* address, System.Runtime.Intrinsics.Vector512 source) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreAlignedNonTemporal(double* address, System.Runtime.Intrinsics.Vector512 source) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreAlignedNonTemporal(short* address, System.Runtime.Intrinsics.Vector512 source) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreAlignedNonTemporal(int* address, System.Runtime.Intrinsics.Vector512 source) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreAlignedNonTemporal(long* address, System.Runtime.Intrinsics.Vector512 source) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreAlignedNonTemporal(sbyte* address, System.Runtime.Intrinsics.Vector512 source) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreAlignedNonTemporal(float* address, System.Runtime.Intrinsics.Vector512 source) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreAlignedNonTemporal(ushort* address, System.Runtime.Intrinsics.Vector512 source) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreAlignedNonTemporal(uint* address, System.Runtime.Intrinsics.Vector512 source) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreAlignedNonTemporal(ulong* address, System.Runtime.Intrinsics.Vector512 source) { } public static System.Runtime.Intrinsics.Vector512 Subtract(System.Runtime.Intrinsics.Vector512 left, System.Runtime.Intrinsics.Vector512 right) { throw null; } public static System.Runtime.Intrinsics.Vector512 Subtract(System.Runtime.Intrinsics.Vector512 left, System.Runtime.Intrinsics.Vector512 right) { throw null; } @@ -11428,29 +9906,17 @@ internal VL() { } public static System.Runtime.Intrinsics.Vector256 Compress(System.Runtime.Intrinsics.Vector256 merge, System.Runtime.Intrinsics.Vector256 mask, System.Runtime.Intrinsics.Vector256 value) { throw null; } public static System.Runtime.Intrinsics.Vector256 Compress(System.Runtime.Intrinsics.Vector256 merge, System.Runtime.Intrinsics.Vector256 mask, System.Runtime.Intrinsics.Vector256 value) { throw null; } public static System.Runtime.Intrinsics.Vector256 Compress(System.Runtime.Intrinsics.Vector256 merge, System.Runtime.Intrinsics.Vector256 mask, System.Runtime.Intrinsics.Vector256 value) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void CompressStore(double* address, System.Runtime.Intrinsics.Vector128 mask, System.Runtime.Intrinsics.Vector128 source) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void CompressStore(int* address, System.Runtime.Intrinsics.Vector128 mask, System.Runtime.Intrinsics.Vector128 source) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void CompressStore(long* address, System.Runtime.Intrinsics.Vector128 mask, System.Runtime.Intrinsics.Vector128 source) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void CompressStore(float* address, System.Runtime.Intrinsics.Vector128 mask, System.Runtime.Intrinsics.Vector128 source) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void CompressStore(uint* address, System.Runtime.Intrinsics.Vector128 mask, System.Runtime.Intrinsics.Vector128 source) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void CompressStore(ulong* address, System.Runtime.Intrinsics.Vector128 mask, System.Runtime.Intrinsics.Vector128 source) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void CompressStore(double* address, System.Runtime.Intrinsics.Vector256 mask, System.Runtime.Intrinsics.Vector256 source) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void CompressStore(int* address, System.Runtime.Intrinsics.Vector256 mask, System.Runtime.Intrinsics.Vector256 source) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void CompressStore(long* address, System.Runtime.Intrinsics.Vector256 mask, System.Runtime.Intrinsics.Vector256 source) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void CompressStore(float* address, System.Runtime.Intrinsics.Vector256 mask, System.Runtime.Intrinsics.Vector256 source) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void CompressStore(uint* address, System.Runtime.Intrinsics.Vector256 mask, System.Runtime.Intrinsics.Vector256 source) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void CompressStore(ulong* address, System.Runtime.Intrinsics.Vector256 mask, System.Runtime.Intrinsics.Vector256 source) { throw null; } public static System.Runtime.Intrinsics.Vector128 ConvertToVector128Byte(System.Runtime.Intrinsics.Vector128 value) { throw null; } public static System.Runtime.Intrinsics.Vector128 ConvertToVector128Byte(System.Runtime.Intrinsics.Vector128 value) { throw null; } @@ -11536,29 +10002,17 @@ internal VL() { } public static System.Runtime.Intrinsics.Vector256 Expand(System.Runtime.Intrinsics.Vector256 merge, System.Runtime.Intrinsics.Vector256 mask, System.Runtime.Intrinsics.Vector256 value) { throw null; } public static System.Runtime.Intrinsics.Vector256 Expand(System.Runtime.Intrinsics.Vector256 merge, System.Runtime.Intrinsics.Vector256 mask, System.Runtime.Intrinsics.Vector256 value) { throw null; } public static System.Runtime.Intrinsics.Vector256 Expand(System.Runtime.Intrinsics.Vector256 merge, System.Runtime.Intrinsics.Vector256 mask, System.Runtime.Intrinsics.Vector256 value) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 ExpandLoad(double* address, System.Runtime.Intrinsics.Vector128 mask, System.Runtime.Intrinsics.Vector128 merge) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 ExpandLoad(int* address, System.Runtime.Intrinsics.Vector128 mask, System.Runtime.Intrinsics.Vector128 merge) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 ExpandLoad(long* address, System.Runtime.Intrinsics.Vector128 mask, System.Runtime.Intrinsics.Vector128 merge) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 ExpandLoad(float* address, System.Runtime.Intrinsics.Vector128 mask, System.Runtime.Intrinsics.Vector128 merge) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 ExpandLoad(uint* address, System.Runtime.Intrinsics.Vector128 mask, System.Runtime.Intrinsics.Vector128 merge) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 ExpandLoad(ulong* address, System.Runtime.Intrinsics.Vector128 mask, System.Runtime.Intrinsics.Vector128 merge) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector256 ExpandLoad(double* address, System.Runtime.Intrinsics.Vector256 mask, System.Runtime.Intrinsics.Vector256 merge) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector256 ExpandLoad(int* address, System.Runtime.Intrinsics.Vector256 mask, System.Runtime.Intrinsics.Vector256 merge) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector256 ExpandLoad(long* address, System.Runtime.Intrinsics.Vector256 mask, System.Runtime.Intrinsics.Vector256 merge) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector256 ExpandLoad(float* address, System.Runtime.Intrinsics.Vector256 mask, System.Runtime.Intrinsics.Vector256 merge) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector256 ExpandLoad(uint* address, System.Runtime.Intrinsics.Vector256 mask, System.Runtime.Intrinsics.Vector256 merge) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector256 ExpandLoad(ulong* address, System.Runtime.Intrinsics.Vector256 mask, System.Runtime.Intrinsics.Vector256 merge) { throw null; } public static System.Runtime.Intrinsics.Vector128 Fixup(System.Runtime.Intrinsics.Vector128 left, System.Runtime.Intrinsics.Vector128 right, System.Runtime.Intrinsics.Vector128 table, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute] byte control) { throw null; } public static System.Runtime.Intrinsics.Vector128 Fixup(System.Runtime.Intrinsics.Vector128 left, System.Runtime.Intrinsics.Vector128 right, System.Runtime.Intrinsics.Vector128 table, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute] byte control) { throw null; } @@ -11572,101 +10026,53 @@ internal VL() { } public static System.Runtime.Intrinsics.Vector128 GetMantissa(System.Runtime.Intrinsics.Vector128 value, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Max = (byte)(0x0F))] byte control) { throw null; } public static System.Runtime.Intrinsics.Vector256 GetMantissa(System.Runtime.Intrinsics.Vector256 value, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Max = (byte)(0x0F))] byte control) { throw null; } public static System.Runtime.Intrinsics.Vector256 GetMantissa(System.Runtime.Intrinsics.Vector256 value, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute(Max = (byte)(0x0F))] byte control) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 MaskLoad(double* address, System.Runtime.Intrinsics.Vector128 mask, System.Runtime.Intrinsics.Vector128 merge) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 MaskLoad(int* address, System.Runtime.Intrinsics.Vector128 mask, System.Runtime.Intrinsics.Vector128 merge) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 MaskLoad(long* address, System.Runtime.Intrinsics.Vector128 mask, System.Runtime.Intrinsics.Vector128 merge) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 MaskLoad(float* address, System.Runtime.Intrinsics.Vector128 mask, System.Runtime.Intrinsics.Vector128 merge) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 MaskLoad(uint* address, System.Runtime.Intrinsics.Vector128 mask, System.Runtime.Intrinsics.Vector128 merge) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 MaskLoad(ulong* address, System.Runtime.Intrinsics.Vector128 mask, System.Runtime.Intrinsics.Vector128 merge) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector256 MaskLoad(double* address, System.Runtime.Intrinsics.Vector256 mask, System.Runtime.Intrinsics.Vector256 merge) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector256 MaskLoad(int* address, System.Runtime.Intrinsics.Vector256 mask, System.Runtime.Intrinsics.Vector256 merge) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector256 MaskLoad(long* address, System.Runtime.Intrinsics.Vector256 mask, System.Runtime.Intrinsics.Vector256 merge) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector256 MaskLoad(float* address, System.Runtime.Intrinsics.Vector256 mask, System.Runtime.Intrinsics.Vector256 merge) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector256 MaskLoad(uint* address, System.Runtime.Intrinsics.Vector256 mask, System.Runtime.Intrinsics.Vector256 merge) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector256 MaskLoad(ulong* address, System.Runtime.Intrinsics.Vector256 mask, System.Runtime.Intrinsics.Vector256 merge) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 MaskLoadAligned(double* address, System.Runtime.Intrinsics.Vector128 mask, System.Runtime.Intrinsics.Vector128 merge) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 MaskLoadAligned(int* address, System.Runtime.Intrinsics.Vector128 mask, System.Runtime.Intrinsics.Vector128 merge) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 MaskLoadAligned(long* address, System.Runtime.Intrinsics.Vector128 mask, System.Runtime.Intrinsics.Vector128 merge) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 MaskLoadAligned(float* address, System.Runtime.Intrinsics.Vector128 mask, System.Runtime.Intrinsics.Vector128 merge) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 MaskLoadAligned(uint* address, System.Runtime.Intrinsics.Vector128 mask, System.Runtime.Intrinsics.Vector128 merge) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 MaskLoadAligned(ulong* address, System.Runtime.Intrinsics.Vector128 mask, System.Runtime.Intrinsics.Vector128 merge) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector256 MaskLoadAligned(double* address, System.Runtime.Intrinsics.Vector256 mask, System.Runtime.Intrinsics.Vector256 merge) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector256 MaskLoadAligned(int* address, System.Runtime.Intrinsics.Vector256 mask, System.Runtime.Intrinsics.Vector256 merge) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector256 MaskLoadAligned(long* address, System.Runtime.Intrinsics.Vector256 mask, System.Runtime.Intrinsics.Vector256 merge) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector256 MaskLoadAligned(float* address, System.Runtime.Intrinsics.Vector256 mask, System.Runtime.Intrinsics.Vector256 merge) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector256 MaskLoadAligned(uint* address, System.Runtime.Intrinsics.Vector256 mask, System.Runtime.Intrinsics.Vector256 merge) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector256 MaskLoadAligned(ulong* address, System.Runtime.Intrinsics.Vector256 mask, System.Runtime.Intrinsics.Vector256 merge) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void MaskStore(double* address, System.Runtime.Intrinsics.Vector128 mask, System.Runtime.Intrinsics.Vector128 source) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void MaskStore(int* address, System.Runtime.Intrinsics.Vector128 mask, System.Runtime.Intrinsics.Vector128 source) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void MaskStore(long* address, System.Runtime.Intrinsics.Vector128 mask, System.Runtime.Intrinsics.Vector128 source) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void MaskStore(float* address, System.Runtime.Intrinsics.Vector128 mask, System.Runtime.Intrinsics.Vector128 source) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void MaskStore(uint* address, System.Runtime.Intrinsics.Vector128 mask, System.Runtime.Intrinsics.Vector128 source) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void MaskStore(ulong* address, System.Runtime.Intrinsics.Vector128 mask, System.Runtime.Intrinsics.Vector128 source) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void MaskStore(double* address, System.Runtime.Intrinsics.Vector256 mask, System.Runtime.Intrinsics.Vector256 source) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void MaskStore(int* address, System.Runtime.Intrinsics.Vector256 mask, System.Runtime.Intrinsics.Vector256 source) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void MaskStore(long* address, System.Runtime.Intrinsics.Vector256 mask, System.Runtime.Intrinsics.Vector256 source) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void MaskStore(float* address, System.Runtime.Intrinsics.Vector256 mask, System.Runtime.Intrinsics.Vector256 source) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void MaskStore(uint* address, System.Runtime.Intrinsics.Vector256 mask, System.Runtime.Intrinsics.Vector256 source) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void MaskStore(ulong* address, System.Runtime.Intrinsics.Vector256 mask, System.Runtime.Intrinsics.Vector256 source) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void MaskStoreAligned(double* address, System.Runtime.Intrinsics.Vector128 mask, System.Runtime.Intrinsics.Vector128 source) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void MaskStoreAligned(int* address, System.Runtime.Intrinsics.Vector128 mask, System.Runtime.Intrinsics.Vector128 source) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void MaskStoreAligned(long* address, System.Runtime.Intrinsics.Vector128 mask, System.Runtime.Intrinsics.Vector128 source) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void MaskStoreAligned(float* address, System.Runtime.Intrinsics.Vector128 mask, System.Runtime.Intrinsics.Vector128 source) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void MaskStoreAligned(uint* address, System.Runtime.Intrinsics.Vector128 mask, System.Runtime.Intrinsics.Vector128 source) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void MaskStoreAligned(ulong* address, System.Runtime.Intrinsics.Vector128 mask, System.Runtime.Intrinsics.Vector128 source) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void MaskStoreAligned(double* address, System.Runtime.Intrinsics.Vector256 mask, System.Runtime.Intrinsics.Vector256 source) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void MaskStoreAligned(int* address, System.Runtime.Intrinsics.Vector256 mask, System.Runtime.Intrinsics.Vector256 source) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void MaskStoreAligned(long* address, System.Runtime.Intrinsics.Vector256 mask, System.Runtime.Intrinsics.Vector256 source) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void MaskStoreAligned(float* address, System.Runtime.Intrinsics.Vector256 mask, System.Runtime.Intrinsics.Vector256 source) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void MaskStoreAligned(uint* address, System.Runtime.Intrinsics.Vector256 mask, System.Runtime.Intrinsics.Vector256 source) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void MaskStoreAligned(ulong* address, System.Runtime.Intrinsics.Vector256 mask, System.Runtime.Intrinsics.Vector256 source) { throw null; } public static System.Runtime.Intrinsics.Vector128 Max(System.Runtime.Intrinsics.Vector128 left, System.Runtime.Intrinsics.Vector128 right) { throw null; } public static System.Runtime.Intrinsics.Vector128 Max(System.Runtime.Intrinsics.Vector128 left, System.Runtime.Intrinsics.Vector128 right) { throw null; } @@ -11835,25 +10241,17 @@ internal Avx512Vbmi2() { } public static System.Runtime.Intrinsics.Vector512 Compress(System.Runtime.Intrinsics.Vector512 merge, System.Runtime.Intrinsics.Vector512 mask, System.Runtime.Intrinsics.Vector512 value) { throw null; } public static System.Runtime.Intrinsics.Vector512 Compress(System.Runtime.Intrinsics.Vector512 merge, System.Runtime.Intrinsics.Vector512 mask, System.Runtime.Intrinsics.Vector512 value) { throw null; } public static System.Runtime.Intrinsics.Vector512 Compress(System.Runtime.Intrinsics.Vector512 merge, System.Runtime.Intrinsics.Vector512 mask, System.Runtime.Intrinsics.Vector512 value) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void CompressStore(byte* address, System.Runtime.Intrinsics.Vector512 mask, System.Runtime.Intrinsics.Vector512 source) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void CompressStore(short* address, System.Runtime.Intrinsics.Vector512 mask, System.Runtime.Intrinsics.Vector512 source) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void CompressStore(sbyte* address, System.Runtime.Intrinsics.Vector512 mask, System.Runtime.Intrinsics.Vector512 source) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void CompressStore(ushort* address, System.Runtime.Intrinsics.Vector512 mask, System.Runtime.Intrinsics.Vector512 source) { throw null; } public static System.Runtime.Intrinsics.Vector512 Expand(System.Runtime.Intrinsics.Vector512 merge, System.Runtime.Intrinsics.Vector512 mask, System.Runtime.Intrinsics.Vector512 value) { throw null; } public static System.Runtime.Intrinsics.Vector512 Expand(System.Runtime.Intrinsics.Vector512 merge, System.Runtime.Intrinsics.Vector512 mask, System.Runtime.Intrinsics.Vector512 value) { throw null; } public static System.Runtime.Intrinsics.Vector512 Expand(System.Runtime.Intrinsics.Vector512 merge, System.Runtime.Intrinsics.Vector512 mask, System.Runtime.Intrinsics.Vector512 value) { throw null; } public static System.Runtime.Intrinsics.Vector512 Expand(System.Runtime.Intrinsics.Vector512 merge, System.Runtime.Intrinsics.Vector512 mask, System.Runtime.Intrinsics.Vector512 value) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector512 ExpandLoad(byte* address, System.Runtime.Intrinsics.Vector512 mask, System.Runtime.Intrinsics.Vector512 merge) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector512 ExpandLoad(short* address, System.Runtime.Intrinsics.Vector512 mask, System.Runtime.Intrinsics.Vector512 merge) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector512 ExpandLoad(sbyte* address, System.Runtime.Intrinsics.Vector512 mask, System.Runtime.Intrinsics.Vector512 merge) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector512 ExpandLoad(ushort* address, System.Runtime.Intrinsics.Vector512 mask, System.Runtime.Intrinsics.Vector512 merge) { throw null; } public new abstract partial class VL : System.Runtime.Intrinsics.X86.Avx512Vbmi.VL { @@ -11867,21 +10265,13 @@ internal VL() { } public static System.Runtime.Intrinsics.Vector256 Compress(System.Runtime.Intrinsics.Vector256 merge, System.Runtime.Intrinsics.Vector256 mask, System.Runtime.Intrinsics.Vector256 value) { throw null; } public static System.Runtime.Intrinsics.Vector256 Compress(System.Runtime.Intrinsics.Vector256 merge, System.Runtime.Intrinsics.Vector256 mask, System.Runtime.Intrinsics.Vector256 value) { throw null; } public static System.Runtime.Intrinsics.Vector256 Compress(System.Runtime.Intrinsics.Vector256 merge, System.Runtime.Intrinsics.Vector256 mask, System.Runtime.Intrinsics.Vector256 value) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void CompressStore(byte* address, System.Runtime.Intrinsics.Vector128 mask, System.Runtime.Intrinsics.Vector128 source) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void CompressStore(short* address, System.Runtime.Intrinsics.Vector128 mask, System.Runtime.Intrinsics.Vector128 source) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void CompressStore(sbyte* address, System.Runtime.Intrinsics.Vector128 mask, System.Runtime.Intrinsics.Vector128 source) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void CompressStore(ushort* address, System.Runtime.Intrinsics.Vector128 mask, System.Runtime.Intrinsics.Vector128 source) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void CompressStore(byte* address, System.Runtime.Intrinsics.Vector256 mask, System.Runtime.Intrinsics.Vector256 source) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void CompressStore(short* address, System.Runtime.Intrinsics.Vector256 mask, System.Runtime.Intrinsics.Vector256 source) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void CompressStore(sbyte* address, System.Runtime.Intrinsics.Vector256 mask, System.Runtime.Intrinsics.Vector256 source) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void CompressStore(ushort* address, System.Runtime.Intrinsics.Vector256 mask, System.Runtime.Intrinsics.Vector256 source) { throw null; } public static System.Runtime.Intrinsics.Vector128 Expand(System.Runtime.Intrinsics.Vector128 merge, System.Runtime.Intrinsics.Vector128 mask, System.Runtime.Intrinsics.Vector128 value) { throw null; } public static System.Runtime.Intrinsics.Vector128 Expand(System.Runtime.Intrinsics.Vector128 merge, System.Runtime.Intrinsics.Vector128 mask, System.Runtime.Intrinsics.Vector128 value) { throw null; } @@ -11891,21 +10281,13 @@ internal VL() { } public static System.Runtime.Intrinsics.Vector256 Expand(System.Runtime.Intrinsics.Vector256 merge, System.Runtime.Intrinsics.Vector256 mask, System.Runtime.Intrinsics.Vector256 value) { throw null; } public static System.Runtime.Intrinsics.Vector256 Expand(System.Runtime.Intrinsics.Vector256 merge, System.Runtime.Intrinsics.Vector256 mask, System.Runtime.Intrinsics.Vector256 value) { throw null; } public static System.Runtime.Intrinsics.Vector256 Expand(System.Runtime.Intrinsics.Vector256 merge, System.Runtime.Intrinsics.Vector256 mask, System.Runtime.Intrinsics.Vector256 value) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 ExpandLoad(byte* address, System.Runtime.Intrinsics.Vector128 mask, System.Runtime.Intrinsics.Vector128 merge) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 ExpandLoad(short* address, System.Runtime.Intrinsics.Vector128 mask, System.Runtime.Intrinsics.Vector128 merge) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 ExpandLoad(sbyte* address, System.Runtime.Intrinsics.Vector128 mask, System.Runtime.Intrinsics.Vector128 merge) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 ExpandLoad(ushort* address, System.Runtime.Intrinsics.Vector128 mask, System.Runtime.Intrinsics.Vector128 merge) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector256 ExpandLoad(byte* address, System.Runtime.Intrinsics.Vector256 mask, System.Runtime.Intrinsics.Vector256 merge) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector256 ExpandLoad(short* address, System.Runtime.Intrinsics.Vector256 mask, System.Runtime.Intrinsics.Vector256 merge) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector256 ExpandLoad(sbyte* address, System.Runtime.Intrinsics.Vector256 mask, System.Runtime.Intrinsics.Vector256 merge) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector256 ExpandLoad(ushort* address, System.Runtime.Intrinsics.Vector256 mask, System.Runtime.Intrinsics.Vector256 merge) { throw null; } } public new abstract partial class X64 : System.Runtime.Intrinsics.X86.Avx512Vbmi.X64 @@ -11964,7 +10346,6 @@ public abstract partial class Bmi2 : System.Runtime.Intrinsics.X86.X86Base internal Bmi2() { } public static new bool IsSupported { get { throw null; } } public static uint MultiplyNoFlags(uint left, uint right) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe uint MultiplyNoFlags(uint left, uint right, uint* low) { throw null; } public static uint ParallelBitDeposit(uint value, uint mask) { throw null; } public static uint ParallelBitExtract(uint value, uint mask) { throw null; } @@ -11974,7 +10355,6 @@ internal Bmi2() { } internal X64() { } public static new bool IsSupported { get { throw null; } } public static ulong MultiplyNoFlags(ulong left, ulong right) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe ulong MultiplyNoFlags(ulong left, ulong right, ulong* low) { throw null; } public static ulong ParallelBitDeposit(ulong value, ulong mask) { throw null; } public static ulong ParallelBitExtract(ulong value, ulong mask) { throw null; } @@ -12169,15 +10549,10 @@ internal Sse() { } public static int ConvertToInt32WithTruncation(System.Runtime.Intrinsics.Vector128 value) { throw null; } public static System.Runtime.Intrinsics.Vector128 Divide(System.Runtime.Intrinsics.Vector128 left, System.Runtime.Intrinsics.Vector128 right) { throw null; } public static System.Runtime.Intrinsics.Vector128 DivideScalar(System.Runtime.Intrinsics.Vector128 left, System.Runtime.Intrinsics.Vector128 right) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 LoadAlignedVector128(float* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 LoadHigh(System.Runtime.Intrinsics.Vector128 lower, float* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 LoadLow(System.Runtime.Intrinsics.Vector128 upper, float* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 LoadScalarVector128(float* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 LoadVector128(float* address) { throw null; } public static System.Runtime.Intrinsics.Vector128 Max(System.Runtime.Intrinsics.Vector128 left, System.Runtime.Intrinsics.Vector128 right) { throw null; } public static System.Runtime.Intrinsics.Vector128 MaxScalar(System.Runtime.Intrinsics.Vector128 left, System.Runtime.Intrinsics.Vector128 right) { throw null; } @@ -12190,13 +10565,9 @@ internal Sse() { } public static System.Runtime.Intrinsics.Vector128 Multiply(System.Runtime.Intrinsics.Vector128 left, System.Runtime.Intrinsics.Vector128 right) { throw null; } public static System.Runtime.Intrinsics.Vector128 MultiplyScalar(System.Runtime.Intrinsics.Vector128 left, System.Runtime.Intrinsics.Vector128 right) { throw null; } public static System.Runtime.Intrinsics.Vector128 Or(System.Runtime.Intrinsics.Vector128 left, System.Runtime.Intrinsics.Vector128 right) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Prefetch0(void* address) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Prefetch1(void* address) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Prefetch2(void* address) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void PrefetchNonTemporal(void* address) { } public static System.Runtime.Intrinsics.Vector128 Reciprocal(System.Runtime.Intrinsics.Vector128 value) { throw null; } public static System.Runtime.Intrinsics.Vector128 ReciprocalScalar(System.Runtime.Intrinsics.Vector128 value) { throw null; } @@ -12208,18 +10579,12 @@ public static unsafe void PrefetchNonTemporal(void* address) { } public static System.Runtime.Intrinsics.Vector128 Sqrt(System.Runtime.Intrinsics.Vector128 value) { throw null; } public static System.Runtime.Intrinsics.Vector128 SqrtScalar(System.Runtime.Intrinsics.Vector128 value) { throw null; } public static System.Runtime.Intrinsics.Vector128 SqrtScalar(System.Runtime.Intrinsics.Vector128 upper, System.Runtime.Intrinsics.Vector128 value) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Store(float* address, System.Runtime.Intrinsics.Vector128 source) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreAligned(float* address, System.Runtime.Intrinsics.Vector128 source) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreAlignedNonTemporal(float* address, System.Runtime.Intrinsics.Vector128 source) { } public static void StoreFence() { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreHigh(float* address, System.Runtime.Intrinsics.Vector128 source) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreLow(float* address, System.Runtime.Intrinsics.Vector128 source) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreScalar(float* address, System.Runtime.Intrinsics.Vector128 source) { } public static System.Runtime.Intrinsics.Vector128 Subtract(System.Runtime.Intrinsics.Vector128 left, System.Runtime.Intrinsics.Vector128 right) { throw null; } public static System.Runtime.Intrinsics.Vector128 SubtractScalar(System.Runtime.Intrinsics.Vector128 left, System.Runtime.Intrinsics.Vector128 right) { throw null; } @@ -12344,60 +10709,33 @@ internal Sse2() { } public static ushort Extract(System.Runtime.Intrinsics.Vector128 value, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute] byte index) { throw null; } public static System.Runtime.Intrinsics.Vector128 Insert(System.Runtime.Intrinsics.Vector128 value, short data, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute] byte index) { throw null; } public static System.Runtime.Intrinsics.Vector128 Insert(System.Runtime.Intrinsics.Vector128 value, ushort data, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute] byte index) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 LoadAlignedVector128(byte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 LoadAlignedVector128(double* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 LoadAlignedVector128(short* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 LoadAlignedVector128(int* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 LoadAlignedVector128(long* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 LoadAlignedVector128(sbyte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 LoadAlignedVector128(ushort* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 LoadAlignedVector128(uint* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 LoadAlignedVector128(ulong* address) { throw null; } public static void LoadFence() { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 LoadHigh(System.Runtime.Intrinsics.Vector128 lower, double* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 LoadLow(System.Runtime.Intrinsics.Vector128 upper, double* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 LoadScalarVector128(double* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 LoadScalarVector128(int* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 LoadScalarVector128(long* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 LoadScalarVector128(uint* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 LoadScalarVector128(ulong* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 LoadVector128(byte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 LoadVector128(double* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 LoadVector128(short* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 LoadVector128(int* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 LoadVector128(long* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 LoadVector128(sbyte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 LoadVector128(ushort* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 LoadVector128(uint* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 LoadVector128(ulong* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void MaskMove(System.Runtime.Intrinsics.Vector128 source, System.Runtime.Intrinsics.Vector128 mask, byte* address) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void MaskMove(System.Runtime.Intrinsics.Vector128 source, System.Runtime.Intrinsics.Vector128 mask, sbyte* address) { } public static System.Runtime.Intrinsics.Vector128 Max(System.Runtime.Intrinsics.Vector128 left, System.Runtime.Intrinsics.Vector128 right) { throw null; } public static System.Runtime.Intrinsics.Vector128 Max(System.Runtime.Intrinsics.Vector128 left, System.Runtime.Intrinsics.Vector128 right) { throw null; } @@ -12488,77 +10826,41 @@ public static void MemoryFence() { } public static System.Runtime.Intrinsics.Vector128 Sqrt(System.Runtime.Intrinsics.Vector128 value) { throw null; } public static System.Runtime.Intrinsics.Vector128 SqrtScalar(System.Runtime.Intrinsics.Vector128 value) { throw null; } public static System.Runtime.Intrinsics.Vector128 SqrtScalar(System.Runtime.Intrinsics.Vector128 upper, System.Runtime.Intrinsics.Vector128 value) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Store(byte* address, System.Runtime.Intrinsics.Vector128 source) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Store(double* address, System.Runtime.Intrinsics.Vector128 source) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Store(short* address, System.Runtime.Intrinsics.Vector128 source) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Store(int* address, System.Runtime.Intrinsics.Vector128 source) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Store(long* address, System.Runtime.Intrinsics.Vector128 source) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Store(sbyte* address, System.Runtime.Intrinsics.Vector128 source) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Store(ushort* address, System.Runtime.Intrinsics.Vector128 source) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Store(uint* address, System.Runtime.Intrinsics.Vector128 source) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Store(ulong* address, System.Runtime.Intrinsics.Vector128 source) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreAligned(byte* address, System.Runtime.Intrinsics.Vector128 source) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreAligned(double* address, System.Runtime.Intrinsics.Vector128 source) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreAligned(short* address, System.Runtime.Intrinsics.Vector128 source) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreAligned(int* address, System.Runtime.Intrinsics.Vector128 source) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreAligned(long* address, System.Runtime.Intrinsics.Vector128 source) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreAligned(sbyte* address, System.Runtime.Intrinsics.Vector128 source) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreAligned(ushort* address, System.Runtime.Intrinsics.Vector128 source) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreAligned(uint* address, System.Runtime.Intrinsics.Vector128 source) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreAligned(ulong* address, System.Runtime.Intrinsics.Vector128 source) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreAlignedNonTemporal(byte* address, System.Runtime.Intrinsics.Vector128 source) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreAlignedNonTemporal(double* address, System.Runtime.Intrinsics.Vector128 source) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreAlignedNonTemporal(short* address, System.Runtime.Intrinsics.Vector128 source) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreAlignedNonTemporal(int* address, System.Runtime.Intrinsics.Vector128 source) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreAlignedNonTemporal(long* address, System.Runtime.Intrinsics.Vector128 source) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreAlignedNonTemporal(sbyte* address, System.Runtime.Intrinsics.Vector128 source) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreAlignedNonTemporal(ushort* address, System.Runtime.Intrinsics.Vector128 source) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreAlignedNonTemporal(uint* address, System.Runtime.Intrinsics.Vector128 source) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreAlignedNonTemporal(ulong* address, System.Runtime.Intrinsics.Vector128 source) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreHigh(double* address, System.Runtime.Intrinsics.Vector128 source) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreLow(double* address, System.Runtime.Intrinsics.Vector128 source) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreNonTemporal(int* address, int value) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreNonTemporal(uint* address, uint value) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreScalar(double* address, System.Runtime.Intrinsics.Vector128 source) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreScalar(int* address, System.Runtime.Intrinsics.Vector128 source) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreScalar(long* address, System.Runtime.Intrinsics.Vector128 source) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreScalar(uint* address, System.Runtime.Intrinsics.Vector128 source) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreScalar(ulong* address, System.Runtime.Intrinsics.Vector128 source) { } public static System.Runtime.Intrinsics.Vector128 Subtract(System.Runtime.Intrinsics.Vector128 left, System.Runtime.Intrinsics.Vector128 right) { throw null; } public static System.Runtime.Intrinsics.Vector128 Subtract(System.Runtime.Intrinsics.Vector128 left, System.Runtime.Intrinsics.Vector128 right) { throw null; } @@ -12613,9 +10915,7 @@ internal X64() { } public static long ConvertToInt64(System.Runtime.Intrinsics.Vector128 value) { throw null; } public static long ConvertToInt64WithTruncation(System.Runtime.Intrinsics.Vector128 value) { throw null; } public static ulong ConvertToUInt64(System.Runtime.Intrinsics.Vector128 value) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreNonTemporal(long* address, long value) { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreNonTemporal(ulong* address, ulong value) { } } } @@ -12630,23 +10930,14 @@ internal Sse3() { } public static System.Runtime.Intrinsics.Vector128 HorizontalAdd(System.Runtime.Intrinsics.Vector128 left, System.Runtime.Intrinsics.Vector128 right) { throw null; } public static System.Runtime.Intrinsics.Vector128 HorizontalSubtract(System.Runtime.Intrinsics.Vector128 left, System.Runtime.Intrinsics.Vector128 right) { throw null; } public static System.Runtime.Intrinsics.Vector128 HorizontalSubtract(System.Runtime.Intrinsics.Vector128 left, System.Runtime.Intrinsics.Vector128 right) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 LoadAndDuplicateToVector128(double* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 LoadDquVector128(byte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 LoadDquVector128(short* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 LoadDquVector128(int* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 LoadDquVector128(long* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 LoadDquVector128(sbyte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 LoadDquVector128(ushort* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 LoadDquVector128(uint* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 LoadDquVector128(ulong* address) { throw null; } public static System.Runtime.Intrinsics.Vector128 MoveAndDuplicate(System.Runtime.Intrinsics.Vector128 source) { throw null; } public static System.Runtime.Intrinsics.Vector128 MoveHighAndDuplicate(System.Runtime.Intrinsics.Vector128 source) { throw null; } @@ -12684,29 +10975,20 @@ internal Sse41() { } public static System.Runtime.Intrinsics.Vector128 CeilingScalar(System.Runtime.Intrinsics.Vector128 upper, System.Runtime.Intrinsics.Vector128 value) { throw null; } public static System.Runtime.Intrinsics.Vector128 CompareEqual(System.Runtime.Intrinsics.Vector128 left, System.Runtime.Intrinsics.Vector128 right) { throw null; } public static System.Runtime.Intrinsics.Vector128 CompareEqual(System.Runtime.Intrinsics.Vector128 left, System.Runtime.Intrinsics.Vector128 right) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 ConvertToVector128Int16(byte* address) { throw null; } public static System.Runtime.Intrinsics.Vector128 ConvertToVector128Int16(System.Runtime.Intrinsics.Vector128 value) { throw null; } public static System.Runtime.Intrinsics.Vector128 ConvertToVector128Int16(System.Runtime.Intrinsics.Vector128 value) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 ConvertToVector128Int16(sbyte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 ConvertToVector128Int32(byte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 ConvertToVector128Int32(short* address) { throw null; } public static System.Runtime.Intrinsics.Vector128 ConvertToVector128Int32(System.Runtime.Intrinsics.Vector128 value) { throw null; } public static System.Runtime.Intrinsics.Vector128 ConvertToVector128Int32(System.Runtime.Intrinsics.Vector128 value) { throw null; } public static System.Runtime.Intrinsics.Vector128 ConvertToVector128Int32(System.Runtime.Intrinsics.Vector128 value) { throw null; } public static System.Runtime.Intrinsics.Vector128 ConvertToVector128Int32(System.Runtime.Intrinsics.Vector128 value) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 ConvertToVector128Int32(sbyte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 ConvertToVector128Int32(ushort* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 ConvertToVector128Int64(byte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 ConvertToVector128Int64(short* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 ConvertToVector128Int64(int* address) { throw null; } public static System.Runtime.Intrinsics.Vector128 ConvertToVector128Int64(System.Runtime.Intrinsics.Vector128 value) { throw null; } public static System.Runtime.Intrinsics.Vector128 ConvertToVector128Int64(System.Runtime.Intrinsics.Vector128 value) { throw null; } @@ -12714,11 +10996,8 @@ internal Sse41() { } public static System.Runtime.Intrinsics.Vector128 ConvertToVector128Int64(System.Runtime.Intrinsics.Vector128 value) { throw null; } public static System.Runtime.Intrinsics.Vector128 ConvertToVector128Int64(System.Runtime.Intrinsics.Vector128 value) { throw null; } public static System.Runtime.Intrinsics.Vector128 ConvertToVector128Int64(System.Runtime.Intrinsics.Vector128 value) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 ConvertToVector128Int64(sbyte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 ConvertToVector128Int64(ushort* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 ConvertToVector128Int64(uint* address) { throw null; } public static System.Runtime.Intrinsics.Vector128 DotProduct(System.Runtime.Intrinsics.Vector128 left, System.Runtime.Intrinsics.Vector128 right, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute] byte control) { throw null; } public static System.Runtime.Intrinsics.Vector128 DotProduct(System.Runtime.Intrinsics.Vector128 left, System.Runtime.Intrinsics.Vector128 right, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute] byte control) { throw null; } @@ -12737,21 +11016,13 @@ internal Sse41() { } public static System.Runtime.Intrinsics.Vector128 Insert(System.Runtime.Intrinsics.Vector128 value, sbyte data, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute] byte index) { throw null; } public static System.Runtime.Intrinsics.Vector128 Insert(System.Runtime.Intrinsics.Vector128 value, System.Runtime.Intrinsics.Vector128 data, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute] byte index) { throw null; } public static System.Runtime.Intrinsics.Vector128 Insert(System.Runtime.Intrinsics.Vector128 value, uint data, [System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute] byte index) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 LoadAlignedVector128NonTemporal(byte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 LoadAlignedVector128NonTemporal(short* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 LoadAlignedVector128NonTemporal(int* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 LoadAlignedVector128NonTemporal(long* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 LoadAlignedVector128NonTemporal(sbyte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 LoadAlignedVector128NonTemporal(ushort* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 LoadAlignedVector128NonTemporal(uint* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe System.Runtime.Intrinsics.Vector128 LoadAlignedVector128NonTemporal(ulong* address) { throw null; } public static System.Runtime.Intrinsics.Vector128 Max(System.Runtime.Intrinsics.Vector128 left, System.Runtime.Intrinsics.Vector128 right) { throw null; } public static System.Runtime.Intrinsics.Vector128 Max(System.Runtime.Intrinsics.Vector128 left, System.Runtime.Intrinsics.Vector128 right) { throw null; } @@ -13288,153 +11559,79 @@ public abstract partial class PackedSimd public static Vector128 CompareGreaterThanOrEqual(Vector128 left, Vector128 right) { throw null; } public static Vector128 CompareGreaterThanOrEqual(Vector128 left, Vector128 right) { throw null; } public static Vector128 CompareGreaterThanOrEqual(Vector128 left, Vector128 right) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe Vector128 LoadVector128(sbyte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe Vector128 LoadVector128(byte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe Vector128 LoadVector128(short* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe Vector128 LoadVector128(ushort* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe Vector128 LoadVector128(int* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe Vector128 LoadVector128(uint* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe Vector128 LoadVector128(long* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe Vector128 LoadVector128(ulong* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe Vector128 LoadVector128(float* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe Vector128 LoadVector128(double* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe Vector128 LoadVector128(nint* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe Vector128 LoadVector128(nuint* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe Vector128 LoadScalarVector128(int* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe Vector128 LoadScalarVector128(uint* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe Vector128 LoadScalarVector128(long* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe Vector128 LoadScalarVector128(ulong* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe Vector128 LoadScalarVector128(float* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe Vector128 LoadScalarVector128(double* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe Vector128 LoadScalarVector128(nint* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe Vector128 LoadScalarVector128(nuint* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe Vector128 LoadScalarAndSplatVector128(sbyte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe Vector128 LoadScalarAndSplatVector128(byte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe Vector128 LoadScalarAndSplatVector128(short* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe Vector128 LoadScalarAndSplatVector128(ushort* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe Vector128 LoadScalarAndSplatVector128(int* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe Vector128 LoadScalarAndSplatVector128(uint* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe Vector128 LoadScalarAndSplatVector128(long* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe Vector128 LoadScalarAndSplatVector128(ulong* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe Vector128 LoadScalarAndSplatVector128(float* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe Vector128 LoadScalarAndSplatVector128(double* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe Vector128 LoadScalarAndSplatVector128(nint* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe Vector128 LoadScalarAndSplatVector128(nuint* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe Vector128 LoadScalarAndInsert(sbyte* address, Vector128 vector, [ConstantExpected(Max = (byte)(15))] byte index) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe Vector128 LoadScalarAndInsert(byte* address, Vector128 vector, [ConstantExpected(Max = (byte)(15))] byte index) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe Vector128 LoadScalarAndInsert(short* address, Vector128 vector, [ConstantExpected(Max = (byte)(7))] byte index) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe Vector128 LoadScalarAndInsert(ushort* address, Vector128 vector, [ConstantExpected(Max = (byte)(7))] byte index) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe Vector128 LoadScalarAndInsert(int* address, Vector128 vector, [ConstantExpected(Max = (byte)(3))] byte index) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe Vector128 LoadScalarAndInsert(uint* address, Vector128 vector, [ConstantExpected(Max = (byte)(3))] byte index) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe Vector128 LoadScalarAndInsert(long* address, Vector128 vector, [ConstantExpected(Max = (byte)(1))] byte index) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe Vector128 LoadScalarAndInsert(ulong* address, Vector128 vector, [ConstantExpected(Max = (byte)(1))] byte index) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe Vector128 LoadScalarAndInsert(float* address, Vector128 vector, [ConstantExpected(Max = (byte)(3))] byte index) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe Vector128 LoadScalarAndInsert(double* address, Vector128 vector, [ConstantExpected(Max = (byte)(1))] byte index) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe Vector128 LoadScalarAndInsert(nint* address, Vector128 vector, [ConstantExpected(Max = (byte)(3))] byte index) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe Vector128 LoadScalarAndInsert(nuint* address, Vector128 vector, [ConstantExpected(Max = (byte)(3))] byte index) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe Vector128 LoadWideningVector128(sbyte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe Vector128 LoadWideningVector128(byte* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe Vector128 LoadWideningVector128(short* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe Vector128 LoadWideningVector128(ushort* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe Vector128 LoadWideningVector128(int* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe Vector128 LoadWideningVector128(uint* address) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Store(sbyte* address, Vector128 source) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Store(byte* address, Vector128 source) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Store(short* address, Vector128 source) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Store(ushort* address, Vector128 source) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Store(int* address, Vector128 source) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Store(uint* address, Vector128 source) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Store(long* address, Vector128 source) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Store(ulong* address, Vector128 source) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Store(float* address, Vector128 source) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Store(double* address, Vector128 source) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Store(nint* address, Vector128 source) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void Store(nuint* address, Vector128 source) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreSelectedScalar(sbyte* address, Vector128 source, [ConstantExpected(Max = (byte)(15))] byte index) { throw null; } // takes ImmLaneIdx16 - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreSelectedScalar(byte* address, Vector128 source, [ConstantExpected(Max = (byte)(15))] byte index) { throw null; } // takes ImmLaneIdx16 - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreSelectedScalar(short* address, Vector128 source, [ConstantExpected(Max = (byte)(7))] byte index) { throw null; } // takes ImmLaneIdx8 - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreSelectedScalar(ushort* address, Vector128 source, [ConstantExpected(Max = (byte)(7))] byte index) { throw null; } // takes ImmLaneIdx8 - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreSelectedScalar(int* address, Vector128 source, [ConstantExpected(Max = (byte)(3))] byte index) { throw null; } // takes ImmLaneIdx4 - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreSelectedScalar(uint* address, Vector128 source, [ConstantExpected(Max = (byte)(3))] byte index) { throw null; } // takes ImmLaneIdx4 - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreSelectedScalar(long* address, Vector128 source, [ConstantExpected(Max = (byte)(1))] byte index) { throw null; } // takes ImmLaneIdx2 - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreSelectedScalar(ulong* address, Vector128 source, [ConstantExpected(Max = (byte)(1))] byte index) { throw null; } // takes ImmLaneIdx2 - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreSelectedScalar(float* address, Vector128 source, [ConstantExpected(Max = (byte)(3))] byte index) { throw null; } // takes ImmLaneIdx4 - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreSelectedScalar(double* address, Vector128 source, [ConstantExpected(Max = (byte)(1))] byte index) { throw null; } // takes ImmLaneIdx2 - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreSelectedScalar(nint* address, Vector128 source, [ConstantExpected(Max = (byte)(3))] byte index) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe void StoreSelectedScalar(nuint* address, Vector128 source, [ConstantExpected(Max = (byte)(3))] byte index) { throw null; } public static Vector128 Negate(Vector128 value) { throw null; } public static Vector128 Negate(Vector128 value) { throw null; } diff --git a/src/libraries/System.Runtime.Loader/ref/System.Runtime.Loader.cs b/src/libraries/System.Runtime.Loader/ref/System.Runtime.Loader.cs index 772b6dad345900..8f7555ac5b599d 100644 --- a/src/libraries/System.Runtime.Loader/ref/System.Runtime.Loader.cs +++ b/src/libraries/System.Runtime.Loader/ref/System.Runtime.Loader.cs @@ -9,7 +9,6 @@ namespace System.Reflection.Metadata public static partial class AssemblyExtensions { [System.CLSCompliantAttribute(false)] - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public unsafe static bool TryGetRawMetadata(this System.Reflection.Assembly assembly, out byte* blob, out int length) { throw null; } } [System.AttributeUsageAttribute(System.AttributeTargets.Assembly, AllowMultiple=true)] diff --git a/src/libraries/System.Runtime/ref/System.Runtime.cs b/src/libraries/System.Runtime/ref/System.Runtime.cs index 8c517b088c4d76..e5cb2b3b05da45 100644 --- a/src/libraries/System.Runtime/ref/System.Runtime.cs +++ b/src/libraries/System.Runtime/ref/System.Runtime.cs @@ -419,7 +419,6 @@ public ref partial struct ArgIterator private int _dummyPrimitive; public ArgIterator(System.RuntimeArgumentHandle arglist) { throw null; } [System.CLSCompliantAttribute(false)] - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public unsafe ArgIterator(System.RuntimeArgumentHandle arglist, void* ptr) { throw null; } public void End() { } public override bool Equals(object? o) { throw null; } @@ -930,10 +929,8 @@ public static void BlockCopy(System.Array src, int srcOffset, System.Array dst, public static int ByteLength(System.Array array) { throw null; } public static byte GetByte(System.Array array, int index) { throw null; } [System.CLSCompliantAttribute(false)] - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public unsafe static void MemoryCopy(void* source, void* destination, long destinationSizeInBytes, long sourceBytesToCopy) { } [System.CLSCompliantAttribute(false)] - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public unsafe static void MemoryCopy(void* source, void* destination, ulong destinationSizeInBytes, ulong sourceBytesToCopy) { } public static void SetByte(System.Array array, int index, byte value) { } } @@ -5110,7 +5107,6 @@ public readonly ref partial struct ReadOnlySpan private readonly object _dummy; private readonly int _dummyPrimitive; [System.CLSCompliantAttribute(false)] - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public unsafe ReadOnlySpan(void* pointer, int length) { throw null; } public ReadOnlySpan(ref readonly T reference) { throw null; } public ReadOnlySpan(T[]? array) { throw null; } @@ -5574,7 +5570,6 @@ public readonly ref partial struct Span private readonly object _dummy; private readonly int _dummyPrimitive; [System.CLSCompliantAttribute(false)] - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public unsafe Span(void* pointer, int length) { throw null; } public Span(ref T reference) { throw null; } public Span(T[]? array) { throw null; } @@ -5632,23 +5627,18 @@ public sealed partial class String : System.Collections.Generic.IEnumerable value) { } [System.CLSCompliantAttribute(false)] - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public unsafe String(sbyte* value) { } [System.CLSCompliantAttribute(false)] - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public unsafe String(sbyte* value, int startIndex, int length) { } [System.CLSCompliantAttribute(false)] - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public unsafe String(sbyte* value, int startIndex, int length, System.Text.Encoding enc) { } [System.Runtime.CompilerServices.IndexerName("Chars")] public char this[int index] { get { throw null; } } @@ -11198,10 +11188,8 @@ public partial class UnmanagedMemoryStream : System.IO.Stream { protected UnmanagedMemoryStream() { } [System.CLSCompliantAttribute(false)] - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public unsafe UnmanagedMemoryStream(byte* pointer, long length) { } [System.CLSCompliantAttribute(false)] - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public unsafe UnmanagedMemoryStream(byte* pointer, long length, long capacity, System.IO.FileAccess access) { } public UnmanagedMemoryStream(System.Runtime.InteropServices.SafeBuffer buffer, long offset, long length) { } public UnmanagedMemoryStream(System.Runtime.InteropServices.SafeBuffer buffer, long offset, long length, System.IO.FileAccess access) { } @@ -11212,13 +11200,11 @@ public UnmanagedMemoryStream(System.Runtime.InteropServices.SafeBuffer buffer, l public override long Length { get { throw null; } } public override long Position { get { throw null; } set { } } [System.CLSCompliantAttribute(false)] - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public unsafe byte* PositionPointer { get { throw null; } set { } } protected override void Dispose(bool disposing) { } public override void Flush() { } public override System.Threading.Tasks.Task FlushAsync(System.Threading.CancellationToken cancellationToken) { throw null; } [System.CLSCompliantAttribute(false)] - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] protected unsafe void Initialize(byte* pointer, long length, long capacity, System.IO.FileAccess access) { } protected void Initialize(System.Runtime.InteropServices.SafeBuffer buffer, long offset, long length, System.IO.FileAccess access) { } public override int Read(byte[] buffer, int offset, int count) { throw null; } @@ -14402,7 +14388,6 @@ public static partial class Unsafe [System.CLSCompliantAttribute(false)] public unsafe static void* AsPointer(ref readonly T value) where T : allows ref struct { throw null; } [System.CLSCompliantAttribute(false)] - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public unsafe static ref T AsRef(void* source) where T : allows ref struct { throw null; } public static ref T AsRef(scoped ref readonly T source) where T : allows ref struct { throw null; } [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNullAttribute("o")] @@ -14413,28 +14398,22 @@ public static partial class Unsafe [System.CLSCompliantAttribute(false)] public static void CopyBlock(ref byte destination, ref readonly byte source, uint byteCount) { } [System.CLSCompliantAttribute(false)] - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public unsafe static void CopyBlock(void* destination, void* source, uint byteCount) { } [System.CLSCompliantAttribute(false)] public static void CopyBlockUnaligned(ref byte destination, ref readonly byte source, uint byteCount) { } [System.CLSCompliantAttribute(false)] - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public unsafe static void CopyBlockUnaligned(void* destination, void* source, uint byteCount) { } [System.CLSCompliantAttribute(false)] - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public unsafe static void Copy(void* destination, ref readonly T source) where T : allows ref struct { } [System.CLSCompliantAttribute(false)] - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public unsafe static void Copy(ref T destination, void* source) where T : allows ref struct { } [System.CLSCompliantAttribute(false)] public static void InitBlock(ref byte startAddress, byte value, uint byteCount) { } [System.CLSCompliantAttribute(false)] - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public unsafe static void InitBlock(void* startAddress, byte value, uint byteCount) { } [System.CLSCompliantAttribute(false)] public static void InitBlockUnaligned(ref byte startAddress, byte value, uint byteCount) { } [System.CLSCompliantAttribute(false)] - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public unsafe static void InitBlockUnaligned(void* startAddress, byte value, uint byteCount) { } public static bool IsAddressGreaterThan([System.Diagnostics.CodeAnalysis.AllowNull] ref readonly T left, [System.Diagnostics.CodeAnalysis.AllowNull] ref readonly T right) where T : allows ref struct { throw null; } public static bool IsAddressGreaterThanOrEqualTo([System.Diagnostics.CodeAnalysis.AllowNull] ref readonly T left, [System.Diagnostics.CodeAnalysis.AllowNull] ref readonly T right) where T : allows ref struct { throw null; } @@ -14444,10 +14423,8 @@ public unsafe static void InitBlockUnaligned(void* startAddress, byte value, uin public static ref T NullRef() where T : allows ref struct { throw null; } public static T ReadUnaligned(scoped ref readonly byte source) where T : allows ref struct { throw null; } [System.CLSCompliantAttribute(false)] - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public unsafe static T ReadUnaligned(void* source) where T : allows ref struct { throw null; } [System.CLSCompliantAttribute(false)] - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public unsafe static T Read(void* source) where T : allows ref struct { throw null; } public static int SizeOf() where T : allows ref struct { throw null; } public static void SkipInit(out T value) where T : allows ref struct { throw null; } @@ -14463,10 +14440,8 @@ public unsafe static void InitBlockUnaligned(void* startAddress, byte value, uin public static ref T Unbox(object box) where T : struct { throw null; } public static void WriteUnaligned(ref byte destination, T value) where T : allows ref struct { } [System.CLSCompliantAttribute(false)] - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public unsafe static void WriteUnaligned(void* destination, T value) where T : allows ref struct { } [System.CLSCompliantAttribute(false)] - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public unsafe static void Write(void* destination, T value) where T : allows ref struct { } } [System.AttributeUsageAttribute(System.AttributeTargets.Method, AllowMultiple=false, Inherited=false)] @@ -14704,14 +14679,12 @@ public GCHandle(T target) { } public static class GCHandleExtensions { [System.CLSCompliantAttribute(false)] - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public static unsafe T* GetAddressOfArrayData( #nullable disable this System.Runtime.InteropServices.PinnedGCHandle handle) #nullable restore { throw null; } [System.CLSCompliantAttribute(false)] - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] #nullable disable public static unsafe char* GetAddressOfStringData( #nullable disable @@ -14752,10 +14725,8 @@ public static partial class MemoryMarshal public static System.Span Cast(System.Span span) where TFrom : struct where TTo : struct { throw null; } public static System.Memory CreateFromPinnedArray(T[]? array, int start, int length) { throw null; } [System.CLSCompliantAttribute(false)] - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public unsafe static System.ReadOnlySpan CreateReadOnlySpanFromNullTerminated(byte* value) { throw null; } [System.CLSCompliantAttribute(false)] - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public unsafe static System.ReadOnlySpan CreateReadOnlySpanFromNullTerminated(char* value) { throw null; } public static System.ReadOnlySpan CreateReadOnlySpan(scoped ref readonly T reference, int length) { throw null; } public static System.Span CreateSpan(scoped ref T reference, int length) { throw null; } @@ -15001,7 +14972,6 @@ public void FromManaged(System.ReadOnlySpan managed, System.Span managed) { throw null; } public System.Span GetUnmanagedValuesDestination() { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public unsafe TUnmanagedElement* ToUnmanaged() { throw null; } } public partial struct ManagedToUnmanagedOut @@ -15009,7 +14979,6 @@ public partial struct ManagedToUnmanagedOut private object _dummy; private int _dummyPrimitive; public void Free() { } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public unsafe void FromUnmanaged(TUnmanagedElement* unmanaged) { } public System.Span GetManagedValuesDestination(int numElements) { throw null; } public System.ReadOnlySpan GetUnmanagedValuesSource(int numElements) { throw null; } @@ -15017,10 +14986,8 @@ public unsafe void FromUnmanaged(TUnmanagedElement* unmanaged) { } } public static partial class UnmanagedToManagedOut { - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public unsafe static TUnmanagedElement* AllocateContainerForUnmanagedElements(System.ReadOnlySpan managed, out int numElements) { throw null; } public static System.ReadOnlySpan GetManagedValuesSource(System.ReadOnlySpan managed) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public unsafe static System.Span GetUnmanagedValuesDestination(TUnmanagedElement* unmanaged, int numElements) { throw null; } } } @@ -15065,16 +15032,12 @@ public void OnInvoked() { } [System.Runtime.InteropServices.Marshalling.CustomMarshallerAttribute(typeof(System.Span<>), System.Runtime.InteropServices.Marshalling.MarshalMode.ManagedToUnmanagedIn, typeof(System.Runtime.InteropServices.Marshalling.SpanMarshaller<,>.ManagedToUnmanagedIn))] public static partial class SpanMarshaller where TUnmanagedElement : unmanaged { - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public unsafe static System.Span AllocateContainerForManagedElements(TUnmanagedElement* unmanaged, int numElements) { throw null; } public unsafe static TUnmanagedElement* AllocateContainerForUnmanagedElements(System.Span managed, out int numElements) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public unsafe static void Free(TUnmanagedElement* unmanaged) { } public static System.Span GetManagedValuesDestination(System.Span managed) { throw null; } public static System.ReadOnlySpan GetManagedValuesSource(System.Span managed) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public unsafe static System.Span GetUnmanagedValuesDestination(TUnmanagedElement* unmanaged, int numElements) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public unsafe static System.ReadOnlySpan GetUnmanagedValuesSource(TUnmanagedElement* unmanaged, int numElements) { throw null; } public ref partial struct ManagedToUnmanagedIn { @@ -15087,7 +15050,6 @@ public void FromManaged(System.Span managed, System.Span b public ref TUnmanagedElement GetPinnableReference() { throw null; } public static ref T GetPinnableReference(System.Span managed) { throw null; } public System.Span GetUnmanagedValuesDestination() { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public unsafe TUnmanagedElement* ToUnmanaged() { throw null; } } } @@ -15801,18 +15763,15 @@ protected Decoder() { } public System.Text.DecoderFallback? Fallback { get { throw null; } set { } } public System.Text.DecoderFallbackBuffer FallbackBuffer { get { throw null; } } [System.CLSCompliantAttribute(false)] - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public unsafe virtual void Convert(byte* bytes, int byteCount, char* chars, int charCount, bool flush, out int bytesUsed, out int charsUsed, out bool completed) { throw null; } public virtual void Convert(byte[] bytes, int byteIndex, int byteCount, char[] chars, int charIndex, int charCount, bool flush, out int bytesUsed, out int charsUsed, out bool completed) { throw null; } public virtual void Convert(System.ReadOnlySpan bytes, System.Span chars, bool flush, out int bytesUsed, out int charsUsed, out bool completed) { throw null; } [System.CLSCompliantAttribute(false)] - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public unsafe virtual int GetCharCount(byte* bytes, int count, bool flush) { throw null; } public abstract int GetCharCount(byte[] bytes, int index, int count); public virtual int GetCharCount(byte[] bytes, int index, int count, bool flush) { throw null; } public virtual int GetCharCount(System.ReadOnlySpan bytes, bool flush) { throw null; } [System.CLSCompliantAttribute(false)] - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public unsafe virtual int GetChars(byte* bytes, int byteCount, char* chars, int charCount, bool flush) { throw null; } public abstract int GetChars(byte[] bytes, int byteIndex, int byteCount, char[] chars, int charIndex); public virtual int GetChars(byte[] bytes, int byteIndex, int byteCount, char[] chars, int charIndex, bool flush) { throw null; } @@ -15886,17 +15845,14 @@ protected Encoder() { } public System.Text.EncoderFallback? Fallback { get { throw null; } set { } } public System.Text.EncoderFallbackBuffer FallbackBuffer { get { throw null; } } [System.CLSCompliantAttribute(false)] - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public unsafe virtual void Convert(char* chars, int charCount, byte* bytes, int byteCount, bool flush, out int charsUsed, out int bytesUsed, out bool completed) { throw null; } public virtual void Convert(char[] chars, int charIndex, int charCount, byte[] bytes, int byteIndex, int byteCount, bool flush, out int charsUsed, out int bytesUsed, out bool completed) { throw null; } public virtual void Convert(System.ReadOnlySpan chars, System.Span bytes, bool flush, out int charsUsed, out int bytesUsed, out bool completed) { throw null; } [System.CLSCompliantAttribute(false)] - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public unsafe virtual int GetByteCount(char* chars, int count, bool flush) { throw null; } public abstract int GetByteCount(char[] chars, int index, int count, bool flush); public virtual int GetByteCount(System.ReadOnlySpan chars, bool flush) { throw null; } [System.CLSCompliantAttribute(false)] - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public unsafe virtual int GetBytes(char* chars, int charCount, byte* bytes, int byteCount, bool flush) { throw null; } public abstract int GetBytes(char[] chars, int charIndex, int charCount, byte[] bytes, int byteIndex, bool flush); public virtual int GetBytes(System.ReadOnlySpan chars, System.Span bytes, bool flush) { throw null; } @@ -16003,7 +15959,6 @@ protected Encoding(int codePage, System.Text.EncoderFallback? encoderFallback, S public static System.IO.Stream CreateTranscodingStream(System.IO.Stream innerStream, System.Text.Encoding innerStreamEncoding, System.Text.Encoding outerStreamEncoding, bool leaveOpen = false) { throw null; } public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? value) { throw null; } [System.CLSCompliantAttribute(false)] - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public unsafe virtual int GetByteCount(char* chars, int count) { throw null; } public virtual int GetByteCount(char[] chars) { throw null; } public abstract int GetByteCount(char[] chars, int index, int count); @@ -16011,7 +15966,6 @@ protected Encoding(int codePage, System.Text.EncoderFallback? encoderFallback, S public virtual int GetByteCount(string s) { throw null; } public int GetByteCount(string s, int index, int count) { throw null; } [System.CLSCompliantAttribute(false)] - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public unsafe virtual int GetBytes(char* chars, int charCount, byte* bytes, int byteCount) { throw null; } public virtual byte[] GetBytes(char[] chars) { throw null; } public virtual byte[] GetBytes(char[] chars, int index, int count) { throw null; } @@ -16021,13 +15975,11 @@ protected Encoding(int codePage, System.Text.EncoderFallback? encoderFallback, S public byte[] GetBytes(string s, int index, int count) { throw null; } public virtual int GetBytes(string s, int charIndex, int charCount, byte[] bytes, int byteIndex) { throw null; } [System.CLSCompliantAttribute(false)] - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public unsafe virtual int GetCharCount(byte* bytes, int count) { throw null; } public virtual int GetCharCount(byte[] bytes) { throw null; } public abstract int GetCharCount(byte[] bytes, int index, int count); public virtual int GetCharCount(System.ReadOnlySpan bytes) { throw null; } [System.CLSCompliantAttribute(false)] - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public unsafe virtual int GetChars(byte* bytes, int byteCount, char* chars, int charCount) { throw null; } public virtual char[] GetChars(byte[] bytes) { throw null; } public virtual char[] GetChars(byte[] bytes, int index, int count) { throw null; } @@ -16045,7 +15997,6 @@ protected Encoding(int codePage, System.Text.EncoderFallback? encoderFallback, S public abstract int GetMaxCharCount(int byteCount); public virtual byte[] GetPreamble() { throw null; } [System.CLSCompliantAttribute(false)] - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public unsafe string GetString(byte* bytes, int byteCount) { throw null; } public virtual string GetString(byte[] bytes) { throw null; } public virtual string GetString(byte[] bytes, int index, int count) { throw null; } @@ -16217,7 +16168,6 @@ public StringBuilder(string? value, int startIndex, int length, int capacity) { public System.Text.StringBuilder Append(char value) { throw null; } public System.Text.StringBuilder Append(System.Text.Rune value) { throw null; } [System.CLSCompliantAttribute(false)] - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public unsafe System.Text.StringBuilder Append(char* value, int valueCount) { throw null; } public System.Text.StringBuilder Append(char value, int repeatCount) { throw null; } public System.Text.StringBuilder Append(char[]? value) { throw null; } diff --git a/src/libraries/System.Text.Encoding.Extensions/ref/System.Text.Encoding.Extensions.cs b/src/libraries/System.Text.Encoding.Extensions/ref/System.Text.Encoding.Extensions.cs index e2fd49aa05d537..0c9b8230911fe9 100644 --- a/src/libraries/System.Text.Encoding.Extensions/ref/System.Text.Encoding.Extensions.cs +++ b/src/libraries/System.Text.Encoding.Extensions/ref/System.Text.Encoding.Extensions.cs @@ -11,24 +11,20 @@ public partial class ASCIIEncoding : System.Text.Encoding public ASCIIEncoding() { } public override bool IsSingleByte { get { throw null; } } [System.CLSCompliantAttribute(false)] - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public unsafe override int GetByteCount(char* chars, int count) { throw null; } public override int GetByteCount(char[] chars, int index, int count) { throw null; } public override int GetByteCount(System.ReadOnlySpan chars) { throw null; } public override int GetByteCount(string chars) { throw null; } [System.CLSCompliantAttribute(false)] - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public unsafe override int GetBytes(char* chars, int charCount, byte* bytes, int byteCount) { throw null; } public override int GetBytes(char[] chars, int charIndex, int charCount, byte[] bytes, int byteIndex) { throw null; } public override int GetBytes(System.ReadOnlySpan chars, System.Span bytes) { throw null; } public override int GetBytes(string chars, int charIndex, int charCount, byte[] bytes, int byteIndex) { throw null; } [System.CLSCompliantAttribute(false)] - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public unsafe override int GetCharCount(byte* bytes, int count) { throw null; } public override int GetCharCount(byte[] bytes, int index, int count) { throw null; } public override int GetCharCount(System.ReadOnlySpan bytes) { throw null; } [System.CLSCompliantAttribute(false)] - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public unsafe override int GetChars(byte* bytes, int byteCount, char* chars, int charCount) { throw null; } public override int GetChars(byte[] bytes, int byteIndex, int byteCount, char[] chars, int charIndex) { throw null; } public override int GetChars(System.ReadOnlySpan bytes, System.Span chars) { throw null; } @@ -49,21 +45,17 @@ public UnicodeEncoding(bool bigEndian, bool byteOrderMark, bool throwOnInvalidBy public override System.ReadOnlySpan Preamble { get { throw null; } } public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? value) { throw null; } [System.CLSCompliantAttribute(false)] - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public unsafe override int GetByteCount(char* chars, int count) { throw null; } public override int GetByteCount(char[] chars, int index, int count) { throw null; } public override int GetByteCount(string s) { throw null; } [System.CLSCompliantAttribute(false)] - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public unsafe override int GetBytes(char* chars, int charCount, byte* bytes, int byteCount) { throw null; } public override int GetBytes(char[] chars, int charIndex, int charCount, byte[] bytes, int byteIndex) { throw null; } public override int GetBytes(string s, int charIndex, int charCount, byte[] bytes, int byteIndex) { throw null; } [System.CLSCompliantAttribute(false)] - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public unsafe override int GetCharCount(byte* bytes, int count) { throw null; } public override int GetCharCount(byte[] bytes, int index, int count) { throw null; } [System.CLSCompliantAttribute(false)] - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public unsafe override int GetChars(byte* bytes, int byteCount, char* chars, int charCount) { throw null; } public override int GetChars(byte[] bytes, int byteIndex, int byteCount, char[] chars, int charIndex) { throw null; } public override System.Text.Decoder GetDecoder() { throw null; } @@ -82,21 +74,17 @@ public UTF32Encoding(bool bigEndian, bool byteOrderMark, bool throwOnInvalidChar public override System.ReadOnlySpan Preamble { get { throw null; } } public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? value) { throw null; } [System.CLSCompliantAttribute(false)] - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public unsafe override int GetByteCount(char* chars, int count) { throw null; } public override int GetByteCount(char[] chars, int index, int count) { throw null; } public override int GetByteCount(string s) { throw null; } [System.CLSCompliantAttribute(false)] - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public unsafe override int GetBytes(char* chars, int charCount, byte* bytes, int byteCount) { throw null; } public override int GetBytes(char[] chars, int charIndex, int charCount, byte[] bytes, int byteIndex) { throw null; } public override int GetBytes(string s, int charIndex, int charCount, byte[] bytes, int byteIndex) { throw null; } [System.CLSCompliantAttribute(false)] - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public unsafe override int GetCharCount(byte* bytes, int count) { throw null; } public override int GetCharCount(byte[] bytes, int index, int count) { throw null; } [System.CLSCompliantAttribute(false)] - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public unsafe override int GetChars(byte* bytes, int byteCount, char* chars, int charCount) { throw null; } public override int GetChars(byte[] bytes, int byteIndex, int byteCount, char[] chars, int charIndex) { throw null; } public override System.Text.Decoder GetDecoder() { throw null; } @@ -115,21 +103,17 @@ public UTF7Encoding() { } public UTF7Encoding(bool allowOptionals) { } public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? value) { throw null; } [System.CLSCompliantAttribute(false)] - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public unsafe override int GetByteCount(char* chars, int count) { throw null; } public override int GetByteCount(char[] chars, int index, int count) { throw null; } public override int GetByteCount(string s) { throw null; } [System.CLSCompliantAttribute(false)] - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public unsafe override int GetBytes(char* chars, int charCount, byte* bytes, int byteCount) { throw null; } public override int GetBytes(char[] chars, int charIndex, int charCount, byte[] bytes, int byteIndex) { throw null; } public override int GetBytes(string s, int charIndex, int charCount, byte[] bytes, int byteIndex) { throw null; } [System.CLSCompliantAttribute(false)] - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public unsafe override int GetCharCount(byte* bytes, int count) { throw null; } public override int GetCharCount(byte[] bytes, int index, int count) { throw null; } [System.CLSCompliantAttribute(false)] - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public unsafe override int GetChars(byte* bytes, int byteCount, char* chars, int charCount) { throw null; } public override int GetChars(byte[] bytes, int byteIndex, int byteCount, char[] chars, int charIndex) { throw null; } public override System.Text.Decoder GetDecoder() { throw null; } @@ -147,24 +131,20 @@ public UTF8Encoding(bool encoderShouldEmitUTF8Identifier, bool throwOnInvalidByt public override System.ReadOnlySpan Preamble { get { throw null; } } public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? value) { throw null; } [System.CLSCompliantAttribute(false)] - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public unsafe override int GetByteCount(char* chars, int count) { throw null; } public override int GetByteCount(char[] chars, int index, int count) { throw null; } public override int GetByteCount(System.ReadOnlySpan chars) { throw null; } public override int GetByteCount(string chars) { throw null; } [System.CLSCompliantAttribute(false)] - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public unsafe override int GetBytes(char* chars, int charCount, byte* bytes, int byteCount) { throw null; } public override int GetBytes(char[] chars, int charIndex, int charCount, byte[] bytes, int byteIndex) { throw null; } public override int GetBytes(System.ReadOnlySpan chars, System.Span bytes) { throw null; } public override int GetBytes(string s, int charIndex, int charCount, byte[] bytes, int byteIndex) { throw null; } [System.CLSCompliantAttribute(false)] - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public unsafe override int GetCharCount(byte* bytes, int count) { throw null; } public override int GetCharCount(byte[] bytes, int index, int count) { throw null; } public override int GetCharCount(System.ReadOnlySpan bytes) { throw null; } [System.CLSCompliantAttribute(false)] - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public unsafe override int GetChars(byte* bytes, int byteCount, char* chars, int charCount) { throw null; } public override int GetChars(byte[] bytes, int byteIndex, int byteCount, char[] chars, int charIndex) { throw null; } public override int GetChars(System.ReadOnlySpan bytes, System.Span chars) { throw null; } diff --git a/src/libraries/System.Threading.Overlapped/ref/System.Threading.Overlapped.cs b/src/libraries/System.Threading.Overlapped/ref/System.Threading.Overlapped.cs index a721243da51948..d4bc6823da8a10 100644 --- a/src/libraries/System.Threading.Overlapped/ref/System.Threading.Overlapped.cs +++ b/src/libraries/System.Threading.Overlapped/ref/System.Threading.Overlapped.cs @@ -29,7 +29,6 @@ public Overlapped(int offsetLo, int offsetHi, System.IntPtr hEvent, System.IAsyn public int OffsetHigh { get { throw null; } set { } } public int OffsetLow { get { throw null; } set { } } [System.CLSCompliantAttribute(false)] - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public unsafe static void Free(System.Threading.NativeOverlapped* nativeOverlappedPtr) { } [System.CLSCompliantAttribute(false)] [System.ObsoleteAttribute("This overload is not safe and has been deprecated. Use Pack(IOCompletionCallback?, object?) instead.")] @@ -37,7 +36,6 @@ public unsafe static void Free(System.Threading.NativeOverlapped* nativeOverlapp [System.CLSCompliantAttribute(false)] public unsafe System.Threading.NativeOverlapped* Pack(System.Threading.IOCompletionCallback? iocb, object? userData) { throw null; } [System.CLSCompliantAttribute(false)] - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public unsafe static System.Threading.Overlapped Unpack(System.Threading.NativeOverlapped* nativeOverlappedPtr) { throw null; } [System.CLSCompliantAttribute(false)] [System.ObsoleteAttribute("This overload is not safe and has been deprecated. Use UnsafePack(IOCompletionCallback?, object?) instead.")] diff --git a/src/libraries/System.Threading.ThreadPool/ref/System.Threading.ThreadPool.cs b/src/libraries/System.Threading.ThreadPool/ref/System.Threading.ThreadPool.cs index 47a420019ca6ef..5ff1eb3924e8e0 100644 --- a/src/libraries/System.Threading.ThreadPool/ref/System.Threading.ThreadPool.cs +++ b/src/libraries/System.Threading.ThreadPool/ref/System.Threading.ThreadPool.cs @@ -55,7 +55,6 @@ public static partial class ThreadPool public static bool SetMinThreads(int workerThreads, int completionPortThreads) { throw null; } [System.CLSCompliantAttribute(false)] [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")] - [System.Diagnostics.CodeAnalysis.RequiresUnsafeAttribute] public unsafe static bool UnsafeQueueNativeOverlapped(System.Threading.NativeOverlapped* overlapped) { throw null; } public static bool UnsafeQueueUserWorkItem(System.Threading.IThreadPoolWorkItem callBack, bool preferLocal) { throw null; } public static bool UnsafeQueueUserWorkItem(System.Threading.WaitCallback callBack, object? state) { throw null; } diff --git a/src/mono/System.Private.CoreLib/src/System/ArgIterator.cs b/src/mono/System.Private.CoreLib/src/System/ArgIterator.cs index f90875d6f1d6cc..71c1e2772dfa78 100644 --- a/src/mono/System.Private.CoreLib/src/System/ArgIterator.cs +++ b/src/mono/System.Private.CoreLib/src/System/ArgIterator.cs @@ -31,7 +31,6 @@ public ArgIterator(RuntimeArgumentHandle arglist) } [CLSCompliant(false)] - [RequiresUnsafe] public unsafe ArgIterator(RuntimeArgumentHandle arglist, void* ptr) { sig = IntPtr.Zero; diff --git a/src/mono/System.Private.CoreLib/src/System/Reflection/Emit/DynamicILInfo.cs b/src/mono/System.Private.CoreLib/src/System/Reflection/Emit/DynamicILInfo.cs index 8fa8a839c0ec5a..d256e89f0fbd0d 100644 --- a/src/mono/System.Private.CoreLib/src/System/Reflection/Emit/DynamicILInfo.cs +++ b/src/mono/System.Private.CoreLib/src/System/Reflection/Emit/DynamicILInfo.cs @@ -110,7 +110,6 @@ public void SetCode(byte[]? code, int maxStackSize) } [CLSCompliantAttribute(false)] - [RequiresUnsafe] public unsafe void SetCode(byte* code, int codeSize, int maxStackSize) { ArgumentOutOfRangeException.ThrowIfNegative(codeSize); @@ -128,7 +127,6 @@ public void SetExceptions(byte[]? exceptions) // FIXME: [CLSCompliantAttribute(false)] - [RequiresUnsafe] public unsafe void SetExceptions(byte* exceptions, int exceptionsSize) { throw new NotImplementedException(); @@ -141,7 +139,6 @@ public void SetLocalSignature(byte[]? localSignature) } [CLSCompliantAttribute(false)] - [RequiresUnsafe] public unsafe void SetLocalSignature(byte* localSignature, int signatureSize) { byte[] b = new byte[signatureSize]; diff --git a/src/mono/System.Private.CoreLib/src/System/Reflection/Metadata/AssemblyExtensions.cs b/src/mono/System.Private.CoreLib/src/System/Reflection/Metadata/AssemblyExtensions.cs index 5bdcf5baa14d22..508ad151fdb14e 100644 --- a/src/mono/System.Private.CoreLib/src/System/Reflection/Metadata/AssemblyExtensions.cs +++ b/src/mono/System.Private.CoreLib/src/System/Reflection/Metadata/AssemblyExtensions.cs @@ -9,7 +9,6 @@ namespace System.Reflection.Metadata public static class AssemblyExtensions { [CLSCompliant(false)] - [RequiresUnsafe] public static unsafe bool TryGetRawMetadata(this Assembly assembly, out byte* blob, out int length) { ArgumentNullException.ThrowIfNull(assembly); From 92fa3866d1506519fc57f1d4640f23a7a71212f0 Mon Sep 17 00:00:00 2001 From: Milos Kotlar Date: Tue, 5 May 2026 21:08:35 +0200 Subject: [PATCH 006/109] [mobile] Skip NonRandomizedToRandomizedUpgrade on aggressive trimming (#127790) Workaround for #81945 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../ConcurrentDictionary/ConcurrentDictionary.Generic.Tests.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/libraries/System.Collections.Concurrent/tests/ConcurrentDictionary/ConcurrentDictionary.Generic.Tests.cs b/src/libraries/System.Collections.Concurrent/tests/ConcurrentDictionary/ConcurrentDictionary.Generic.Tests.cs index fcb69130195742..98f79b5aaf848b 100644 --- a/src/libraries/System.Collections.Concurrent/tests/ConcurrentDictionary/ConcurrentDictionary.Generic.Tests.cs +++ b/src/libraries/System.Collections.Concurrent/tests/ConcurrentDictionary/ConcurrentDictionary.Generic.Tests.cs @@ -47,6 +47,7 @@ protected override string CreateTKey(int seed) [Theory] [InlineData(false)] [InlineData(true)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/81945", typeof(PlatformDetection), nameof(PlatformDetection.IsBuiltWithAggressiveTrimming))] public void NonRandomizedToRandomizedUpgrade_FunctionsCorrectly(bool ignoreCase) { List strings = GenerateCollidingStrings(110); // higher than the collisions threshold From 9bca25de3d724638d4846088411c4a5fe85c66f7 Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Tue, 5 May 2026 12:20:57 -0700 Subject: [PATCH 007/109] [cDAC] Implement cDAC `TraverseVirtCallStubHeap` (#127296) Adding `TraverseVirtCallStubHeap` SOS API, using the same `TraverseLoaderHeapCore` loader heap traversal structure added for the `TraverseLoaderHeap` APIs. --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: rcj1 <77995559+rcj1@users.noreply.github.com> Co-authored-by: max-charlamb <44248479+max-charlamb@users.noreply.github.com> Co-authored-by: rcj1 --- .../ISOSDacInterface.cs | 12 +- .../SOSDacImpl.cs | 64 ++++++- src/native/managed/cdac/tests/LoaderTests.cs | 171 ++++++++++++++++++ 3 files changed, 238 insertions(+), 9 deletions(-) diff --git a/src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Legacy/ISOSDacInterface.cs b/src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Legacy/ISOSDacInterface.cs index 120ca75b6c328e..06c887b7ffd89b 100644 --- a/src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Legacy/ISOSDacInterface.cs +++ b/src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Legacy/ISOSDacInterface.cs @@ -635,6 +635,16 @@ public struct DacpRCWData public Interop.BOOL isDisconnected; } +public enum VCSHeapType : int +{ + IndcellHeap = 0, + LookupHeap = 1, + ResolveHeap = 2, + DispatchHeap = 3, + CacheEntryHeap = 4, + VtableHeap = 5 +} + [GeneratedComInterface] [Guid("436f00f2-b42a-4b9f-870c-e73db66ae930")] public unsafe partial interface ISOSDacInterface @@ -818,7 +828,7 @@ public unsafe partial interface ISOSDacInterface [PreserveSig] int GetCodeHeapList(ClrDataAddress jitManager, uint count, [In, MarshalUsing(CountElementName = nameof(count)), Out] DacpJitCodeHeapInfo[]? codeHeaps, uint* pNeeded); [PreserveSig] - int TraverseVirtCallStubHeap(ClrDataAddress pAppDomain, /*VCSHeapType*/ int heaptype, /*VISITHEAP*/ void* pCallback); + int TraverseVirtCallStubHeap(ClrDataAddress pAppDomain, VCSHeapType heaptype, /*VISITHEAP*/ delegate* unmanaged pCallback); // Other [PreserveSig] diff --git a/src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Legacy/SOSDacImpl.cs b/src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Legacy/SOSDacImpl.cs index 5154540fd0c6c1..d75018d735878f 100644 --- a/src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Legacy/SOSDacImpl.cs +++ b/src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Legacy/SOSDacImpl.cs @@ -4724,7 +4724,7 @@ private static void TraverseLoaderHeapDebugCallback(ulong virtualAddress, nuint } #endif - private int TraverseLoaderHeapCore(ClrDataAddress loaderHeapAddr, delegate* unmanaged pCallback) + private int TraverseLoaderHeapCore(TargetPointer loaderHeapAddr, delegate* unmanaged pCallback) { int hr = HResults.S_OK; #if DEBUG @@ -4733,13 +4733,12 @@ private int TraverseLoaderHeapCore(ClrDataAddress loaderHeapAddr, delegate* unma #endif try { - if (loaderHeapAddr == 0 || pCallback is null) + if (loaderHeapAddr == TargetPointer.Null || pCallback is null) throw new ArgumentException(); int iterationMax = 8192; Contracts.ILoader loader = _target.Contracts.Loader; - TargetPointer heapAddr = loaderHeapAddr.ToTargetPointer(_target); - TargetPointer block = loader.GetFirstLoaderHeapBlock(heapAddr); + TargetPointer block = loader.GetFirstLoaderHeapBlock(loaderHeapAddr); TargetPointer firstBlock = block; int i = 0; while (block != TargetPointer.Null && i++ < iterationMax) @@ -4773,7 +4772,7 @@ private int TraverseLoaderHeapCore(ClrDataAddress loaderHeapAddr, delegate* unma int ISOSDacInterface.TraverseLoaderHeap(ClrDataAddress loaderHeapAddr, delegate* unmanaged pCallback) { - int hr = TraverseLoaderHeapCore(loaderHeapAddr, pCallback); + int hr = TraverseLoaderHeapCore(loaderHeapAddr.ToTargetPointer(_target), pCallback); #if DEBUG if (_legacyImpl is not null) { @@ -4918,8 +4917,57 @@ int ISOSDacInterface.TraverseRCWCleanupList(ClrDataAddress cleanupListPtr, deleg #endif return hr; } - int ISOSDacInterface.TraverseVirtCallStubHeap(ClrDataAddress pAppDomain, int heaptype, void* pCallback) - => LegacyFallbackHelper.CanFallback() && _legacyImpl is not null ? _legacyImpl.TraverseVirtCallStubHeap(pAppDomain, heaptype, pCallback) : HResults.E_NOTIMPL; + int ISOSDacInterface.TraverseVirtCallStubHeap(ClrDataAddress pAppDomain, VCSHeapType heaptype, delegate* unmanaged pCallback) + { + int hr = HResults.S_OK; + try + { + // Native DAC only validates pAppDomain here; traversal always uses the global loader allocator. + if (pAppDomain == 0 || pCallback is null) + throw new ArgumentException(); + + Contracts.ILoader loader = _target.Contracts.Loader; + TargetPointer globalLoaderAllocator = loader.GetGlobalLoaderAllocator(); + IReadOnlyDictionary heaps = loader.GetLoaderAllocatorHeaps(globalLoaderAllocator); + + if (!heaps.ContainsKey(Contracts.LoaderAllocatorHeapType.IndcellHeap)) + throw new NullReferenceException(); + + Contracts.LoaderAllocatorHeapType heapKey = heaptype switch + { + VCSHeapType.IndcellHeap => Contracts.LoaderAllocatorHeapType.IndcellHeap, + VCSHeapType.CacheEntryHeap => Contracts.LoaderAllocatorHeapType.CacheEntryHeap, + _ => throw new ArgumentException(), + }; + + if (heaps.TryGetValue(heapKey, out TargetPointer heap) && heap != TargetPointer.Null) + { + hr = TraverseLoaderHeapCore(heap, pCallback); + } + } + catch (System.Exception ex) + { + hr = ex.HResult; + } + +#if DEBUG + if (_legacyImpl is not null) + { + int cdacCount = DebugTraverseLoaderHeapBlocks.Count; + delegate* unmanaged debugCallbackPtr = &TraverseLoaderHeapDebugCallback; + int hrLocal = _legacyImpl.TraverseVirtCallStubHeap(pAppDomain, heaptype, debugCallbackPtr); + Debug.ValidateHResult(hr, hrLocal); + if (hr == HResults.S_OK || hr == HResults.S_FALSE) + { + Debug.Assert(DebugTraverseLoaderHeapBlocks.Count == 0, + $"cDAC found {cdacCount} blocks, DAC matched {_debugTraverseLoaderDebugCount}, {DebugTraverseLoaderHeapBlocks.Count} unmatched"); + Debug.Assert(_debugTraverseLoaderDebugCount == (uint)cdacCount, + $"cDAC: {cdacCount} blocks, DAC: {_debugTraverseLoaderDebugCount} blocks"); + } + } +#endif + return hr; + } #endregion ISOSDacInterface #region ISOSDacInterface2 @@ -6263,7 +6311,7 @@ int ISOSDacInterface12.GetGlobalAllocationContext(ClrDataAddress* allocPtr, ClrD int ISOSDacInterface13.TraverseLoaderHeap(ClrDataAddress loaderHeapAddr, /*LoaderHeapKind*/ int kind, /*VISITHEAP*/ delegate* unmanaged pCallback) { - int hr = TraverseLoaderHeapCore(loaderHeapAddr, pCallback); + int hr = TraverseLoaderHeapCore(loaderHeapAddr.ToTargetPointer(_target), pCallback); #if DEBUG if (_legacyImpl13 is not null) { diff --git a/src/native/managed/cdac/tests/LoaderTests.cs b/src/native/managed/cdac/tests/LoaderTests.cs index 1af03c11710887..e283a7ece00154 100644 --- a/src/native/managed/cdac/tests/LoaderTests.cs +++ b/src/native/managed/cdac/tests/LoaderTests.cs @@ -172,6 +172,15 @@ public void GetSimpleName_InvalidUtf8(MockTarget.Architecture arch) [LoaderAllocatorHeapType.CacheEntryHeap] = new(0x9000), }; + private const VCSHeapType VCSHeapTypeIndcell = VCSHeapType.IndcellHeap; + private const VCSHeapType VCSHeapTypeCacheEntry = VCSHeapType.CacheEntryHeap; + private const VCSHeapType InvalidVCSHeapType = (VCSHeapType)99; + + [UnmanagedCallersOnly] + private static void VisitHeapNoOp(ulong address, nuint size, Interop.BOOL isCurrent) + { + } + private static LoaderAllocatorHeapType HeapNameToType(string name) => Enum.Parse(name); private static ISOSDacInterface13 CreateSOSDacInterface13ForHeapTests(MockTarget.Architecture arch) @@ -214,6 +223,168 @@ private static ISOSDacInterface13 CreateSOSDacInterface13ForHeapTests(MockTarget return new SOSDacImpl(target, null); } + private static (ISOSDacInterface Interface, Mock Loader) CreateSOSDacInterfaceForVirtCallHeapTests(MockTarget.Architecture arch) + { + Mock loader = new(MockBehavior.Strict); + TargetPointer globalLoaderAllocator = new(0x100); + loader.Setup(l => l.GetGlobalLoaderAllocator()).Returns(globalLoaderAllocator); + + var target = new TestPlaceholderTarget.Builder(arch) + .AddMockContract(loader.Object) + .Build(); + + return (new SOSDacImpl(target, null), loader); + } + + [Theory] + [ClassData(typeof(MockTarget.StdArch))] + public void TraverseVirtCallStubHeap_IndcellHeap_Traverses(MockTarget.Architecture arch) + { + (ISOSDacInterface impl, Mock loader) = CreateSOSDacInterfaceForVirtCallHeapTests(arch); + + TargetPointer indcellHeap = new(0x8000); + TargetPointer firstBlock = new(0x8100); + var heaps = new Dictionary + { + [LoaderAllocatorHeapType.IndcellHeap] = indcellHeap, + }; + loader.Setup(l => l.GetLoaderAllocatorHeaps(new TargetPointer(0x100))) + .Returns((IReadOnlyDictionary)heaps); + loader.Setup(l => l.GetFirstLoaderHeapBlock(indcellHeap)).Returns(firstBlock); + loader.Setup(l => l.GetLoaderHeapBlockData(firstBlock)).Returns(new LoaderHeapBlockData + { + Address = new TargetPointer(0x9000), + Size = new TargetNUInt(0x40), + NextBlock = TargetPointer.Null, + }); + + delegate* unmanaged callback = &VisitHeapNoOp; + int hr = impl.TraverseVirtCallStubHeap(new ClrDataAddress(0x1), VCSHeapTypeIndcell, callback); + + Assert.Equal(HResults.S_OK, hr); + loader.Verify(l => l.GetFirstLoaderHeapBlock(indcellHeap), Times.Once()); + loader.Verify(l => l.GetLoaderHeapBlockData(firstBlock), Times.Once()); + } + + [Theory] + [ClassData(typeof(MockTarget.StdArch))] + public void TraverseVirtCallStubHeap_CacheEntryHeap_Traverses(MockTarget.Architecture arch) + { + (ISOSDacInterface impl, Mock loader) = CreateSOSDacInterfaceForVirtCallHeapTests(arch); + + TargetPointer cacheEntryHeap = new(0x9000); + TargetPointer firstBlock = new(0x9100); + var heaps = new Dictionary + { + [LoaderAllocatorHeapType.IndcellHeap] = new TargetPointer(0x8000), + [LoaderAllocatorHeapType.CacheEntryHeap] = cacheEntryHeap, + }; + loader.Setup(l => l.GetLoaderAllocatorHeaps(new TargetPointer(0x100))) + .Returns((IReadOnlyDictionary)heaps); + loader.Setup(l => l.GetFirstLoaderHeapBlock(cacheEntryHeap)).Returns(firstBlock); + loader.Setup(l => l.GetLoaderHeapBlockData(firstBlock)).Returns(new LoaderHeapBlockData + { + Address = new TargetPointer(0xA000), + Size = new TargetNUInt(0x40), + NextBlock = TargetPointer.Null, + }); + + delegate* unmanaged callback = &VisitHeapNoOp; + int hr = impl.TraverseVirtCallStubHeap(new ClrDataAddress(0x1), VCSHeapTypeCacheEntry, callback); + + Assert.Equal(HResults.S_OK, hr); + loader.Verify(l => l.GetFirstLoaderHeapBlock(cacheEntryHeap), Times.Once()); + loader.Verify(l => l.GetLoaderHeapBlockData(firstBlock), Times.Once()); + } + + [Theory] + [ClassData(typeof(MockTarget.StdArch))] + public void TraverseVirtCallStubHeap_NoVirtualCallStubManager_ReturnsEPointer(MockTarget.Architecture arch) + { + (ISOSDacInterface impl, Mock loader) = CreateSOSDacInterfaceForVirtCallHeapTests(arch); + + loader.Setup(l => l.GetLoaderAllocatorHeaps(new TargetPointer(0x100))) + .Returns((IReadOnlyDictionary)new Dictionary()); + + delegate* unmanaged callback = &VisitHeapNoOp; + int hr = impl.TraverseVirtCallStubHeap(new ClrDataAddress(0x1), VCSHeapTypeIndcell, callback); + + Assert.Equal(HResults.E_POINTER, hr); + } + + [Theory] + [ClassData(typeof(MockTarget.StdArch))] + public void TraverseVirtCallStubHeap_CacheEntryMissing_ReturnsSOk(MockTarget.Architecture arch) + { + (ISOSDacInterface impl, Mock loader) = CreateSOSDacInterfaceForVirtCallHeapTests(arch); + + TargetPointer indcellHeap = new(0x8000); + loader.Setup(l => l.GetLoaderAllocatorHeaps(new TargetPointer(0x100))) + .Returns((IReadOnlyDictionary)new Dictionary + { + [LoaderAllocatorHeapType.IndcellHeap] = indcellHeap, + }); + + delegate* unmanaged callback = &VisitHeapNoOp; + int hr = impl.TraverseVirtCallStubHeap(new ClrDataAddress(0x1), VCSHeapTypeCacheEntry, callback); + + Assert.Equal(HResults.S_OK, hr); + loader.Verify(l => l.GetFirstLoaderHeapBlock(It.IsAny()), Times.Never()); + } + + [Theory] + [ClassData(typeof(MockTarget.StdArch))] + public void TraverseVirtCallStubHeap_InvalidHeapType_ReturnsEInvalidArg(MockTarget.Architecture arch) + { + (ISOSDacInterface impl, Mock loader) = CreateSOSDacInterfaceForVirtCallHeapTests(arch); + + loader.Setup(l => l.GetLoaderAllocatorHeaps(new TargetPointer(0x100))) + .Returns((IReadOnlyDictionary)new Dictionary + { + [LoaderAllocatorHeapType.IndcellHeap] = new TargetPointer(0x8000), + }); + + delegate* unmanaged callback = &VisitHeapNoOp; + int hr = impl.TraverseVirtCallStubHeap(new ClrDataAddress(0x1), InvalidVCSHeapType, callback); + + Assert.Equal(HResults.E_INVALIDARG, hr); + } + + [Theory] + [ClassData(typeof(MockTarget.StdArch))] + public void TraverseVirtCallStubHeap_InvalidArguments_ReturnsEInvalidArg(MockTarget.Architecture arch) + { + (ISOSDacInterface impl, Mock loader) = CreateSOSDacInterfaceForVirtCallHeapTests(arch); + + loader.Setup(l => l.GetLoaderAllocatorHeaps(new TargetPointer(0x100))) + .Returns((IReadOnlyDictionary)new Dictionary + { + [LoaderAllocatorHeapType.IndcellHeap] = new TargetPointer(0x8000), + }); + + delegate* unmanaged callback = &VisitHeapNoOp; + int hr = impl.TraverseVirtCallStubHeap(new ClrDataAddress(0), VCSHeapTypeIndcell, callback); + + Assert.Equal(HResults.E_INVALIDARG, hr); + } + + [Theory] + [ClassData(typeof(MockTarget.StdArch))] + public void TraverseVirtCallStubHeap_NullCallback_ReturnsEInvalidArg(MockTarget.Architecture arch) + { + (ISOSDacInterface impl, Mock loader) = CreateSOSDacInterfaceForVirtCallHeapTests(arch); + + loader.Setup(l => l.GetLoaderAllocatorHeaps(new TargetPointer(0x100))) + .Returns((IReadOnlyDictionary)new Dictionary + { + [LoaderAllocatorHeapType.IndcellHeap] = new TargetPointer(0x8000), + }); + + int hr = impl.TraverseVirtCallStubHeap(new ClrDataAddress(0x1), VCSHeapTypeIndcell, null); + + Assert.Equal(HResults.E_INVALIDARG, hr); + } + [Theory] [ClassData(typeof(MockTarget.StdArch))] public void GetLoaderAllocatorHeapNames_GetCount(MockTarget.Architecture arch) From 458c690b458b7e672eaf228cc408aff7933b88b3 Mon Sep 17 00:00:00 2001 From: Nikolay Zdravkov Date: Tue, 5 May 2026 22:32:51 +0300 Subject: [PATCH 008/109] Fix CounterGroup timer to use Stopwatch instead of DateTime.UtcNow (#127303) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Background `DateTime.UtcNow` can jump due to NTP sync, causing elapsed time reported to EventCounter subscribers to be incorrect for that interval — affecting rate calculations like requests/sec in monitoring dashboards. Stopwatch is monotonic and not subject to clock adjustments. `CounterGroup` is only directly referenced from `DiagnosticCounter`. `DiagnosticCounter` is the base class of `EventCounter`, `PollingCounter`, `IncrementingPollingCounter`, `IncrementingEventCounter`, so they all are affected. --- .../Diagnostics/Tracing/CounterGroup.cs | 59 +++++++++++-------- 1 file changed, 35 insertions(+), 24 deletions(-) diff --git a/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/CounterGroup.cs b/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/CounterGroup.cs index d08c6949616c10..8bdda96a727971 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/CounterGroup.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/CounterGroup.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.Collections.Generic; +using System.Diagnostics; using System.Runtime.Versioning; using System.Threading; @@ -92,7 +93,7 @@ private void OnEventSourceCommand(object? sender, EventCommandEventArgs e) Debug.Assert((s_counterGroupEnabledList == null && !_eventSource.IsEnabled()) || (_eventSource.IsEnabled() && s_counterGroupEnabledList!.Contains(this)) - || (_pollingIntervalInMilliseconds == 0 && !s_counterGroupEnabledList!.Contains(this)) + || (_pollingInterval == TimeSpan.Zero && !s_counterGroupEnabledList!.Contains(this)) || (!_eventSource.IsEnabled() && !s_counterGroupEnabledList!.Contains(this))); } } @@ -142,22 +143,25 @@ internal static CounterGroup GetCounterGroup(EventSource eventSource) #region Timer Processing - private DateTime _timeStampSinceCollectionStarted; - private int _pollingIntervalInMilliseconds; - private DateTime _nextPollingTimeStamp; + private long _baseTimestamp; + private TimeSpan _timeSinceCollectionStarted; + private TimeSpan _pollingInterval; + private TimeSpan _nextPollingOffset; private void EnableTimer(float pollingIntervalInSeconds) { Debug.Assert(pollingIntervalInSeconds > 0); Debug.Assert(Monitor.IsEntered(s_counterGroupLock)); - if (_pollingIntervalInMilliseconds == 0 || pollingIntervalInSeconds * 1000 < _pollingIntervalInMilliseconds) + TimeSpan interval = TimeSpan.FromSeconds(pollingIntervalInSeconds); + if (_pollingInterval == TimeSpan.Zero || interval < _pollingInterval) { - _pollingIntervalInMilliseconds = (int)(pollingIntervalInSeconds * 1000); + _pollingInterval = interval; // Schedule IncrementingPollingCounter reset and synchronously reset other counters HandleCountersReset(); - _timeStampSinceCollectionStarted = DateTime.UtcNow; - _nextPollingTimeStamp = DateTime.UtcNow + new TimeSpan(0, 0, (int)pollingIntervalInSeconds); + _baseTimestamp = Stopwatch.GetTimestamp(); + _timeSinceCollectionStarted = TimeSpan.Zero; + _nextPollingOffset = _pollingInterval; // Create the polling thread and init all the shared state if needed if (s_pollingThread == null) @@ -186,7 +190,7 @@ private void EnableTimer(float pollingIntervalInSeconds) private void DisableTimer() { Debug.Assert(Monitor.IsEntered(s_counterGroupLock)); - _pollingIntervalInMilliseconds = 0; + _pollingInterval = TimeSpan.Zero; s_counterGroupEnabledList?.Remove(this); if (s_needsResetIncrementingPollingCounters.Count > 0) @@ -225,15 +229,15 @@ private void OnTimer() { if (_eventSource.IsEnabled()) { - DateTime now; + TimeSpan nowOffset; TimeSpan elapsed; - int pollingIntervalInMilliseconds; + TimeSpan pollingInterval; DiagnosticCounter[] counters; lock (s_counterGroupLock) { - now = DateTime.UtcNow; - elapsed = now - _timeStampSinceCollectionStarted; - pollingIntervalInMilliseconds = _pollingIntervalInMilliseconds; + nowOffset = Stopwatch.GetElapsedTime(_baseTimestamp); + elapsed = nowOffset - _timeSinceCollectionStarted; + pollingInterval = _pollingInterval; counters = new DiagnosticCounter[_counters.Count]; _counters.CopyTo(counters); } @@ -253,16 +257,23 @@ private void OnTimer() // written to the old session or the new session. The behavior change is not being treated as a // significant problem to address for now, but we can come back and address it if it turns out to // be an actual issue. - counter.WritePayload((float)elapsed.TotalSeconds, pollingIntervalInMilliseconds); + counter.WritePayload((float)elapsed.TotalSeconds, (int)pollingInterval.TotalMilliseconds); } lock (s_counterGroupLock) { - _timeStampSinceCollectionStarted = now; - TimeSpan delta = now - _nextPollingTimeStamp; - delta = _pollingIntervalInMilliseconds > delta.TotalMilliseconds ? TimeSpan.FromMilliseconds(_pollingIntervalInMilliseconds) : delta; - if (_pollingIntervalInMilliseconds > 0) - _nextPollingTimeStamp += TimeSpan.FromMilliseconds(_pollingIntervalInMilliseconds * Math.Ceiling(delta.TotalMilliseconds / _pollingIntervalInMilliseconds)); + _timeSinceCollectionStarted = nowOffset; + TimeSpan delta = nowOffset - _nextPollingOffset; + if (delta < _pollingInterval) + { + delta = _pollingInterval; + } + + if (_pollingInterval > TimeSpan.Zero) + { + long missed = (delta.Ticks + _pollingInterval.Ticks - 1) / _pollingInterval.Ticks; + _nextPollingOffset += new TimeSpan(missed * _pollingInterval.Ticks); + } } } } @@ -292,14 +303,14 @@ private static void PollForValues() sleepEvent = s_pollingThreadSleepEvent; foreach (CounterGroup counterGroup in s_counterGroupEnabledList!) { - DateTime now = DateTime.UtcNow; - if (counterGroup._nextPollingTimeStamp < now + new TimeSpan(0, 0, 0, 0, 1)) + TimeSpan nowOffset = Stopwatch.GetElapsedTime(counterGroup._baseTimestamp); + TimeSpan timeUntilNextPoll = counterGroup._nextPollingOffset - nowOffset; + if (timeUntilNextPoll < TimeSpan.FromMilliseconds(1)) { onTimers.Add(counterGroup); } - int millisecondsTillNextPoll = (int)((counterGroup._nextPollingTimeStamp - now).TotalMilliseconds); - millisecondsTillNextPoll = Math.Max(1, millisecondsTillNextPoll); + int millisecondsTillNextPoll = Math.Max(1, (int)timeUntilNextPoll.TotalMilliseconds); sleepDurationInMilliseconds = Math.Min(sleepDurationInMilliseconds, millisecondsTillNextPoll); } From 0f84a105b017492b9fe034941a4626e380970542 Mon Sep 17 00:00:00 2001 From: Andy Ayers Date: Tue, 5 May 2026 12:47:56 -0700 Subject: [PATCH 009/109] [Wasm RyuJit] add length prefix to each jit code contribution (#127773) And no longer do this on the host side. This will let the host split out funclets without having to parse the JIT-generated code. --- src/coreclr/jit/codegencommon.cpp | 6 +++ src/coreclr/jit/codegenwasm.cpp | 4 ++ src/coreclr/jit/emitfmtswasm.h | 1 + src/coreclr/jit/emitwasm.cpp | 51 +++++++++++++++++++ src/coreclr/jit/emitwasm.h | 1 + src/coreclr/jit/instrswasm.h | 3 +- src/coreclr/jit/unwindwasm.cpp | 2 - .../Compiler/ObjectWriter/WasmObjectWriter.cs | 14 ++--- 8 files changed, 68 insertions(+), 14 deletions(-) diff --git a/src/coreclr/jit/codegencommon.cpp b/src/coreclr/jit/codegencommon.cpp index 2fe77b1a3294b0..ad6cef5840900b 100644 --- a/src/coreclr/jit/codegencommon.cpp +++ b/src/coreclr/jit/codegencommon.cpp @@ -2310,6 +2310,12 @@ void CodeGen::genEmitMachineCode() m_compiler->unwindReserve(); +#if defined(TARGET_WASM) + // For Wasm we know know the exact size of each function and funclet. + // + GetEmitter()->emitUpdateFuncletLocations(); +#endif + bool trackedStackPtrsContig; // are tracked stk-ptrs contiguous ? #ifdef TARGET_64BIT diff --git a/src/coreclr/jit/codegenwasm.cpp b/src/coreclr/jit/codegenwasm.cpp index 4df06a6e5d22b0..db056b21ab704b 100644 --- a/src/coreclr/jit/codegenwasm.cpp +++ b/src/coreclr/jit/codegenwasm.cpp @@ -103,6 +103,8 @@ void CodeGen::genMarkLabelsForCodegen() // void CodeGen::genBeginFnProlog() { + GetEmitter()->emitIns(INS_code_size); + FuncInfoDsc* const func = m_compiler->funGetFunc(ROOT_FUNC_IDX); assert(func->funWasmLocalDecls != nullptr); @@ -351,6 +353,8 @@ void CodeGen::genFuncletProlog(BasicBlock* block) assert(m_compiler->bbIsFuncletBeg(block)); JITDUMP("*************** In genFuncletProlog()\n"); + GetEmitter()->emitIns(INS_code_size); + // Local sig for the funclet // unsigned localsCount = 0; diff --git a/src/coreclr/jit/emitfmtswasm.h b/src/coreclr/jit/emitfmtswasm.h index c2a631cec97cc3..4cb69ee24e57c5 100644 --- a/src/coreclr/jit/emitfmtswasm.h +++ b/src/coreclr/jit/emitfmtswasm.h @@ -30,6 +30,7 @@ IF_DEF(NONE, IS_NONE, NONE) IF_DEF(OPCODE, IS_NONE, NONE) // IF_DEF(BLOCK, IS_NONE, NONE) // IF_DEF(RAW_ULEB128, IS_NONE, NONE) // +IF_DEF(CODE_SIZE, IS_NONE, NONE) IF_DEF(ULEB128, IS_NONE, NONE) // IF_DEF(FUNCIDX, IS_NONE, NONE) // IF_DEF(SLEB128, IS_NONE, NONE) // diff --git a/src/coreclr/jit/emitwasm.cpp b/src/coreclr/jit/emitwasm.cpp index 3492406ccf2cbd..148a7e01f85e5b 100644 --- a/src/coreclr/jit/emitwasm.cpp +++ b/src/coreclr/jit/emitwasm.cpp @@ -502,6 +502,10 @@ unsigned emitter::instrDesc::idCodeSize() const assert(!idIsCnsReloc()); size = SizeOfULEB128(emitGetInsSC(this)); break; + case IF_CODE_SIZE: + assert(!idIsCnsReloc()); + size = PADDED_RELOC_SIZE; + break; case IF_LOCAL_DECL: { assert(idIsLclVarDecl()); @@ -592,6 +596,22 @@ size_t emitter::emitOutputULEB128(uint8_t* destination, uint64_t value) } } +size_t emitter::emitOutputULEB128Padded(uint8_t* destination, uint64_t value) +{ + uint8_t* buffer = destination + writeableOffset; + int i = 0; + + for (; i < PADDED_RELOC_SIZE - 1; i++) + { + buffer[i] = (uint8_t)((value & 0x7F) | 0x80); + value >>= 7; + } + + buffer[i] = (uint8_t)value; + + return PADDED_RELOC_SIZE; +} + size_t emitter::emitOutputSLEB128(uint8_t* destination, int64_t value) { uint8_t* buffer = destination + writeableOffset; @@ -836,6 +856,17 @@ size_t emitter::emitOutputInstr(insGroup* ig, instrDesc* id, BYTE** dp) dst += emitOutputULEB128(dst, (int64_t)emitGetInsSC(id)); break; } + case IF_CODE_SIZE: + { + // We always emit this as 5 bytes + FuncInfoDsc* const func = m_compiler->funGetFunc(emitCurIG->igFuncIdx); + UNATIVE_OFFSET startOffset = func->startLoc->CodeOffset(this); + UNATIVE_OFFSET endOffset = func->endLoc->CodeOffset(this); + assert(endOffset >= (startOffset + PADDED_RELOC_SIZE)); + unsigned const size = endOffset - startOffset - PADDED_RELOC_SIZE; + dst += emitOutputULEB128Padded(dst, (int64_t)size); + break; + } default: NYI_WASM("emitOutputInstr"); break; @@ -1083,6 +1114,26 @@ void emitter::emitDispIns( } break; + case IF_CODE_SIZE: + { + FuncInfoDsc* const func = m_compiler->funGetFunc(emitCurIG->igFuncIdx); + + emitLocation* const startLoc = func->startLoc; + emitLocation* const endLoc = func->endLoc; + + if (startLoc != nullptr) + { + assert(endLoc != nullptr); + UNATIVE_OFFSET codeSize = endLoc->CodeOffset(this) - startLoc->CodeOffset(this) - PADDED_RELOC_SIZE; + printf(" %u", codeSize); + } + else + { + printf(" "); + } + } + break; + default: unreached(); } diff --git a/src/coreclr/jit/emitwasm.h b/src/coreclr/jit/emitwasm.h index 631d7b9c1f2e2f..d97555fd3760a5 100644 --- a/src/coreclr/jit/emitwasm.h +++ b/src/coreclr/jit/emitwasm.h @@ -60,6 +60,7 @@ bool emitInsIsStore(instruction ins); insFormat emitInsFormat(instruction ins); size_t emitOutputULEB128(uint8_t* destination, uint64_t value); +size_t emitOutputULEB128Padded(uint8_t* destination, uint64_t value); size_t emitOutputSLEB128(uint8_t* destination, int64_t value); size_t emitRawBytes(uint8_t* destination, const void* source, size_t count); size_t emitOutputOpcode(BYTE* dst, instruction ins); diff --git a/src/coreclr/jit/instrswasm.h b/src/coreclr/jit/instrswasm.h index e9d24ca1795215..d499e3e4b9ff15 100644 --- a/src/coreclr/jit/instrswasm.h +++ b/src/coreclr/jit/instrswasm.h @@ -28,12 +28,13 @@ // control flow // -INST2(invalid, "INVALID", 0, IF_NONE, 0xFC, BAD_CODE) +INST2(invalid, "INVALID", 0, IF_NONE, 0xFC, BAD_CODE) INST(unreachable, "unreachable", 0, IF_OPCODE, 0x00) INST(label, "label", 0, IF_RAW_ULEB128, 0x00) INST(catch_ref, "catch_ref", 0, IF_CATCH_DECL, 0x00) INST(local_cnt, "local.cnt", 0, IF_RAW_ULEB128, 0x00) INST(local_decl, "local", 0, IF_LOCAL_DECL, 0x00) +INST(code_size, "code.size", 0, IF_CODE_SIZE, 0x00) INST(nop, "nop", 0, IF_OPCODE, 0x01) INST(block, "block", 0, IF_BLOCK, 0x02) INST(loop, "loop", 0, IF_BLOCK, 0x03) diff --git a/src/coreclr/jit/unwindwasm.cpp b/src/coreclr/jit/unwindwasm.cpp index ee5ab16979a423..0d6b73e8c46657 100644 --- a/src/coreclr/jit/unwindwasm.cpp +++ b/src/coreclr/jit/unwindwasm.cpp @@ -77,8 +77,6 @@ void Compiler::unwindEmit(void* pHotCode, void* pColdCode) assert(!compGeneratingProlog); assert(!compGeneratingEpilog); - GetEmitter()->emitUpdateFuncletLocations(); - for (FuncInfoDsc* const func : Funcs()) { unwindEmitFunc(func, pHotCode, pColdCode); diff --git a/src/coreclr/tools/Common/Compiler/ObjectWriter/WasmObjectWriter.cs b/src/coreclr/tools/Common/Compiler/ObjectWriter/WasmObjectWriter.cs index 7f1bb208f7b563..b6fabef169fa91 100644 --- a/src/coreclr/tools/Common/Compiler/ObjectWriter/WasmObjectWriter.cs +++ b/src/coreclr/tools/Common/Compiler/ObjectWriter/WasmObjectWriter.cs @@ -359,8 +359,9 @@ private void InsertWasmStub(Utf8String name, WasmFunctionBody body) byte[] data = new byte[codeSize]; body.Encode(data); - // The code writer should already be set up to write the function body size as a prefix, so just emit the function body here - Debug.Assert(codeWriter.HasLengthPrefix); + // We must emit the length prefix explicitly + Debug.Assert(!codeWriter.HasLengthPrefix); + codeWriter.WriteULEB128((ulong)codeSize); codeWriter.EmitData(data); _uniqueSymbols.Add(name.ToString(), _methodCount); _methodCount++; @@ -481,21 +482,12 @@ private protected override ObjectNodeSection GetEmitSection(ObjectNodeSection se private protected override SectionWriter.Params WriterParams(ObjectNodeSection section) { - if (section == ObjectNodeSection.WasmCodeSection) - { - return new SectionWriter.Params - { - LengthEncodeFormat = LengthEncodeFormat.ULEB128 - }; - } - return new SectionWriter.Params { LengthEncodeFormat = LengthEncodeFormat.None }; } - private protected override void CreateSection(ObjectNodeSection section, Utf8String comdatName, Utf8String symbolName, int sectionIndex, Stream sectionStream) { WasmSectionType sectionType = GetWasmSectionType(section); From 847e1c53559eb57c16e9b91b4fa5ba1c737784fb Mon Sep 17 00:00:00 2001 From: dotnet-renovate-bot Date: Tue, 5 May 2026 13:26:14 -0700 Subject: [PATCH 010/109] Update container image digests (#127801) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Automated Dependency Update This PR contains the following updates: | Package | Update | Change | |---|---|---| | mcr.microsoft.com/dotnet-buildtools/prereqs | digest | `7c1931f` → `0596a84` | | mcr.microsoft.com/dotnet-buildtools/prereqs | digest | `0ef2d61` → `abd0864` | | mcr.microsoft.com/dotnet-buildtools/prereqs | digest | `051f8f1` → `c9dc510` | | mcr.microsoft.com/dotnet-buildtools/prereqs | digest | `754a73d` → `9e71dbc` | | mcr.microsoft.com/dotnet-buildtools/prereqs | digest | `20b45a0` → `9d938f6` | | mcr.microsoft.com/dotnet-buildtools/prereqs | digest | `7a5b1a8` → `030241e` | | mcr.microsoft.com/dotnet-buildtools/prereqs | digest | `f0d4e84` → `ff0868b` | | mcr.microsoft.com/dotnet-buildtools/prereqs | digest | `2d2df03` → `360a2dc` | | mcr.microsoft.com/dotnet-buildtools/prereqs | digest | `58f51fb` → `010211f` | | mcr.microsoft.com/dotnet-buildtools/prereqs | digest | `6ad25da` → `d61f2b7` | | mcr.microsoft.com/dotnet-buildtools/prereqs | digest | `05e16d1` → `4bf6a0a` | | mcr.microsoft.com/dotnet-buildtools/prereqs | digest | `09e23d7` → `ede2550` | | mcr.microsoft.com/dotnet-buildtools/prereqs | digest | `0d1628f` → `28a8f1c` | | mcr.microsoft.com/dotnet-buildtools/prereqs | digest | `f3eb05c` → `2191169` | | mcr.microsoft.com/dotnet-buildtools/prereqs | digest | `8dc85a0` → `71ebe96` | | mcr.microsoft.com/dotnet-buildtools/prereqs | digest | `0fc4e37` → `527933f` | | mcr.microsoft.com/dotnet-buildtools/prereqs | digest | `51d0879` → `9ee81df` | | mcr.microsoft.com/dotnet-buildtools/prereqs | digest | `b6a2e70` → `d442f29` | | mcr.microsoft.com/dotnet-buildtools/prereqs | digest | `7be7701` → `a1d0aff` | | mcr.microsoft.com/dotnet-buildtools/prereqs | digest | `dc020b6` → `664efcd` | | mcr.microsoft.com/dotnet-buildtools/prereqs | digest | `5b8a4bb` → `75e59a4` | | mcr.microsoft.com/dotnet-buildtools/prereqs | digest | `e601475` → `09e5e6a` | | mcr.microsoft.com/dotnet-buildtools/prereqs | digest | `9165c90` → `0e9efcf` | | mcr.microsoft.com/dotnet-buildtools/prereqs | digest | `5908b2e` → `6833f4b` | | mcr.microsoft.com/dotnet-buildtools/prereqs | digest | `6f5f90b` → `f82e3fa` | | mcr.microsoft.com/dotnet-buildtools/prereqs | digest | `cd8001a` → `3849fef` | | mcr.microsoft.com/dotnet-buildtools/prereqs | digest | `846c828` → `a4b9035` | | mcr.microsoft.com/dotnet-buildtools/prereqs | digest | `3278744` → `e364bac` | | mcr.microsoft.com/dotnet-buildtools/prereqs | digest | `567cec8` → `d6ae4c8` | | mcr.microsoft.com/dotnet-buildtools/prereqs | digest | `f38b4db` → `a18d858` | | mcr.microsoft.com/dotnet-buildtools/prereqs | digest | `3d3aa4e` → `949fc61` | | mcr.microsoft.com/dotnet-buildtools/prereqs | digest | `e688700` → `c71e530` | | mcr.microsoft.com/dotnet-buildtools/prereqs | digest | `a31af6e` → `b3bccb9` | | mcr.microsoft.com/dotnet-buildtools/prereqs | digest | `46268aa` → `943d8e8` | | mcr.microsoft.com/dotnet-buildtools/prereqs | digest | `2b2d3b9` → `7345d8b` | | mcr.microsoft.com/dotnet-buildtools/prereqs | digest | `bbc4191` → `d8cdb6c` | | mcr.microsoft.com/dotnet-buildtools/prereqs | digest | `8c9ecb5` → `a219633` | | mcr.microsoft.com/dotnet-buildtools/prereqs | digest | `5a2238e` → `a5f826c` | | mcr.microsoft.com/dotnet-buildtools/prereqs | digest | `b62d3e5` → `0e01074` | | mcr.microsoft.com/dotnet-buildtools/prereqs | digest | `8e2b84e` → `09f90b1` | | mcr.microsoft.com/dotnet-buildtools/prereqs | digest | `462906a` → `ac402d0` | This PR has been created automatically by the [.NET Renovate Bot](https://redirect.github.com/dotnet/arcade/blob/main/Documentation/Renovate.md) to update one or more dependencies in your repo. Please review the changes and merge the PR if everything looks good. --- .../templates/pipeline-with-resources.yml | 50 +++++++++---------- .../coreclr/templates/helix-queues-setup.yml | 20 ++++---- .../installer/helix-queues-setup.yml | 8 +-- .../libraries/helix-queues-setup.yml | 44 ++++++++-------- 4 files changed, 61 insertions(+), 61 deletions(-) diff --git a/eng/pipelines/common/templates/pipeline-with-resources.yml b/eng/pipelines/common/templates/pipeline-with-resources.yml index 764dd7339cc123..5c77fb16e0c060 100644 --- a/eng/pipelines/common/templates/pipeline-with-resources.yml +++ b/eng/pipelines/common/templates/pipeline-with-resources.yml @@ -17,113 +17,113 @@ extends: containers: linux_arm: - image: mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net11.0-cross-arm@sha256:462906ac0014b813e823afe392e6cf47c87e09ebb821ee20243e964646bf13f9 + image: mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net11.0-cross-arm@sha256:ac402d059f817f65382ec3d515496b26fe1a79c4b08372674e844eebcd807554 env: ROOTFS_DIR: /crossrootfs/arm linux_arm64: - image: mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net11.0-cross-arm64@sha256:8e2b84e8315f2014f7970399511ba485788c1f95c28857a72b9fb2fcbe760a48 + image: mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net11.0-cross-arm64@sha256:09f90b1e175d2344d5f6a526d2aa02b4df4535154c30595593053b1295141ef3 env: ROOTFS_DIR: /crossrootfs/arm64 linux_musl_x64: - image: mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net11.0-cross-amd64-musl@sha256:b62d3e588b6af52f02afc9736cb330d61f9895b0305b85cc71dfaeb00bb86d2f + image: mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net11.0-cross-amd64-musl@sha256:0e0107407ebbd416d12aab2f08b8446b0fcaeb3dffe04c5900f469a2342a6950 env: ROOTFS_DIR: /crossrootfs/x64 linux_musl_arm: - image: mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net11.0-cross-arm-musl@sha256:5a2238ea33c63e49fab79676d427bfca79c4cd5d456e3bf4f873081eea933b6d + image: mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net11.0-cross-arm-musl@sha256:a5f826c6660a8ea4afac80c0eeaadecfcc4eb568e64bb61d2d7bbefb4a600fe8 env: ROOTFS_DIR: /crossrootfs/arm linux_musl_arm64: - image: mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net11.0-cross-arm64-musl@sha256:8c9ecb5e96b4e9d9a056b710d97d41b91cdef7c954d8d693c6211ea64d034f1c + image: mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net11.0-cross-arm64-musl@sha256:a21963382df7677563b79aabe8e9949eb105372ecb0dc23048d94d50e78c6d74 env: ROOTFS_DIR: /crossrootfs/arm64 # This container contains all required toolsets to build for Android and for Linux with bionic libc. android: - image: mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net11.0-cross-android-amd64@sha256:bbc4191c9bc75791faf3fb06d3f7a69822e6710d8b4c651fdf94314116f1d4b3 + image: mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net11.0-cross-android-amd64@sha256:d8cdb6c6b1c631e6f9fac2e4e0814037193c364c002843b0a78dadfb070efab7 # This container contains all required toolsets to build for Android and for Linux with bionic libc and a special layout of OpenSSL. linux_bionic: - image: mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net11.0-cross-android-openssl-amd64@sha256:2b2d3b9b6347e9a20281363fda1b4c4cb48658fd7d9fda92f8c62b1d880cfbb5 + image: mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net11.0-cross-android-openssl-amd64@sha256:7345d8b542a02276e7f383dc4847a9139b2681246c65e4446f829acf0eeb69c0 # This container contains all required toolsets to build for Android as well as tooling to build docker images. android_docker: - image: mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net11.0-android-docker-amd64@sha256:46268aa47fab84c655114e37aa8cb81acffb27a0358ee2cffa133af7de47fe6a + image: mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net11.0-android-docker-amd64@sha256:943d8e88803a4e902b6578689781002ad9dca5fe5d2fd1d7506c12cfd83df43f linux_x64: - image: mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net11.0-cross-amd64@sha256:a31af6e52ced742683bcd0775cb27878905573c80e275016d1da765c3537d160 + image: mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net11.0-cross-amd64@sha256:b3bccb97c39671ff6ae42da1aebe2c36eefef762dbbff2b1c940107e7556925c env: ROOTFS_DIR: /crossrootfs/x64 linux_x86: - image: mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net11.0-cross-x86@sha256:e68870057076f6cff81a038fad76658d29c650fcd9a2b2f4ee167089e9e83b0a + image: mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net11.0-cross-x86@sha256:c71e5306e3b913c4848a24c4a6cb1486d600efce75def0cdc8f60ae8493f2013 env: ROOTFS_DIR: /crossrootfs/x86 linux_x64_dev_innerloop: - image: mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-24.04@sha256:3d3aa4e4460fe67c708e9f997864767b83167f0402b67964be1e2cc1e760bc31 + image: mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-24.04@sha256:949fc6137f91381b7646870d1081a7d8dd3acbdf0f69980c6a7318888d28d04a linux_musl_x64_dev_innerloop: - image: mcr.microsoft.com/dotnet-buildtools/prereqs:alpine-3.23-amd64@sha256:f38b4dbbb9a441d842d80bc9fbeabbda94cf92f9197f295bfbef810cbf026170 + image: mcr.microsoft.com/dotnet-buildtools/prereqs:alpine-3.23-amd64@sha256:a18d858c0c9dbcb8a6ebc64db4398c40f956e003da8d80c0f7dc9b6bce271edc linux_x64_sanitizer: - image: mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net11.0-cross-amd64-sanitizer@sha256:567cec8ee739e1ba663d588e8ff5cfa10a9f2db8d71cbc8e5b48cff286a4a584 + image: mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net11.0-cross-amd64-sanitizer@sha256:d6ae4c886d5b9859b99fdad6e9de067f8728fe2c3beb68e9578715f798f4f5cd env: ROOTFS_DIR: /crossrootfs/x64 # Used to test RHEL compatibility: CentOS Stream is upstream of RHEL SourceBuild_centos_x64: - image: mcr.microsoft.com/dotnet-buildtools/prereqs:centos-stream-10-amd64@sha256:e601475697ad0647de81530cfdc93c7bb0c0687675048193f815865599eb8a92 + image: mcr.microsoft.com/dotnet-buildtools/prereqs:centos-stream-10-amd64@sha256:09e5e6a37b8e5d2f6d887e38aacf248f92f43013620e347ce66f717a09d6764d # Used to test RHEL compatibility: Alma Linux is downstream of RHEL SourceBuild_linux_x64: - image: mcr.microsoft.com/dotnet-buildtools/prereqs:almalinux-9-source-build-amd64@sha256:327874499a3e62bc8548bd82dda2420338b9c5b322bf3e3a343236d262ddd327 + image: mcr.microsoft.com/dotnet-buildtools/prereqs:almalinux-9-source-build-amd64@sha256:e364bac19f3b478a8d0d164d616e2a3ec4f80ae2f4bef3f15c3dd7691710de13 linux_s390x: - image: mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net11.0-cross-s390x@sha256:846c828ce879b3fd8ff538f7f1b26f5e74385bdf5ad3397c589c9fcb6f2eb6aa + image: mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net11.0-cross-s390x@sha256:a4b90354ee8b21a90a7fbb986e35f5fba5cc26a2f5c1e38736744413729d2ded env: ROOTFS_DIR: /crossrootfs/s390x linux_ppc64le: - image: mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net11.0-cross-ppc64le@sha256:cd8001a24f2465383ccdb80fbf413db4976b0490aa5ea6079f4bd51095ea6cbe + image: mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net11.0-cross-ppc64le@sha256:3849fefaf3d6529468e3996d951f1d5018f0baac04081c7a5b44a5c43bd6add9 env: ROOTFS_DIR: /crossrootfs/ppc64le linux_riscv64: - image: mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net11.0-cross-riscv64@sha256:6f5f90b9ae70d2debfc1f465697345b32b661fa9d42972802a2bb660325fd447 + image: mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net11.0-cross-riscv64@sha256:f82e3fa0b0968e940f8fa4bb947ecae11ec6198969b834daaabef8115b0f41f7 env: ROOTFS_DIR: /crossrootfs/riscv64 linux_loongarch64: - image: mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net11.0-cross-loongarch64@sha256:5908b2ef30027f87bbb6b037a21c09f17b1c5f632558d553202b5732860420ae + image: mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net11.0-cross-loongarch64@sha256:6833f4b20402f1cb5e3565adefa2f1b3587d30c52a80a45a907e567d249e773e env: ROOTFS_DIR: /crossrootfs/loongarch64 debian-13-gcc15-amd64: - image: mcr.microsoft.com/dotnet-buildtools/prereqs:debian-13-gcc15-amd64@sha256:9165c90647a47c6c300d9c7e4a4fb41ac89c36a60b116ff38c7ccc66e9e393d2 + image: mcr.microsoft.com/dotnet-buildtools/prereqs:debian-13-gcc15-amd64@sha256:0e9efcf38050fcaea19d07812bd24bfc106a1562bb0a4e2b2d5183dcfe014be2 linux_x64_llvmaot: - image: mcr.microsoft.com/dotnet-buildtools/prereqs:centos-stream-10-amd64@sha256:e601475697ad0647de81530cfdc93c7bb0c0687675048193f815865599eb8a92 + image: mcr.microsoft.com/dotnet-buildtools/prereqs:centos-stream-10-amd64@sha256:09e5e6a37b8e5d2f6d887e38aacf248f92f43013620e347ce66f717a09d6764d browser_wasm: - image: mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net11.0-webassembly-amd64@sha256:5b8a4bba79623fb4e873d2fe7fe83a3c2734160f9e72549f870b8ae2e0e3c994 + image: mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net11.0-webassembly-amd64@sha256:75e59a4fb5bb9cffcfd34a234f43d2282c2cfb0df153f0e83f29f77bde7a0e6b env: ROOTFS_DIR: /crossrootfs/x64 wasi_wasm: - image: mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net11.0-webassembly-amd64@sha256:5b8a4bba79623fb4e873d2fe7fe83a3c2734160f9e72549f870b8ae2e0e3c994 + image: mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net11.0-webassembly-amd64@sha256:75e59a4fb5bb9cffcfd34a234f43d2282c2cfb0df153f0e83f29f77bde7a0e6b env: ROOTFS_DIR: /crossrootfs/x64 freebsd_x64: - image: mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net11.0-cross-freebsd-14-amd64@sha256:dc020b61ddf932532645dff420807b71700b6eff814969dcef3933fcfb2cf858 + image: mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net11.0-cross-freebsd-14-amd64@sha256:664efcd9da2322928c05f65a16e6442644503f8472ef89ec7b3d8766a40a2d5c env: ROOTFS_DIR: /crossrootfs/x64 tizen_armel: - image: mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-22.04-cross-armel-tizen@sha256:7be7701b9889fba8263dd1bd36b269541909071e8c725001f6875c04dad703d0 + image: mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-22.04-cross-armel-tizen@sha256:a1d0affe09ce7ca2abd1badbb806e268d907f2abbe8e995e9d701e98727ace8a env: ROOTFS_DIR: /crossrootfs/armel diff --git a/eng/pipelines/coreclr/templates/helix-queues-setup.yml b/eng/pipelines/coreclr/templates/helix-queues-setup.yml index ad687d71b45604..38fa0c13123486 100644 --- a/eng/pipelines/coreclr/templates/helix-queues-setup.yml +++ b/eng/pipelines/coreclr/templates/helix-queues-setup.yml @@ -63,9 +63,9 @@ jobs: # Browser wasm - ${{ if eq(parameters.platform, 'browser_wasm') }}: - ${{ if eq(variables['System.TeamProject'], 'public') }}: - - (Ubuntu.2604.Amd64.Open)AzureLinux.3.Amd64.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-26.04-helix-webassembly-amd64@sha256:051f8f1a037bbe85fca4d81e4cd56d496840fbe3edcfee776d4963331cb28029 + - (Ubuntu.2604.Amd64.Open)AzureLinux.3.Amd64.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-26.04-helix-webassembly-amd64@sha256:c9dc51010e0627d319d55e058400b4888b03f4be8988d09e65a7505264ea45a2 - ${{ if eq(variables['System.TeamProject'], 'internal') }}: - - (Ubuntu.2604.Amd64)AzureLinux.3.Amd64@mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-26.04-helix-webassembly-amd64@sha256:051f8f1a037bbe85fca4d81e4cd56d496840fbe3edcfee776d4963331cb28029 + - (Ubuntu.2604.Amd64)AzureLinux.3.Amd64@mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-26.04-helix-webassembly-amd64@sha256:c9dc51010e0627d319d55e058400b4888b03f4be8988d09e65a7505264ea45a2 # iOS devices - ${{ if in(parameters.platform, 'ios_arm64') }}: @@ -84,9 +84,9 @@ jobs: # Linux arm - ${{ if eq(parameters.platform, 'linux_arm') }}: - ${{ if eq(variables['System.TeamProject'], 'public') }}: - - (Debian.13.Arm32.Open)AzureLinux.3.Arm64.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:debian-13-helix-arm32v7@sha256:51d087934972200928d8deffdcbd164d7b6f12af7b46059be125bc00b357ad12 + - (Debian.13.Arm32.Open)AzureLinux.3.Arm64.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:debian-13-helix-arm32v7@sha256:9ee81df17d6a4bf96b7b2f785a1352a3a762aec2a01b2bb8ffd691520aad7dee - ${{ if eq(variables['System.TeamProject'], 'internal') }}: - - (Debian.13.Arm32)AzureLinux.3.Arm64@mcr.microsoft.com/dotnet-buildtools/prereqs:debian-13-helix-arm32v7@sha256:51d087934972200928d8deffdcbd164d7b6f12af7b46059be125bc00b357ad12 + - (Debian.13.Arm32)AzureLinux.3.Arm64@mcr.microsoft.com/dotnet-buildtools/prereqs:debian-13-helix-arm32v7@sha256:9ee81df17d6a4bf96b7b2f785a1352a3a762aec2a01b2bb8ffd691520aad7dee # Linux arm64 - ${{ if eq(parameters.platform, 'linux_arm64') }}: @@ -98,23 +98,23 @@ jobs: # Linux musl x64 - ${{ if eq(parameters.platform, 'linux_musl_x64') }}: - ${{ if eq(variables['System.TeamProject'], 'public') }}: - - (Alpine.323.Amd64.Open)AzureLinux.3.Amd64.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:alpine-3.23-helix-amd64@sha256:0d1628f4008b733e3a8f91fa617153b54cc792a30443395624652b372cfb55b0 + - (Alpine.323.Amd64.Open)AzureLinux.3.Amd64.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:alpine-3.23-helix-amd64@sha256:28a8f1c15d472911de8095c1bb21b624cfd5eae6aeb00d4092c3894cb0d3966b - ${{ if eq(variables['System.TeamProject'], 'internal') }}: - - (Alpine.323.Amd64)AzureLinux.3.Amd64@mcr.microsoft.com/dotnet-buildtools/prereqs:alpine-3.23-helix-amd64@sha256:0d1628f4008b733e3a8f91fa617153b54cc792a30443395624652b372cfb55b0 + - (Alpine.323.Amd64)AzureLinux.3.Amd64@mcr.microsoft.com/dotnet-buildtools/prereqs:alpine-3.23-helix-amd64@sha256:28a8f1c15d472911de8095c1bb21b624cfd5eae6aeb00d4092c3894cb0d3966b # Linux musl arm32 - ${{ if eq(parameters.platform, 'linux_musl_arm') }}: - ${{ if eq(variables['System.TeamProject'], 'public') }}: - - (Alpine.323.Arm32.Open)AzureLinux.3.Arm64.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:alpine-3.23-helix-arm32v7@sha256:b6a2e7098c3949b98043f847d5fc17523ab711fab0b8769b17a8e2b9677843d0 + - (Alpine.323.Arm32.Open)AzureLinux.3.Arm64.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:alpine-3.23-helix-arm32v7@sha256:d442f29874a97bdadc42c48eaf0b0e0c65454414e42aadfa0dba3cb206e3ecef - ${{ if eq(variables['System.TeamProject'], 'internal') }}: - - (Alpine.323.Arm32)AzureLinux.3.Arm64@mcr.microsoft.com/dotnet-buildtools/prereqs:alpine-3.23-helix-arm32v7@sha256:b6a2e7098c3949b98043f847d5fc17523ab711fab0b8769b17a8e2b9677843d0 + - (Alpine.323.Arm32)AzureLinux.3.Arm64@mcr.microsoft.com/dotnet-buildtools/prereqs:alpine-3.23-helix-arm32v7@sha256:d442f29874a97bdadc42c48eaf0b0e0c65454414e42aadfa0dba3cb206e3ecef # Linux musl arm64 - ${{ if eq(parameters.platform, 'linux_musl_arm64') }}: - ${{ if eq(variables['System.TeamProject'], 'public') }}: - - (Alpine.323.Arm64.Open)AzureLinux.3.Arm64.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:alpine-3.23-helix-arm64v8@sha256:09e23d72bd6741b7a95ffeebc2899c97388e95fbce2bc8edff79afc4f15b15be + - (Alpine.323.Arm64.Open)AzureLinux.3.Arm64.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:alpine-3.23-helix-arm64v8@sha256:ede25506b331984c7f64a2961e5f5ca6222f237a929c2ad2a4c4f4a5af652504 - ${{ if eq(variables['System.TeamProject'], 'internal') }}: - - (Alpine.323.Arm64)AzureLinux.3.Arm64@mcr.microsoft.com/dotnet-buildtools/prereqs:alpine-3.23-helix-arm64v8@sha256:09e23d72bd6741b7a95ffeebc2899c97388e95fbce2bc8edff79afc4f15b15be + - (Alpine.323.Arm64)AzureLinux.3.Arm64@mcr.microsoft.com/dotnet-buildtools/prereqs:alpine-3.23-helix-arm64v8@sha256:ede25506b331984c7f64a2961e5f5ca6222f237a929c2ad2a4c4f4a5af652504 # Linux x64 - ${{ if eq(parameters.platform, 'linux_x64') }}: diff --git a/eng/pipelines/installer/helix-queues-setup.yml b/eng/pipelines/installer/helix-queues-setup.yml index 1f0d820fedfd62..592e70c310dc03 100644 --- a/eng/pipelines/installer/helix-queues-setup.yml +++ b/eng/pipelines/installer/helix-queues-setup.yml @@ -25,19 +25,19 @@ jobs: # Linux arm - ${{ if eq(parameters.platform, 'linux_arm') }}: - - (Debian.13.Arm32.Open)AzureLinux.3.Arm64.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:debian-13-helix-arm32v7@sha256:51d087934972200928d8deffdcbd164d7b6f12af7b46059be125bc00b357ad12 + - (Debian.13.Arm32.Open)AzureLinux.3.Arm64.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:debian-13-helix-arm32v7@sha256:9ee81df17d6a4bf96b7b2f785a1352a3a762aec2a01b2bb8ffd691520aad7dee # Linux arm64 - ${{ if eq(parameters.platform, 'linux_arm64') }}: - - (Ubuntu.2604.Arm64.Open)AzureLinux.3.Arm64.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-26.04-helix-arm64v8@sha256:0fc4e37fe8415580242f392d306761444e69efcd2e9668f13ac7a1eec9f439b8 + - (Ubuntu.2604.Arm64.Open)AzureLinux.3.Arm64.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-26.04-helix-arm64v8@sha256:527933fdfcdf9bcc73c049f43db352710d6c9d666d84ae84991209b39a2f6acd # Linux musl x64 - ${{ if eq(parameters.platform, 'linux_musl_x64') }}: - - (Alpine.323.Amd64.Open)AzureLinux.3.Amd64.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:alpine-3.23-helix-amd64@sha256:0d1628f4008b733e3a8f91fa617153b54cc792a30443395624652b372cfb55b0 + - (Alpine.323.Amd64.Open)AzureLinux.3.Amd64.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:alpine-3.23-helix-amd64@sha256:28a8f1c15d472911de8095c1bb21b624cfd5eae6aeb00d4092c3894cb0d3966b # Linux musl arm64 - ${{ if and(eq(parameters.platform, 'linux_musl_arm64'), or(eq(parameters.jobParameters.isExtraPlatformsBuild, true), eq(parameters.jobParameters.includeAllPlatforms, true))) }}: - - (Alpine.323.Arm64.Open)AzureLinux.3.Arm64.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:alpine-3.23-helix-arm64v8@sha256:09e23d72bd6741b7a95ffeebc2899c97388e95fbce2bc8edff79afc4f15b15be + - (Alpine.323.Arm64.Open)AzureLinux.3.Arm64.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:alpine-3.23-helix-arm64v8@sha256:ede25506b331984c7f64a2961e5f5ca6222f237a929c2ad2a4c4f4a5af652504 # Linux x64 - ${{ if eq(parameters.platform, 'linux_x64') }}: diff --git a/eng/pipelines/libraries/helix-queues-setup.yml b/eng/pipelines/libraries/helix-queues-setup.yml index 103c4aa1fc3cf7..925362ecd58495 100644 --- a/eng/pipelines/libraries/helix-queues-setup.yml +++ b/eng/pipelines/libraries/helix-queues-setup.yml @@ -26,44 +26,44 @@ jobs: # Linux arm - ${{ if eq(parameters.platform, 'linux_arm') }}: - ${{ if or(eq(parameters.jobParameters.isExtraPlatformsBuild, true), eq(parameters.jobParameters.includeAllPlatforms, true)) }}: - - (Debian.13.Arm32.Open)AzureLinux.3.Arm64.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:debian-13-helix-arm32v7@sha256:51d087934972200928d8deffdcbd164d7b6f12af7b46059be125bc00b357ad12 + - (Debian.13.Arm32.Open)AzureLinux.3.Arm64.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:debian-13-helix-arm32v7@sha256:9ee81df17d6a4bf96b7b2f785a1352a3a762aec2a01b2bb8ffd691520aad7dee # Linux arm64 - ${{ if eq(parameters.platform, 'linux_arm64') }}: - ${{ if or(eq(parameters.jobParameters.isExtraPlatformsBuild, true), eq(parameters.jobParameters.includeAllPlatforms, true)) }}: - - (Ubuntu.2604.ArmArch.Open)AzureLinux.3.Arm64.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-26.04-helix-arm64v8@sha256:0fc4e37fe8415580242f392d306761444e69efcd2e9668f13ac7a1eec9f439b8 + - (Ubuntu.2604.ArmArch.Open)AzureLinux.3.Arm64.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-26.04-helix-arm64v8@sha256:527933fdfcdf9bcc73c049f43db352710d6c9d666d84ae84991209b39a2f6acd - ${{ if or(ne(parameters.jobParameters.isExtraPlatformsBuild, true), eq(parameters.jobParameters.includeAllPlatforms, true)) }}: - - (AzureLinux.3.0.ArmArch.Open)AzureLinux.3.Arm64.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-helix-arm64v8@sha256:8dc85a0534a8d46f7e2b149adf53c78c8208f06b8bb60835422b4ab8a948798b + - (AzureLinux.3.0.ArmArch.Open)AzureLinux.3.Arm64.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-helix-arm64v8@sha256:71ebe961ba52031c21a19a0b5f32cb03be8b246bb63ccd2111c8dbc2b8af2a84 # Linux musl x64 - ${{ if eq(parameters.platform, 'linux_musl_x64') }}: - ${{ if or(eq(parameters.jobParameters.isExtraPlatformsBuild, true), eq(parameters.jobParameters.includeAllPlatforms, true)) }}: - - (Alpine.Edge.Amd64.Open)AzureLinux.3.Amd64.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:alpine-edge-helix-amd64@sha256:f3eb05cdc8f8b56f9b3d0a75ebfaff49ac0bcc6da64686d5519fed6659483b4a + - (Alpine.Edge.Amd64.Open)AzureLinux.3.Amd64.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:alpine-edge-helix-amd64@sha256:2191169e5469f76f05cf11ba367707c321d7d454297fa55c65efa799c8146a36 - ${{ if or(ne(parameters.jobParameters.isExtraPlatformsBuild, true), eq(parameters.jobParameters.includeAllPlatforms, true)) }}: - - (Alpine.323.Amd64.Open)AzureLinux.3.Amd64.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:alpine-3.23-helix-amd64@sha256:0d1628f4008b733e3a8f91fa617153b54cc792a30443395624652b372cfb55b0 + - (Alpine.323.Amd64.Open)AzureLinux.3.Amd64.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:alpine-3.23-helix-amd64@sha256:28a8f1c15d472911de8095c1bb21b624cfd5eae6aeb00d4092c3894cb0d3966b # Linux musl arm64 - ${{ if eq(parameters.platform, 'linux_musl_arm64') }}: - ${{ if or(eq(parameters.jobParameters.isExtraPlatformsBuild, true), eq(parameters.jobParameters.includeAllPlatforms, true)) }}: - - (Alpine.323.Arm64.Open)AzureLinux.3.Arm64.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:alpine-3.23-helix-arm64v8@sha256:09e23d72bd6741b7a95ffeebc2899c97388e95fbce2bc8edff79afc4f15b15be + - (Alpine.323.Arm64.Open)AzureLinux.3.Arm64.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:alpine-3.23-helix-arm64v8@sha256:ede25506b331984c7f64a2961e5f5ca6222f237a929c2ad2a4c4f4a5af652504 # Linux x64 - ${{ if eq(parameters.platform, 'linux_x64') }}: - ${{ if or(eq(parameters.jobParameters.interpreter, 'true'), eq(parameters.jobParameters.isSingleFile, true)) }}: # Limiting interp runs as we don't need as much coverage. - - (Debian.13.Amd64.Open)AzureLinux.3.Amd64.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:debian-13-helix-amd64@sha256:05e16d140c118f0b1764276949d413dc0a6b9e553c93ef744d18cc950fe41931 + - (Debian.13.Amd64.Open)AzureLinux.3.Amd64.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:debian-13-helix-amd64@sha256:4bf6a0a32b1e4dbe3e0cc0b453d0bea775d9898336cdb3c92c84862c05d822ea - ${{ else }}: - ${{ if eq(parameters.jobParameters.runtimeFlavor, 'mono') }}: # Mono path - test minimal scenario - - (Ubuntu.2604.Amd64.Open)AzureLinux.3.Amd64.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-26.04-helix-amd64@sha256:2d2df03fcfe386c1a95f7d778e17e6efac2d5e0b907a6d9efd4c05cbc4ab8cec + - (Ubuntu.2604.Amd64.Open)AzureLinux.3.Amd64.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-26.04-helix-amd64@sha256:360a2dc1aac8bbfc1b0923ea5ce9dac11845aa373fe03eb89d9baff0b3f2243e - ${{ else }}: # CoreCLR path - ${{ if and(eq(parameters.jobParameters.isExtraPlatformsBuild, true), ne(parameters.jobParameters.testScope, 'outerloop'))}}: # extra-platforms CoreCLR (inner loop only) - - (Debian.13.Amd64.Open)AzureLinux.3.Amd64.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:debian-13-helix-amd64@sha256:05e16d140c118f0b1764276949d413dc0a6b9e553c93ef744d18cc950fe41931 - - (Fedora.44.Amd64.Open)AzureLinux.3.Amd64.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:fedora-44-helix-amd64@sha256:6ad25da3791c165ad4ae034d0ad59f2c745dbaa8657b433504050e82c9d63450 - - (openSUSE.16.0.Amd64.Open)AzureLinux.3.Amd64.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:opensuse-16.0-helix-amd64@sha256:58f51fb0b035d1d3ed1acae56aab87392854933bcff52a4ec6007975dc4cae95 + - (Debian.13.Amd64.Open)AzureLinux.3.Amd64.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:debian-13-helix-amd64@sha256:4bf6a0a32b1e4dbe3e0cc0b453d0bea775d9898336cdb3c92c84862c05d822ea + - (Fedora.44.Amd64.Open)AzureLinux.3.Amd64.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:fedora-44-helix-amd64@sha256:d61f2b7f64797109f37109b55183751847b62eb23734698c9b056cb25194577e + - (openSUSE.16.0.Amd64.Open)AzureLinux.3.Amd64.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:opensuse-16.0-helix-amd64@sha256:010211f9ab9e8238ffb0656edee4c8a411e5a4a9fb4718037614c8c94350e45c - ${{ if eq(parameters.jobParameters.testScope, 'outerloop') }}: # outerloop only CoreCLR @@ -72,11 +72,11 @@ jobs: - ${{ if or(ne(parameters.jobParameters.isExtraPlatformsBuild, true), eq(parameters.jobParameters.includeAllPlatforms, true))}}: # inner and outer loop CoreCLR (general set) # Primary distro for all builds - - (Ubuntu.2604.Amd64.Open)AzureLinux.3.Amd64.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-26.04-helix-amd64@sha256:2d2df03fcfe386c1a95f7d778e17e6efac2d5e0b907a6d9efd4c05cbc4ab8cec + - (Ubuntu.2604.Amd64.Open)AzureLinux.3.Amd64.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-26.04-helix-amd64@sha256:360a2dc1aac8bbfc1b0923ea5ce9dac11845aa373fe03eb89d9baff0b3f2243e # Additional distros on non-PR builds for broader coverage - ${{ if or(eq(variables['isRollingBuild'], true), eq(parameters.jobParameters.includeAllPlatforms, true)) }}: - - (AzureLinux.3.0.Amd64.Open)AzureLinux.3.Amd64.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-helix-amd64@sha256:f0d4e84954cdc5f603bb25c9cb321b422b657479ac3df340c0819f23c9781c4e - - (Centos.10.Amd64.Open)AzureLinux.3.Amd64.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:centos-stream-10-helix-amd64@sha256:7a5b1a8c465581b40bcc5a4ec119b842152eb3e83986982ffbaed1ec2e2c1c35 + - (AzureLinux.3.0.Amd64.Open)AzureLinux.3.Amd64.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-helix-amd64@sha256:ff0868b68401f47e9d8e81508f1170eacbc0dba6cdc90a576f6e01193d4a0953 + - (Centos.10.Amd64.Open)AzureLinux.3.Amd64.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:centos-stream-10-helix-amd64@sha256:030241e789bd9adb3542dbf9b2a2ca5e71c7c86dfb2d3be414fb01c2dcc60665 # OSX arm64 - ${{ if eq(parameters.platform, 'osx_arm64') }}: @@ -126,18 +126,18 @@ jobs: - Windows.Amd64.Server2022.Open - Windows.Server2025.Amd64.Open - ${{ if ne(parameters.jobParameters.testScope, 'outerloop') }}: - - (Windows.10.Amd64.ServerRS5.Open)windows.10.amd64.serverrs5.open@mcr.microsoft.com/dotnet-buildtools/prereqs:windowsservercore-ltsc2019-helix-amd64@sha256:754a73dec81279f87da34bd8ad9c7ce5c7295435d52d7eeeb1efdb090186c988 + - (Windows.10.Amd64.ServerRS5.Open)windows.10.amd64.serverrs5.open@mcr.microsoft.com/dotnet-buildtools/prereqs:windowsservercore-ltsc2019-helix-amd64@sha256:9e71dbc7309ebc5aff24175cc366e012d32bf12128a2d5f350a188b97d8500de - ${{ if or(ne(parameters.jobParameters.isExtraPlatformsBuild, true), eq(parameters.jobParameters.includeAllPlatforms, true)) }}: # Primary Windows versions for all builds: newest server + Nano (distinct environment) - Windows.Server2025.Amd64.Open - ${{ if ne(parameters.jobParameters.runtimeFlavor, 'mono') }}: - - (Windows.Nano.1809.Amd64.Open)windows.10.amd64.serverrs5.open@mcr.microsoft.com/dotnet-buildtools/prereqs:nanoserver-1809-helix-amd64@sha256:20b45a061831d02743bd27ff4031ada2fba0dadc231e41d5ce96541e0b3058fc + - (Windows.Nano.1809.Amd64.Open)windows.10.amd64.serverrs5.open@mcr.microsoft.com/dotnet-buildtools/prereqs:nanoserver-1809-helix-amd64@sha256:9d938f6fa79e4cf52577e14662fa064d6321e22ee14940fd1bf696b0c9a0738e # Additional Windows versions on non-PR builds for broader coverage - ${{ if or(eq(variables['isRollingBuild'], true), eq(parameters.jobParameters.includeAllPlatforms, true)) }}: - Windows.Amd64.Server2022.Open - Windows.11.Amd64.Client.Open - ${{ if eq(parameters.jobParameters.testScope, 'outerloop') }}: - - (Windows.10.Amd64.ServerRS5.Open)windows.10.amd64.serverrs5.open@mcr.microsoft.com/dotnet-buildtools/prereqs:windowsservercore-ltsc2019-helix-amd64@sha256:754a73dec81279f87da34bd8ad9c7ce5c7295435d52d7eeeb1efdb090186c988 + - (Windows.10.Amd64.ServerRS5.Open)windows.10.amd64.serverrs5.open@mcr.microsoft.com/dotnet-buildtools/prereqs:windowsservercore-ltsc2019-helix-amd64@sha256:9e71dbc7309ebc5aff24175cc366e012d32bf12128a2d5f350a188b97d8500de # .NETFramework - ${{ if eq(parameters.jobParameters.framework, 'net481') }}: @@ -167,22 +167,22 @@ jobs: # WASI - ${{ if eq(parameters.platform, 'wasi_wasm') }}: - - (Ubuntu.2604.Amd64.Open)AzureLinux.3.Amd64.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-26.04-helix-webassembly-amd64@sha256:051f8f1a037bbe85fca4d81e4cd56d496840fbe3edcfee776d4963331cb28029 + - (Ubuntu.2604.Amd64.Open)AzureLinux.3.Amd64.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-26.04-helix-webassembly-amd64@sha256:c9dc51010e0627d319d55e058400b4888b03f4be8988d09e65a7505264ea45a2 # Browser WebAssembly - ${{ if eq(parameters.platform, 'browser_wasm') }}: - - (Ubuntu.2604.Amd64.Open)AzureLinux.3.Amd64.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-26.04-helix-webassembly-amd64@sha256:051f8f1a037bbe85fca4d81e4cd56d496840fbe3edcfee776d4963331cb28029 + - (Ubuntu.2604.Amd64.Open)AzureLinux.3.Amd64.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-26.04-helix-webassembly-amd64@sha256:c9dc51010e0627d319d55e058400b4888b03f4be8988d09e65a7505264ea45a2 # Browser WebAssembly Firefox - ${{ if eq(parameters.platform, 'browser_wasm_firefox') }}: - - (Ubuntu.2604.Amd64.Open)AzureLinux.3.Amd64.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-26.04-helix-webassembly-amd64@sha256:051f8f1a037bbe85fca4d81e4cd56d496840fbe3edcfee776d4963331cb28029 + - (Ubuntu.2604.Amd64.Open)AzureLinux.3.Amd64.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-26.04-helix-webassembly-amd64@sha256:c9dc51010e0627d319d55e058400b4888b03f4be8988d09e65a7505264ea45a2 # Browser WebAssembly windows - ${{ if in(parameters.platform, 'browser_wasm_win', 'wasi_wasm_win') }}: # Primary Windows version for all builds - - (Windows.Server2025.Amd64.Open)windows.server2025.amd64.open@mcr.microsoft.com/dotnet-buildtools/prereqs:windowsservercore-ltsc2025-helix-webassembly-amd64@sha256:0ef2d61bfaaef7e12e749fba43613faf733e4cb6414f802050a05a352db1ff74 + - (Windows.Server2025.Amd64.Open)windows.server2025.amd64.open@mcr.microsoft.com/dotnet-buildtools/prereqs:windowsservercore-ltsc2025-helix-webassembly-amd64@sha256:abd08648c8873a4941b231c0320068c1178327d370890f86620598ad0c0fd4b8 # Additional Windows version on non-PR builds or when all platforms are requested - ${{ if or(eq(variables['isRollingBuild'], true), eq(parameters.jobParameters.includeAllPlatforms, true)) }}: - - (Windows.Amd64.Server2022.Open)windows.amd64.server2022.open@mcr.microsoft.com/dotnet-buildtools/prereqs:windowsservercore-ltsc2022-helix-webassembly@sha256:7c1931f80de6811b6575464b16e3406e9ed1515c4c4ed0514010f69d72c99a7c + - (Windows.Amd64.Server2022.Open)windows.amd64.server2022.open@mcr.microsoft.com/dotnet-buildtools/prereqs:windowsservercore-ltsc2022-helix-webassembly@sha256:0596a8407fe97242294c2e60d433483a65196e90d1cebcf52e802055153fbcd9 ${{ insert }}: ${{ parameters.jobParameters }} From 9dced0c3655de3955d9fa7887f6da165b50acbe6 Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Tue, 5 May 2026 13:56:26 -0700 Subject: [PATCH 011/109] Use exponential buffer growth in LoopbackServer test helper (#127779) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Description `LoopbackServer.Connection` grows its read buffers by a fixed `+BufferSize` (4000 bytes) on each resize, causing O(n²) copying for large payloads. Changed to `*2` doubling in both `ReadToEndAsync` and `ReadLineBytesAsync` using `Array.Resize`. **`ReadToEndAsync`:** - Fixed the resize trigger from `bytesRead == buffer.Length` to `offset == buffer.Length` (the previous check would stop triggering after the first resize, since subsequent reads only fill the remaining buffer space) - Replaced manual `new byte[] + CopyTo` with `Array.Resize(ref buffer, buffer.Length * 2)` - Removed the redundant `totalLength` variable; the final `GetString` now uses `offset` directly **`ReadLineBytesAsync`:** - Replaced manual `new byte[] + Array.Copy` (into new buffer) with in-place `Array.Copy` to compact live data, followed by `Array.Resize(ref _readBuffer, _readBuffer.Length * 2)` - Index resets (`_readStart`, `_readEnd`, `startSearch`) are now always applied unconditionally after the compact step --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: agocke <515774+agocke@users.noreply.github.com> Co-authored-by: MihaZupan <25307628+MihaZupan@users.noreply.github.com> --- .../tests/System/Net/Http/LoopbackServer.cs | 24 +++++++------------ 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/src/libraries/Common/tests/System/Net/Http/LoopbackServer.cs b/src/libraries/Common/tests/System/Net/Http/LoopbackServer.cs index ac80fe227c4579..d1a795bfec9e29 100644 --- a/src/libraries/Common/tests/System/Net/Http/LoopbackServer.cs +++ b/src/libraries/Common/tests/System/Net/Http/LoopbackServer.cs @@ -582,25 +582,20 @@ public async Task ReadToEndAsync() { byte[] buffer = new byte[BufferSize]; int offset = 0; - int totalLength = 0; int bytesRead; do { bytesRead = await ReadAsync(buffer, offset, buffer.Length - offset).ConfigureAwait(false); - totalLength += bytesRead; offset += bytesRead; - if (bytesRead == buffer.Length) + if (offset == buffer.Length) { - byte[] newBuffer = new byte[buffer.Length + BufferSize]; - buffer.CopyTo(newBuffer, 0); - offset = buffer.Length; - buffer = newBuffer; + Array.Resize(ref buffer, buffer.Length * 2); } } while (bytesRead > 0); - return System.Text.Encoding.ASCII.GetString(buffer, 0, totalLength); + return System.Text.Encoding.ASCII.GetString(buffer, 0, offset); } public string ReadLine() @@ -631,17 +626,16 @@ private async Task ReadLineBytesAsync() // In either case, read more. if (_readEnd + 2 > _readBuffer.Length) { - // We no longer have space to read CRLF. Allocate new buffer and start over. - byte[] newBuffer = new byte[_readBuffer.Length + BufferSize]; + // We no longer have space to read CRLF. Compact and/or grow the buffer. int dataLength = _readEnd - _readStart; if (dataLength > 0) { - Array.Copy(_readBuffer, _readStart, newBuffer, 0, dataLength); - _readStart = 0; - _readEnd = dataLength; - _readBuffer = newBuffer; - startSearch = dataLength; + Array.Copy(_readBuffer, _readStart, _readBuffer, 0, dataLength); } + _readStart = 0; + _readEnd = dataLength; + startSearch = dataLength; + Array.Resize(ref _readBuffer, _readBuffer.Length * 2); } int bytesRead = await _stream.ReadAsync(_readBuffer, _readEnd, _readBuffer.Length - _readEnd).ConfigureAwait(false); From 2e33a3e335d509dda962bf1ca463d6c970b7393b Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Tue, 5 May 2026 18:27:34 -0700 Subject: [PATCH 012/109] Fix CompositeFormat brace escaping ignored in string.Format fast-path (#127819) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes https://github.com/dotnet/runtime/issues/127794 `string.Format` with `CompositeFormat` returned the raw format string instead of unescaping `{{`→`{` and `}}`→`}` when no format holes were present. ## Root Cause Two fast-paths in `String.Manipulation.cs` short-circuit to `format.Format` (the original unparsed string) without checking whether brace escaping occurred: 1. `args.Length == 0` branch returns `format.Format` unconditionally 2. `_formattedCount == 0` guard in the private `Format` returns `format.Format` unconditionally `StringBuilder.AppendFormat` and `MemoryExtensions.TryWrite` lack these fast-paths and work correctly by always iterating parsed segments. ## Fix Both conditions additionally check `format._literalLength == format.Format.Length`. When escaped braces are present, the unescaped literal length is shorter than the raw format string, so the condition is `false` and execution falls through to the correct segment-iteration path. ```csharp // Before: 0 => format.Format, // After: 0 => format._literalLength == format.Format.Length ? format.Format : Format(provider, format, (object?)null, 0, 0, args), ``` ```csharp // Before: if (format._formattedCount == 0) { return format.Format; } // After: if (format._formattedCount == 0 && format._literalLength == format.Format.Length) { return format.Format; } ``` ## Test Coverage Three new entries in `Format_Valid_TestData` (reused by `StringFormat_Valid`, `StringBuilderAppendFormat_Valid`, and `MemoryExtensionsTryWrite_Valid`): | Format | Expected | |--------|----------| | `"{{"` | `"{"` | | `"}}"` | `"}"` | | `"{{text}}"` | `"{text}"` | --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: tarekgh <10833894+tarekgh@users.noreply.github.com> --- src/libraries/Common/tests/Tests/System/StringTests.cs | 3 +++ .../src/System/String.Manipulation.cs | 8 +++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/libraries/Common/tests/Tests/System/StringTests.cs b/src/libraries/Common/tests/Tests/System/StringTests.cs index fa5214bb43609a..806c39efa529a6 100644 --- a/src/libraries/Common/tests/Tests/System/StringTests.cs +++ b/src/libraries/Common/tests/Tests/System/StringTests.cs @@ -2666,6 +2666,9 @@ public static IEnumerable Format_Valid_TestData() yield return new object[] { null, "Foo {{{0}", new object[] { 1 }, "Foo {1" }; // Escaped open curly braces yield return new object[] { null, "Foo }}{0}", new object[] { 1 }, "Foo }1" }; // Escaped closed curly braces yield return new object[] { null, "Foo {0} {{0}}", new object[] { 1 }, "Foo 1 {0}" }; // Escaped placeholder + yield return new object[] { null, "{{", new object[0], "{" }; // Escaped open curly brace only + yield return new object[] { null, "}}", new object[0], "}" }; // Escaped close curly brace only + yield return new object[] { null, "{{text}}", new object[0], "{text}" }; // Escaped braces around text yield return new object[] { null, "Foo {0}", new object[] { null }, "Foo " }; // Values has null only yield return new object[] { null, "Foo {0} {1} {2}", new object[] { "Bar", null, "Baz" }, "Foo Bar Baz" }; // Values has null diff --git a/src/libraries/System.Private.CoreLib/src/System/String.Manipulation.cs b/src/libraries/System.Private.CoreLib/src/System/String.Manipulation.cs index d9d03cf0666b54..e0efef5daf3b5c 100644 --- a/src/libraries/System.Private.CoreLib/src/System/String.Manipulation.cs +++ b/src/libraries/System.Private.CoreLib/src/System/String.Manipulation.cs @@ -634,7 +634,7 @@ public static string Format(IFormatProvider? provider, CompositeFormat format, p format.ValidateNumberOfArgs(args.Length); return args.Length switch { - 0 => format.Format, + 0 => format._literalLength == format.Format.Length ? format.Format : Format(provider, format, (object?)null, 0, 0, args), 1 => Format(provider, format, args[0], 0, 0, args), 2 => Format(provider, format, args[0], args[1], 0, args), _ => Format(provider, format, args[0], args[1], args[2], args), @@ -643,8 +643,10 @@ public static string Format(IFormatProvider? provider, CompositeFormat format, p private static string Format(IFormatProvider? provider, CompositeFormat format, TArg0 arg0, TArg1 arg1, TArg2 arg2, ReadOnlySpan args) { - // If there's no formatting to be done, we can just return the original format string as the result. - if (format._formattedCount == 0) + // If there's no formatting to be done and no brace escaping in the format string, we can just return + // the original format string as the result. If there is brace escaping, we need to process the segments + // so that the escaped braces are properly unescaped in the result. + if (format._formattedCount == 0 && format._literalLength == format.Format.Length) { return format.Format; } From 859a2ea7e9d33406bbce6f4a147057ece1a65906 Mon Sep 17 00:00:00 2001 From: Stephen Toub Date: Tue, 5 May 2026 22:27:24 -0400 Subject: [PATCH 013/109] Add generic Random NextInteger/NextBinaryFloat APIs (#127462) Adds generic numeric APIs to `System.Random`: - `NextInteger()` - `NextInteger(T maxValue)` - `NextInteger(T minValue, T maxValue)` - `NextBinaryFloat()`. Fixes https://github.com/dotnet/runtime/issues/75431 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../src/System/Random.cs | 294 ++++++ .../System.Runtime/ref/System.Runtime.cs | 4 + .../System/Random.cs | 957 ++++++++++++++++++ 3 files changed, 1255 insertions(+) diff --git a/src/libraries/System.Private.CoreLib/src/System/Random.cs b/src/libraries/System.Private.CoreLib/src/System/Random.cs index 9fa1859187cbf0..35ffb4c8e2d9cf 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Random.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Random.cs @@ -15,6 +15,8 @@ namespace System /// public partial class Random { + private const int StackallocThreshold = 256; + /// The underlying generator implementation. /// /// This is separated out so that different generators can be used based on how this Random instance is constructed. @@ -179,6 +181,298 @@ public virtual void NextBytes(byte[] buffer) /// The array to be filled with random numbers. public virtual void NextBytes(Span buffer) => _impl.NextBytes(buffer); + /// Returns a non-negative random integer of type . + /// The type of integer to generate. + /// + /// A value of type in the inclusive range [0, T.MaxValue]. + /// + /// + /// Unlike , which returns an that is less than , + /// NextInteger<int>() returns an in the inclusive range from zero through + /// and may return . + /// must use a two's complement representation for signed values. + /// + public T NextInteger() where T : IBinaryInteger, IMinMaxValue + { + if (T.MaxValue == T.Zero) + { + return T.Zero; + } + + Debug.Assert(T.IsPositive(T.MaxValue)); + + int bitLength = T.MaxValue.GetShortestBitLength(); + int byteCount = (bitLength + 7) >> 3; + + // Compute mask for the top byte to avoid negative values for signed types + // and to reduce rejection rate for custom integer types. + int topBits = bitLength & 7; + byte topMask = topBits == 0 ? byte.MaxValue : (byte)((1 << topBits) - 1); + + byte[]? rented = null; + Span bytes = byteCount <= StackallocThreshold + ? stackalloc byte[StackallocThreshold] + : rented = ArrayPool.Shared.Rent(byteCount); + bytes = bytes.Slice(0, byteCount); + + try + { + while (true) + { + NextBytes(bytes); + bytes[^1] &= topMask; + + T value = T.ReadLittleEndian(bytes, isUnsigned: true); + if (value <= T.MaxValue) + { + return value; + } + } + } + finally + { + if (rented is not null) + { + ArrayPool.Shared.Return(rented); + } + } + } + + /// Returns a non-negative random integer that is less than the specified maximum. + /// The type of integer to generate. + /// The exclusive upper bound of the random number to be generated. + /// must be greater than or equal to zero. + /// + /// A value of type that is greater than or equal to zero, + /// and less than ; that is, the range of return values is ordinarily + /// [0, ). However, if equals zero, zero is returned. + /// + /// is less than zero. + /// must use a two's complement representation for signed values. + public T NextInteger(T maxValue) where T : IBinaryInteger + { + ArgumentOutOfRangeException.ThrowIfNegative(maxValue); + + return NextBinaryIntegerInRange(maxValue); + } + + /// Returns a random integer that is within a specified range. + /// The type of integer to generate. + /// The inclusive lower bound of the random number returned. + /// The exclusive upper bound of the random number returned. + /// must be greater than or equal to . + /// + /// A value of type greater than or equal to + /// and less than ; that is, the range of return values is ordinarily + /// [, ). If + /// equals , is returned. + /// + /// is greater than . + /// must use a two's complement representation for signed values. + public T NextInteger(T minValue, T maxValue) where T : IBinaryInteger + { + if (minValue > maxValue) + { + ThrowMinMaxValueSwapped(); + } + + T range = maxValue - minValue; + + // For signed types, subtraction may overflow when the range exceeds T.MaxValue. + // T.IsNegative(range) detects this. Fall back to full-width generation. + if (T.IsNegative(range)) + { + return NextBinaryIntegerFullRange(minValue, maxValue); + } + + return NextBinaryIntegerInRange(range) + minValue; + } + + /// Generates a random value in [T.Zero, maxExclusive) where maxExclusive is non-negative. + private T NextBinaryIntegerInRange(T maxExclusive) where T : IBinaryInteger + { + Debug.Assert(!T.IsNegative(maxExclusive)); + + // Fast paths for common types using existing optimized implementations. + // The JIT eliminates the dead branches when T is a known value type. + if (typeof(T) == typeof(sbyte) || + typeof(T) == typeof(byte) || + typeof(T) == typeof(short) || + typeof(T) == typeof(ushort) || + typeof(T) == typeof(char) || + typeof(T) == typeof(int) || + (typeof(T) == typeof(nint) && nint.Size == 4)) + { + return T.CreateTruncating(Next(int.CreateTruncating(maxExclusive))); + } + + if (typeof(T) == typeof(uint) || + typeof(T) == typeof(nint) || + typeof(T) == typeof(long) || + (typeof(T) == typeof(nuint) && nint.Size == 4)) + { + return T.CreateTruncating(NextInt64(long.CreateTruncating(maxExclusive))); + } + + // We can't always use a fast path for these types, but if the maxExclusive value + // fits within a long, we can just generate a long and cast. The round-trip check + // ensures we don't silently truncate values for types larger than ulong. + if (typeof(T) == typeof(ulong) || + (typeof(T) == typeof(nuint) && nint.Size == 8) || + typeof(T) == typeof(Int128) || + typeof(T) == typeof(UInt128)) + { + ulong maxExclusiveUlong = ulong.CreateTruncating(maxExclusive); + if (maxExclusiveUlong <= (ulong)long.MaxValue && + T.CreateTruncating(maxExclusiveUlong) == maxExclusive) + { + return T.CreateTruncating(NextInt64((long)maxExclusiveUlong)); + } + } + + // Generic fallback for large ulong, nuint, Int128, UInt128, BigInteger, etc. + return NextBinaryIntegerRejectionSampling(maxExclusive); + } + + /// Generic rejection sampling for arbitrary types. + private T NextBinaryIntegerRejectionSampling(T maxExclusive) where T : IBinaryInteger + { + if (maxExclusive == T.Zero) + { + return T.Zero; + } + + Debug.Assert(T.IsPositive(maxExclusive)); + + int bitLength = maxExclusive.GetShortestBitLength(); + int byteCount = (bitLength + 7) >> 3; + + // Compute mask for the top byte to reduce rejection rate. + int topBits = bitLength & 7; + byte topMask = topBits == 0 ? byte.MaxValue : (byte)((1 << topBits) - 1); + + byte[]? rented = null; + Span bytes = byteCount <= StackallocThreshold + ? stackalloc byte[StackallocThreshold] + : rented = ArrayPool.Shared.Rent(byteCount); + bytes = bytes.Slice(0, byteCount); + + try + { + while (true) + { + NextBytes(bytes); + bytes[^1] &= topMask; + + T value = T.ReadLittleEndian(bytes, isUnsigned: true); + if (value < maxExclusive) + { + return value; + } + } + } + finally + { + if (rented is not null) + { + ArrayPool.Shared.Return(rented); + } + } + } + + /// Handles the case where the range overflows for signed types by generating full-width random values. + private T NextBinaryIntegerFullRange(T minValue, T maxValue) where T : IBinaryInteger + { + Debug.Assert(minValue < maxValue); + + // The range exceeds what T can represent as a positive value. + // Generate a random value across the full range of T and check bounds. + // Since the range > T.MaxValue, the acceptance rate is > 50%. + int byteCount = Math.Max(minValue.GetByteCount(), maxValue.GetByteCount()); + + byte[]? rented = null; + Span bytes = byteCount <= StackallocThreshold + ? stackalloc byte[StackallocThreshold] + : rented = ArrayPool.Shared.Rent(byteCount); + bytes = bytes.Slice(0, byteCount); + + try + { + while (true) + { + NextBytes(bytes); + + T value = T.ReadLittleEndian(bytes, isUnsigned: false); + if (value >= minValue && value < maxValue) + { + return value; + } + } + } + finally + { + if (rented is not null) + { + ArrayPool.Shared.Return(rented); + } + } + } + + /// Returns a random binary floating-point number of type that is greater than or equal to 0.0, and less than 1.0. + /// The type of floating-point number to generate. + /// A binary floating-point number of type in the range [0.0, 1.0). + public T NextBinaryFloat() where T : IBinaryFloatingPointIeee754 + { + // Fast paths for common types using existing optimized implementations. + if (typeof(T) == typeof(float)) + { + return T.CreateTruncating(NextSingle()); + } + + if (typeof(T) == typeof(double)) + { + return T.CreateTruncating(NextDouble()); + } + + if (typeof(T) == typeof(NFloat)) + { + return nint.Size == 8 + ? T.CreateTruncating(NextDouble()) + : T.CreateTruncating(NextSingle()); + } + + // For Half, BFloat16, and other low-precision types, converting from NextSingle() + // can round up to 1.0. Generate the value directly using the type's significand + // bit length to guarantee the result is in [0.0, 1.0). + int significandBitLength = T.Zero.GetSignificandBitLength(); + + // For types with significand >= 63 bits, 1L << significandBitLength would overflow. + // Build the random significand using chunks of up to 62 random bits. Since T has + // significandBitLength bits of precision, all intermediate values are exact. + // Note: No built-in IEEE type reaches this path (double has the largest significand + // at 53 bits). This handles hypothetical custom IBinaryFloatingPointIeee754 + // implementations with wider significands (e.g. Quad/Float128 with 113 bits). + if (significandBitLength >= 63) + { + T value = T.Zero; + int bitsRemaining = significandBitLength; + while (bitsRemaining > 0) + { + int chunk = Math.Min(bitsRemaining, 62); + Debug.Assert(chunk >= 1 && chunk <= 62); + long randomChunk = NextInt64(1L << chunk); + value = T.ScaleB(value, chunk) + T.CreateTruncating(randomChunk); + bitsRemaining -= chunk; + } + + Debug.Assert(value >= T.Zero && value < T.ScaleB(T.One, significandBitLength)); + return T.ScaleB(value, -significandBitLength); + } + + long randomBits = NextInt64(1L << significandBitLength); + return T.ScaleB(T.CreateTruncating(randomBits), -significandBitLength); + } + /// /// Fills the elements of a specified span with items chosen at random from the provided set of choices. /// diff --git a/src/libraries/System.Runtime/ref/System.Runtime.cs b/src/libraries/System.Runtime/ref/System.Runtime.cs index e5cb2b3b05da45..890e1852ca75b7 100644 --- a/src/libraries/System.Runtime/ref/System.Runtime.cs +++ b/src/libraries/System.Runtime/ref/System.Runtime.cs @@ -5041,12 +5041,16 @@ public void GetItems(System.ReadOnlySpan choices, System.Span destinati public virtual int Next() { throw null; } public virtual int Next(int maxValue) { throw null; } public virtual int Next(int minValue, int maxValue) { throw null; } + public T NextBinaryFloat() where T : System.Numerics.IBinaryFloatingPointIeee754 { throw null; } public virtual void NextBytes(byte[] buffer) { } public virtual void NextBytes(System.Span buffer) { } public virtual double NextDouble() { throw null; } public virtual long NextInt64() { throw null; } public virtual long NextInt64(long maxValue) { throw null; } public virtual long NextInt64(long minValue, long maxValue) { throw null; } + public T NextInteger() where T : System.Numerics.IBinaryInteger, System.Numerics.IMinMaxValue { throw null; } + public T NextInteger(T maxValue) where T : System.Numerics.IBinaryInteger { throw null; } + public T NextInteger(T minValue, T maxValue) where T : System.Numerics.IBinaryInteger { throw null; } public virtual float NextSingle() { throw null; } protected virtual double Sample() { throw null; } public void Shuffle(System.Span values) { } diff --git a/src/libraries/System.Runtime/tests/System.Runtime.Extensions.Tests/System/Random.cs b/src/libraries/System.Runtime/tests/System.Runtime.Extensions.Tests/System/Random.cs index 3ab2f0a090c853..6729aed2296e6f 100644 --- a/src/libraries/System.Runtime/tests/System.Runtime.Extensions.Tests/System/Random.cs +++ b/src/libraries/System.Runtime/tests/System.Runtime.Extensions.Tests/System/Random.cs @@ -2,9 +2,12 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; using System.Globalization; using System.Linq; +using System.Numerics; using System.Reflection; +using System.Runtime.InteropServices; using System.Text; using System.Threading; using System.Threading.Tasks; @@ -997,6 +1000,522 @@ public static void GetHexString_Span_ProducesExpectedItems() } } + [Theory] + [InlineData(false, false)] + [InlineData(false, true)] + [InlineData(true, false)] + [InlineData(true, true)] + public void NextIntegerT_InvalidArguments_Throws(bool derived, bool seeded) + { + Random r = Create(derived, seeded); + + // Negative maxValue throws for all signed types. + Assert.Throws(() => r.NextInteger(-1)); + Assert.Throws(() => r.NextInteger(-1)); + Assert.Throws(() => r.NextInteger(-1)); + Assert.Throws(() => r.NextInteger(-1)); + Assert.Throws(() => r.NextInteger(-1)); + Assert.Throws(() => r.NextInteger(-1)); + Assert.Throws(() => r.NextInteger(-1)); + + // minValue > maxValue throws. + Assert.Throws(() => r.NextInteger(2, 1)); + Assert.Throws(() => r.NextInteger(2, 1)); + Assert.Throws(() => r.NextInteger((byte)5, (byte)3)); + Assert.Throws(() => r.NextInteger(10u, 5u)); + Assert.Throws(() => r.NextInteger((Int128)10, (Int128)5)); + Assert.Throws(() => r.NextInteger(10, 5)); + } + + [Theory] + [InlineData(false, false)] + [InlineData(false, true)] + [InlineData(true, false)] + [InlineData(true, true)] + public void NextIntegerT_ZeroMaxValue_ReturnsZero(bool derived, bool seeded) + { + Random r = Create(derived, seeded); + AssertNextIntegerTZeroMaxValue(r); + AssertNextIntegerTZeroMaxValue(r); + AssertNextIntegerTZeroMaxValue(r); + AssertNextIntegerTZeroMaxValue(r); + AssertNextIntegerTZeroMaxValue(r); + AssertNextIntegerTZeroMaxValue(r); + AssertNextIntegerTZeroMaxValue(r); + AssertNextIntegerTZeroMaxValue(r); + AssertNextIntegerTZeroMaxValue(r); + AssertNextIntegerTZeroMaxValue(r); + AssertNextIntegerTZeroMaxValue(r); + AssertNextIntegerTZeroMaxValue(r); + AssertNextIntegerTZeroMaxValue(r); + + static void AssertNextIntegerTZeroMaxValue(Random r) where T : IBinaryInteger + { + Assert.Equal(T.Zero, r.NextInteger(T.Zero)); + Assert.Equal(T.Zero, r.NextInteger(T.Zero, T.Zero)); + } + } + + [Theory] + [InlineData(false, false)] + [InlineData(false, true)] + [InlineData(true, false)] + [InlineData(true, true)] + public void NextIntegerT_EqualMinMax_ReturnsMinValue(bool derived, bool seeded) + { + Random r = Create(derived, seeded); + AssertNextIntegerTEqualMinMax(r, (byte)42); + AssertNextIntegerTEqualMinMax(r, (sbyte)-10); + AssertNextIntegerTEqualMinMax(r, (short)1000); + AssertNextIntegerTEqualMinMax(r, (ushort)500); + AssertNextIntegerTEqualMinMax(r, 12345); + AssertNextIntegerTEqualMinMax(r, 99u); + AssertNextIntegerTEqualMinMax(r, -42L); + AssertNextIntegerTEqualMinMax(r, 100UL); + AssertNextIntegerTEqualMinMax(r, (nint)7); + AssertNextIntegerTEqualMinMax(r, (nuint)7); + AssertNextIntegerTEqualMinMax(r, (Int128)(-77)); + AssertNextIntegerTEqualMinMax(r, (UInt128)200); + + static void AssertNextIntegerTEqualMinMax(Random r, T value) where T : IBinaryInteger + { + Assert.Equal(value, r.NextInteger(value, value)); + } + } + + [Theory] + [InlineData(false, false)] + [InlineData(false, true)] + [InlineData(true, false)] + [InlineData(true, true)] + public void NextIntegerT_SingleElementRange_ReturnsMinValue(bool derived, bool seeded) + { + Random r = Create(derived, seeded); + AssertNextIntegerTSingleElement(r, (byte)5, (byte)6); + AssertNextIntegerTSingleElement(r, (sbyte)-3, (sbyte)-2); + AssertNextIntegerTSingleElement(r, (short)100, (short)101); + AssertNextIntegerTSingleElement(r, (ushort)200, (ushort)201); + AssertNextIntegerTSingleElement(r, 42, 43); + AssertNextIntegerTSingleElement(r, 42u, 43u); + AssertNextIntegerTSingleElement(r, -1L, 0L); + AssertNextIntegerTSingleElement(r, 99UL, 100UL); + AssertNextIntegerTSingleElement(r, (nint)10, (nint)11); + AssertNextIntegerTSingleElement(r, (nuint)10, (nuint)11); + AssertNextIntegerTSingleElement(r, (Int128)(-1), (Int128)0); + AssertNextIntegerTSingleElement(r, (UInt128)50, (UInt128)51); + + static void AssertNextIntegerTSingleElement(Random r, T min, T max) where T : IBinaryInteger + { + for (int i = 0; i < 10; i++) + { + Assert.Equal(min, r.NextInteger(min, max)); + } + } + } + + [Theory] + [InlineData(false, false)] + [InlineData(false, true)] + [InlineData(true, false)] + [InlineData(true, true)] + public void NextIntegerT_AllBuiltInTypes_MaxValueInRange(bool derived, bool seeded) + { + Random r = Create(derived, seeded); + AssertNextIntegerTMaxValueInRange(r, (byte)100); + AssertNextIntegerTMaxValueInRange(r, (sbyte)50); + AssertNextIntegerTMaxValueInRange(r, (short)500); + AssertNextIntegerTMaxValueInRange(r, (ushort)500); + AssertNextIntegerTMaxValueInRange(r, (char)100); + AssertNextIntegerTMaxValueInRange(r, 1000); + AssertNextIntegerTMaxValueInRange(r, 1000u); + AssertNextIntegerTMaxValueInRange(r, 1000L); + AssertNextIntegerTMaxValueInRange(r, 1000UL); + AssertNextIntegerTMaxValueInRange(r, (nint)1000); + AssertNextIntegerTMaxValueInRange(r, (nuint)1000); + AssertNextIntegerTMaxValueInRange(r, (Int128)1000); + AssertNextIntegerTMaxValueInRange(r, (UInt128)1000); + } + + [Theory] + [InlineData(false, false)] + [InlineData(false, true)] + [InlineData(true, false)] + [InlineData(true, true)] + public void NextIntegerT_AllBuiltInTypes_MinMaxInRange(bool derived, bool seeded) + { + Random r = Create(derived, seeded); + AssertNextIntegerTMinMaxInRange(r, (byte)10, (byte)200); + AssertNextIntegerTMinMaxInRange(r, (sbyte)-50, (sbyte)50); + AssertNextIntegerTMinMaxInRange(r, (short)-500, (short)500); + AssertNextIntegerTMinMaxInRange(r, (ushort)100, (ushort)1000); + AssertNextIntegerTMinMaxInRange(r, -1000, 1000); + AssertNextIntegerTMinMaxInRange(r, 50u, 500u); + AssertNextIntegerTMinMaxInRange(r, -100_000L, 100_000L); + AssertNextIntegerTMinMaxInRange(r, 100UL, 1000UL); + AssertNextIntegerTMinMaxInRange(r, (nint)(-100), (nint)100); + AssertNextIntegerTMinMaxInRange(r, (nuint)10, (nuint)500); + AssertNextIntegerTMinMaxInRange(r, (Int128)(-1000), (Int128)1000); + AssertNextIntegerTMinMaxInRange(r, (UInt128)50, (UInt128)500); + } + + [Theory] + [InlineData(false, false)] + [InlineData(false, true)] + [InlineData(true, false)] + [InlineData(true, true)] + public void NextIntegerT_AllValuesInSmallRangeHit(bool derived, bool seeded) + { + Random r = Create(derived, seeded); + const int rangeSize = 5; + AssertAllValuesHit(r, (byte)rangeSize); + AssertAllValuesHit(r, (sbyte)rangeSize); + AssertAllValuesHit(r, (short)rangeSize); + AssertAllValuesHit(r, (ushort)rangeSize); + AssertAllValuesHit(r, rangeSize); + AssertAllValuesHit(r, (uint)rangeSize); + AssertAllValuesHit(r, (long)rangeSize); + AssertAllValuesHit(r, (ulong)rangeSize); + AssertAllValuesHit(r, (nint)rangeSize); + AssertAllValuesHit(r, (nuint)rangeSize); + AssertAllValuesHit(r, (Int128)rangeSize); + AssertAllValuesHit(r, (UInt128)rangeSize); + + static void AssertAllValuesHit(Random r, T maxExclusive) where T : IBinaryInteger + { + HashSet seen = []; + for (int i = 0; i < 10_000; i++) + { + seen.Add(r.NextInteger(maxExclusive)); + } + + for (T v = T.Zero; v < maxExclusive; v++) + { + Assert.Contains(v, seen); + } + + Assert.DoesNotContain(maxExclusive, seen); + } + } + + [Theory] + [InlineData(false, false)] + [InlineData(false, true)] + [InlineData(true, false)] + [InlineData(true, true)] + public void NextIntegerT_Parameterless_AllTypes(bool derived, bool seeded) + { + Random r = Create(derived, seeded); + AssertNextIntegerTParameterless(r); + AssertNextIntegerTParameterless(r); + AssertNextIntegerTParameterless(r); + AssertNextIntegerTParameterless(r); + AssertNextIntegerTParameterless(r); + AssertNextIntegerTParameterless(r); + AssertNextIntegerTParameterless(r); + AssertNextIntegerTParameterless(r); + AssertNextIntegerTParameterless(r); + AssertNextIntegerTParameterless(r); + AssertNextIntegerTParameterless(r); + AssertNextIntegerTParameterless(r); + AssertNextIntegerTParameterless(r); + + static void AssertNextIntegerTParameterless(Random r) where T : IBinaryInteger, IMinMaxValue + { + for (int i = 0; i < 100; i++) + { + T value = r.NextInteger(); + Assert.True(value >= T.Zero, $"NextInteger<{typeof(T).Name}>() returned negative value: {value}"); + Assert.True(value <= T.MaxValue, $"NextInteger<{typeof(T).Name}>() returned a value greater than MaxValue: {value}"); + } + } + } + + [Fact] + public void NextIntegerT_Parameterless_CanReturnMaxValue() + { + Random r = new MaxValueRandom(); + Assert.Equal(byte.MaxValue, r.NextInteger()); + Assert.Equal(sbyte.MaxValue, r.NextInteger()); + Assert.Equal(short.MaxValue, r.NextInteger()); + Assert.Equal(ushort.MaxValue, r.NextInteger()); + Assert.Equal(char.MaxValue, r.NextInteger()); + Assert.Equal(int.MaxValue, r.NextInteger()); + Assert.Equal(uint.MaxValue, r.NextInteger()); + Assert.Equal(long.MaxValue, r.NextInteger()); + Assert.Equal(ulong.MaxValue, r.NextInteger()); + Assert.Equal(nint.MaxValue, r.NextInteger()); + Assert.Equal(nuint.MaxValue, r.NextInteger()); + Assert.Equal(Int128.MaxValue, r.NextInteger()); + Assert.Equal(UInt128.MaxValue, r.NextInteger()); + } + + public static IEnumerable NextIntegerT_SignedOverflowRange_MemberData() => + from derived in new[] { false, true } + from seeded in new[] { false, true } + select new object[] { derived, seeded }; + + [Theory] + [MemberData(nameof(NextIntegerT_SignedOverflowRange_MemberData))] + public void NextIntegerT_SignedOverflow_FullRange(bool derived, bool seeded) + { + Random r = Create(derived, seeded); + + // These ranges exceed T.MaxValue, triggering the NextBinaryIntegerFullRange path. + AssertNextIntegerTMinMaxInRange(r, sbyte.MinValue, sbyte.MaxValue); + AssertNextIntegerTMinMaxInRange(r, short.MinValue, short.MaxValue); + AssertNextIntegerTMinMaxInRange(r, int.MinValue, int.MaxValue); + AssertNextIntegerTMinMaxInRange(r, long.MinValue, long.MaxValue); + AssertNextIntegerTMinMaxInRange(r, nint.MinValue, nint.MaxValue); + AssertNextIntegerTMinMaxInRange(r, Int128.MinValue, Int128.MaxValue); + + // Ranges that cross zero with large span. + AssertNextIntegerTMinMaxInRange(r, int.MinValue, 0); + AssertNextIntegerTMinMaxInRange(r, -1, int.MaxValue); + AssertNextIntegerTMinMaxInRange(r, long.MinValue, 0L); + AssertNextIntegerTMinMaxInRange(r, -1L, long.MaxValue); + } + + [Theory] + [InlineData(false, false)] + [InlineData(false, true)] + [InlineData(true, false)] + [InlineData(true, true)] + public void NextIntegerT_LargeUnsignedValues(bool derived, bool seeded) + { + Random r = Create(derived, seeded); + + // ulong values beyond long.MaxValue. + for (int i = 0; i < 100; i++) + { + ulong value = r.NextInteger(ulong.MaxValue); + Assert.True(value < ulong.MaxValue); + } + + // Full uint range. + AssertNextIntegerTMaxValueInRange(r, uint.MaxValue); + + // UInt128 large range. + AssertNextIntegerTMinMaxInRange(r, (UInt128)0, UInt128.MaxValue); + + // nuint on the current platform. + AssertNextIntegerTMaxValueInRange(r, nuint.MaxValue); + + // Int128/UInt128 values that exceed ulong.MaxValue - these must bypass the + // ulong fast path and use rejection sampling. + UInt128 largeUInt128Max = ((UInt128)ulong.MaxValue << 1) + 5; + AssertNextIntegerTMaxValueInRange(r, largeUInt128Max); + + Int128 largeInt128Max = (Int128)ulong.MaxValue + 100; + AssertNextIntegerTMaxValueInRange(r, largeInt128Max); + + // UInt128 maxExclusive = 2^64 (exactly one more than ulong.MaxValue) + // This previously truncated to 0 via ulong.CreateTruncating. + UInt128 twoTo64 = (UInt128)ulong.MaxValue + 1; + for (int i = 0; i < 100; i++) + { + UInt128 value = r.NextInteger(twoTo64); + Assert.True(value < twoTo64, $"NextInteger({twoTo64}) returned {value}"); + } + + // Int128 maxExclusive that truncates to a small value when cast to ulong + Int128 tricky = ((Int128)1 << 64) + 5; + for (int i = 0; i < 100; i++) + { + Int128 value = r.NextInteger(tricky); + Assert.True(value >= Int128.Zero && value < tricky, $"NextInteger({tricky}) returned {value}"); + } + } + + [Theory] + [InlineData(false, false)] + [InlineData(false, true)] + [InlineData(true, false)] + [InlineData(true, true)] + public void NextIntegerT_BigInteger_InRange(bool derived, bool seeded) + { + Random r = Create(derived, seeded); + + AssertNextIntegerTMaxValueInRange(r, new BigInteger(1_000)); + AssertNextIntegerTMinMaxInRange(r, new BigInteger(-1_000), new BigInteger(1_000)); + + BigInteger largeMax = BigInteger.One << 3_000; + AssertNextIntegerTMaxValueInRange(r, largeMax, iterations: 10); + AssertNextIntegerTMinMaxInRange(r, -largeMax, largeMax, iterations: 10); + } + + [Theory] + [InlineData(false, false)] + [InlineData(false, true)] + [InlineData(true, false)] + [InlineData(true, true)] + public void NextIntegerT_NegativeRanges(bool derived, bool seeded) + { + Random r = Create(derived, seeded); + AssertNextIntegerTMinMaxInRange(r, (sbyte)-100, (sbyte)-10); + AssertNextIntegerTMinMaxInRange(r, (short)-1000, (short)-1); + AssertNextIntegerTMinMaxInRange(r, -1_000_000, -1); + AssertNextIntegerTMinMaxInRange(r, -1_000_000_000L, -1L); + AssertNextIntegerTMinMaxInRange(r, (Int128)(-1000), (Int128)(-1)); + } + + [Theory] + [InlineData(false, false)] + [InlineData(false, true)] + [InlineData(true, false)] + [InlineData(true, true)] + public void NextBinaryFloatT_AllTypes_InRange(bool derived, bool seeded) + { + Random r = Create(derived, seeded); + AssertNextBinaryFloatInRange(r); + AssertNextBinaryFloatInRange(r); + AssertNextBinaryFloatInRange(r); + AssertNextBinaryFloatInRange(r); + AssertNextBinaryFloatInRange(r); + + static void AssertNextBinaryFloatInRange(Random r) where T : IBinaryFloatingPointIeee754 + { + for (int i = 0; i < 1000; i++) + { + T value = r.NextBinaryFloat(); + Assert.True(value >= T.Zero, $"NextBinaryFloat<{typeof(T).Name}>() returned {value}, expected >= 0"); + Assert.True(value < T.One, $"NextBinaryFloat<{typeof(T).Name}>() returned {value}, expected < 1"); + } + } + } + + [Theory] + [InlineData(false, false)] + [InlineData(false, true)] + [InlineData(true, false)] + [InlineData(true, true)] + public void NextBinaryFloatT_ProducesVariedValues(bool derived, bool seeded) + { + Random r = Create(derived, seeded); + AssertNextBinaryFloatVaried(r); + AssertNextBinaryFloatVaried(r); + AssertNextBinaryFloatVaried(r); + AssertNextBinaryFloatVaried(r); + AssertNextBinaryFloatVaried(r); + + static void AssertNextBinaryFloatVaried(Random r) where T : IBinaryFloatingPointIeee754 + { + HashSet seen = []; + for (int i = 0; i < 100; i++) + { + seen.Add(r.NextBinaryFloat()); + } + + Assert.True(seen.Count > 50, $"NextBinaryFloat<{typeof(T).Name}>() produced only {seen.Count} distinct values in 100 calls"); + } + } + + [Theory] + [InlineData(false, false)] + [InlineData(false, true)] + [InlineData(true, false)] + [InlineData(true, true)] + public void NextIntegerT_CustomReferenceType(bool derived, bool seeded) + { + Random r = Create(derived, seeded); + + AssertNextIntegerTMaxValueInRange>(r, 10); + AssertNextIntegerTMinMaxInRange>(r, -5, 5); + } + + [Fact] + public void NextIntegerT_CustomReferenceType_ParameterlessCanReturnMaxValue() + { + Random r = new MaxValueRandom(); + + Assert.Equal(BinaryIntegerReference.MaxValue, r.NextInteger>()); + } + + [Theory] + [InlineData(false, false)] + [InlineData(false, true)] + [InlineData(true, false)] + [InlineData(true, true)] + public void NextBinaryFloatT_CustomReferenceType(bool derived, bool seeded) + { + Random r = Create(derived, seeded); + HashSet> seen = []; + string typeName = nameof(BinaryFloatingPointIeee754Reference); + + for (int i = 0; i < 100; i++) + { + BinaryFloatingPointIeee754Reference value = r.NextBinaryFloat>(); + Assert.True(value >= BinaryFloatingPointIeee754Reference.Zero, $"NextBinaryFloat<{typeName}>() returned {value}, expected >= 0"); + Assert.True(value < BinaryFloatingPointIeee754Reference.One, $"NextBinaryFloat<{typeName}>() returned {value}, expected < 1"); + seen.Add(value); + } + + Assert.True(seen.Count > 50, $"NextBinaryFloat<{typeName}>() produced only {seen.Count} distinct values in 100 calls"); + } + + [Theory] + [InlineData(false)] + [InlineData(true)] + public void NextIntegerT_DerivedType_DispatchesThroughVirtuals(bool seeded) + { + // NextInteger() routes through Next(int), NextInt64(long), or NextBytes(Span), + // all of which are virtual. For a derived Random, these must reach the derived + // type's overrides so that subclass behavior (e.g. custom RNG) is preserved. + // SubRandom.Next() sets NextCalled; the compat path routes Next(int)/NextInt64/ + // NextSingle/NextDouble through Sample(), which sets SampleCalled. + + SubRandom r; + + // Integer types that hit Next(int) -> Sample() + r = seeded ? new SubRandom(42) : new SubRandom(); + r.NextInteger(42); + Assert.True(r.SampleCalled, "NextInteger should dispatch through Sample on derived type"); + + // Integer types that hit NextInt64(long) -> Sample() + r = seeded ? new SubRandom(42) : new SubRandom(); + r.NextInteger(42L); + Assert.True(r.SampleCalled, "NextInteger should dispatch through Sample on derived type"); + + // Large types that hit NextBytes -> Next() -> NextCalled + r = seeded ? new SubRandom(42) : new SubRandom(); + r.NextInteger(UInt128.MaxValue); + Assert.True(r.NextCalled, "NextInteger should dispatch through Next on derived type"); + + // NextBinaryFloat -> NextSingle() -> Sample() + r = seeded ? new SubRandom(42) : new SubRandom(); + r.NextBinaryFloat(); + Assert.True(r.SampleCalled, "NextBinaryFloat should dispatch through Sample on derived type"); + + // NextBinaryFloat -> NextDouble() -> Sample() + r = seeded ? new SubRandom(42) : new SubRandom(); + r.NextBinaryFloat(); + Assert.True(r.SampleCalled, "NextBinaryFloat should dispatch through Sample on derived type"); + + // NextBinaryFloat -> NextInt64() -> Sample() + r = seeded ? new SubRandom(42) : new SubRandom(); + r.NextBinaryFloat(); + Assert.True(r.SampleCalled, "NextBinaryFloat should dispatch through Sample on derived type"); + } + + private static void AssertNextIntegerTMaxValueInRange(Random r, T maxExclusive, int iterations = 100) where T : IBinaryInteger + { + for (int i = 0; i < iterations; i++) + { + T value = r.NextInteger(maxExclusive); + Assert.True(!T.IsNegative(value), $"NextInteger<{typeof(T).Name}>({maxExclusive}) returned negative: {value}"); + Assert.True(value < maxExclusive, $"NextInteger<{typeof(T).Name}>({maxExclusive}) returned {value}, expected < {maxExclusive}"); + } + } + + private static void AssertNextIntegerTMinMaxInRange(Random r, T min, T max, int iterations = 100) where T : IBinaryInteger + { + for (int i = 0; i < iterations; i++) + { + T value = r.NextInteger(min, max); + Assert.True(value >= min, $"NextInteger<{typeof(T).Name}>({min}, {max}) returned {value}, expected >= {min}"); + Assert.True(value < max, $"NextInteger<{typeof(T).Name}>({min}, {max}) returned {value}, expected < {max}"); + } + } + private static Random Create(bool derived, bool seeded) => (derived, seeded) switch { @@ -1027,5 +1546,443 @@ public override int Next() return base.Next(); } } + + private sealed class BinaryIntegerReference : IBinaryInteger>, IMinMaxValue> + where T : IBinaryInteger, IMinMaxValue + { + public BinaryIntegerReference(T value) => Value = value; + + public T Value { get; } + + public static implicit operator BinaryIntegerReference(T value) => new(value); + public static implicit operator T(BinaryIntegerReference value) => value.Value; + + public static BinaryIntegerReference AdditiveIdentity => T.AdditiveIdentity; + public static BinaryIntegerReference MaxValue => T.MaxValue; + public static BinaryIntegerReference MinValue => T.MinValue; + public static BinaryIntegerReference MultiplicativeIdentity => T.MultiplicativeIdentity; + public static BinaryIntegerReference One => T.One; + public static int Radix => T.Radix; + public static BinaryIntegerReference Zero => T.Zero; + + public static BinaryIntegerReference Abs(BinaryIntegerReference value) => T.Abs(value); + public static bool IsCanonical(BinaryIntegerReference value) => T.IsCanonical(value); + public static bool IsComplexNumber(BinaryIntegerReference value) => T.IsComplexNumber(value); + public static bool IsEvenInteger(BinaryIntegerReference value) => T.IsEvenInteger(value); + public static bool IsFinite(BinaryIntegerReference value) => T.IsFinite(value); + public static bool IsImaginaryNumber(BinaryIntegerReference value) => T.IsImaginaryNumber(value); + public static bool IsInfinity(BinaryIntegerReference value) => T.IsInfinity(value); + public static bool IsInteger(BinaryIntegerReference value) => T.IsInteger(value); + public static bool IsNaN(BinaryIntegerReference value) => T.IsNaN(value); + public static bool IsNegative(BinaryIntegerReference value) => T.IsNegative(value); + public static bool IsNegativeInfinity(BinaryIntegerReference value) => T.IsNegativeInfinity(value); + public static bool IsNormal(BinaryIntegerReference value) => T.IsNormal(value); + public static bool IsOddInteger(BinaryIntegerReference value) => T.IsOddInteger(value); + public static bool IsPositive(BinaryIntegerReference value) => T.IsPositive(value); + public static bool IsPositiveInfinity(BinaryIntegerReference value) => T.IsPositiveInfinity(value); + public static bool IsPow2(BinaryIntegerReference value) => T.IsPow2(value); + public static bool IsRealNumber(BinaryIntegerReference value) => T.IsRealNumber(value); + public static bool IsSubnormal(BinaryIntegerReference value) => T.IsSubnormal(value); + public static bool IsZero(BinaryIntegerReference value) => T.IsZero(value); + public static BinaryIntegerReference Log2(BinaryIntegerReference value) => T.Log2(value); + public static BinaryIntegerReference MaxMagnitude(BinaryIntegerReference x, BinaryIntegerReference y) => T.MaxMagnitude(x, y); + public static BinaryIntegerReference MaxMagnitudeNumber(BinaryIntegerReference x, BinaryIntegerReference y) => T.MaxMagnitudeNumber(x, y); + public static BinaryIntegerReference MinMagnitude(BinaryIntegerReference x, BinaryIntegerReference y) => T.MinMagnitude(x, y); + public static BinaryIntegerReference MinMagnitudeNumber(BinaryIntegerReference x, BinaryIntegerReference y) => T.MinMagnitudeNumber(x, y); + public static BinaryIntegerReference Parse(ReadOnlySpan s, NumberStyles style, IFormatProvider? provider) => T.Parse(s, style, provider); + public static BinaryIntegerReference Parse(string s, NumberStyles style, IFormatProvider? provider) => T.Parse(s, style, provider); + public static BinaryIntegerReference Parse(ReadOnlySpan s, IFormatProvider? provider) => T.Parse(s, provider); + public static BinaryIntegerReference Parse(string s, IFormatProvider? provider) => T.Parse(s, provider); + public static BinaryIntegerReference PopCount(BinaryIntegerReference value) => T.PopCount(value); + public static BinaryIntegerReference TrailingZeroCount(BinaryIntegerReference value) => T.TrailingZeroCount(value); + + public static bool TryParse(ReadOnlySpan s, NumberStyles style, IFormatProvider? provider, [MaybeNullWhen(false)] out BinaryIntegerReference result) + { + bool succeeded = T.TryParse(s, style, provider, out T actualResult); + result = actualResult; + return succeeded; + } + + public static bool TryParse([NotNullWhen(true)] string? s, NumberStyles style, IFormatProvider? provider, [MaybeNullWhen(false)] out BinaryIntegerReference result) + { + bool succeeded = T.TryParse(s, style, provider, out T actualResult); + result = actualResult; + return succeeded; + } + + public static bool TryParse(ReadOnlySpan s, IFormatProvider? provider, [MaybeNullWhen(false)] out BinaryIntegerReference result) + { + bool succeeded = T.TryParse(s, provider, out T actualResult); + result = actualResult; + return succeeded; + } + + public static bool TryParse([NotNullWhen(true)] string? s, IFormatProvider? provider, [MaybeNullWhen(false)] out BinaryIntegerReference result) + { + bool succeeded = T.TryParse(s, provider, out T actualResult); + result = actualResult; + return succeeded; + } + + public static bool TryReadBigEndian(ReadOnlySpan source, bool isUnsigned, out BinaryIntegerReference value) + { + bool succeeded = T.TryReadBigEndian(source, isUnsigned, out T actualValue); + value = actualValue; + return succeeded; + } + + public static bool TryReadLittleEndian(ReadOnlySpan source, bool isUnsigned, out BinaryIntegerReference value) + { + bool succeeded = T.TryReadLittleEndian(source, isUnsigned, out T actualValue); + value = actualValue; + return succeeded; + } + + public int CompareTo(object? obj) + { + if (obj is not BinaryIntegerReference other) + { + return obj is null ? 1 : throw new ArgumentException(); + } + + return CompareTo(other); + } + + public int CompareTo(BinaryIntegerReference? other) => other is null ? 1 : Value.CompareTo(other.Value); + public override bool Equals([NotNullWhen(true)] object? obj) => obj is BinaryIntegerReference other && Equals(other); + public bool Equals(BinaryIntegerReference? other) => other is not null && Value.Equals(other.Value); + public int GetByteCount() => Value.GetByteCount(); + public override int GetHashCode() => Value.GetHashCode(); + public int GetShortestBitLength() => Value.GetShortestBitLength(); + public override string ToString() => Value.ToString()!; + public string ToString(string? format, IFormatProvider? formatProvider) => Value.ToString(format, formatProvider); + public bool TryFormat(Span destination, out int charsWritten, ReadOnlySpan format, IFormatProvider? provider) => Value.TryFormat(destination, out charsWritten, format, provider); + public bool TryWriteBigEndian(Span destination, out int bytesWritten) => Value.TryWriteBigEndian(destination, out bytesWritten); + public bool TryWriteLittleEndian(Span destination, out int bytesWritten) => Value.TryWriteLittleEndian(destination, out bytesWritten); + + static bool INumberBase>.TryConvertFromChecked(TOther value, out BinaryIntegerReference result) + { + if (typeof(TOther) == typeof(T)) + { + result = (T)(object)value; + return true; + } + + bool succeeded = T.TryConvertFromChecked(value, out T actualResult); + + if (!succeeded) + { + succeeded = TOther.TryConvertToChecked(value, out actualResult); + } + + result = actualResult; + return succeeded; + } + + static bool INumberBase>.TryConvertFromSaturating(TOther value, out BinaryIntegerReference result) + { + if (typeof(TOther) == typeof(T)) + { + result = (T)(object)value; + return true; + } + + bool succeeded = T.TryConvertFromSaturating(value, out T actualResult); + + if (!succeeded) + { + succeeded = TOther.TryConvertToSaturating(value, out actualResult); + } + + result = actualResult; + return succeeded; + } + + static bool INumberBase>.TryConvertFromTruncating(TOther value, out BinaryIntegerReference result) + { + if (typeof(TOther) == typeof(T)) + { + result = (T)(object)value; + return true; + } + + bool succeeded = T.TryConvertFromTruncating(value, out T actualResult); + + if (!succeeded) + { + succeeded = TOther.TryConvertToTruncating(value, out actualResult); + } + + result = actualResult; + return succeeded; + } + + static bool INumberBase>.TryConvertToChecked(BinaryIntegerReference value, out TOther result) => T.TryConvertToChecked(value.Value, out result); + static bool INumberBase>.TryConvertToSaturating(BinaryIntegerReference value, out TOther result) => T.TryConvertToSaturating(value.Value, out result); + static bool INumberBase>.TryConvertToTruncating(BinaryIntegerReference value, out TOther result) => T.TryConvertToTruncating(value.Value, out result); + + public static BinaryIntegerReference operator +(BinaryIntegerReference value) => +value.Value; + public static BinaryIntegerReference operator +(BinaryIntegerReference left, BinaryIntegerReference right) => left.Value + right.Value; + public static BinaryIntegerReference operator -(BinaryIntegerReference value) => -value.Value; + public static BinaryIntegerReference operator -(BinaryIntegerReference left, BinaryIntegerReference right) => left.Value - right.Value; + public static BinaryIntegerReference operator ~(BinaryIntegerReference value) => ~value.Value; + public static BinaryIntegerReference operator ++(BinaryIntegerReference value) => value.Value + T.One; + public static BinaryIntegerReference operator --(BinaryIntegerReference value) => value.Value - T.One; + public static BinaryIntegerReference operator *(BinaryIntegerReference left, BinaryIntegerReference right) => left.Value * right.Value; + public static BinaryIntegerReference operator /(BinaryIntegerReference left, BinaryIntegerReference right) => left.Value / right.Value; + public static BinaryIntegerReference operator %(BinaryIntegerReference left, BinaryIntegerReference right) => left.Value % right.Value; + public static BinaryIntegerReference operator &(BinaryIntegerReference left, BinaryIntegerReference right) => left.Value & right.Value; + public static BinaryIntegerReference operator |(BinaryIntegerReference left, BinaryIntegerReference right) => left.Value | right.Value; + public static BinaryIntegerReference operator ^(BinaryIntegerReference left, BinaryIntegerReference right) => left.Value ^ right.Value; + public static BinaryIntegerReference operator <<(BinaryIntegerReference value, int shiftAmount) => value.Value << shiftAmount; + public static BinaryIntegerReference operator >>(BinaryIntegerReference value, int shiftAmount) => value.Value >> shiftAmount; + public static bool operator ==(BinaryIntegerReference? left, BinaryIntegerReference? right) => left is null ? right is null : left.Equals(right); + public static bool operator !=(BinaryIntegerReference? left, BinaryIntegerReference? right) => !(left == right); + public static bool operator <(BinaryIntegerReference left, BinaryIntegerReference right) => left.Value < right.Value; + public static bool operator >(BinaryIntegerReference left, BinaryIntegerReference right) => left.Value > right.Value; + public static bool operator <=(BinaryIntegerReference left, BinaryIntegerReference right) => left.Value <= right.Value; + public static bool operator >=(BinaryIntegerReference left, BinaryIntegerReference right) => left.Value >= right.Value; + public static BinaryIntegerReference operator >>>(BinaryIntegerReference value, int shiftAmount) => value.Value >>> shiftAmount; + } + + private sealed class BinaryFloatingPointIeee754Reference : IBinaryFloatingPointIeee754> + where T : IBinaryFloatingPointIeee754 + { + public BinaryFloatingPointIeee754Reference(T value) => Value = value; + + public T Value { get; } + + public static implicit operator BinaryFloatingPointIeee754Reference(T value) => new(value); + public static implicit operator T(BinaryFloatingPointIeee754Reference value) => value.Value; + + public static BinaryFloatingPointIeee754Reference AdditiveIdentity => T.AdditiveIdentity; + public static BinaryFloatingPointIeee754Reference E => T.E; + public static BinaryFloatingPointIeee754Reference Epsilon => T.Epsilon; + public static BinaryFloatingPointIeee754Reference MultiplicativeIdentity => T.MultiplicativeIdentity; + public static BinaryFloatingPointIeee754Reference NaN => T.NaN; + public static BinaryFloatingPointIeee754Reference NegativeInfinity => T.NegativeInfinity; + public static BinaryFloatingPointIeee754Reference NegativeOne => T.NegativeOne; + public static BinaryFloatingPointIeee754Reference NegativeZero => T.NegativeZero; + public static BinaryFloatingPointIeee754Reference One => T.One; + public static BinaryFloatingPointIeee754Reference Pi => T.Pi; + public static BinaryFloatingPointIeee754Reference PositiveInfinity => T.PositiveInfinity; + public static int Radix => T.Radix; + public static BinaryFloatingPointIeee754Reference Tau => T.Tau; + public static BinaryFloatingPointIeee754Reference Zero => T.Zero; + + public static BinaryFloatingPointIeee754Reference Abs(BinaryFloatingPointIeee754Reference value) => T.Abs(value); + public static BinaryFloatingPointIeee754Reference Acos(BinaryFloatingPointIeee754Reference x) => T.Acos(x); + public static BinaryFloatingPointIeee754Reference Acosh(BinaryFloatingPointIeee754Reference x) => T.Acosh(x); + public static BinaryFloatingPointIeee754Reference AcosPi(BinaryFloatingPointIeee754Reference x) => T.AcosPi(x); + public static BinaryFloatingPointIeee754Reference Asin(BinaryFloatingPointIeee754Reference x) => T.Asin(x); + public static BinaryFloatingPointIeee754Reference Asinh(BinaryFloatingPointIeee754Reference x) => T.Asinh(x); + public static BinaryFloatingPointIeee754Reference AsinPi(BinaryFloatingPointIeee754Reference x) => T.AsinPi(x); + public static BinaryFloatingPointIeee754Reference Atan(BinaryFloatingPointIeee754Reference x) => T.Atan(x); + public static BinaryFloatingPointIeee754Reference Atan2(BinaryFloatingPointIeee754Reference y, BinaryFloatingPointIeee754Reference x) => T.Atan2(y, x); + public static BinaryFloatingPointIeee754Reference Atan2Pi(BinaryFloatingPointIeee754Reference y, BinaryFloatingPointIeee754Reference x) => T.Atan2Pi(y, x); + public static BinaryFloatingPointIeee754Reference Atanh(BinaryFloatingPointIeee754Reference x) => T.Atanh(x); + public static BinaryFloatingPointIeee754Reference AtanPi(BinaryFloatingPointIeee754Reference x) => T.AtanPi(x); + public static BinaryFloatingPointIeee754Reference BitDecrement(BinaryFloatingPointIeee754Reference x) => T.BitDecrement(x); + public static BinaryFloatingPointIeee754Reference BitIncrement(BinaryFloatingPointIeee754Reference x) => T.BitIncrement(x); + public static BinaryFloatingPointIeee754Reference Cbrt(BinaryFloatingPointIeee754Reference x) => T.Cbrt(x); + public static BinaryFloatingPointIeee754Reference Cos(BinaryFloatingPointIeee754Reference x) => T.Cos(x); + public static BinaryFloatingPointIeee754Reference Cosh(BinaryFloatingPointIeee754Reference x) => T.Cosh(x); + public static BinaryFloatingPointIeee754Reference CosPi(BinaryFloatingPointIeee754Reference x) => T.CosPi(x); + public static BinaryFloatingPointIeee754Reference Exp(BinaryFloatingPointIeee754Reference x) => T.Exp(x); + public static BinaryFloatingPointIeee754Reference Exp2(BinaryFloatingPointIeee754Reference x) => T.Exp2(x); + public static BinaryFloatingPointIeee754Reference Exp10(BinaryFloatingPointIeee754Reference x) => T.Exp10(x); + public static BinaryFloatingPointIeee754Reference FusedMultiplyAdd(BinaryFloatingPointIeee754Reference left, BinaryFloatingPointIeee754Reference right, BinaryFloatingPointIeee754Reference addend) => T.FusedMultiplyAdd(left, right, addend); + public static BinaryFloatingPointIeee754Reference Hypot(BinaryFloatingPointIeee754Reference x, BinaryFloatingPointIeee754Reference y) => T.Hypot(x, y); + public static BinaryFloatingPointIeee754Reference Ieee754Remainder(BinaryFloatingPointIeee754Reference left, BinaryFloatingPointIeee754Reference right) => T.Ieee754Remainder(left, right); + public static int ILogB(BinaryFloatingPointIeee754Reference x) => T.ILogB(x); + public static bool IsCanonical(BinaryFloatingPointIeee754Reference value) => T.IsCanonical(value); + public static bool IsComplexNumber(BinaryFloatingPointIeee754Reference value) => T.IsComplexNumber(value); + public static bool IsEvenInteger(BinaryFloatingPointIeee754Reference value) => T.IsEvenInteger(value); + public static bool IsFinite(BinaryFloatingPointIeee754Reference value) => T.IsFinite(value); + public static bool IsImaginaryNumber(BinaryFloatingPointIeee754Reference value) => T.IsImaginaryNumber(value); + public static bool IsInfinity(BinaryFloatingPointIeee754Reference value) => T.IsInfinity(value); + public static bool IsInteger(BinaryFloatingPointIeee754Reference value) => T.IsInteger(value); + public static bool IsNaN(BinaryFloatingPointIeee754Reference value) => T.IsNaN(value); + public static bool IsNegative(BinaryFloatingPointIeee754Reference value) => T.IsNegative(value); + public static bool IsNegativeInfinity(BinaryFloatingPointIeee754Reference value) => T.IsNegativeInfinity(value); + public static bool IsNormal(BinaryFloatingPointIeee754Reference value) => T.IsNormal(value); + public static bool IsOddInteger(BinaryFloatingPointIeee754Reference value) => T.IsOddInteger(value); + public static bool IsPositive(BinaryFloatingPointIeee754Reference value) => T.IsPositive(value); + public static bool IsPositiveInfinity(BinaryFloatingPointIeee754Reference value) => T.IsPositiveInfinity(value); + public static bool IsPow2(BinaryFloatingPointIeee754Reference value) => T.IsPow2(value); + public static bool IsRealNumber(BinaryFloatingPointIeee754Reference value) => T.IsRealNumber(value); + public static bool IsSubnormal(BinaryFloatingPointIeee754Reference value) => T.IsSubnormal(value); + public static bool IsZero(BinaryFloatingPointIeee754Reference value) => T.IsZero(value); + public static BinaryFloatingPointIeee754Reference Log(BinaryFloatingPointIeee754Reference x) => T.Log(x); + public static BinaryFloatingPointIeee754Reference Log(BinaryFloatingPointIeee754Reference x, BinaryFloatingPointIeee754Reference newBase) => T.Log(x, newBase); + public static BinaryFloatingPointIeee754Reference Log2(BinaryFloatingPointIeee754Reference x) => BinaryLog2(x.Value); + public static BinaryFloatingPointIeee754Reference Log10(BinaryFloatingPointIeee754Reference x) => T.Log10(x); + public static BinaryFloatingPointIeee754Reference MaxMagnitude(BinaryFloatingPointIeee754Reference x, BinaryFloatingPointIeee754Reference y) => T.MaxMagnitude(x, y); + public static BinaryFloatingPointIeee754Reference MaxMagnitudeNumber(BinaryFloatingPointIeee754Reference x, BinaryFloatingPointIeee754Reference y) => T.MaxMagnitudeNumber(x, y); + public static BinaryFloatingPointIeee754Reference MinMagnitude(BinaryFloatingPointIeee754Reference x, BinaryFloatingPointIeee754Reference y) => T.MinMagnitude(x, y); + public static BinaryFloatingPointIeee754Reference MinMagnitudeNumber(BinaryFloatingPointIeee754Reference x, BinaryFloatingPointIeee754Reference y) => T.MinMagnitudeNumber(x, y); + public static BinaryFloatingPointIeee754Reference Pow(BinaryFloatingPointIeee754Reference x, BinaryFloatingPointIeee754Reference y) => T.Pow(x, y); + public static BinaryFloatingPointIeee754Reference Parse(ReadOnlySpan s, NumberStyles style, IFormatProvider? provider) => T.Parse(s, style, provider); + public static BinaryFloatingPointIeee754Reference Parse(string s, NumberStyles style, IFormatProvider? provider) => T.Parse(s, style, provider); + public static BinaryFloatingPointIeee754Reference Parse(ReadOnlySpan s, IFormatProvider? provider) => T.Parse(s, provider); + public static BinaryFloatingPointIeee754Reference Parse(string s, IFormatProvider? provider) => T.Parse(s, provider); + public static BinaryFloatingPointIeee754Reference RootN(BinaryFloatingPointIeee754Reference x, int n) => T.RootN(x, n); + public static BinaryFloatingPointIeee754Reference Round(BinaryFloatingPointIeee754Reference x, int digits, MidpointRounding mode) => T.Round(x, digits, mode); + public static BinaryFloatingPointIeee754Reference ScaleB(BinaryFloatingPointIeee754Reference x, int n) => T.ScaleB(x, n); + public static BinaryFloatingPointIeee754Reference Sin(BinaryFloatingPointIeee754Reference x) => T.Sin(x); + public static (BinaryFloatingPointIeee754Reference Sin, BinaryFloatingPointIeee754Reference Cos) SinCos(BinaryFloatingPointIeee754Reference x) => T.SinCos(x); + public static (BinaryFloatingPointIeee754Reference SinPi, BinaryFloatingPointIeee754Reference CosPi) SinCosPi(BinaryFloatingPointIeee754Reference x) => T.SinCosPi(x); + public static BinaryFloatingPointIeee754Reference Sinh(BinaryFloatingPointIeee754Reference x) => T.Sinh(x); + public static BinaryFloatingPointIeee754Reference SinPi(BinaryFloatingPointIeee754Reference x) => T.SinPi(x); + public static BinaryFloatingPointIeee754Reference Sqrt(BinaryFloatingPointIeee754Reference x) => T.Sqrt(x); + public static BinaryFloatingPointIeee754Reference Tan(BinaryFloatingPointIeee754Reference x) => T.Tan(x); + public static BinaryFloatingPointIeee754Reference Tanh(BinaryFloatingPointIeee754Reference x) => T.Tanh(x); + public static BinaryFloatingPointIeee754Reference TanPi(BinaryFloatingPointIeee754Reference x) => T.TanPi(x); + + public static bool TryParse(ReadOnlySpan s, NumberStyles style, IFormatProvider? provider, [MaybeNullWhen(false)] out BinaryFloatingPointIeee754Reference result) + { + bool succeeded = T.TryParse(s, style, provider, out T actualResult); + result = actualResult; + return succeeded; + } + + public static bool TryParse([NotNullWhen(true)] string? s, NumberStyles style, IFormatProvider? provider, [MaybeNullWhen(false)] out BinaryFloatingPointIeee754Reference result) + { + bool succeeded = T.TryParse(s, style, provider, out T actualResult); + result = actualResult; + return succeeded; + } + + public static bool TryParse(ReadOnlySpan s, IFormatProvider? provider, [MaybeNullWhen(false)] out BinaryFloatingPointIeee754Reference result) + { + bool succeeded = T.TryParse(s, provider, out T actualResult); + result = actualResult; + return succeeded; + } + + public static bool TryParse([NotNullWhen(true)] string? s, IFormatProvider? provider, [MaybeNullWhen(false)] out BinaryFloatingPointIeee754Reference result) + { + bool succeeded = T.TryParse(s, provider, out T actualResult); + result = actualResult; + return succeeded; + } + + public int CompareTo(object? obj) + { + if (obj is not BinaryFloatingPointIeee754Reference other) + { + return obj is null ? 1 : throw new ArgumentException(); + } + + return CompareTo(other); + } + + public int CompareTo(BinaryFloatingPointIeee754Reference? other) => other is null ? 1 : Value.CompareTo(other.Value); + public override bool Equals([NotNullWhen(true)] object? obj) => obj is BinaryFloatingPointIeee754Reference other && Equals(other); + public bool Equals(BinaryFloatingPointIeee754Reference? other) => other is not null && Value.Equals(other.Value); + public int GetExponentByteCount() => Value.GetExponentByteCount(); + public int GetExponentShortestBitLength() => Value.GetExponentShortestBitLength(); + public override int GetHashCode() => Value.GetHashCode(); + public int GetSignificandBitLength() => Value.GetSignificandBitLength(); + public int GetSignificandByteCount() => Value.GetSignificandByteCount(); + public override string ToString() => Value.ToString()!; + public string ToString(string? format, IFormatProvider? formatProvider) => Value.ToString(format, formatProvider); + public bool TryFormat(Span destination, out int charsWritten, ReadOnlySpan format, IFormatProvider? provider) => Value.TryFormat(destination, out charsWritten, format, provider); + public bool TryWriteExponentBigEndian(Span destination, out int bytesWritten) => Value.TryWriteExponentBigEndian(destination, out bytesWritten); + public bool TryWriteExponentLittleEndian(Span destination, out int bytesWritten) => Value.TryWriteExponentLittleEndian(destination, out bytesWritten); + public bool TryWriteSignificandBigEndian(Span destination, out int bytesWritten) => Value.TryWriteSignificandBigEndian(destination, out bytesWritten); + public bool TryWriteSignificandLittleEndian(Span destination, out int bytesWritten) => Value.TryWriteSignificandLittleEndian(destination, out bytesWritten); + + static bool INumberBase>.TryConvertFromChecked(TOther value, out BinaryFloatingPointIeee754Reference result) + { + if (typeof(TOther) == typeof(T)) + { + result = (T)(object)value; + return true; + } + + bool succeeded = T.TryConvertFromChecked(value, out T actualResult); + + if (!succeeded) + { + succeeded = TOther.TryConvertToChecked(value, out actualResult); + } + + result = actualResult; + return succeeded; + } + + static bool INumberBase>.TryConvertFromSaturating(TOther value, out BinaryFloatingPointIeee754Reference result) + { + if (typeof(TOther) == typeof(T)) + { + result = (T)(object)value; + return true; + } + + bool succeeded = T.TryConvertFromSaturating(value, out T actualResult); + + if (!succeeded) + { + succeeded = TOther.TryConvertToSaturating(value, out actualResult); + } + + result = actualResult; + return succeeded; + } + + static bool INumberBase>.TryConvertFromTruncating(TOther value, out BinaryFloatingPointIeee754Reference result) + { + if (typeof(TOther) == typeof(T)) + { + result = (T)(object)value; + return true; + } + + bool succeeded = T.TryConvertFromTruncating(value, out T actualResult); + + if (!succeeded) + { + succeeded = TOther.TryConvertToTruncating(value, out actualResult); + } + + result = actualResult; + return succeeded; + } + + static bool INumberBase>.TryConvertToChecked(BinaryFloatingPointIeee754Reference value, out TOther result) => T.TryConvertToChecked(value.Value, out result); + static bool INumberBase>.TryConvertToSaturating(BinaryFloatingPointIeee754Reference value, out TOther result) => T.TryConvertToSaturating(value.Value, out result); + static bool INumberBase>.TryConvertToTruncating(BinaryFloatingPointIeee754Reference value, out TOther result) => T.TryConvertToTruncating(value.Value, out result); + + public static BinaryFloatingPointIeee754Reference operator +(BinaryFloatingPointIeee754Reference value) => +value.Value; + public static BinaryFloatingPointIeee754Reference operator +(BinaryFloatingPointIeee754Reference left, BinaryFloatingPointIeee754Reference right) => left.Value + right.Value; + public static BinaryFloatingPointIeee754Reference operator -(BinaryFloatingPointIeee754Reference value) => -value.Value; + public static BinaryFloatingPointIeee754Reference operator -(BinaryFloatingPointIeee754Reference left, BinaryFloatingPointIeee754Reference right) => left.Value - right.Value; + public static BinaryFloatingPointIeee754Reference operator ~(BinaryFloatingPointIeee754Reference value) => ~value.Value; + public static BinaryFloatingPointIeee754Reference operator ++(BinaryFloatingPointIeee754Reference value) => value.Value + T.One; + public static BinaryFloatingPointIeee754Reference operator --(BinaryFloatingPointIeee754Reference value) => value.Value - T.One; + public static BinaryFloatingPointIeee754Reference operator *(BinaryFloatingPointIeee754Reference left, BinaryFloatingPointIeee754Reference right) => left.Value * right.Value; + public static BinaryFloatingPointIeee754Reference operator /(BinaryFloatingPointIeee754Reference left, BinaryFloatingPointIeee754Reference right) => left.Value / right.Value; + public static BinaryFloatingPointIeee754Reference operator %(BinaryFloatingPointIeee754Reference left, BinaryFloatingPointIeee754Reference right) => left.Value % right.Value; + public static BinaryFloatingPointIeee754Reference operator &(BinaryFloatingPointIeee754Reference left, BinaryFloatingPointIeee754Reference right) => left.Value & right.Value; + public static BinaryFloatingPointIeee754Reference operator |(BinaryFloatingPointIeee754Reference left, BinaryFloatingPointIeee754Reference right) => left.Value | right.Value; + public static BinaryFloatingPointIeee754Reference operator ^(BinaryFloatingPointIeee754Reference left, BinaryFloatingPointIeee754Reference right) => left.Value ^ right.Value; + public static bool operator ==(BinaryFloatingPointIeee754Reference? left, BinaryFloatingPointIeee754Reference? right) => left is null ? right is null : left.Equals(right); + public static bool operator !=(BinaryFloatingPointIeee754Reference? left, BinaryFloatingPointIeee754Reference? right) => !(left == right); + public static bool operator <(BinaryFloatingPointIeee754Reference left, BinaryFloatingPointIeee754Reference right) => left.Value < right.Value; + public static bool operator >(BinaryFloatingPointIeee754Reference left, BinaryFloatingPointIeee754Reference right) => left.Value > right.Value; + public static bool operator <=(BinaryFloatingPointIeee754Reference left, BinaryFloatingPointIeee754Reference right) => left.Value <= right.Value; + public static bool operator >=(BinaryFloatingPointIeee754Reference left, BinaryFloatingPointIeee754Reference right) => left.Value >= right.Value; + + private static TNumber BinaryLog2(TNumber value) where TNumber : IBinaryNumber => TNumber.Log2(value); + } + + private sealed class MaxValueRandom : Random + { + public override void NextBytes(Span buffer) + { + buffer.Fill(byte.MaxValue); + } + } } } From 1f84bc9339681b4d27eeeaf80c27e18340b25524 Mon Sep 17 00:00:00 2001 From: Larry Ewing Date: Tue, 5 May 2026 21:34:31 -0500 Subject: [PATCH 014/109] Set per-target compile PDB for cDAC descriptor object libraries (#127836) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit > [!NOTE] > This PR was authored with assistance from GitHub Copilot. ## Problem The OBJECT libraries created by `generate_data_descriptors()` in `src/coreclr/clrdatadescriptors.cmake` compile `contract-descriptor.c` and `contractpointerdata.cpp` with MSVC defaults, which routes debug info into the compiler-default `vc140.pdb`. That PDB does not travel with the `.obj` files when they are archived into a static library such as `Runtime.ServerGC.lib`. Downstream linkers — in particular the NativeAOT publish of `ILCompiler`, `crossgen2`, and `ilasm` on Windows — then emit `LNK4099` ("PDB 'vc140.pdb' was not found") for each affected object, which is fatal under `/WX`. ## Symptom The `dotnet/runtime` → `dotnet/dotnet` codeflow PR [dotnet/dotnet#6423](https://github.com/dotnet/dotnet/pull/6423) is blocked: the **VMR Vertical Build Windows_x64** and **VMR Vertical Build Windows_x86** legs both fail with 22 `LNK4099` errors apiece, e.g.: ``` Runtime.ServerGC.lib(contract-descriptor.c.obj) : error LNK4099: PDB 'vc140.pdb' was not found with 'Runtime.ServerGC.lib(contract-descriptor.c.obj)' or at '...\artifacts\bin\ILCompiler_publish\x64\Release\native\vc140.pdb'; linking object as if no debug info [src\coreclr\tools\aot\ILCompiler\ILCompiler_publish.csproj] Runtime.ServerGC.lib(contractpointerdata.cpp.obj) : error LNK4099: ... ``` repeated for `crossgen2_publish.csproj` and `ilasm.csproj`. Linux/macOS/WASM/iOS/Android verticals all pass — `LNK4099` is MSVC-specific. The regression was introduced by #126972 ("[NativeAOT] Add cDAC data descriptor infrastructure"), which wired the new descriptor `OBJECT` libraries into the NativeAOT runtime so they end up archived inside `Runtime.ServerGC.lib`. ## Fix Set `COMPILE_PDB_NAME` and `COMPILE_PDB_OUTPUT_DIRECTORY` on `${LIBRARY}` so each descriptor library produces its own deterministic PDB that the consuming linker can locate. This matches the convention already used by `install_static_library` in `eng/native/functions.cmake`. ## Validation - CMake reconfigures cleanly. - Ninja built `nativeaot_gc_svr_descriptor`, `nativeaot_gc_wks_descriptor`, `nativeaot_cdac_contract_descriptor`, and `cdac_contract_descriptor` without errors on linux-x64. - The actual `LNK4099` resolution can only be verified on a Windows NativeAOT publish leg in CI; please pay particular attention to the Windows legs and to the next forward-flow into `dotnet/dotnet`. cc @max-charlamb (author of #126972) --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: Steve Pfister --- src/coreclr/clrdatadescriptors.cmake | 12 ++++++++++++ src/coreclr/jit/emitwasm.cpp | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/coreclr/clrdatadescriptors.cmake b/src/coreclr/clrdatadescriptors.cmake index 4cc6692d861da5..86b1b7defbebcb 100644 --- a/src/coreclr/clrdatadescriptors.cmake +++ b/src/coreclr/clrdatadescriptors.cmake @@ -88,4 +88,16 @@ function(generate_data_descriptors) # Set include directories for the data descriptor targets, now that they are created. target_include_directories(${LIBRARY} PUBLIC ${DATA_DESCRIPTOR_SHARED_INCLUDE_DIR}) target_include_directories(${LIBRARY} PRIVATE ${GENERATED_CDAC_DESCRIPTOR_DIR}) + + if(MSVC) + # Give this OBJECT library a deterministic, per-target compile PDB. Without this, + # MSVC writes debug info to the default `vc140.pdb`, which does not travel with + # the .obj files when they are archived into a static library (e.g. + # Runtime.ServerGC.lib). Downstream linkers - notably the NativeAOT publish + # of ILCompiler/crossgen2/ilasm - then emit LNK4099 ("PDB 'vc140.pdb' was not + # found"), which is fatal under /WX. + set_target_properties(${LIBRARY} PROPERTIES + COMPILE_PDB_NAME "${LIBRARY}" + COMPILE_PDB_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/$") + endif() endfunction(generate_data_descriptors) diff --git a/src/coreclr/jit/emitwasm.cpp b/src/coreclr/jit/emitwasm.cpp index 148a7e01f85e5b..4eaaf589cc9b20 100644 --- a/src/coreclr/jit/emitwasm.cpp +++ b/src/coreclr/jit/emitwasm.cpp @@ -599,7 +599,7 @@ size_t emitter::emitOutputULEB128(uint8_t* destination, uint64_t value) size_t emitter::emitOutputULEB128Padded(uint8_t* destination, uint64_t value) { uint8_t* buffer = destination + writeableOffset; - int i = 0; + unsigned i = 0; for (; i < PADDED_RELOC_SIZE - 1; i++) { From 055e04bbff528e950acfa0f5e56aa80c2e7929f7 Mon Sep 17 00:00:00 2001 From: Tanner Gooding Date: Tue, 5 May 2026 23:37:39 -0700 Subject: [PATCH 015/109] Centralize a couple JIT arithmetic helpers (#127781) --- src/coreclr/jit/bitset.cpp | 7 ------- src/coreclr/jit/bitset.h | 30 ----------------------------- src/coreclr/jit/bitsetasshortlong.h | 12 ++++++++++-- src/coreclr/jit/bitsetasuint64.h | 2 +- src/coreclr/jit/hashbv.cpp | 25 +----------------------- src/coreclr/jit/hashbv.h | 29 +--------------------------- 6 files changed, 13 insertions(+), 92 deletions(-) diff --git a/src/coreclr/jit/bitset.cpp b/src/coreclr/jit/bitset.cpp index 3bb356a61c8ce0..122609fc04bdca 100644 --- a/src/coreclr/jit/bitset.cpp +++ b/src/coreclr/jit/bitset.cpp @@ -10,13 +10,6 @@ #include "bitsetasshortlong.h" #include "bitsetasuint64inclass.h" -// clang-format off -unsigned BitSetSupport::BitCountTable[16] = { 0, 1, 1, 2, - 1, 2, 2, 3, - 1, 2, 2, 3, - 2, 3, 3, 4 }; -// clang-format on - #ifdef DEBUG template void BitSetSupport::RunTests(Env env) diff --git a/src/coreclr/jit/bitset.h b/src/coreclr/jit/bitset.h index 6f1e3d8dcd0db1..00e7b8ee14c2f3 100644 --- a/src/coreclr/jit/bitset.h +++ b/src/coreclr/jit/bitset.h @@ -20,23 +20,6 @@ class BitSetSupport public: static const unsigned BitsInByte = 8; - // This maps 4-bit ("nibble") values into the number of 1 bits they contain. - static unsigned BitCountTable[16]; - - // Returns the number of 1 bits in the binary representation of "u". - template - static unsigned CountBitsInIntegral(T u) - { - unsigned res = 0; - // We process "u" in 4-bit nibbles, hence the "*2" below. - for (unsigned int i = 0; i < sizeof(T) * 2; i++) - { - res += BitCountTable[u & 0xf]; - u >>= 4; - } - return res; - } - #ifdef DEBUG // This runs the "TestSuite" method for a few important instantiations of BitSet. static void TestSuite(CompAllocator env); @@ -74,19 +57,6 @@ class BitSetSupport }; }; -template <> -FORCEINLINE unsigned BitSetSupport::CountBitsInIntegral(unsigned c) -{ - // Make sure we're 32 bit. - assert(sizeof(unsigned) == 4); - c = (c & 0x55555555) + ((c >> 1) & 0x55555555); - c = (c & 0x33333333) + ((c >> 2) & 0x33333333); - c = (c & 0x0f0f0f0f) + ((c >> 4) & 0x0f0f0f0f); - c = (c & 0x00ff00ff) + ((c >> 8) & 0x00ff00ff); - c = (c & 0x0000ffff) + ((c >> 16) & 0x0000ffff); - return c; -} - // A "BitSet" represents a set of integers from a "universe" [0..N-1]. This implementation assumes that "N" // (the "Size") is provided by the "Env" template argument type discussed below, and accessed from the Env // via a static method of the BitSetTraits type discussed below. The intent of "BitSet" is that the set is diff --git a/src/coreclr/jit/bitsetasshortlong.h b/src/coreclr/jit/bitsetasshortlong.h index 027b0aafe47219..0e539ee25489b4 100644 --- a/src/coreclr/jit/bitsetasshortlong.h +++ b/src/coreclr/jit/bitsetasshortlong.h @@ -178,7 +178,11 @@ class BitSetOps> 1) & 0x55555555) + (bits & 0x55555555); - bits = ((bits >> 2) & 0x33333333) + (bits & 0x33333333); - bits = ((bits >> 4) & 0x0F0F0F0F) + (bits & 0x0F0F0F0F); - bits = ((bits >> 8) & 0x00FF00FF) + (bits & 0x00FF00FF); - bits = ((bits >> 16) & 0x0000FFFF) + (bits & 0x0000FFFF); - return (int)bits; -} - -int countBitsInWord(uint64_t bits) -{ - bits = ((bits >> 1) & 0x5555555555555555) + (bits & 0x5555555555555555); - bits = ((bits >> 2) & 0x3333333333333333) + (bits & 0x3333333333333333); - bits = ((bits >> 4) & 0x0F0F0F0F0F0F0F0F) + (bits & 0x0F0F0F0F0F0F0F0F); - bits = ((bits >> 8) & 0x00FF00FF00FF00FF) + (bits & 0x00FF00FF00FF00FF); - bits = ((bits >> 16) & 0x0000FFFF0000FFFF) + (bits & 0x0000FFFF0000FFFF); - bits = ((bits >> 32) & 0x00000000FFFFFFFF) + (bits & 0x00000000FFFFFFFF); - return (int)bits; -} - int hashBvNode::countBits() { int result = 0; @@ -146,7 +123,7 @@ int hashBvNode::countBits() { elemType bits = elements[i]; - result += countBitsInWord(bits); + result += BitOperations::PopCount(bits); result += (int)bits; } diff --git a/src/coreclr/jit/hashbv.h b/src/coreclr/jit/hashbv.h index b93a4baa6b4d62..2098814b6730b2 100644 --- a/src/coreclr/jit/hashbv.h +++ b/src/coreclr/jit/hashbv.h @@ -85,34 +85,7 @@ inline int log2(int number) // return greatest power of 2 that is less than or equal inline int nearest_pow2(unsigned number) { - int result = 0; - - if (number > 0xffff) - { - number >>= 16; - result += 16; - } - if (number > 0xff) - { - number >>= 8; - result += 8; - } - if (number > 0xf) - { - number >>= 4; - result += 4; - } - if (number > 0x3) - { - number >>= 2; - result += 2; - } - if (number > 0x1) - { - number >>= 1; - result += 1; - } - return 1 << result; + return 1 << BitOperations::Log2(number); } class hashBvNode From c0bea4094f512f9badff664966387838773f2df1 Mon Sep 17 00:00:00 2001 From: Milos Kotlar Date: Wed, 6 May 2026 13:11:44 +0200 Subject: [PATCH 016/109] [mobile] Disable RoundTrip_AllWindowLogs on iOS / tvOS / MacCatalyst / Android (#127789) ## Description `EncoderDecoderTestBase.RoundTrip_AllWindowLogs` (Deflate / ZLib / GZip variants) deterministically returns `OperationStatus.DestinationTooSmall` on every Apple-mobile and Android architecture regardless of runtime flavor tracked in #127563. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../Common/tests/System/IO/Compression/EncoderDecoderTestBase.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/libraries/Common/tests/System/IO/Compression/EncoderDecoderTestBase.cs b/src/libraries/Common/tests/System/IO/Compression/EncoderDecoderTestBase.cs index 39a7b68cf79c15..b27712a3dd9f4d 100644 --- a/src/libraries/Common/tests/System/IO/Compression/EncoderDecoderTestBase.cs +++ b/src/libraries/Common/tests/System/IO/Compression/EncoderDecoderTestBase.cs @@ -688,6 +688,7 @@ public void RoundTrip_AllCompressionLevels() } [Fact] + [ActiveIssue("https://github.com/dotnet/runtime/issues/127563", TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst | TestPlatforms.Android)] public void RoundTrip_AllWindowLogs() { byte[] input = CreateTestData(); From 055b99b765edfb2df59fcdfb4b70b355c1cf6c07 Mon Sep 17 00:00:00 2001 From: prozolic <42107886+prozolic@users.noreply.github.com> Date: Wed, 6 May 2026 20:46:24 +0900 Subject: [PATCH 017/109] Fix scoped Utf8JsonReader to carry original position (#127679) #97893 This PR capture the original reader's `_lineNumber` and `_bytePositionInLine` in `JsonSerializer.GetReaderScopedToNextValue`, rewind them per token type to point immediately before the value token, and pass them to the scoped reader through `JsonReaderState`. The scoped reader, after consuming its first token, lands on the same position as the original reader, so `JsonException` now reports positions relative to the original input. --------- Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- .../JsonSerializer.Read.Utf8JsonReader.cs | 43 ++- .../Serialization/ReadValueTests.cs | 247 ++++++++++++++++++ 2 files changed, 288 insertions(+), 2 deletions(-) diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonSerializer.Read.Utf8JsonReader.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonSerializer.Read.Utf8JsonReader.cs index e84888c90087fa..2933c753c7ba69 100644 --- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonSerializer.Read.Utf8JsonReader.cs +++ b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonSerializer.Read.Utf8JsonReader.cs @@ -325,6 +325,9 @@ private static Utf8JsonReader GetReaderScopedToNextValue(ref Utf8JsonReader read ReadOnlySpan valueSpan = default; ReadOnlySequence valueSequence = default; + long lineNumber = 0; + long bytePositionInLine = 0; + try { switch (reader.TokenType) @@ -345,6 +348,13 @@ private static Utf8JsonReader GetReaderScopedToNextValue(ref Utf8JsonReader read } } + // Capture the original reader's position so that the scoped reader, after consuming its + // first token, lands on the same position the original reader is currently at. + // The values captured here represent the position immediately after the current token, + // the per-case logic below rewinds them to the position immediately before the value token starts. + lineNumber = reader.CurrentState._lineNumber; + bytePositionInLine = reader.CurrentState._bytePositionInLine; + switch (reader.TokenType) { // Any of the "value start" states are acceptable. @@ -371,6 +381,8 @@ private static Utf8JsonReader GetReaderScopedToNextValue(ref Utf8JsonReader read valueSequence = sequence.Slice(startingOffset, totalLength); } + // Rewind by 1 byte to point right before the opening '{' or '['. + bytePositionInLine--; Debug.Assert(reader.TokenType is JsonTokenType.EndObject or JsonTokenType.EndArray); break; @@ -379,13 +391,16 @@ private static Utf8JsonReader GetReaderScopedToNextValue(ref Utf8JsonReader read case JsonTokenType.True: case JsonTokenType.False: case JsonTokenType.Null: + // Rewind by the length of the value token to point right before the start of the value. if (reader.HasValueSequence) { valueSequence = reader.ValueSequence; + bytePositionInLine -= valueSequence.Length; } else { valueSpan = reader.ValueSpan; + bytePositionInLine -= valueSpan.Length; } break; @@ -412,6 +427,9 @@ private static Utf8JsonReader GetReaderScopedToNextValue(ref Utf8JsonReader read $"Calculated span ends with {readerSpan[(int)reader.TokenStartIndex + payloadLength - 1]}"); valueSpan = readerSpan.Slice((int)reader.TokenStartIndex, payloadLength); + + // Rewind by payloadLength to point right before the opening quote. + bytePositionInLine -= payloadLength; } else { @@ -427,6 +445,9 @@ private static Utf8JsonReader GetReaderScopedToNextValue(ref Utf8JsonReader read Debug.Assert( valueSequence.ToArray()[payloadLength - 1] == (byte)'"', $"Calculated sequence ends with {valueSequence.ToArray()[payloadLength - 1]}"); + + // Rewind by payloadLength to point right before the opening quote. + bytePositionInLine -= payloadLength; } break; @@ -451,10 +472,28 @@ private static Utf8JsonReader GetReaderScopedToNextValue(ref Utf8JsonReader read } Debug.Assert(!valueSpan.IsEmpty ^ !valueSequence.IsEmpty); + Debug.Assert(lineNumber >= 0); + Debug.Assert(bytePositionInLine >= 0); + + // Carry only the position information and reader options to the scoped reader + // so that any JsonException it raises reports a position relative to the original input. + var scopedCurrentState = new JsonReaderState + ( + lineNumber: lineNumber, + bytePositionInLine: bytePositionInLine, + inObject: default, + isNotPrimitive: default, + valueIsEscaped: default, + trailingCommaBeforeComment: default, + tokenType: default, + previousTokenType: default, + readerOptions: reader.CurrentState.Options, + bitStack: default + ); return valueSpan.IsEmpty - ? new Utf8JsonReader(valueSequence, reader.CurrentState.Options) - : new Utf8JsonReader(valueSpan, reader.CurrentState.Options); + ? new Utf8JsonReader(valueSequence, isFinalBlock: true, state: scopedCurrentState) + : new Utf8JsonReader(valueSpan, isFinalBlock: true, state: scopedCurrentState); } } } diff --git a/src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Serialization/ReadValueTests.cs b/src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Serialization/ReadValueTests.cs index cd74eda2748fd6..3e1d3310cd5415 100644 --- a/src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Serialization/ReadValueTests.cs +++ b/src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Serialization/ReadValueTests.cs @@ -781,6 +781,253 @@ public static void ReadSimpleList_AllowMultipleValues_TrailingContent() List result = JsonSerializer.Deserialize>(ref reader); Assert.Equal([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20], result); } + + [Fact] + public static void ReaderPreservesPositionInfo() + { + var utf8 = """ + [ + 42 + ] + """u8.ToArray(); + + JsonException ex = Assert.Throws(() => + { + var reader = new Utf8JsonReader(utf8); + + reader.Read(); + reader.Read(); + + JsonSerializer.Deserialize(ref reader); + }); + + Assert.Equal(1, ex.LineNumber); + Assert.Equal(6, ex.BytePositionInLine); + } + + [Theory] + [InlineData("[ 42]", typeof(string), 0, 5)] + [InlineData("[true]", typeof(string), 0, 5)] + [InlineData("[false]", typeof(string), 0, 6)] + [InlineData("[null]", typeof(int), 0, 5)] + [InlineData("[\"hello\"]", typeof(int), 0, 8)] + [InlineData("[{\"key\":1}]", typeof(string), 0, 2)] + [InlineData("[[1,2]]", typeof(string), 0, 2)] + public static void ReaderPreservesPositionInfoSingleLineTokens( + string json, Type deserializeType, long expectedLine, long expectedBytePosition) + { + byte[] utf8 = Encoding.UTF8.GetBytes(json); + + JsonException ex = Assert.Throws(() => + { + var reader = new Utf8JsonReader(utf8, isFinalBlock: true, state: default); + reader.Read(); + reader.Read(); + + JsonSerializer.Deserialize(ref reader, deserializeType); + }); + + Assert.Equal(expectedLine, ex.LineNumber); + Assert.Equal(expectedBytePosition, ex.BytePositionInLine); + } + + [Fact] + public static void ReaderPreservesPositionInfoNoneTokenType() + { + byte[] utf8 = "42"u8.ToArray(); + + JsonException ex = Assert.Throws(() => + { + var reader = new Utf8JsonReader(utf8, isFinalBlock: true, state: default); + + JsonSerializer.Deserialize(ref reader); + }); + + Assert.Equal(0, ex.LineNumber); + Assert.Equal(2, ex.BytePositionInLine); + } + + [Fact] + public static void ReaderPreservesPositionInfoPropertyNameTokenType() + { + byte[] utf8 = "{\"val\": 42}"u8.ToArray(); + + JsonException ex = Assert.Throws(() => + { + var reader = new Utf8JsonReader(utf8, isFinalBlock: true, state: default); + reader.Read(); + reader.Read(); + Assert.Equal(JsonTokenType.PropertyName, reader.TokenType); + + JsonSerializer.Deserialize(ref reader); + }); + + Assert.Equal(0, ex.LineNumber); + Assert.Equal(10, ex.BytePositionInLine); + } + + [Fact] + public static void ReaderPreservesPositionInfoPropertyNameMultiLine() + { + byte[] utf8 = Encoding.UTF8.GetBytes("{\n \"val\":\n 42\n}"); + + JsonException ex = Assert.Throws(() => + { + var reader = new Utf8JsonReader(utf8, isFinalBlock: true, state: default); + reader.Read(); + reader.Read(); + Assert.Equal(JsonTokenType.PropertyName, reader.TokenType); + + JsonSerializer.Deserialize(ref reader); + }); + + Assert.Equal(2, ex.LineNumber); + Assert.Equal(4, ex.BytePositionInLine); + } + + [Theory] + [InlineData("[1234]", 2, typeof(string), 0, 5)] + [InlineData("[true]", 3, typeof(string), 0, 5)] + [InlineData("[\"hello\"]", 4, typeof(int), 0, 8)] + [InlineData("[{\"key\":1}]", 5, typeof(string), 0, 2)] + public static void ReaderPreservesPositionInfoMultiSegment(string json, int splitAt, Type deserializeType, long expectedLine, long expectedBytePosition) + { + byte[] utf8 = Encoding.UTF8.GetBytes(json); + ReadOnlySequence sequence = JsonTestHelper.CreateSegments(utf8, splitAt); + + JsonException ex = Assert.Throws(() => + { + var reader = new Utf8JsonReader(sequence, isFinalBlock: true, state: default); + reader.Read(); + reader.Read(); + + JsonSerializer.Deserialize(ref reader, deserializeType); + }); + + Assert.Equal(expectedLine, ex.LineNumber); + Assert.Equal(expectedBytePosition, ex.BytePositionInLine); + } + + [Fact] + public static void ReaderPreservesPositionInfoMultiByteUtf8String() + { + // "😀葛🀄" occupies 11 bytes in UTF-8 (4 + 3 + 4), + // so the closing quote sits at byte index 13 and BytePositionInLine after the token is 14. + byte[] utf8 = Encoding.UTF8.GetBytes("[\"😀葛🀄\"]"); + + JsonException ex = Assert.Throws(() => + { + var reader = new Utf8JsonReader(utf8, isFinalBlock: true, state: default); + reader.Read(); + reader.Read(); + Assert.Equal(JsonTokenType.String, reader.TokenType); + + JsonSerializer.Deserialize(ref reader); + }); + + Assert.Equal(0, ex.LineNumber); + Assert.Equal(14, ex.BytePositionInLine); + } + + [Theory] + [InlineData("[\n {\"key\":1}\n]", typeof(string), 1, 3)] + [InlineData("[\n [1, 2]\n]", typeof(string), 1, 3)] + public static void ReaderPreservesPositionInfoMultiLineContainer( + string json, Type deserializeType, long expectedLine, long expectedBytePosition) + { + byte[] utf8 = Encoding.UTF8.GetBytes(json); + + JsonException ex = Assert.Throws(() => + { + var reader = new Utf8JsonReader(utf8, isFinalBlock: true, state: default); + reader.Read(); + reader.Read(); + Assert.True(reader.TokenType is JsonTokenType.StartObject or JsonTokenType.StartArray); + + JsonSerializer.Deserialize(ref reader, deserializeType); + }); + + Assert.Equal(expectedLine, ex.LineNumber); + Assert.Equal(expectedBytePosition, ex.BytePositionInLine); + } + + [Theory] + [InlineData("[ /* comment */ 42 ]", typeof(string), 0, 18)] + [InlineData("[ // comment\n42 ]", typeof(string), 1, 2)] + [InlineData("[ /* comment */ true ]", typeof(int), 0, 20)] + [InlineData("[ /* comment */ false ]", typeof(int), 0, 21)] + [InlineData("[ /* comment */ null ]", typeof(int), 0, 20)] + [InlineData("[ /* comment */ \"hello\" ]", typeof(int), 0, 23)] + [InlineData("[ /* comment */ {\"key\":1} ]", typeof(string), 0, 17)] + [InlineData("[ /* comment */ [1,2] ]", typeof(string), 0, 17)] + [InlineData("[ /*\nmultiline\ncomment\n*/ 42 ]", typeof(string), 3, 5)] + [InlineData("[ /*\n*/ 42 ]", typeof(string), 1, 5)] + [InlineData("[ /*\nmultiline\n*/ {\"key\":1} ]", typeof(string), 2, 4)] + [InlineData("[ /*\nmultiline\n*/ [1,2] ]", typeof(string), 2, 4)] + [InlineData("[ /*\nmultiline\n*/ \"hello\" ]", typeof(int), 2, 10)] + public static void ReaderPreservesPositionInfoWithSkippedComments( + string json, Type deserializeType, long expectedLine, long expectedBytePosition) + { + byte[] utf8 = Encoding.UTF8.GetBytes(json); + var options = new JsonReaderOptions { CommentHandling = JsonCommentHandling.Skip }; + + JsonException ex = Assert.Throws(() => + { + var reader = new Utf8JsonReader(utf8, isFinalBlock: true, state: new JsonReaderState(options)); + reader.Read(); + reader.Read(); + + JsonSerializer.Deserialize(ref reader, deserializeType); + }); + + Assert.Equal(expectedLine, ex.LineNumber); + Assert.Equal(expectedBytePosition, ex.BytePositionInLine); + } + + [Theory] + [InlineData("{\"val\": /* comment */ 42}", 0, 24)] + [InlineData("{\"val\": // comment\n42}", 1, 2)] + [InlineData("{\"val\":\n/* comment */\n42}", 2, 2)] + [InlineData("{\"val\": /* comment */ {\"k\":1}}", 0, 23)] + public static void ReaderPreservesPositionInfoPropertyNameWithSkippedComments( + string json, long expectedLine, long expectedBytePosition) + { + byte[] utf8 = Encoding.UTF8.GetBytes(json); + var options = new JsonReaderOptions { CommentHandling = JsonCommentHandling.Skip }; + + JsonException ex = Assert.Throws(() => + { + var reader = new Utf8JsonReader(utf8, isFinalBlock: true, state: new JsonReaderState(options)); + reader.Read(); + reader.Read(); + Assert.Equal(JsonTokenType.PropertyName, reader.TokenType); + + JsonSerializer.Deserialize(ref reader); + }); + + Assert.Equal(expectedLine, ex.LineNumber); + Assert.Equal(expectedBytePosition, ex.BytePositionInLine); + } + + [Theory] + [InlineData("/* comment */ 42", 0, 16)] + [InlineData("/*\ncomment\n*/ 42", 2, 5)] + public static void ReaderPreservesPositionInfoWithCommentBeforeNoneToken( + string json, long expectedLine, long expectedBytePosition) + { + byte[] utf8 = Encoding.UTF8.GetBytes(json); + var options = new JsonReaderOptions { CommentHandling = JsonCommentHandling.Skip }; + + JsonException ex = Assert.Throws(() => + { + var reader = new Utf8JsonReader(utf8, isFinalBlock: true, state: new JsonReaderState(options)); + + JsonSerializer.Deserialize(ref reader); + }); + + Assert.Equal(expectedLine, ex.LineNumber); + Assert.Equal(expectedBytePosition, ex.BytePositionInLine); + } } // From https://github.com/dotnet/runtime/issues/882 From 5a73be0dfd3abe369fc9b42af394711b3abf0a0e Mon Sep 17 00:00:00 2001 From: Ahmed Waleed Date: Wed, 6 May 2026 15:01:21 +0300 Subject: [PATCH 018/109] Optimize ImmutableSortedSet.SetEquals to avoid unnecessary allocations (#126549) Part of #127279 ### Summary `ImmutableSortedSet.SetEquals` always creates a new intermediate `SortedSet` for the `other` collection, leading to avoidable allocations and GC pressure, especially for large datasets ### Optimization Logic * **Type-Specific Fast Paths:** Uses pattern matching to detect if `other` is an `ImmutableSortedSet` or `SortedSet`, triggering optimized logic only if their `Comparer` matches. * **O(1) Early Exit:** Performs an immediate `ReferenceEquals` check and leverages `ICollection` to return `false` early if `other.Count` is less than `this.Count`. * **Sequential Lock-Step Comparison:** Replaces the $O(\log n)$ per-element `.Contains()` check with a dual-enumerator `while` loop. This leverages the sorted nature of both sets to achieve $O(n)$ linear complexity. * **Zero Allocation Path:** For compatible sorted sets, the comparison is performed directly on existing instances, eliminating the memory overhead of temporary collections. * **Refined Fallback:** Even when a `new SortedSet` is required for general `IEnumerable` types, the final comparison now uses the same efficient $O(n)$ sequential scan instead of repeated lookups.
Click to expand Benchmark Source Code ```csharp using BenchmarkDotNet.Attributes; using BenchmarkDotNet.Order; using BenchmarkDotNet.Running; using System; using System.Collections.Generic; using System.Collections.Immutable; using System.Linq; namespace ImmutableSortedSetBenchmarks { [MemoryDiagnoser] [Orderer(SummaryOrderPolicy.FastestToSlowest)] [RankColumn] public class ImmutableSortedSetSetEqualsBenchmark_Int { private ImmutableSortedSet _sourceSet = null!; private ImmutableSortedSet _immutableSortedSetEqual = null!; private SortedSet _bclSortedSetEqual = null!; private List _listEqual = null!; private IEnumerable _linqSelectEqual = null!; private int[] _arrayEqual = null!; private List _listLastDiff = null!; private List _listSmaller = null!; private ImmutableSortedSet _immutableLarger = null!; private int[] _smallerArray = null!; private SortedSet _smallerSortedSetDiffComparer = null!; private ImmutableSortedSet _immutableSortedSetLastDiff = null!; private SortedSet _bclSortedSetLastDiff = null!; private List _listWithDuplicates = null!; private List _listWithDuplicatesMatch = null!; private SortedSet _bclSortedSetDiffComparer = null!; private ImmutableSortedSet _immutableSortedSetSmaller = null!; private SortedSet _bclSortedSetSmaller = null!; private IEnumerable _lazyEnumerableLastDiff = null!; [Params(100000)] public int Size { get; set; } [GlobalSetup] public void Setup() { var elements = Enumerable.Range(0, Size).ToList(); var elementsWithLastDiff = Enumerable.Range(0, Size - 1).Concat(new[] { Size + 1000 }).ToList(); var smallerElements = Enumerable.Range(0, Size / 2).ToList(); var duplicates = Enumerable.Repeat(1, Size).ToList(); var smallerList = new List(); for(int i = 0; i < Size - 1; i++) smallerList.Add(i); var reverseComparer = new ReverseComparer(); _sourceSet = ImmutableSortedSet.CreateRange(elements); _immutableSortedSetEqual = ImmutableSortedSet.CreateRange(elements); _bclSortedSetEqual = new SortedSet(elements); _listEqual = elements; _linqSelectEqual = elements.Select(x => x); _arrayEqual = elements.ToArray(); _immutableSortedSetLastDiff = ImmutableSortedSet.CreateRange(elementsWithLastDiff); _bclSortedSetLastDiff = new SortedSet(elementsWithLastDiff); _listLastDiff = elementsWithLastDiff; _bclSortedSetDiffComparer = new SortedSet(elements, reverseComparer); _immutableSortedSetSmaller = ImmutableSortedSet.CreateRange(smallerElements); _bclSortedSetSmaller = new SortedSet(smallerElements); _lazyEnumerableLastDiff = elementsWithLastDiff.Select(x => x); _immutableLarger = ImmutableSortedSet.CreateRange(elements.Concat(new[] { -1 })); _listWithDuplicates = duplicates; _listWithDuplicatesMatch = elements.Concat(elements).ToList(); _listSmaller = smallerList; _smallerArray = Enumerable.Range(0, Size - 1).ToArray(); _smallerSortedSetDiffComparer = new SortedSet(_listSmaller, reverseComparer); } #region Fast Path: Same Type and Comparer [Benchmark(Description = "ImmutableSortedSet (Match - Same Comparer)")] public bool Case_ImmutableSortedSet_Match() => _sourceSet.SetEquals(_immutableSortedSetEqual); [Benchmark(Description = "BCL SortedSet (Match - Same Comparer)")] public bool Case_BclSortedSet_Match() => _sourceSet.SetEquals(_bclSortedSetEqual); [Benchmark(Description = "ImmutableSortedSet (Mismatch - Same Count)")] public bool Case_ImmutableSortedSet_LastDiff() => _sourceSet.SetEquals(_immutableSortedSetLastDiff); [Benchmark(Description = "BCL SortedSet (Mismatch - Same Count)")] public bool Case_BclSortedSet_LastDiff() => _sourceSet.SetEquals(_bclSortedSetLastDiff); #endregion #region Early Exit: Count Mismatch [Benchmark(Description = "ImmutableSortedSet (Smaller Count)")] public bool Case_ImmutableSortedSet_SmallerCount() => _sourceSet.SetEquals(_immutableSortedSetSmaller); [Benchmark(Description = "BCL SortedSet (Smaller Count)")] public bool Case_BclSortedSet_SmallerCount() => _sourceSet.SetEquals(_bclSortedSetSmaller); [Benchmark(Description = "Array (Smaller Count)")] public bool Case_SmallerCollection_EarlyExit() => _sourceSet.SetEquals(_smallerArray); #endregion #region Fallback Path: Different Comparer [Benchmark(Description = "SortedSet (Different Comparer)")] public bool Case_SortedSet_DifferentComparer() => _sourceSet.SetEquals(_bclSortedSetDiffComparer); [Benchmark(Description = "SortedSet (Smaller Count - Different Comparer)")] public bool Case_SortedSet_SmallerCount_DiffComparer() => _sourceSet.SetEquals(_smallerSortedSetDiffComparer); #endregion #region Fallback Path: Non-Set Collections [Benchmark(Description = "List (Match - Fallback)")] public bool Case_List_Match() => _sourceSet.SetEquals(_listEqual); [Benchmark(Description = "LINQ (Mismatch - Lazy IEnumerable)")] public bool Case_LazyEnumerable_LastDiff() => _sourceSet.SetEquals(_lazyEnumerableLastDiff); [Benchmark(Description = "LINQ (Match - Lazy IEnumerable)")] public bool Case_LazyEnumerable_Match() => _sourceSet.SetEquals(_linqSelectEqual); [Benchmark(Description = "List (Last Diff - Fallback)")] public bool Case_List_LastDiff() => _sourceSet.SetEquals(_listLastDiff); [Benchmark(Description = "Array (Match - Fallback)")] public bool Case_Array_Match() => _sourceSet.SetEquals(_arrayEqual); [Benchmark(Description = "ImmutableSortedSet (Larger Count)")] public bool Case_LargerCount() => _sourceSet.SetEquals(_immutableLarger); #endregion #region Handling Duplicates [Benchmark(Description = "List with Duplicates (Mismatch)")] public bool Case_List_Duplicates_Mismatch() => _sourceSet.SetEquals(_listWithDuplicates); [Benchmark(Description = "List with Duplicates (Match)")] public bool Case_List_Duplicates_Match() => _sourceSet.SetEquals(_listWithDuplicatesMatch); #endregion } public class ReverseComparer : IComparer where T : IComparable { public int Compare(T? x, T? y) { if (x == null && y == null) return 0; if (x == null) return 1; if (y == null) return -1; return y.CompareTo(x); } } public class Program { public static void Main(string[] args) { BenchmarkRunner.Run(); } } } ```
Click to expand Benchmark Results ### Benchmark Results (Before Optimization) | Method | Size | Mean | Error | StdDev | Rank | Gen0 | Gen1 | Gen2 | Allocated | |--------------------------------------------------|--------|------------:|------------:|------------:|-----:|-----------:|-----------:|---------:|------------:| | 'List with Duplicates (Mismatch)' | 100000 | 1.931 ms | 0.0321 ms | 0.0268 ms | 1 | 9.7656 | 9.7656 | 9.7656 | 390.8 KB | | 'BCL SortedSet (Smaller Count)' | 100000 | 1.956 ms | 0.0249 ms | 0.0233 ms | 1 | 371.0938 | 285.1563 | - | 1953.73 KB | | 'ImmutableSortedSet (Smaller Count)' | 100000 | 3.516 ms | 0.0413 ms | 0.0387 ms | 2 | 367.1875 | 304.6875 | 3.9063 | 2148.52 KB | | 'Array (Smaller Count)' | 100000 | 4.910 ms | 0.0860 ms | 0.0718 ms | 3 | 671.8750 | 609.3750 | 7.8125 | 4296.91 KB | | 'SortedSet (Smaller Count - Different Comparer)' | 100000 | 6.799 ms | 0.0873 ms | 0.0816 ms | 4 | 679.6875 | 609.3750 | 7.8125 | 4297.31 KB | | 'ImmutableSortedSet (Larger Count)' | 100000 | 7.513 ms | 0.1106 ms | 0.0981 ms | 5 | 671.8750 | 625.0000 | 7.8125 | 4297 KB | | 'List (Match - Fallback)' | 100000 | 13.665 ms | 0.1204 ms | 0.1005 ms | 6 | 671.8750 | 625.0000 | - | 4297.26 KB | | 'Array (Match - Fallback)' | 100000 | 13.797 ms | 0.0807 ms | 0.0716 ms | 6 | 656.2500 | 625.0000 | - | 4297.25 KB | | 'List (Last Diff - Fallback)' | 100000 | 13.888 ms | 0.1573 ms | 0.1394 ms | 6 | 671.8750 | 609.3750 | - | 4297.25 KB | | 'BCL SortedSet (Match - Same Comparer)' | 100000 | 14.849 ms | 0.2830 ms | 0.2647 ms | 7 | 671.8750 | 609.3750 | - | 3907.19 KB | | 'BCL SortedSet (Mismatch - Same Count)' | 100000 | 15.137 ms | 0.2700 ms | 0.2526 ms | 7 | 671.8750 | 625.0000 | - | 3907.19 KB | | 'LINQ (Mismatch - Lazy IEnumerable)' | 100000 | 15.202 ms | 0.1243 ms | 0.1162 ms | 7 | 750.0000 | 625.0000 | 15.6250 | 4931.04 KB | | 'SortedSet (Different Comparer)' | 100000 | 15.214 ms | 0.1632 ms | 0.1447 ms | 7 | 640.6250 | 625.0000 | - | 4297.65 KB | | 'LINQ (Match - Lazy IEnumerable)' | 100000 | 15.360 ms | 0.1323 ms | 0.1238 ms | 7 | 734.3750 | 640.6250 | 15.6250 | 4931.13 KB | | 'ImmutableSortedSet (Mismatch - Same Count)' | 100000 | 17.122 ms | 0.2080 ms | 0.1946 ms | 8 | 656.2500 | 593.7500 | - | 4297.26 KB | | 'ImmutableSortedSet (Match - Same Comparer)' | 100000 | 17.256 ms | 0.2191 ms | 0.1829 ms | 8 | 750.0000 | 593.7500 | - | 4297.25 KB | | 'List with Duplicates (Match)' | 100000 | 31.781 ms | 0.2065 ms | 0.1724 ms | 9 | 625.0000 | 562.5000 | - | 4687.9 KB | --- ### Benchmark Results (After Optimization) | Method | Size | Mean | Error | StdDev | Gen0 | Gen1 | Gen2 | Allocated | |:---|---:|---:|---:|---:|---:|---:|---:|---:| | 'ImmutableSortedSet (Larger Count)' | 100000 | 1.605 ns | 0.0427 ns | 0.0379 ns | - | - | - | - | | 'ImmutableSortedSet (Smaller Count)' | 100000 | 1.624 ns | 0.0491 ns | 0.0459 ns | - | - | - | - | | 'SortedSet (Smaller Count - Different Comparer)' | 100000 | 1.690 ns | 0.0456 ns | 0.0404 ns | - | - | - | - | | 'BCL SortedSet (Smaller Count)' | 100000 | 1.816 ns | 0.0569 ns | 0.0532 ns | - | - | - | - | | 'Array (Smaller Count)' | 100000 | 2.155 ns | 0.0625 ns | 0.0522 ns | - | - | - | - | | 'List with Duplicates (Mismatch)' | 100000 | 1,241,268.377 ns | 9,938.3202 ns | 8,810.0620 ns | 9.7656 | 9.7656 | 9.7656 | 400150 B | | 'BCL SortedSet (Mismatch - Same Count)' | 100000 | 2,656,001.235 ns | 26,235.3715 ns | 23,256.9735 ns | - | - | - | 312 B | | 'BCL SortedSet (Match - Same Comparer)' | 100000 | 2,656,167.835 ns | 36,661.1748 ns | 32,499.1766 ns | - | - | - | 314 B | | 'ImmutableSortedSet (Mismatch - Same Count)' | 100000 | 3,658,683.860 ns | 43,801.7836 ns | 40,972.2155 ns | - | - | - | - | | 'ImmutableSortedSet (Match - Same Comparer)' | 100000 | 3,672,184.801 ns | 28,641.6696 ns | 22,361.5316 ns | - | - | - | - | | 'List (Match - Fallback)' | 100000 | 7,607,183.416 ns | 116,938.1638 ns | 97,648.6630 ns | 671.8750 | 625.0000 | - | 4400390 B | | 'List (Last Diff - Fallback)' | 100000 | 7,713,407.057 ns | 123,214.3767 ns | 109,226.3356 ns | 671.8750 | 625.0000 | 7.8125 | 4400387 B | | 'Array (Match - Fallback)' | 100000 | 7,717,749.754 ns | 124,099.3086 ns | 116,082.5703 ns | 664.0625 | 625.0000 | 7.8125 | 4400387 B | | 'LINQ (Mismatch - Lazy IEnumerable)' | 100000 | 8,974,566.438 ns | 171,672.9513 ns | 160,582.9853 ns | 750.0000 | 593.7500 | 15.6250 | 5049380 B | | 'LINQ (Match - Lazy IEnumerable)' | 100000 | 9,006,743.952 ns | 112,508.0211 ns | 105,240.0728 ns | 734.3750 | 640.6250 | 15.6250 | 5049380 B | | 'SortedSet (Different Comparer)' | 100000 | 9,661,422.295 ns | 175,748.1986 ns | 164,394.9741 ns | 656.2500 | 609.3750 | - | 4400729 B | | 'List with Duplicates (Match)' | 100000 | 24,718,281.944 ns | 253,370.8073 ns | 224,606.6212 ns | 656.2500 | 593.7500 | - | 4800396 B |
### Performance Analysis Summary (100,000 Elements) ### Performance Analysis Summary (100,000 Elements) | Case | Speed Improvement | Memory Improvement | | :--- | :--- | :--- | | **ImmutableSortedSet (Larger Count)** | **~4,681,000x** | **Zero Alloc** | | **SortedSet (Smaller - Diff Comparer)** | **~4,023,000x** | **Zero Alloc** | | **ImmutableSortedSet (Smaller Count)** | **~2,165,000x** | **Zero Alloc** | | **Array (Smaller Count)** | **~2,278,000x** | **Zero Alloc** | | **BCL SortedSet (Smaller Count)** | **~1,077,000x** | **Zero Alloc** | | **BCL SortedSet (Mismatch - Same Count)** | **~5.70x** | **~99.99%** | | **BCL SortedSet (Match - Same Comparer)** | **~5.59x** | **~99.99%** | | **ImmutableSortedSet (Match - Same Comparer)** | **~4.70x** | **Zero Alloc** | | **ImmutableSortedSet (Mismatch - Same Count)** | **~4.68x** | **Zero Alloc** | | **List (Match - Fallback)** | **~1.80x** | Stable | | **Array (Match - Fallback)** | **~1.79x** | Stable | | **List (Last Diff - Fallback)** | **~1.80x** | Stable | | **LINQ (Mismatch - Lazy IEnumerable)** | **~1.69x** | Stable | | **LINQ (Match - Lazy IEnumerable)** | **~1.70x** | Stable | | **List with Duplicates (Mismatch)** | **~1.56x** | Stable | | **SortedSet (Different Comparer)** | **~1.57x** | Stable | | **List with Duplicates (Match)** | **~1.29x** | Stable | --- ## Testing In addition to the fix, I have added comprehensive unit tests covering various scenarios to ensure correctness: - **Mismatched Comparers (Ordinal vs. OrdinalIgnoreCase):** Verified that `SetEquals` returns `true` when logically equal but with different comparers, and `false` when logically different. - **ICollection with Duplicates:** Verified the fallback path correctly handles collections like `List` with duplicate elements. - **Count Optimizations:** - Verified that mismatched comparers correctly bypass the fast-path count check. - Verified that `SetEquals` still performs early-exit when `other.Count < source.Count`. - **Fast-Path Validation:** Ensured that when comparers match, the optimized count-based comparison still works as expected. - **Edge Cases:** Included tests for empty sets with different comparers and content-specific mismatches. --- .../Immutable/ImmutableSortedSet_1.cs | 92 ++++++++++++++++--- .../tests/ImmutableSortedSetTest.cs | 90 ++++++++++++++++++ 2 files changed, 170 insertions(+), 12 deletions(-) diff --git a/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableSortedSet_1.cs b/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableSortedSet_1.cs index 902e9168872cf4..0434ace28f7494 100644 --- a/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableSortedSet_1.cs +++ b/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableSortedSet_1.cs @@ -375,24 +375,56 @@ public bool SetEquals(IEnumerable other) return true; } - var otherSet = new SortedSet(other, this.KeyComparer); - if (this.Count != otherSet.Count) + switch (other) { - return false; + case ImmutableSortedSet otherAsImmutableSortedSet: + if (EqualityComparer>.Default.Equals(this.KeyComparer, otherAsImmutableSortedSet.KeyComparer)) + { + if (otherAsImmutableSortedSet.Count != this.Count) + { + return false; + } + return SetEqualsWithImmutableSortedSet(otherAsImmutableSortedSet, this); + } + + if (otherAsImmutableSortedSet.Count < this.Count) + { + return false; + } + break; + + case SortedSet otherAsSortedSet: + if (EqualityComparer>.Default.Equals(this.KeyComparer, otherAsSortedSet.Comparer)) + { + if (otherAsSortedSet.Count != this.Count) + { + return false; + } + return SetEqualsWithSortedSet(otherAsSortedSet, this); + } + + if (otherAsSortedSet.Count < this.Count) + { + return false; + } + break; + + case ICollection otherAsICollectionGeneric: + // We check for < instead of != because other is not guaranteed to be a set; it could be a collection with duplicates. + if (otherAsICollectionGeneric.Count < this.Count) + { + return false; + } + break; } - int matches = 0; - foreach (T item in otherSet) + var otherSet = new SortedSet(other, this.KeyComparer); + if (otherSet.Count != this.Count) { - if (!this.Contains(item)) - { - return false; - } - - matches++; + return false; } - return matches == this.Count; + return SetEqualsWithSortedSet(otherSet, this); } /// @@ -1079,6 +1111,42 @@ private ImmutableSortedSet UnionIncremental(ReadOnlySpan items) return this.Wrap(result); } + private static bool SetEqualsWithImmutableSortedSet(ImmutableSortedSet other, ImmutableSortedSet source) + { + // We can use a linear scan because both sets are sorted using the same comparer. + using var e = other.GetEnumerator(); + foreach (T item in source) + { + bool eHasMore = e.MoveNext(); + Debug.Assert(eHasMore); + + if (source.KeyComparer.Compare(item, e.Current) != 0) + { + return false; + } + } + + return true; + } + + private static bool SetEqualsWithSortedSet(SortedSet other, ImmutableSortedSet source) + { + // We can use a linear scan because both sets are sorted using the same comparer. + using var e = other.GetEnumerator(); + foreach (T item in source) + { + bool eHasMore = e.MoveNext(); + Debug.Assert(eHasMore); + + if (source.KeyComparer.Compare(item, e.Current) != 0) + { + return false; + } + } + + return true; + } + /// /// Creates a wrapping collection type around a root node. /// diff --git a/src/libraries/System.Collections.Immutable/tests/ImmutableSortedSetTest.cs b/src/libraries/System.Collections.Immutable/tests/ImmutableSortedSetTest.cs index f16d59dd63ae1b..0a7e7249efec08 100644 --- a/src/libraries/System.Collections.Immutable/tests/ImmutableSortedSetTest.cs +++ b/src/libraries/System.Collections.Immutable/tests/ImmutableSortedSetTest.cs @@ -77,6 +77,96 @@ public void RandomOperationsTest() } } + [Fact] + public void SetEqualsMismatchedComparersOriginInsensitiveOtherSensitive() + { + var ignoreCaseSet = ImmutableSortedSet.Create(StringComparer.OrdinalIgnoreCase, "a"); + var sensitiveSet = ImmutableSortedSet.Create(StringComparer.Ordinal, "a", "A"); + + Assert.True(ignoreCaseSet.SetEquals(sensitiveSet)); + } + + [Fact] + public void SetEqualsMismatchedComparersOriginSensitiveOtherInsensitive() + { + var sensitiveSetMain = ImmutableSortedSet.Create(StringComparer.Ordinal, "a"); + var insensitiveMutable = new SortedSet(StringComparer.OrdinalIgnoreCase) { "a", "A" }; + + Assert.True(sensitiveSetMain.SetEquals(insensitiveMutable)); + } + + [Fact] + public void SetEqualsICollectionWithDuplicatesValidatesCorrectness() + { + var ignoreCaseSet = ImmutableSortedSet.Create(StringComparer.OrdinalIgnoreCase, "a"); + var listWithDupes = new List { "a", "a", "a", "a" }; + + Assert.True(ignoreCaseSet.SetEquals(listWithDupes)); + } + + [Fact] + public void SetEqualsDifferentContent() + { + var ignoreCaseSet = ImmutableSortedSet.Create(StringComparer.OrdinalIgnoreCase, "a"); + var setB = ImmutableSortedSet.Create(StringComparer.Ordinal, "b"); + + Assert.False(ignoreCaseSet.SetEquals(setB)); + } + + [Fact] + public void SetEqualsMismatchedComparersOtherCountSmaller() + { + var originTwoElements = ImmutableSortedSet.Create(StringComparer.OrdinalIgnoreCase, "a", "b"); + var otherOneElement = ImmutableSortedSet.Create(StringComparer.Ordinal, "a"); + + Assert.False(originTwoElements.SetEquals(otherOneElement)); + } + + [Fact] + public void SetEqualsMatchedComparersDifferentCounts() + { + var matchedSet1 = ImmutableSortedSet.Create(StringComparer.Ordinal, "a", "b"); + var matchedSet2 = ImmutableSortedSet.Create(StringComparer.Ordinal, "a"); + + Assert.False(matchedSet1.SetEquals(matchedSet2)); + } + + [Fact] + public void SetEqualsMatchedComparersSameContent() + { + var matchedSet1 = ImmutableSortedSet.Create(StringComparer.Ordinal, "a", "b"); + var matchedSet2 = ImmutableSortedSet.Create(StringComparer.Ordinal, "a", "b"); + + Assert.True(matchedSet1.SetEquals(matchedSet2)); + } + + [Fact] + public void SetEqualsEmptySetsDifferentComparers() + { + var empty1 = ImmutableSortedSet.Empty.WithComparer(StringComparer.Ordinal); + var empty2 = ImmutableSortedSet.Empty.WithComparer(StringComparer.OrdinalIgnoreCase); + + Assert.True(empty1.SetEquals(empty2)); + } + + [Fact] + public void SetEqualsMismatchedComparersOriginSensitiveOtherInsensitiveSameCount() + { + var sensitiveSet = ImmutableSortedSet.Create(StringComparer.Ordinal, "a", "A"); + var insensitiveSet = ImmutableSortedSet.Create(StringComparer.OrdinalIgnoreCase, "a", "b"); + + Assert.False(sensitiveSet.SetEquals(insensitiveSet)); + } + + [Fact] + public void SetEqualsMismatchedComparersOtherIsLarger() + { + var origin = ImmutableSortedSet.Create(StringComparer.OrdinalIgnoreCase, "a"); + var other = ImmutableSortedSet.Create(StringComparer.Ordinal, "a", "b"); + + Assert.False(origin.SetEquals(other)); + } + [Fact] public void CustomSort() { From 2fc23e68a49aeea2458d4a0e20fc4cc232930ff3 Mon Sep 17 00:00:00 2001 From: Kevin Jones Date: Wed, 6 May 2026 11:04:53 -0400 Subject: [PATCH 019/109] Add scalar FixedTimeEquals overload Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../ref/System.Security.Cryptography.cs | 1 + .../Cryptography/CryptographicOperations.cs | 38 +++++++++++ ...5519DiffieHellmanImplementation.Windows.cs | 8 +-- .../tests/FixedTimeEqualsTests.cs | 68 +++++++++++++++++-- 4 files changed, 101 insertions(+), 14 deletions(-) diff --git a/src/libraries/System.Security.Cryptography/ref/System.Security.Cryptography.cs b/src/libraries/System.Security.Cryptography/ref/System.Security.Cryptography.cs index 0da5a776b5ee8d..48693c2beaa2ae 100644 --- a/src/libraries/System.Security.Cryptography/ref/System.Security.Cryptography.cs +++ b/src/libraries/System.Security.Cryptography/ref/System.Security.Cryptography.cs @@ -676,6 +676,7 @@ public static void AddOID(string oid, params string[] names) { } } public static partial class CryptographicOperations { + public static bool FixedTimeEquals(System.ReadOnlySpan source, byte value) { throw null; } public static bool FixedTimeEquals(System.ReadOnlySpan left, System.ReadOnlySpan right) { throw null; } public static byte[] HashData(System.Security.Cryptography.HashAlgorithmName hashAlgorithm, byte[] source) { throw null; } public static byte[] HashData(System.Security.Cryptography.HashAlgorithmName hashAlgorithm, System.IO.Stream source) { throw null; } diff --git a/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/CryptographicOperations.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/CryptographicOperations.cs index b92c6ae809423c..c05da5dfa11da4 100644 --- a/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/CryptographicOperations.cs +++ b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/CryptographicOperations.cs @@ -57,6 +57,44 @@ public static bool FixedTimeEquals(ReadOnlySpan left, ReadOnlySpan r return accum == 0; } + /// + /// Determines whether every byte in a byte sequence is equal to a specified value in an amount of time + /// that depends on the length of the sequence, but not the values. + /// + /// The buffer to compare. + /// The value to compare with each byte in . + /// + /// if every byte in is equal to ; + /// otherwise, . + /// + /// + /// + /// This method compares a buffer's contents with in a manner which does not + /// leak timing information, making it ideal for use within cryptographic routines. + /// + /// + /// If is empty, this method returns . + /// + /// + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] + public static bool FixedTimeEquals(ReadOnlySpan source, byte value) + { + // NoOptimization because we want this method to be exactly as non-short-circuiting + // as written. + // + // NoInlining because the NoOptimization would get lost if the method got inlined. + + int length = source.Length; + int accum = 0; + + for (int i = 0; i < length; i++) + { + accum |= source[i] - value; + } + + return accum == 0; + } + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public static void ZeroMemory(Span buffer) { diff --git a/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/X25519DiffieHellmanImplementation.Windows.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/X25519DiffieHellmanImplementation.Windows.cs index 7a61724ce44a77..1660da4d802d2c 100644 --- a/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/X25519DiffieHellmanImplementation.Windows.cs +++ b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/X25519DiffieHellmanImplementation.Windows.cs @@ -89,13 +89,7 @@ protected override void DeriveRawSecretAgreementCore(X25519DiffieHellman otherPa // derive time per RFC 7748 6.1. // We still need BCRYPT_NO_KEY_VALIDATION though because there are small subgroup keys that work, which do // not produce all zero shared secrets. - ReadOnlySpan zeros = [ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - ]; - - Debug.Assert(zeros.Length == SecretAgreementSizeInBytes); - - if (CryptographicOperations.FixedTimeEquals(destination, zeros)) + if (CryptographicOperations.FixedTimeEquals(destination, 0)) { throw new CryptographicException(); } diff --git a/src/libraries/System.Security.Cryptography/tests/FixedTimeEqualsTests.cs b/src/libraries/System.Security.Cryptography/tests/FixedTimeEqualsTests.cs index 6af74897b554f7..486b44d5767145 100644 --- a/src/libraries/System.Security.Cryptography/tests/FixedTimeEqualsTests.cs +++ b/src/libraries/System.Security.Cryptography/tests/FixedTimeEqualsTests.cs @@ -91,17 +91,71 @@ public static void DifferentLengthsReturnFalse(int byteLength) Assert.False(isEqualB, "value missing last byte, value"); } + [Theory] + [InlineData(0, 0)] + [InlineData(1, 0)] + [InlineData(128 / 8, 0)] + [InlineData(256 / 8, 1)] + [InlineData(512 / 8, 0x7F)] + [InlineData(96, 0x80)] + [InlineData(1024, 0xFF)] + public static void EqualScalarReturnsTrue(int byteLength, byte value) + { + byte[] rented = ArrayPool.Shared.Rent(byteLength); + Span testSpan = new Span(rented, 0, byteLength); + testSpan.Fill(value); + + bool isEqual = CryptographicOperations.FixedTimeEquals(testSpan, value); + + ArrayPool.Shared.Return(rented); + + AssertExtensions.TrueExpression(isEqual); + } + + [Theory] + [InlineData(1, 0)] + [InlineData(128 / 8, 0)] + [InlineData(256 / 8, 1)] + [InlineData(512 / 8, 0x7F)] + [InlineData(96, 0x80)] + [InlineData(1024, 0xFF)] + public static void UnequalScalarReturnsFalse(int byteLength, byte value) + { + byte[] rented = ArrayPool.Shared.Rent(byteLength); + Span testSpan = new Span(rented, 0, byteLength); + testSpan.Fill(value); + testSpan[value % testSpan.Length] = (byte)(value ^ 0xFF); + + bool isEqual = CryptographicOperations.FixedTimeEquals(testSpan, value); + + ArrayPool.Shared.Return(rented); + + AssertExtensions.FalseExpression(isEqual); + } + [Fact] public static void HasCorrectMethodImpl() { Type t = typeof(CryptographicOperations); - MethodInfo mi = t.GetMethod(nameof(CryptographicOperations.FixedTimeEquals)); - - // This method cannot be optimized, or it loses its fixed time guarantees. - // It cannot be inlined, or it loses its no-optimization guarantee. - Assert.Equal( - MethodImplAttributes.NoInlining | MethodImplAttributes.NoOptimization, - mi.MethodImplementationFlags); + MethodInfo spanOverload = t.GetMethod( + nameof(CryptographicOperations.FixedTimeEquals), + new[] { typeof(ReadOnlySpan), typeof(ReadOnlySpan) }); + + MethodInfo scalarOverload = t.GetMethod( + nameof(CryptographicOperations.FixedTimeEquals), + new[] { typeof(ReadOnlySpan), typeof(byte) }); + + AssertCorrectMethodImpl(spanOverload); + AssertCorrectMethodImpl(scalarOverload); + + static void AssertCorrectMethodImpl(MethodInfo mi) + { + // This method cannot be optimized, or it loses its fixed time guarantees. + // It cannot be inlined, or it loses its no-optimization guarantee. + Assert.Equal( + MethodImplAttributes.NoInlining | MethodImplAttributes.NoOptimization, + mi.MethodImplementationFlags); + } } } } From af80ab7093c16414b9e1df3300d5726b69af99b0 Mon Sep 17 00:00:00 2001 From: Mitchell Hwang <16830051+mdh1418@users.noreply.github.com> Date: Wed, 6 May 2026 11:56:09 -0400 Subject: [PATCH 020/109] [iOS] In-Proc Crash Reporter (#127812) Extending https://github.com/dotnet/runtime/pull/126916 to iOS, tvOS, and MacCatalyst. --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/coreclr/clrfeatures.cmake | 2 +- .../debug/crashreport/inproccrashreporter.cpp | 61 ++++++++++++++++++- .../debug/crashreport/inproccrashreporter.h | 4 ++ src/coreclr/pal/src/exception/signal.cpp | 4 +- src/coreclr/vm/ceemain.cpp | 4 +- src/coreclr/vm/eepolicy.cpp | 4 +- src/coreclr/vm/eepolicy.h | 2 +- 7 files changed, 71 insertions(+), 10 deletions(-) diff --git a/src/coreclr/clrfeatures.cmake b/src/coreclr/clrfeatures.cmake index 829efbc022c5b9..0a15452b398e85 100644 --- a/src/coreclr/clrfeatures.cmake +++ b/src/coreclr/clrfeatures.cmake @@ -89,7 +89,7 @@ if(NOT DEFINED FEATURE_SINGLE_FILE_DIAGNOSTICS) endif(NOT DEFINED FEATURE_SINGLE_FILE_DIAGNOSTICS) if(NOT DEFINED FEATURE_INPROC_CRASHREPORT) - if(CLR_CMAKE_TARGET_ANDROID) + if(CLR_CMAKE_TARGET_ANDROID OR CLR_CMAKE_TARGET_IOS OR CLR_CMAKE_TARGET_TVOS OR CLR_CMAKE_TARGET_MACCATALYST) set(FEATURE_INPROC_CRASHREPORT 1) else() set(FEATURE_INPROC_CRASHREPORT 0) diff --git a/src/coreclr/debug/crashreport/inproccrashreporter.cpp b/src/coreclr/debug/crashreport/inproccrashreporter.cpp index d8c5257e8aff28..fe771432eee5f4 100644 --- a/src/coreclr/debug/crashreport/inproccrashreporter.cpp +++ b/src/coreclr/debug/crashreport/inproccrashreporter.cpp @@ -18,6 +18,10 @@ #include #include #include +#ifdef __APPLE__ +#include +#include +#endif // Include the .NET version string instead of linking because it is "static". #if __has_include("_version.c") @@ -26,6 +30,27 @@ static char sccsid[] = "@(#)Version N/A"; #endif +#ifdef __APPLE__ +// Query a sysctl by name into a caller-supplied buffer. Called from Initialize, NOT from the +// signal handler -- sysctl/sysctlbyname is not on POSIX's async-signal-safe list, so the +// queried values are cached for use during crash reporting (mirrors the m_hostName / +// gethostname pattern). +static void CacheSysctlString(const char* sysctlName, char* buffer, size_t bufferSize) +{ + buffer[0] = '\0'; + size_t size = bufferSize; + if (sysctlbyname(sysctlName, buffer, &size, nullptr, 0) == 0 && size > 0) + { + size_t terminatorIndex = (size < bufferSize) ? size : bufferSize - 1; + buffer[terminatorIndex] = '\0'; + } + else + { + buffer[0] = '\0'; + } +} +#endif // __APPLE__ + class ThreadEnumerationContext { public: @@ -276,6 +301,17 @@ InProcCrashReporter::CreateReport( m_jsonWriter.OpenObject("parameters"); m_jsonWriter.WriteSignedDecimalAsString("signal", static_cast(signal)); +#ifdef __APPLE__ + if (m_osVersion[0] != '\0') + { + m_jsonWriter.WriteString("OSVersion", m_osVersion); + } + if (m_systemModel[0] != '\0') + { + m_jsonWriter.WriteString("SystemModel", m_systemModel); + } + m_jsonWriter.WriteString("SystemManufacturer", "apple"); +#endif m_jsonWriter.CloseObject(); // parameters m_jsonWriter.CloseObject(); // root @@ -349,6 +385,13 @@ InProcCrashReporter::Initialize( { m_hostName[0] = '\0'; } + +#ifdef __APPLE__ + // Cache sysctl values at Initialize because sysctl/sysctlbyname is not on POSIX's + // async-signal-safe list; CreateReport reads these from the signal-handler path. + CacheSysctlString("kern.osproductversion", m_osVersion, sizeof(m_osVersion)); + CacheSysctlString("hw.model", m_systemModel, sizeof(m_systemModel)); +#endif } void @@ -667,7 +710,11 @@ CrashReportHelpers::GetInstructionPointer( } ucontext_t* ucontext = reinterpret_cast(context); -#if defined(__x86_64__) +#if defined(__APPLE__) && defined(__x86_64__) + return static_cast(ucontext->uc_mcontext->__ss.__rip); +#elif defined(__APPLE__) && defined(__aarch64__) + return reinterpret_cast(arm_thread_state64_get_pc_fptr(ucontext->uc_mcontext->__ss)); +#elif defined(__x86_64__) return static_cast(ucontext->uc_mcontext.gregs[REG_RIP]); #elif defined(__aarch64__) return static_cast(ucontext->uc_mcontext.pc); @@ -688,7 +735,11 @@ CrashReportHelpers::GetStackPointer( } ucontext_t* ucontext = reinterpret_cast(context); -#if defined(__x86_64__) +#if defined(__APPLE__) && defined(__x86_64__) + return static_cast(ucontext->uc_mcontext->__ss.__rsp); +#elif defined(__APPLE__) && defined(__aarch64__) + return static_cast(arm_thread_state64_get_sp(ucontext->uc_mcontext->__ss)); +#elif defined(__x86_64__) return static_cast(ucontext->uc_mcontext.gregs[REG_RSP]); #elif defined(__aarch64__) return static_cast(ucontext->uc_mcontext.sp); @@ -709,7 +760,11 @@ CrashReportHelpers::GetFramePointer( } ucontext_t* ucontext = reinterpret_cast(context); -#if defined(__x86_64__) +#if defined(__APPLE__) && defined(__x86_64__) + return static_cast(ucontext->uc_mcontext->__ss.__rbp); +#elif defined(__APPLE__) && defined(__aarch64__) + return static_cast(arm_thread_state64_get_fp(ucontext->uc_mcontext->__ss)); +#elif defined(__x86_64__) return static_cast(ucontext->uc_mcontext.gregs[REG_RBP]); #elif defined(__aarch64__) return static_cast(ucontext->uc_mcontext.regs[29]); diff --git a/src/coreclr/debug/crashreport/inproccrashreporter.h b/src/coreclr/debug/crashreport/inproccrashreporter.h index 01fa1e706c87da..5018f3b0d10793 100644 --- a/src/coreclr/debug/crashreport/inproccrashreporter.h +++ b/src/coreclr/debug/crashreport/inproccrashreporter.h @@ -95,6 +95,10 @@ class InProcCrashReporter char m_reportPath[CRASHREPORT_PATH_BUFFER_SIZE] = {}; char m_processName[CRASHREPORT_STRING_BUFFER_SIZE] = {}; char m_hostName[CRASHREPORT_STRING_BUFFER_SIZE] = {}; +#ifdef __APPLE__ + char m_osVersion[CRASHREPORT_STRING_BUFFER_SIZE] = {}; + char m_systemModel[CRASHREPORT_STRING_BUFFER_SIZE] = {}; +#endif }; // Free-function entry point used by the runtime to wire the in-proc crash diff --git a/src/coreclr/pal/src/exception/signal.cpp b/src/coreclr/pal/src/exception/signal.cpp index cd47a557eb4648..c5b6886b562219 100644 --- a/src/coreclr/pal/src/exception/signal.cpp +++ b/src/coreclr/pal/src/exception/signal.cpp @@ -448,9 +448,11 @@ static void invoke_previous_action(struct sigaction* action, int code, siginfo_t { if (signalRestarts) { - // Shutdown and create the core dump before we restore the signal to the default handler. + // Shutdown, log the managed callstack (if a host callback is registered), + // and create the core dump before we restore the signal to the default handler. PROCNotifyProcessShutdown(IsRunningOnAlternateStack(context)); + PROCLogManagedCallstackForSignal(code); PROCCreateCrashDumpIfEnabled(code, siginfo, context, true); // Restore the original and restart h/w exception. diff --git a/src/coreclr/vm/ceemain.cpp b/src/coreclr/vm/ceemain.cpp index d7325f5e5796e3..613cb42fae511c 100644 --- a/src/coreclr/vm/ceemain.cpp +++ b/src/coreclr/vm/ceemain.cpp @@ -709,9 +709,9 @@ void EEStartupHelper() PAL_SetShutdownCallback(EESocketCleanupHelper); #endif // TARGET_UNIX -#ifdef HOST_ANDROID +#if defined(HOST_ANDROID) || defined(HOST_IOS) || defined(HOST_TVOS) || defined(HOST_MACCATALYST) PAL_SetLogManagedCallstackForSignalCallback(EEPolicy::LogManagedCallstackForSignal); -#endif // HOST_ANDROID +#endif #ifdef FEATURE_INPROC_CRASHREPORT CrashReportConfigure(); diff --git a/src/coreclr/vm/eepolicy.cpp b/src/coreclr/vm/eepolicy.cpp index 6fcbaec5aaf61a..1462aeb827f681 100644 --- a/src/coreclr/vm/eepolicy.cpp +++ b/src/coreclr/vm/eepolicy.cpp @@ -911,7 +911,7 @@ int NOINLINE EEPolicy::HandleFatalError(UINT exitCode, UINT_PTR address, LPCWSTR return -1; } -#ifdef HOST_ANDROID +#if defined(HOST_ANDROID) || defined(HOST_IOS) || defined(HOST_TVOS) || defined(HOST_MACCATALYST) // Logs the managed callstack when a signal is received. void EEPolicy::LogManagedCallstackForSignal(LPCWSTR signalName) { @@ -926,4 +926,4 @@ void EEPolicy::LogManagedCallstackForSignal(LPCWSTR signalName) LogInfoForFatalError(0, message.GetUnicode(), nullptr, nullptr, nullptr); } -#endif // HOST_ANDROID +#endif diff --git a/src/coreclr/vm/eepolicy.h b/src/coreclr/vm/eepolicy.h index d9103664195e8b..04b592aca5156c 100644 --- a/src/coreclr/vm/eepolicy.h +++ b/src/coreclr/vm/eepolicy.h @@ -38,7 +38,7 @@ class EEPolicy static void DECLSPEC_NORETURN HandleFatalStackOverflow(EXCEPTION_POINTERS *pException, BOOL fSkipDebugger = FALSE); -#ifdef HOST_ANDROID +#if defined(HOST_ANDROID) || defined(HOST_IOS) || defined(HOST_TVOS) || defined(HOST_MACCATALYST) static void LogManagedCallstackForSignal(LPCWSTR signalName); #endif From 4c972df1ebcc1f6208a2250b67e077fa1b276bb2 Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Wed, 6 May 2026 16:01:19 +0000 Subject: [PATCH 021/109] Add StringBuilder.MoveChunks(StringBuilder) API (#127823) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Implements the approved API from #97570, enabling O(1) transfer of a `StringBuilder`'s chunk chain to a fresh instance so that callers (e.g. Roslyn's `StringBuilderText`) can hold a no-copy, immutable view of the contents while releasing the original. ```csharp namespace System.Text; public partial class StringBuilder { public static StringBuilder MoveChunks(StringBuilder source); } ``` ## Description - **`StringBuilder.MoveChunks`** (`src/libraries/System.Private.CoreLib/.../StringBuilder.cs`) - Constructs the returned `StringBuilder` via the existing private `StringBuilder(StringBuilder from)` copy constructor, which transfers `m_ChunkChars`, `m_ChunkPrevious`, `m_ChunkLength`, `m_ChunkOffset`, and `m_MaxCapacity` from `source` and avoids the wasted 16-char default buffer that `new StringBuilder()` would allocate. - Drains `source` by zeroing `m_ChunkChars` (set to `Array.Empty()`), `m_ChunkPrevious`, `m_ChunkLength`, and `m_ChunkOffset`, while **preserving `m_MaxCapacity`**. The drained `source` is left in an empty but fully usable state — distinct from `Clear()`, which retains the buffer. Subsequent append or insert operations on `source` will succeed, allocating new buffers as needed. - Throws `ArgumentNullException` when `source` is `null`. - **Ref assembly** updated (`System.Runtime.cs`). - **Tests** in `StringBuilderTests` cover null arg, empty source, single chunk, multi-chunk chain (using `MemoryMarshal.TryGetArray` to assert backing-array identity by reference, not just content), calling `MoveChunks` on an already-drained source, and that the drained source remains usable with its original `MaxCapacity` preserved. ## Customer Impact Unblocks the no-copy `SourceText` shape Roslyn has been waiting on (dotnet/roslyn#61326) and provides a general primitive for transferring ownership of a `StringBuilder`'s contents without materializing a contiguous string or array of chunks. ## Regression? - [ ] Yes - [x] No New API; no behavior change to existing members. ## Risk - [x] Low - [ ] Medium - [ ] High Pure addition; the implementation only manipulates internal fields already reachable via existing code paths. After the call, `source` retains its original `MaxCapacity` and is fully usable as an empty `StringBuilder`. --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: tannergooding <10487869+tannergooding@users.noreply.github.com> --- .../src/System/Text/StringBuilder.cs | 38 ++++++ .../System.Runtime/ref/System.Runtime.cs | 1 + .../System/Text/StringBuilderTests.cs | 119 ++++++++++++++++++ 3 files changed, 158 insertions(+) diff --git a/src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs b/src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs index 83f9306b16ee71..28a6c1e32125b3 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs @@ -381,6 +381,44 @@ public StringBuilder Clear() return this; } + /// + /// Creates a new instance initialized to the same state as + /// , and resets to an empty, usable state + /// with no allocated buffers. + /// + /// The whose chunks should be moved to the + /// returned instance. + /// A new instance that owns the chunks previously held + /// by . + /// is . + /// + /// + /// In contrast to , which retains the existing internal buffer, + /// this method releases all internal buffers from . Ownership of + /// the chunks is transferred in O(1) to the returned ; the + /// underlying character data is not copied. + /// + /// + /// After the call, has and + /// of zero but retains its original . + /// It remains fully usable; subsequent append or insert operations will allocate new + /// buffers as needed. + /// + /// + public static StringBuilder MoveChunks(StringBuilder source) + { + ArgumentNullException.ThrowIfNull(source); + + StringBuilder destination = new StringBuilder(source); + + source.m_ChunkChars = []; + source.m_ChunkPrevious = null; + source.m_ChunkLength = 0; + source.m_ChunkOffset = 0; + + return destination; + } + /// /// Gets or sets the length of this builder. /// diff --git a/src/libraries/System.Runtime/ref/System.Runtime.cs b/src/libraries/System.Runtime/ref/System.Runtime.cs index 890e1852ca75b7..60651667769b39 100644 --- a/src/libraries/System.Runtime/ref/System.Runtime.cs +++ b/src/libraries/System.Runtime/ref/System.Runtime.cs @@ -16229,6 +16229,7 @@ public StringBuilder(string? value, int startIndex, int length, int capacity) { public System.Text.StringBuilder AppendLine(string? value) { throw null; } public System.Text.StringBuilder AppendLine([System.Runtime.CompilerServices.InterpolatedStringHandlerArgumentAttribute("")] ref System.Text.StringBuilder.AppendInterpolatedStringHandler handler) { throw null; } public System.Text.StringBuilder Clear() { throw null; } + public static System.Text.StringBuilder MoveChunks(System.Text.StringBuilder source) { throw null; } public void CopyTo(int sourceIndex, char[] destination, int destinationIndex, int count) { } public void CopyTo(int sourceIndex, System.Span destination, int count) { } public int EnsureCapacity(int capacity) { throw null; } diff --git a/src/libraries/System.Runtime/tests/System.Runtime.Tests/System/Text/StringBuilderTests.cs b/src/libraries/System.Runtime/tests/System.Runtime.Tests/System/Text/StringBuilderTests.cs index e9a9741a4b1fc1..5adc464a126507 100644 --- a/src/libraries/System.Runtime/tests/System.Runtime.Tests/System/Text/StringBuilderTests.cs +++ b/src/libraries/System.Runtime/tests/System.Runtime.Tests/System/Text/StringBuilderTests.cs @@ -5,6 +5,8 @@ using System.Diagnostics; using System.Globalization; using System.Linq; +using System.Reflection; +using System.Runtime.InteropServices; using System.Tests; using Microsoft.DotNet.RemoteExecutor; using Xunit; @@ -2129,6 +2131,123 @@ public static void Clear_StringBuilderHasTwoChunks_OneChunkIsEmpty_ClearReducesC Assert.Equal(initialCapacity, sb.Capacity); } + [Fact] + public static void MoveChunks_NullSource_ThrowsArgumentNullException() + { + AssertExtensions.Throws("source", () => StringBuilder.MoveChunks(null)); + } + + [Fact] + public static void MoveChunks_Empty_ProducesEmptyDestinationAndDrainsSource() + { + var source = new StringBuilder(32, 64); + char[] originalChars = GetChunkCharsField(source); + + StringBuilder destination = StringBuilder.MoveChunks(source); + + Assert.NotNull(destination); + Assert.NotSame(source, destination); + Assert.Equal(0, destination.Length); + Assert.Equal(32, destination.Capacity); + Assert.Equal(64, destination.MaxCapacity); + Assert.Same(originalChars, GetChunkCharsField(destination)); + + AssertSourceIsDrained(source); + } + + [Fact] + public static void MoveChunks_SingleChunk_TransfersContentsAndDrainsSource() + { + var source = new StringBuilder(16, 100); + source.Append("Hello"); + char[] originalChars = GetChunkCharsField(source); + + StringBuilder destination = StringBuilder.MoveChunks(source); + + Assert.Equal("Hello", destination.ToString()); + Assert.Equal(100, destination.MaxCapacity); + Assert.Same(originalChars, GetChunkCharsField(destination)); + + AssertSourceIsDrained(source); + } + + [Fact] + public static void MoveChunks_MultipleChunks_TransfersChainAndDrainsSource() + { + StringBuilder source = StringBuilderWithMultipleChunks(); + string expected = source.ToString(); + + // Capture the backing char[] arrays by identity to verify no-copy move semantics. + List<(char[] Array, int Offset, int Count)> originalChunks = new List<(char[], int, int)>(); + foreach (ReadOnlyMemory chunk in source.GetChunks()) + { + Assert.True(MemoryMarshal.TryGetArray(chunk, out ArraySegment segment)); + originalChunks.Add((segment.Array!, segment.Offset, segment.Count)); + } + + StringBuilder destination = StringBuilder.MoveChunks(source); + + Assert.Equal(expected, destination.ToString()); + + int i = 0; + foreach (ReadOnlyMemory chunk in destination.GetChunks()) + { + Assert.True(MemoryMarshal.TryGetArray(chunk, out ArraySegment segment)); + Assert.Same(originalChunks[i].Array, segment.Array); + Assert.Equal(originalChunks[i].Offset, segment.Offset); + Assert.Equal(originalChunks[i].Count, segment.Count); + i++; + } + Assert.Equal(originalChunks.Count, i); + + AssertSourceIsDrained(source); + } + + [Fact] + public static void MoveChunks_DrainedSource_RemainsUsable() + { + var source = new StringBuilder("abc"); + int originalMaxCapacity = source.MaxCapacity; + StringBuilder destination = StringBuilder.MoveChunks(source); + + Assert.Equal("abc", destination.ToString()); + Assert.Equal(originalMaxCapacity, source.MaxCapacity); + + // source is empty but fully usable; subsequent appends allocate new buffers. + source.Append('x'); + Assert.Equal("x", source.ToString()); + } + + [Fact] + public static void MoveChunks_AlreadyDrainedSource_ProducesEmptyDestination() + { + var source = new StringBuilder("abc"); + int originalMaxCapacity = source.MaxCapacity; + _ = StringBuilder.MoveChunks(source); + + // MoveChunks on an already-drained (empty) source produces an empty destination. + StringBuilder destination = StringBuilder.MoveChunks(source); + + Assert.Equal(0, destination.Length); + Assert.Equal(0, destination.Capacity); + Assert.Equal(originalMaxCapacity, destination.MaxCapacity); + AssertSourceIsDrained(source); + } + + private static readonly FieldInfo s_chunkCharsField = typeof(StringBuilder).GetField("m_ChunkChars", BindingFlags.Instance | BindingFlags.NonPublic)!; + + private static char[] GetChunkCharsField(StringBuilder builder) + { + return (char[])s_chunkCharsField.GetValue(builder)!; + } + + private static void AssertSourceIsDrained(StringBuilder source) + { + Assert.Equal(0, source.Length); + Assert.Equal(0, source.Capacity); + Assert.Same(Array.Empty(), GetChunkCharsField(source)); + } + [Theory] [InlineData("Hello", 0, new char[] { '\0', '\0', '\0', '\0', '\0' }, 5, new char[] { 'H', 'e', 'l', 'l', 'o' })] [InlineData("Hello", 0, new char[] { '\0', '\0', '\0', '\0' }, 4, new char[] { 'H', 'e', 'l', 'l' })] From 139ad17bad0f8d71296edf72b43e526dd596a85f Mon Sep 17 00:00:00 2001 From: Egor Bogatov Date: Wed, 6 May 2026 18:33:15 +0200 Subject: [PATCH 022/109] Intrinsify string.FastAllocateString (#127659) Another experiment (for better https://github.com/dotnet/runtime/pull/127655) Mark String.FastAllocateString with [Intrinsic] and teach RyuJIT to: - Track the result as known non-null via VNF_StrFastAllocate (knownNonNull=true) - Fold ARR_LENGTH(VNF_StrFastAllocate(len)) -> len - Emit a global assertion 'string.Length(result) == lenArg' in optAssertionGen Example: ```cs int Foo() { string a = "aaa"; string b = "bbb"; string c = a + b; return c[3]; // this PR removes this bound check } ``` --------- Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../src/System/String.CoreCLR.cs | 4 +- src/coreclr/jit/gentree.cpp | 11 +++++- src/coreclr/jit/importercalls.cpp | 5 +++ src/coreclr/jit/namedintrinsiclist.h | 1 + src/coreclr/jit/valuenum.cpp | 39 ++++++++++++++++++- src/coreclr/jit/valuenumfuncs.h | 2 + .../src/System/Runtime/RuntimeImports.cs | 4 -- .../src/System/String.NativeAot.cs | 8 +++- .../src/System/Runtime/RuntimeImports.cs | 6 +-- 9 files changed, 66 insertions(+), 14 deletions(-) diff --git a/src/coreclr/System.Private.CoreLib/src/System/String.CoreCLR.cs b/src/coreclr/System.Private.CoreLib/src/System/String.CoreCLR.cs index 82beec6388b7c6..8e4fbf43f9e64d 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/String.CoreCLR.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/String.CoreCLR.cs @@ -11,10 +11,12 @@ namespace System { public partial class String { + [Intrinsic] [MethodImpl(MethodImplOptions.InternalCall)] - internal static extern unsafe string FastAllocateString(MethodTable *pMT, nint length); + private static extern unsafe string FastAllocateString(MethodTable *pMT, nint length); [DebuggerHidden] + [MethodImpl(MethodImplOptions.AggressiveInlining)] internal static unsafe string FastAllocateString(nint length) { return FastAllocateString(TypeHandle.TypeHandleOf().AsMethodTable(), length); diff --git a/src/coreclr/jit/gentree.cpp b/src/coreclr/jit/gentree.cpp index f9365400bd7f09..dc8d9915954807 100644 --- a/src/coreclr/jit/gentree.cpp +++ b/src/coreclr/jit/gentree.cpp @@ -2045,8 +2045,8 @@ bool GenTreeCall::IsPure(Compiler* compiler) const } //------------------------------------------------------------------------------ -// getArrayLengthFromAllocation: Return the array length for an array allocation -// helper call. +// getArrayLengthFromAllocation: Return the length for an allocation whose length +// is represented by GT_ARR_LENGTH. // // Arguments: // tree - The array allocation helper call. @@ -2086,6 +2086,13 @@ GenTree* Compiler::getArrayLengthFromAllocation(GenTree* tree) assert((arrayLength == nullptr) || ((optMethodFlags & OMF_HAS_NEWARRAY) != 0)); } + else if (call->IsSpecialIntrinsic(this, NI_System_String_FastAllocateString)) + { + // String characters start at a different offset than array data, but string length itself is a + // GT_ARR_LENGTH. + assert(call->gtArgs.CountUserArgs() == 2); + arrayLength = call->gtArgs.GetUserArgByIndex(1)->GetNode(); + } } if (arrayLength != nullptr) diff --git a/src/coreclr/jit/importercalls.cpp b/src/coreclr/jit/importercalls.cpp index 6ef07513ee4b10..a7e7473ac475dc 100644 --- a/src/coreclr/jit/importercalls.cpp +++ b/src/coreclr/jit/importercalls.cpp @@ -4029,6 +4029,7 @@ GenTree* Compiler::impIntrinsic(CORINFO_CLASS_HANDLE clsHnd, } case NI_System_ArgumentNullException_ThrowIfNull: + case NI_System_String_FastAllocateString: isSpecial = true; break; @@ -10727,6 +10728,10 @@ NamedIntrinsic Compiler::lookupNamedIntrinsic(CORINFO_METHOD_HANDLE method) { result = NI_System_String_Equals; } + else if (strcmp(methodName, "FastAllocateString") == 0) + { + result = NI_System_String_FastAllocateString; + } else if (strcmp(methodName, "get_Chars") == 0) { result = NI_System_String_get_Chars; diff --git a/src/coreclr/jit/namedintrinsiclist.h b/src/coreclr/jit/namedintrinsiclist.h index 0a0bd8805859c3..81141e9340e712 100644 --- a/src/coreclr/jit/namedintrinsiclist.h +++ b/src/coreclr/jit/namedintrinsiclist.h @@ -139,6 +139,7 @@ enum NamedIntrinsic : unsigned short NI_System_Runtime_InteropService_MemoryMarshal_GetArrayDataReference, NI_System_String_Equals, + NI_System_String_FastAllocateString, NI_System_String_get_Chars, NI_System_String_get_Length, NI_System_String_op_Implicit, diff --git a/src/coreclr/jit/valuenum.cpp b/src/coreclr/jit/valuenum.cpp index 6570e0c5965162..5d86ad57c0d7e9 100644 --- a/src/coreclr/jit/valuenum.cpp +++ b/src/coreclr/jit/valuenum.cpp @@ -2564,8 +2564,10 @@ ValueNum ValueNumStore::VNForFunc(var_types typ, VNFunc func, ValueNum arg0VN) } // Case 4: ARR_LENGTH(new T[(long)size]) -> size + // ARR_LENGTH(String.FastAllocateString(pMT, (long)size)) -> size VNFuncApp newArrFuncApp; - if (GetVNFunc(arg0VN, &newArrFuncApp) && (newArrFuncApp.m_func == VNF_JitNewArr)) + if (GetVNFunc(arg0VN, &newArrFuncApp) && + ((newArrFuncApp.m_func == VNF_JitNewArr) || (newArrFuncApp.m_func == VNF_StrFastAllocate))) { ValueNum actualSizeVN = VNIgnoreIntToLongCast(newArrFuncApp.m_args[1]); if (TypeOfVN(actualSizeVN) == TYP_INT) @@ -14344,6 +14346,41 @@ bool Compiler::fgValueNumberSpecialIntrinsic(GenTreeCall* call) switch (lookupNamedIntrinsic(call->gtCallMethHnd)) { + case NI_System_String_FastAllocateString: + { + assert(call->gtArgs.CountUserArgs() == 2); + + GenTree* methodTableArg = call->gtArgs.GetUserArgByIndex(0)->GetNode(); + GenTree* lengthArg = call->gtArgs.GetUserArgByIndex(1)->GetNode(); + + // Unpack the exception sets of the arguments, as we will need to include them in the result. + ValueNumPair methodTableVNP; + ValueNumPair methodTableExc; + ValueNumPair lengthVNP; + ValueNumPair lengthExc; + vnStore->VNPUnpackExc(methodTableArg->gtVNPair, &methodTableVNP, &methodTableExc); + vnStore->VNPUnpackExc(lengthArg->gtVNPair, &lengthVNP, &lengthExc); + + // Union the exception sets of the arguments with the potential exceptions of the intrinsic itself. + // NOTE: if the length is known to be within [0..CORINFO_String_MaxLength] we can skip it. + ValueNumPair overflowVnp = + vnStore->VNPExcSetSingleton(vnStore->VNPairForFunc(TYP_REF, VNF_NewStringOverflowExc, lengthVNP)); + ValueNumPair vnpExc = + vnStore->VNPExcSetUnion(vnStore->VNPExcSetUnion(methodTableExc, lengthExc), overflowVnp); + + // Lastly, we need to generate a unique VN for this intrinsic, as it always returns a new string instance. + ValueNumPair uniqueVNP; + uniqueVNP.SetBoth(vnStore->VNForExpr(compCurBB, call->TypeGet())); + + // Now we can compute the VN for the call itself. + ValueNumPair vnp = + vnStore->VNPairForFunc(call->TypeGet(), VNF_StrFastAllocate, methodTableVNP, lengthVNP, uniqueVNP); + call->gtVNPair = vnStore->VNPWithExc(vnp, vnpExc); + + fgMutateGcHeap(call DEBUGARG("NI_System_String_FastAllocateString")); + return true; + } + case NI_System_Type_GetTypeFromHandle: { // Optimize Type.GetTypeFromHandle(TypeHandleToRuntimeTypeHandle(clsHandle)) to a frozen handle. diff --git a/src/coreclr/jit/valuenumfuncs.h b/src/coreclr/jit/valuenumfuncs.h index 094153d578df1f..461f2d2ddd18ab 100644 --- a/src/coreclr/jit/valuenumfuncs.h +++ b/src/coreclr/jit/valuenumfuncs.h @@ -65,6 +65,7 @@ ValueNumFuncDef(IndexOutOfRangeExc, 2, false, false) // Array bounds check, Args ValueNumFuncDef(InvalidCastExc, 2, false, false) // CastClass check, Args: 0: ref value being cast; 1: handle of type being cast to ValueNumFuncDef(R2RInvalidCastExc, 2, false, false) // CastClass check, Args: 0: ref value being cast; 1: entry point of R2R cast helper ValueNumFuncDef(NewArrOverflowExc, 1, false, false) // Raises Integer overflow when Arg 0 is negative +ValueNumFuncDef(NewStringOverflowExc, 1, false, false) // Raises Integer overflow when Arg 0 is negative or bigger than CORINFO_String_MaxLength ValueNumFuncDef(DynamicClassInitExc, 1, false, false) // Represents exceptions thrown by static constructor for class. Args: 0: VN of DynamicStaticsInfo ValueNumFuncDef(ThreadClassInitExc, 1, false, false) // Represents exceptions thrown by static constructor for class. Args: 0: VN of ThreadStaticsInfo ValueNumFuncDef(R2RClassInitExc, 1, false, false) // Represents exceptions thrown by static constructor for class. Args: 0: VN of R2R entry point @@ -162,6 +163,7 @@ ValueNumFuncDef(JitNewMdArr, 4, false, true) ValueNumFuncDef(JitReadyToRunNew, 2, false, true) ValueNumFuncDef(JitReadyToRunNewArr, 3, false, true) ValueNumFuncDef(JitReadyToRunNewLclArr, 3, false, true) +ValueNumFuncDef(StrFastAllocate, 3, false, true) // Args: 0: MethodTable, 1: length, 2: unique VN. ValueNumFuncDef(Box, 3, false, true) ValueNumFuncDef(BoxNullable, 3, false, false) diff --git a/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Runtime/RuntimeImports.cs b/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Runtime/RuntimeImports.cs index fdcec68e625633..de29e80ac1859d 100644 --- a/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Runtime/RuntimeImports.cs +++ b/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Runtime/RuntimeImports.cs @@ -400,10 +400,6 @@ internal static IntPtr RhHandleAllocCrossReference(object value, IntPtr context) [RuntimeImport(RuntimeLibrary, "RhNewVariableSizeObject")] internal static extern unsafe Array RhNewVariableSizeObject(MethodTable* pEEType, int length); - [MethodImpl(MethodImplOptions.InternalCall)] - [RuntimeImport(RuntimeLibrary, "RhNewString")] - internal static extern unsafe string RhNewString(MethodTable* pEEType, nint length); - [MethodImplAttribute(MethodImplOptions.InternalCall)] [RuntimeImport(RuntimeLibrary, "RhGetNewObjectHelper")] internal static extern unsafe IntPtr RhGetNewObjectHelper(MethodTable* pEEType); diff --git a/src/coreclr/nativeaot/System.Private.CoreLib/src/System/String.NativeAot.cs b/src/coreclr/nativeaot/System.Private.CoreLib/src/System/String.NativeAot.cs index 2e951b445befe9..03c2c60ed7b7ff 100644 --- a/src/coreclr/nativeaot/System.Private.CoreLib/src/System/String.NativeAot.cs +++ b/src/coreclr/nativeaot/System.Private.CoreLib/src/System/String.NativeAot.cs @@ -18,12 +18,18 @@ public partial class String [Intrinsic] public static readonly string Empty = ""; + [Intrinsic] + [MethodImpl(MethodImplOptions.InternalCall)] + [RuntimeImport(RuntimeImports.RuntimeLibrary, "RhNewString")] + private static extern unsafe string FastAllocateString(MethodTable *pMT, nint length); + + [MethodImpl(MethodImplOptions.AggressiveInlining)] internal static unsafe string FastAllocateString(nint length) { // We allocate one extra char as an interop convenience so that our strings are null- // terminated, however, we don't pass the extra +1 to the string allocation because the base // size of this object includes the _firstChar field. - string newStr = RuntimeImports.RhNewString(MethodTable.Of(), length); + string newStr = FastAllocateString(MethodTable.Of(), length); Debug.Assert(newStr._stringLength == length); return newStr; } diff --git a/src/coreclr/nativeaot/Test.CoreLib/src/System/Runtime/RuntimeImports.cs b/src/coreclr/nativeaot/Test.CoreLib/src/System/Runtime/RuntimeImports.cs index 09fea74227d5e6..cd44e23904c3b5 100644 --- a/src/coreclr/nativeaot/Test.CoreLib/src/System/Runtime/RuntimeImports.cs +++ b/src/coreclr/nativeaot/Test.CoreLib/src/System/Runtime/RuntimeImports.cs @@ -20,7 +20,7 @@ namespace System.Runtime public static partial class RuntimeImports { - private const string RuntimeLibrary = "*"; + internal const string RuntimeLibrary = "*"; // // calls for GCHandle. @@ -80,10 +80,6 @@ internal static IntPtr RhGetModuleSection(TypeManagerHandle module, ReadyToRunSe [RuntimeImport(RuntimeLibrary, "RhNewArray")] private static extern unsafe Array RhNewArray(MethodTable* pEEType, nint length); - [MethodImpl(MethodImplOptions.InternalCall)] - [RuntimeImport(RuntimeLibrary, "RhNewString")] - internal static extern unsafe string RhNewString(MethodTable* pEEType, nint length); - [DllImport(RuntimeLibrary)] internal static extern unsafe void RhAllocateNewArray(MethodTable* pArrayEEType, uint numElements, uint flags, void* pResult); From 4da638db14b248048f4efc07c8166c1f521b208e Mon Sep 17 00:00:00 2001 From: Milos Kotlar Date: Wed, 6 May 2026 18:36:33 +0200 Subject: [PATCH 023/109] Replace mobile-scan with platform-agnostic CI outer-loop failure scanner (#127824) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Summary Generalizes the existing `.github/workflows/mobile-scan.md` (Apple mobile + Android only, daily, sonnet-4.5, helix-centric) into `.github/workflows/ci-failure-scan.md`. The new workflow scans every public outer-loop pipeline on `dnceng-public/public`, classifies each failure (build break vs test failure vs infra), and converges the pipeline to green by either filing tracking issues, filing Known Build Errors that Arcade Build Analysis can auto-match, opening companion PRs that skip the failing test against an existing tracking issue, or opening small product-fix PRs when a localized root cause is clear. ## What changed | Aspect | Before | After | |---|---|---| | Pipelines scanned | runtime-extra-platforms (154) only | + JIT/GC/PGO stress, libraries-jitstress, jit-experimental, ilasm, jit-cfg, superpmi-replay, randomized stress (109–160, 230, 235) | | Cadence | daily | every 12h (fuzzy schedule) | | Model | claude-sonnet-4.5 | claude-sonnet-4.6 | | Skill routing | mobile-platforms only | mobile-platforms (Apple/Android/WASM), jit-regression-test + ci-pipeline-monitor (JIT/GC/PGO), extensions-review / system-net-review where applicable | | Failure classification | helix-workitem-only (silently no-op'd on build breaks) | explicit walk: build break (Send-to-Helix skipped) vs Phase-only failure vs Helix workitem vs infra | | Outcomes | per-test PR or tracking issue | + Known Build Error issue (Arcade Build Analysis JSON format, exact 3-backtick fences) + companion skip-PR (csproj `` for stress-incompatible JIT tests; `[ActiveIssue(..., TestPlatforms.)]` for unit tests) + small product-fix PR (≤20 lines, single file, non-API, non-JIT/GC/threading/security, with the failing test as evidence) | | Convergence | none — same failure re-issued each run | two-pass: run N files tracking issue, run N+1 finds existing issue + still-failing test, opens companion PR scoped to allowed paths | | PR `allowed-files` | `src/libraries/**/tests/**` | `src/libraries/**`, `src/coreclr/**`, `src/mono/**`, `src/tests/**`, `src/native/**`, `eng/testing/**` | | Title discipline | none | every issue/PR title starts with `[ci-scan] `; titles use "Skip"/"Disable"/"Suppress", never "Mute" | | Coverage discipline | none — picks failures opportunistically | per-pipeline tally files; every signature is recorded as filed-issue / filed-PR / reused-existing / skipped-with-reason | | Caps | 5 PRs / 3 issues | 10 PRs / 5 issues | | Filename | `mobile-scan.{md,lock.yml}` | `ci-failure-scan.{md,lock.yml}` | ## Test runs The test runs produced the following issues: https://github.com/dotnet/runtime/issues/127817 https://github.com/dotnet/runtime/issues/127827 https://github.com/dotnet/runtime/issues/127828 https://github.com/dotnet/runtime/issues/127829 https://github.com/dotnet/runtime/issues/127830 https://github.com/dotnet/runtime/issues/127831 ## Security No new secrets and no new actions are introduced relative to the workflow. The only changes are inside the `engine`, `tools`, `safe-outputs`, `network`, and prompt sections of the markdown. The PR `allowed-files` widening is the surface-area change: it lets the agent edit any path under `src/libraries`, `src/coreclr`, `src/mono`, `src/tests`, `src/native`, and `eng/testing/**` — including product/runtime source — to enable small, well-localized product fixes. The `protected-files: blocked` policy still prevents touching `package.json`, lockfiles, `global.json`, `NuGet.Config`, `Directory.Packages.props`, `CODEOWNERS`, and `.github/` / `.agents/` paths. CODEOWNERS-mandated review remains the hard gate before any merge. --------- Co-authored-by: Copilot Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- ...scan.lock.yml => ci-failure-scan.lock.yml} | 90 ++-- .github/workflows/ci-failure-scan.md | 408 ++++++++++++++++++ .github/workflows/mobile-scan.md | 160 ------- 3 files changed, 453 insertions(+), 205 deletions(-) rename .github/workflows/{mobile-scan.lock.yml => ci-failure-scan.lock.yml} (92%) create mode 100644 .github/workflows/ci-failure-scan.md delete mode 100644 .github/workflows/mobile-scan.md diff --git a/.github/workflows/mobile-scan.lock.yml b/.github/workflows/ci-failure-scan.lock.yml similarity index 92% rename from .github/workflows/mobile-scan.lock.yml rename to .github/workflows/ci-failure-scan.lock.yml index 23d4822e27064b..45c464a68d5a98 100644 --- a/.github/workflows/mobile-scan.lock.yml +++ b/.github/workflows/ci-failure-scan.lock.yml @@ -1,4 +1,4 @@ -# gh-aw-metadata: {"schema_version":"v3","frontmatter_hash":"f77456f33b61a0a920cfcf29a2ff065f923c2d75ef2c2d46909816fd0df9776e","compiler_version":"v0.68.1","strict":true,"agent_id":"copilot","agent_model":"claude-sonnet-4.5"} +# gh-aw-metadata: {"schema_version":"v3","frontmatter_hash":"9f73c4276266e2b227107862cdbff63e464a2f91e9c3cb0a5a749b407cea2b5b","compiler_version":"v0.68.1","strict":true,"agent_id":"copilot","agent_model":"claude-sonnet-4.6"} # gh-aw-manifest: {"version":1,"secrets":["COPILOT_GITHUB_TOKEN","COPILOT_PAT_0","COPILOT_PAT_1","COPILOT_PAT_2","COPILOT_PAT_3","COPILOT_PAT_4","COPILOT_PAT_5","COPILOT_PAT_6","COPILOT_PAT_7","COPILOT_PAT_8","COPILOT_PAT_9","GH_AW_CI_TRIGGER_TOKEN","GH_AW_GITHUB_MCP_SERVER_TOKEN","GH_AW_GITHUB_TOKEN","GITHUB_TOKEN"],"actions":[{"repo":"actions/checkout","sha":"de0fac2e4500dabe0009e67214ff5f5447ce83dd","version":"v6.0.2"},{"repo":"actions/download-artifact","sha":"3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c","version":"v8.0.1"},{"repo":"actions/github-script","sha":"3a2844b7e9c422d3c10d287c895573f7108da1b3","version":"v9"},{"repo":"actions/upload-artifact","sha":"bbbca2ddaa5d8feaa63e36b76fdaad77386f024f","version":"v7"},{"repo":"github/gh-aw-actions/setup","sha":"2fe53acc038ba01c3bbdc767d4b25df31ca5bdfc","version":"v0.68.1"}]} # ___ _ _ # / _ \ | | (_) @@ -22,7 +22,7 @@ # # For more information: https://github.github.com/gh-aw/introduction/overview/ # -# Daily scan of the runtime-extra-platforms pipeline for Apple mobile and Android failures. Fixes per-test failures via PR; files an actionable tracking issue otherwise. +# Periodic scan of runtime-extra-platforms and outer-loop CI pipelines (JIT/GC stress, PGO, libraries-jitstress, etc.). Files Known Build Errors so failures are immediately ignorable in PR CI; opens companion skip PRs to remove the failure permanently after human review. # # Secrets used: # - COPILOT_GITHUB_TOKEN @@ -48,15 +48,15 @@ # - actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7 # - github/gh-aw-actions/setup@2fe53acc038ba01c3bbdc767d4b25df31ca5bdfc # v0.68.1 -name: "Mobile Platform Failure Scanner" +name: "CI Outer-Loop Failure Scanner" "on": # roles: # Roles processed as role check in pre-activation job # - admin # Roles processed as role check in pre-activation job # - maintainer # Roles processed as role check in pre-activation job # - write # Roles processed as role check in pre-activation job schedule: - - cron: "40 10 * * *" - # Friendly format: daily (scattered) + - cron: "34 */12 * * *" + # Friendly format: every 12h (scattered) # steps: # Steps injected into pre-activation job # - name: Checkout the select-copilot-pat action folder # uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd @@ -91,9 +91,9 @@ permissions: {} concurrency: cancel-in-progress: true - group: mobile-scan + group: ci-failure-scan -run-name: "Mobile Platform Failure Scanner" +run-name: "CI Outer-Loop Failure Scanner" jobs: activation: @@ -124,11 +124,11 @@ jobs: env: GH_AW_INFO_ENGINE_ID: "copilot" GH_AW_INFO_ENGINE_NAME: "GitHub Copilot CLI" - GH_AW_INFO_MODEL: "claude-sonnet-4.5" + GH_AW_INFO_MODEL: "claude-sonnet-4.6" GH_AW_INFO_VERSION: "1.0.21" GH_AW_INFO_AGENT_VERSION: "1.0.21" GH_AW_INFO_CLI_VERSION: "v0.68.1" - GH_AW_INFO_WORKFLOW_NAME: "Mobile Platform Failure Scanner" + GH_AW_INFO_WORKFLOW_NAME: "CI Outer-Loop Failure Scanner" GH_AW_INFO_EXPERIMENTAL: "false" GH_AW_INFO_SUPPORTS_TOOLS_ALLOWLIST: "true" GH_AW_INFO_STAGED: "false" @@ -163,7 +163,7 @@ jobs: id: check-lock-file uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9 env: - GH_AW_WORKFLOW_FILE: "mobile-scan.lock.yml" + GH_AW_WORKFLOW_FILE: "ci-failure-scan.lock.yml" GH_AW_CONTEXT_WORKFLOW_REF: "${{ github.workflow_ref }}" with: script: | @@ -197,19 +197,19 @@ jobs: run: | bash "${RUNNER_TEMP}/gh-aw/actions/create_prompt_first.sh" { - cat << 'GH_AW_PROMPT_5b32ebfb2ce4676c_EOF' + cat << 'GH_AW_PROMPT_416b8e1b41d3a8c5_EOF' - GH_AW_PROMPT_5b32ebfb2ce4676c_EOF + GH_AW_PROMPT_416b8e1b41d3a8c5_EOF cat "${RUNNER_TEMP}/gh-aw/prompts/xpia.md" cat "${RUNNER_TEMP}/gh-aw/prompts/temp_folder_prompt.md" cat "${RUNNER_TEMP}/gh-aw/prompts/markdown.md" cat "${RUNNER_TEMP}/gh-aw/prompts/safe_outputs_prompt.md" - cat << 'GH_AW_PROMPT_5b32ebfb2ce4676c_EOF' + cat << 'GH_AW_PROMPT_416b8e1b41d3a8c5_EOF' - Tools: create_issue(max:3), create_pull_request(max:5), missing_tool, missing_data, noop - GH_AW_PROMPT_5b32ebfb2ce4676c_EOF + Tools: create_issue(max:5), create_pull_request(max:10), missing_tool, missing_data, noop + GH_AW_PROMPT_416b8e1b41d3a8c5_EOF cat "${RUNNER_TEMP}/gh-aw/prompts/safe_outputs_create_pull_request.md" - cat << 'GH_AW_PROMPT_5b32ebfb2ce4676c_EOF' + cat << 'GH_AW_PROMPT_416b8e1b41d3a8c5_EOF' The following GitHub context information is available for this workflow: @@ -242,12 +242,12 @@ jobs: - **Note**: If a branch you need is not in the list above and is not listed as an additional fetched ref, it has NOT been checked out. For private repositories you cannot fetch it without proper authentication. If the branch is required and not available, exit with an error and ask the user to add it to the `fetch:` option of the `checkout:` configuration (e.g., `fetch: ["refs/pulls/open/*"]` for all open PR refs, or `fetch: ["main", "feature/my-branch"]` for specific branches). - GH_AW_PROMPT_5b32ebfb2ce4676c_EOF + GH_AW_PROMPT_416b8e1b41d3a8c5_EOF cat "${RUNNER_TEMP}/gh-aw/prompts/github_mcp_tools_with_safeoutputs_prompt.md" - cat << 'GH_AW_PROMPT_5b32ebfb2ce4676c_EOF' + cat << 'GH_AW_PROMPT_416b8e1b41d3a8c5_EOF' - {{#runtime-import .github/workflows/mobile-scan.md}} - GH_AW_PROMPT_5b32ebfb2ce4676c_EOF + {{#runtime-import .github/workflows/ci-failure-scan.md}} + GH_AW_PROMPT_416b8e1b41d3a8c5_EOF } > "$GH_AW_PROMPT" - name: Interpolate variables and render templates uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9 @@ -331,7 +331,7 @@ jobs: GH_AW_ASSETS_BRANCH: "" GH_AW_ASSETS_MAX_SIZE_KB: 0 GH_AW_MCP_LOG_DIR: /tmp/gh-aw/mcp-logs/safeoutputs - GH_AW_WORKFLOW_ID_SANITIZED: mobilescan + GH_AW_WORKFLOW_ID_SANITIZED: cifailurescan outputs: checkout_pr_success: ${{ steps.checkout-pr.outputs.checkout_pr_success || 'true' }} effective_tokens: ${{ steps.parse-mcp-gateway.outputs.effective_tokens }} @@ -413,16 +413,16 @@ jobs: mkdir -p "${RUNNER_TEMP}/gh-aw/safeoutputs" mkdir -p /tmp/gh-aw/safeoutputs mkdir -p /tmp/gh-aw/mcp-logs/safeoutputs - cat > "${RUNNER_TEMP}/gh-aw/safeoutputs/config.json" << 'GH_AW_SAFE_OUTPUTS_CONFIG_9c9d9c81bf97b513_EOF' - {"create_issue":{"labels":["agentic-workflows"],"max":3},"create_pull_request":{"allowed_files":["src/libraries/**/tests/**","src/libraries/Common/tests/**"],"draft":true,"labels":["agentic-workflows"],"max":5,"max_patch_size":1024,"protected_files":["package.json","bun.lockb","bunfig.toml","deno.json","deno.jsonc","deno.lock","global.json","NuGet.Config","Directory.Packages.props","mix.exs","mix.lock","go.mod","go.sum","stack.yaml","stack.yaml.lock","pom.xml","build.gradle","build.gradle.kts","settings.gradle","settings.gradle.kts","gradle.properties","package-lock.json","yarn.lock","pnpm-lock.yaml","npm-shrinkwrap.json","requirements.txt","Pipfile","Pipfile.lock","pyproject.toml","setup.py","setup.cfg","Gemfile","Gemfile.lock","uv.lock","CODEOWNERS"],"protected_files_policy":"blocked","protected_path_prefixes":[".github/",".agents/"],"title_prefix":"[mobile] "},"create_report_incomplete_issue":{},"missing_data":{},"missing_tool":{},"noop":{"max":1,"report-as-issue":"true"},"report_incomplete":{}} - GH_AW_SAFE_OUTPUTS_CONFIG_9c9d9c81bf97b513_EOF + cat > "${RUNNER_TEMP}/gh-aw/safeoutputs/config.json" << 'GH_AW_SAFE_OUTPUTS_CONFIG_93f4d7e8f71e4c3f_EOF' + {"create_issue":{"allowed_labels":["Known Build Error","blocking-clean-ci"],"labels":["agentic-workflows"],"max":5},"create_pull_request":{"allowed_files":["src/libraries/**","src/coreclr/**","src/mono/**","src/tests/**","src/native/**","eng/testing/**"],"draft":true,"labels":["agentic-workflows"],"max":10,"max_patch_size":1024,"protected_files":["package.json","bun.lockb","bunfig.toml","deno.json","deno.jsonc","deno.lock","global.json","NuGet.Config","Directory.Packages.props","mix.exs","mix.lock","go.mod","go.sum","stack.yaml","stack.yaml.lock","pom.xml","build.gradle","build.gradle.kts","settings.gradle","settings.gradle.kts","gradle.properties","package-lock.json","yarn.lock","pnpm-lock.yaml","npm-shrinkwrap.json","requirements.txt","Pipfile","Pipfile.lock","pyproject.toml","setup.py","setup.cfg","Gemfile","Gemfile.lock","uv.lock","CODEOWNERS"],"protected_files_policy":"blocked","protected_path_prefixes":[".github/",".agents/"],"title_prefix":"[ci-scan] "},"create_report_incomplete_issue":{},"missing_data":{},"missing_tool":{},"noop":{"max":1,"report-as-issue":"true"},"report_incomplete":{}} + GH_AW_SAFE_OUTPUTS_CONFIG_93f4d7e8f71e4c3f_EOF - name: Write Safe Outputs Tools env: GH_AW_TOOLS_META_JSON: | { "description_suffixes": { - "create_issue": " CONSTRAINTS: Maximum 3 issue(s) can be created. Labels [\"agentic-workflows\"] will be automatically added.", - "create_pull_request": " CONSTRAINTS: Maximum 5 pull request(s) can be created. Title will be prefixed with \"[mobile] \". Labels [\"agentic-workflows\"] will be automatically added. PRs will be created as drafts." + "create_issue": " CONSTRAINTS: Maximum 5 issue(s) can be created. Labels [\"agentic-workflows\"] will be automatically added. Only these labels are allowed: [\"Known Build Error\" \"blocking-clean-ci\"].", + "create_pull_request": " CONSTRAINTS: Maximum 10 pull request(s) can be created. Title will be prefixed with \"[ci-scan] \". Labels [\"agentic-workflows\"] will be automatically added. Only these labels are allowed: [\"agentic-workflows\"]. PRs will be created as drafts." }, "repo_params": {}, "dynamic_tools": [] @@ -645,7 +645,7 @@ jobs: export MCP_GATEWAY_DOCKER_COMMAND='docker run -i --rm --network host -v /var/run/docker.sock:/var/run/docker.sock -e MCP_GATEWAY_PORT -e MCP_GATEWAY_DOMAIN -e MCP_GATEWAY_API_KEY -e MCP_GATEWAY_PAYLOAD_DIR -e MCP_GATEWAY_PAYLOAD_SIZE_THRESHOLD -e DEBUG -e MCP_GATEWAY_LOG_DIR -e GH_AW_MCP_LOG_DIR -e GH_AW_SAFE_OUTPUTS -e GH_AW_SAFE_OUTPUTS_CONFIG_PATH -e GH_AW_SAFE_OUTPUTS_TOOLS_PATH -e GH_AW_ASSETS_BRANCH -e GH_AW_ASSETS_MAX_SIZE_KB -e GH_AW_ASSETS_ALLOWED_EXTS -e DEFAULT_BRANCH -e GITHUB_MCP_SERVER_TOKEN -e GITHUB_MCP_GUARD_MIN_INTEGRITY -e GITHUB_MCP_GUARD_REPOS -e GITHUB_REPOSITORY -e GITHUB_SERVER_URL -e GITHUB_SHA -e GITHUB_WORKSPACE -e GITHUB_TOKEN -e GITHUB_RUN_ID -e GITHUB_RUN_NUMBER -e GITHUB_RUN_ATTEMPT -e GITHUB_JOB -e GITHUB_ACTION -e GITHUB_EVENT_NAME -e GITHUB_EVENT_PATH -e GITHUB_ACTOR -e GITHUB_ACTOR_ID -e GITHUB_TRIGGERING_ACTOR -e GITHUB_WORKFLOW -e GITHUB_WORKFLOW_REF -e GITHUB_WORKFLOW_SHA -e GITHUB_REF -e GITHUB_REF_NAME -e GITHUB_REF_TYPE -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e GH_AW_SAFE_OUTPUTS_PORT -e GH_AW_SAFE_OUTPUTS_API_KEY -v /tmp/gh-aw/mcp-payloads:/tmp/gh-aw/mcp-payloads:rw -v /opt:/opt:ro -v /tmp:/tmp:rw -v '"${GITHUB_WORKSPACE}"':'"${GITHUB_WORKSPACE}"':rw ghcr.io/github/gh-aw-mcpg:v0.2.17' mkdir -p /home/runner/.copilot - cat << GH_AW_MCP_CONFIG_17f3452edca3354e_EOF | bash "${RUNNER_TEMP}/gh-aw/actions/start_mcp_gateway.sh" + cat << GH_AW_MCP_CONFIG_f1265124db2abfb7_EOF | bash "${RUNNER_TEMP}/gh-aw/actions/start_mcp_gateway.sh" { "mcpServers": { "github": { @@ -689,7 +689,7 @@ jobs: "payloadDir": "${MCP_GATEWAY_PAYLOAD_DIR}" } } - GH_AW_MCP_CONFIG_17f3452edca3354e_EOF + GH_AW_MCP_CONFIG_f1265124db2abfb7_EOF - name: Download activation artifact uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: @@ -743,7 +743,7 @@ jobs: # --allow-tool shell(xargs) # --allow-tool shell(yq) # --allow-tool write - timeout-minutes: 60 + timeout-minutes: 90 run: | set -o pipefail touch /tmp/gh-aw/agent-step-summary.md @@ -754,7 +754,7 @@ jobs: env: COPILOT_AGENT_RUNNER_TYPE: STANDALONE COPILOT_GITHUB_TOKEN: ${{ case(needs.pre_activation.outputs.copilot_pat_number == '0', secrets.COPILOT_PAT_0, needs.pre_activation.outputs.copilot_pat_number == '1', secrets.COPILOT_PAT_1, needs.pre_activation.outputs.copilot_pat_number == '2', secrets.COPILOT_PAT_2, needs.pre_activation.outputs.copilot_pat_number == '3', secrets.COPILOT_PAT_3, needs.pre_activation.outputs.copilot_pat_number == '4', secrets.COPILOT_PAT_4, needs.pre_activation.outputs.copilot_pat_number == '5', secrets.COPILOT_PAT_5, needs.pre_activation.outputs.copilot_pat_number == '6', secrets.COPILOT_PAT_6, needs.pre_activation.outputs.copilot_pat_number == '7', secrets.COPILOT_PAT_7, needs.pre_activation.outputs.copilot_pat_number == '8', secrets.COPILOT_PAT_8, needs.pre_activation.outputs.copilot_pat_number == '9', secrets.COPILOT_PAT_9, secrets.COPILOT_GITHUB_TOKEN) }} - COPILOT_MODEL: claude-sonnet-4.5 + COPILOT_MODEL: claude-sonnet-4.6 GH_AW_MCP_CONFIG: /home/runner/.copilot/mcp-config.json GH_AW_PHASE: agent GH_AW_PROMPT: /tmp/gh-aw/aw-prompts/prompt.txt @@ -954,7 +954,7 @@ jobs: issues: write pull-requests: write concurrency: - group: "gh-aw-conclusion-mobile-scan" + group: "gh-aw-conclusion-ci-failure-scan" cancel-in-progress: false outputs: incomplete_count: ${{ steps.report_incomplete.outputs.incomplete_count }} @@ -989,7 +989,7 @@ jobs: env: GH_AW_AGENT_OUTPUT: ${{ steps.setup-agent-output-env.outputs.GH_AW_AGENT_OUTPUT }} GH_AW_NOOP_MAX: "1" - GH_AW_WORKFLOW_NAME: "Mobile Platform Failure Scanner" + GH_AW_WORKFLOW_NAME: "CI Outer-Loop Failure Scanner" GH_AW_RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} GH_AW_AGENT_CONCLUSION: ${{ needs.agent.result }} GH_AW_NOOP_REPORT_AS_ISSUE: "true" @@ -1006,7 +1006,7 @@ jobs: env: GH_AW_AGENT_OUTPUT: ${{ steps.setup-agent-output-env.outputs.GH_AW_AGENT_OUTPUT }} GH_AW_MISSING_TOOL_CREATE_ISSUE: "true" - GH_AW_WORKFLOW_NAME: "Mobile Platform Failure Scanner" + GH_AW_WORKFLOW_NAME: "CI Outer-Loop Failure Scanner" with: github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} script: | @@ -1020,7 +1020,7 @@ jobs: env: GH_AW_AGENT_OUTPUT: ${{ steps.setup-agent-output-env.outputs.GH_AW_AGENT_OUTPUT }} GH_AW_REPORT_INCOMPLETE_CREATE_ISSUE: "true" - GH_AW_WORKFLOW_NAME: "Mobile Platform Failure Scanner" + GH_AW_WORKFLOW_NAME: "CI Outer-Loop Failure Scanner" with: github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} script: | @@ -1034,10 +1034,10 @@ jobs: uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9 env: GH_AW_AGENT_OUTPUT: ${{ steps.setup-agent-output-env.outputs.GH_AW_AGENT_OUTPUT }} - GH_AW_WORKFLOW_NAME: "Mobile Platform Failure Scanner" + GH_AW_WORKFLOW_NAME: "CI Outer-Loop Failure Scanner" GH_AW_RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} GH_AW_AGENT_CONCLUSION: ${{ needs.agent.result }} - GH_AW_WORKFLOW_ID: "mobile-scan" + GH_AW_WORKFLOW_ID: "ci-failure-scan" GH_AW_ENGINE_ID: "copilot" GH_AW_SECRET_VERIFICATION_RESULT: ${{ needs.activation.outputs.secret_verification_result }} GH_AW_CHECKOUT_PR_SUCCESS: ${{ needs.agent.outputs.checkout_pr_success }} @@ -1048,7 +1048,7 @@ jobs: GH_AW_STALE_LOCK_FILE_FAILED: ${{ needs.activation.outputs.stale_lock_file_failed }} GH_AW_GROUP_REPORTS: "false" GH_AW_FAILURE_REPORT_AS_ISSUE: "true" - GH_AW_TIMEOUT_MINUTES: "60" + GH_AW_TIMEOUT_MINUTES: "90" with: github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} script: | @@ -1137,8 +1137,8 @@ jobs: if: always() && steps.detection_guard.outputs.run_detection == 'true' uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9 env: - WORKFLOW_NAME: "Mobile Platform Failure Scanner" - WORKFLOW_DESCRIPTION: "Daily scan of the runtime-extra-platforms pipeline for Apple mobile and Android failures. Fixes per-test failures via PR; files an actionable tracking issue otherwise." + WORKFLOW_NAME: "CI Outer-Loop Failure Scanner" + WORKFLOW_DESCRIPTION: "Periodic scan of runtime-extra-platforms and outer-loop CI pipelines (JIT/GC stress, PGO, libraries-jitstress, etc.). Files Known Build Errors so failures are immediately ignorable in PR CI; opens companion skip PRs to remove the failure permanently after human review." HAS_PATCH: ${{ needs.agent.outputs.has_patch }} with: script: | @@ -1172,7 +1172,7 @@ jobs: env: COPILOT_AGENT_RUNNER_TYPE: STANDALONE COPILOT_GITHUB_TOKEN: ${{ case(needs.pre_activation.outputs.copilot_pat_number == '0', secrets.COPILOT_PAT_0, needs.pre_activation.outputs.copilot_pat_number == '1', secrets.COPILOT_PAT_1, needs.pre_activation.outputs.copilot_pat_number == '2', secrets.COPILOT_PAT_2, needs.pre_activation.outputs.copilot_pat_number == '3', secrets.COPILOT_PAT_3, needs.pre_activation.outputs.copilot_pat_number == '4', secrets.COPILOT_PAT_4, needs.pre_activation.outputs.copilot_pat_number == '5', secrets.COPILOT_PAT_5, needs.pre_activation.outputs.copilot_pat_number == '6', secrets.COPILOT_PAT_6, needs.pre_activation.outputs.copilot_pat_number == '7', secrets.COPILOT_PAT_7, needs.pre_activation.outputs.copilot_pat_number == '8', secrets.COPILOT_PAT_8, needs.pre_activation.outputs.copilot_pat_number == '9', secrets.COPILOT_PAT_9, secrets.COPILOT_GITHUB_TOKEN) }} - COPILOT_MODEL: claude-sonnet-4.5 + COPILOT_MODEL: claude-sonnet-4.6 GH_AW_PHASE: detection GH_AW_PROMPT: /tmp/gh-aw/aw-prompts/prompt.txt GH_AW_VERSION: v0.68.1 @@ -1270,12 +1270,12 @@ jobs: pull-requests: write timeout-minutes: 15 env: - GH_AW_CALLER_WORKFLOW_ID: "${{ github.repository }}/mobile-scan" + GH_AW_CALLER_WORKFLOW_ID: "${{ github.repository }}/ci-failure-scan" GH_AW_EFFECTIVE_TOKENS: ${{ needs.agent.outputs.effective_tokens }} GH_AW_ENGINE_ID: "copilot" - GH_AW_ENGINE_MODEL: "claude-sonnet-4.5" - GH_AW_WORKFLOW_ID: "mobile-scan" - GH_AW_WORKFLOW_NAME: "Mobile Platform Failure Scanner" + GH_AW_ENGINE_MODEL: "claude-sonnet-4.6" + GH_AW_WORKFLOW_ID: "ci-failure-scan" + GH_AW_WORKFLOW_NAME: "CI Outer-Loop Failure Scanner" outputs: code_push_failure_count: ${{ steps.process_safe_outputs.outputs.code_push_failure_count }} code_push_failure_errors: ${{ steps.process_safe_outputs.outputs.code_push_failure_errors }} @@ -1354,7 +1354,7 @@ jobs: GH_AW_ALLOWED_DOMAINS: "*.blob.core.windows.net,*.githubusercontent.com,api.business.githubcopilot.com,api.enterprise.githubcopilot.com,api.github.com,api.githubcopilot.com,api.individual.githubcopilot.com,api.snapcraft.io,archive.ubuntu.com,azure.archive.ubuntu.com,codeload.github.com,crl.geotrust.com,crl.globalsign.com,crl.identrust.com,crl.sectigo.com,crl.thawte.com,crl.usertrust.com,crl.verisign.com,crl3.digicert.com,crl4.digicert.com,crls.ssl.com,dev.azure.com,docs.github.com,github-cloud.githubusercontent.com,github-cloud.s3.amazonaws.com,github.blog,github.com,github.githubassets.com,helix.dot.net,host.docker.internal,json-schema.org,json.schemastore.org,keyserver.ubuntu.com,lfs.github.com,objects.githubusercontent.com,ocsp.digicert.com,ocsp.geotrust.com,ocsp.globalsign.com,ocsp.identrust.com,ocsp.sectigo.com,ocsp.ssl.com,ocsp.thawte.com,ocsp.usertrust.com,ocsp.verisign.com,packagecloud.io,packages.cloud.google.com,packages.microsoft.com,ppa.launchpad.net,raw.githubusercontent.com,registry.npmjs.org,s.symcb.com,s.symcd.com,security.ubuntu.com,telemetry.enterprise.githubcopilot.com,ts-crl.ws.symantec.com,ts-ocsp.ws.symantec.com,www.googleapis.com" GITHUB_SERVER_URL: ${{ github.server_url }} GITHUB_API_URL: ${{ github.api_url }} - GH_AW_SAFE_OUTPUTS_HANDLER_CONFIG: "{\"create_issue\":{\"labels\":[\"agentic-workflows\"],\"max\":3},\"create_pull_request\":{\"allowed_files\":[\"src/libraries/**/tests/**\",\"src/libraries/Common/tests/**\"],\"draft\":true,\"labels\":[\"agentic-workflows\"],\"max\":5,\"max_patch_size\":1024,\"protected_files\":[\"package.json\",\"bun.lockb\",\"bunfig.toml\",\"deno.json\",\"deno.jsonc\",\"deno.lock\",\"global.json\",\"NuGet.Config\",\"Directory.Packages.props\",\"mix.exs\",\"mix.lock\",\"go.mod\",\"go.sum\",\"stack.yaml\",\"stack.yaml.lock\",\"pom.xml\",\"build.gradle\",\"build.gradle.kts\",\"settings.gradle\",\"settings.gradle.kts\",\"gradle.properties\",\"package-lock.json\",\"yarn.lock\",\"pnpm-lock.yaml\",\"npm-shrinkwrap.json\",\"requirements.txt\",\"Pipfile\",\"Pipfile.lock\",\"pyproject.toml\",\"setup.py\",\"setup.cfg\",\"Gemfile\",\"Gemfile.lock\",\"uv.lock\",\"CODEOWNERS\",\"AGENTS.md\"],\"protected_files_policy\":\"blocked\",\"protected_path_prefixes\":[\".github/\",\".agents/\"],\"title_prefix\":\"[mobile] \"},\"create_report_incomplete_issue\":{},\"missing_data\":{},\"missing_tool\":{},\"noop\":{\"max\":1,\"report-as-issue\":\"true\"},\"report_incomplete\":{}}" + GH_AW_SAFE_OUTPUTS_HANDLER_CONFIG: "{\"create_issue\":{\"allowed_labels\":[\"Known Build Error\",\"blocking-clean-ci\"],\"labels\":[\"agentic-workflows\"],\"max\":5},\"create_pull_request\":{\"allowed_files\":[\"src/libraries/**\",\"src/coreclr/**\",\"src/mono/**\",\"src/tests/**\",\"src/native/**\",\"eng/testing/**\"],\"draft\":true,\"labels\":[\"agentic-workflows\"],\"max\":10,\"max_patch_size\":1024,\"protected_files\":[\"package.json\",\"bun.lockb\",\"bunfig.toml\",\"deno.json\",\"deno.jsonc\",\"deno.lock\",\"global.json\",\"NuGet.Config\",\"Directory.Packages.props\",\"mix.exs\",\"mix.lock\",\"go.mod\",\"go.sum\",\"stack.yaml\",\"stack.yaml.lock\",\"pom.xml\",\"build.gradle\",\"build.gradle.kts\",\"settings.gradle\",\"settings.gradle.kts\",\"gradle.properties\",\"package-lock.json\",\"yarn.lock\",\"pnpm-lock.yaml\",\"npm-shrinkwrap.json\",\"requirements.txt\",\"Pipfile\",\"Pipfile.lock\",\"pyproject.toml\",\"setup.py\",\"setup.cfg\",\"Gemfile\",\"Gemfile.lock\",\"uv.lock\",\"CODEOWNERS\",\"AGENTS.md\"],\"protected_files_policy\":\"blocked\",\"protected_path_prefixes\":[\".github/\",\".agents/\"],\"title_prefix\":\"[ci-scan] \"},\"create_report_incomplete_issue\":{},\"missing_data\":{},\"missing_tool\":{},\"noop\":{\"max\":1,\"report-as-issue\":\"true\"},\"report_incomplete\":{}}" GH_AW_CI_TRIGGER_TOKEN: ${{ secrets.GH_AW_CI_TRIGGER_TOKEN }} with: github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/ci-failure-scan.md b/.github/workflows/ci-failure-scan.md new file mode 100644 index 00000000000000..c1aec2f41a41c8 --- /dev/null +++ b/.github/workflows/ci-failure-scan.md @@ -0,0 +1,408 @@ +--- +name: "CI Outer-Loop Failure Scanner" +description: "Periodic scan of runtime-extra-platforms and outer-loop CI pipelines (JIT/GC stress, PGO, libraries-jitstress, etc.). Files Known Build Errors so failures are immediately ignorable in PR CI; opens companion skip PRs to remove the failure permanently after human review." + +permissions: + contents: read + issues: read + pull-requests: read + +on: + schedule: every 12h + workflow_dispatch: + roles: [admin, maintainer, write] + +# ############################################################### +# Override the COPILOT_GITHUB_TOKEN secret usage for the workflow +# with a randomly-selected token from a pool of secrets. +# +# As soon as organization-level billing is offered for Agentic +# Workflows, this stop-gap approach will be removed. +# +# See: /.github/actions/select-copilot-pat/README.md +# ############################################################### + + # Add the pre-activation step of selecting a random PAT from the supplied secrets + steps: + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + name: Checkout the select-copilot-pat action folder + with: + persist-credentials: false + sparse-checkout: .github/actions/select-copilot-pat + sparse-checkout-cone-mode: true + fetch-depth: 1 + + - id: select-copilot-pat + name: Select Copilot token from pool + uses: ./.github/actions/select-copilot-pat + env: + SECRET_0: ${{ secrets.COPILOT_PAT_0 }} + SECRET_1: ${{ secrets.COPILOT_PAT_1 }} + SECRET_2: ${{ secrets.COPILOT_PAT_2 }} + SECRET_3: ${{ secrets.COPILOT_PAT_3 }} + SECRET_4: ${{ secrets.COPILOT_PAT_4 }} + SECRET_5: ${{ secrets.COPILOT_PAT_5 }} + SECRET_6: ${{ secrets.COPILOT_PAT_6 }} + SECRET_7: ${{ secrets.COPILOT_PAT_7 }} + SECRET_8: ${{ secrets.COPILOT_PAT_8 }} + SECRET_9: ${{ secrets.COPILOT_PAT_9 }} + +# Add the pre-activation output of the randomly selected PAT +jobs: + pre-activation: + outputs: + copilot_pat_number: ${{ steps.select-copilot-pat.outputs.copilot_pat_number }} + +# Override the COPILOT_GITHUB_TOKEN expression used in the activation job +# Consume the PAT number from the pre-activation step and select the corresponding secret +engine: + id: copilot + model: claude-sonnet-4.6 + env: + # We cannot use line breaks in this expression as it leads to a syntax error in the compiled workflow + # If none of the `COPILOT_PAT_#` secrets were selected, then the default COPILOT_GITHUB_TOKEN is used + COPILOT_GITHUB_TOKEN: ${{ case(needs.pre_activation.outputs.copilot_pat_number == '0', secrets.COPILOT_PAT_0, needs.pre_activation.outputs.copilot_pat_number == '1', secrets.COPILOT_PAT_1, needs.pre_activation.outputs.copilot_pat_number == '2', secrets.COPILOT_PAT_2, needs.pre_activation.outputs.copilot_pat_number == '3', secrets.COPILOT_PAT_3, needs.pre_activation.outputs.copilot_pat_number == '4', secrets.COPILOT_PAT_4, needs.pre_activation.outputs.copilot_pat_number == '5', secrets.COPILOT_PAT_5, needs.pre_activation.outputs.copilot_pat_number == '6', secrets.COPILOT_PAT_6, needs.pre_activation.outputs.copilot_pat_number == '7', secrets.COPILOT_PAT_7, needs.pre_activation.outputs.copilot_pat_number == '8', secrets.COPILOT_PAT_8, needs.pre_activation.outputs.copilot_pat_number == '9', secrets.COPILOT_PAT_9, secrets.COPILOT_GITHUB_TOKEN) }} + +concurrency: + group: "ci-failure-scan" + cancel-in-progress: true + +tools: + github: + toolsets: [pull_requests, repos, issues, search] + min-integrity: approved + edit: + bash: ["dotnet", "git", "find", "ls", "cat", "grep", "head", "tail", "wc", "curl", "jq", "tee", "sed", "awk", "tr", "cut", "sort", "uniq", "xargs", "echo", "date", "mkdir", "test", "env", "basename", "dirname", "bash", "sh", "chmod"] + +checkout: + fetch-depth: 50 + +safe-outputs: + create-pull-request: + title-prefix: "[ci-scan] " + draft: true + max: 10 + protected-files: blocked + allowed-files: + - "src/libraries/**" + - "src/coreclr/**" + - "src/mono/**" + - "src/tests/**" + - "src/native/**" + - "eng/testing/**" + labels: [agentic-workflows] + allowed-labels: [agentic-workflows] + create-issue: + max: 5 + labels: [agentic-workflows] + allowed-labels: ["Known Build Error", "blocking-clean-ci"] + +timeout-minutes: 90 + +network: + allowed: + - defaults + - github + - dev.azure.com + - helix.dot.net + - "*.blob.core.windows.net" +--- + +# CI Outer-Loop Failure Scanner + +Platform-agnostic scan of `dnceng-public/public` outer-loop CI pipelines on `main`. Every actionable failure becomes either a draft PR (per-test fix) or a tracking issue (everything else). The intent is to keep outer-loop pipelines green without waiting on humans to file issues. + +## Pipelines to scan + +Iterate over every pipeline in this list. For each, fetch builds on branch `main` filtered to `resultFilter=succeeded,failed,partiallySucceeded` (skip `canceled`). Pick the most recent such build as the "latest", then look back through ~10 prior completed builds to compute first-seen-in-window and occurrence counts. + +| Pipeline | Definition ID | Notes | +|----------|---------------|-------| +| runtime-extra-platforms | 154 | Apple mobile, Android, browser, wasi, NativeAOT outer loop | +| runtime-coreclr outerloop | 108 | | +| runtime-coreclr jitstress | 109 | JIT stress modes | +| runtime-coreclr jitstressregs | 110 | | +| runtime-coreclr jitstress2-jitstressregs | 111 | | +| runtime-coreclr gcstress0x3-gcstress0xc | 112 | | +| runtime-coreclr gcstress-extra | 113 | | +| runtime-coreclr r2r-extra | 114 | | +| runtime-coreclr jitstress-isas-x86 | 115 | | +| runtime-coreclr jitstress-isas-arm | 116 | | +| runtime-coreclr jitstressregs-x86 | 117 | | +| runtime-coreclr libraries-jitstressregs | 118 | | +| runtime-coreclr libraries-jitstress2-jitstressregs | 119 | | +| runtime-coreclr r2r | 120 | | +| runtime-coreclr gc-simulator | 123 | | +| runtime-coreclr crossgen2 | 124 | | +| runtime-jit-experimental | 137 | OSR / partial compilation | +| runtime-coreclr libraries-jitstress | 138 | | +| runtime-coreclr ilasm | 140 | | +| runtime-coreclr pgo | 144 | | +| runtime-coreclr libraries-pgo | 145 | | +| gc-standalone | 146 | ADO name differs from display name | +| runtime-coreclr superpmi-replay | 150 | | +| runtime-coreclr superpmi-asmdiffs-checked-release | 153 | | +| runtime-coreclr jit-cfg | 155 | Control flow guard | +| runtime-coreclr jitstress-random | 159 | Stress mode value comes from logs | +| runtime-coreclr libraries-jitstress-random | 160 | Stress mode value comes from logs | +| runtime-coreclr pgostress | 230 | | +| runtime-coreclr jitstress-isas-avx512 | 235 | | +| runtime-nativeaot-outerloop | 265 | | +| runtime-diagnostics | 309 | | +| runtime-interpreter | 316 | ADO name differs from display name | +| runtime-libraries-interpreter | 330 | ADO name differs from display name | + +If a pipeline has no completed build in the last 7 days, skip it silently. + +## Skills to consult per failure + +Read the relevant skill before classifying / fixing. Skills live under `.github/skills/`. + +- **Mobile (`ios`, `tvos`, `maccatalyst`, `android`, `iossimulator`, `tvossimulator`)** → `mobile-platforms/SKILL.md`. Pipeline layout, platform helpers, code-path map. +- **JIT / GC / PGO stress** (definitions 109–160, 230, 235; `runtime-jit-experimental`) → `jit-regression-test/SKILL.md` for repro extraction; `ci-pipeline-monitor/SKILL.md` for triage and failure-shape recognition. JIT product fixes are out of scope for autofix — file an issue and `@`-mention the JIT area owners. +- **Browser/WASM, WASI** (extra-platforms) → consult `mobile-platforms/SKILL.md` (the WASM/WASI sections) for build-time conditional patterns; `extensions-review/SKILL.md` if the failure is in `Microsoft.Extensions.*` tests; `system-net-review/SKILL.md` if the failure is in `System.Net.*` tests. +- **NativeAOT outer loop** → check `eng/testing/tests.*aot*.targets` and the test `.csproj` for AOT-specific conditions before suggesting a fix. +- **Generic CI triage** → `ci-pipeline-monitor/SKILL.md` for known-failure-shape patterns and Build Analysis matching. + +## Outcome (per actionable failure) + +The primary purpose of this workflow is to keep PR CI green. **KBE** = Known Build Error: an issue tagged `Known Build Error` whose body contains a JSON `ErrorMessage`/`ErrorPattern` block that Arcade Build Analysis matches against future failure logs to mark them as already-tracked, so unrelated PRs aren't blocked. KBEs are immediately effective for PR CI; muting PRs are not effective until merged by a human (latency ≥ 12h, often days). The workflow runs every 12h and converges on **two artifacts per failure across two runs**: KBE in run N (immediate), muting PR in run N+1 (permanent after merge), with a small-fix PR added in run N+1 when scope allows. + +### Per-failure deliverables + +For each actionable failure, produce **up to three artifacts**: + +1. **KBE** — immediate Build Analysis signal so PR CI is unblocked right away. Always produced (or reused if one already exists) for stable-signature failures. +2. **Muting PR** — small, clean, mergeable PR that just adds `[ActiveIssue(...)]` / `` referencing the KBE. No diagnosis logic, no product code. Designed to be merge-without-thinking by any maintainer who agrees the failure should be silenced. Always produced when (1) is produced. +3. **Fix PR** — actual product/test code fix. Produced **only when** (a) the root cause is clear from the failure log, (b) the change fits the "small product fix opportunity" bounds (≤ 20 lines, single file, non-API, non-JIT-codegen, non-GC, non-threading, non-security), and (c) the failing test verifies the fix. Otherwise the deeper investigation is left to the area owner via the KBE — do NOT attempt a speculative fix PR. + +The muting PR and the fix PR are independent: a maintainer can merge the muting PR immediately (CI goes green) and then iterate on the fix PR at human pace. If the fix PR lands first, the muting PR becomes a no-op and can be closed; if the muting PR lands first, the fix PR removes the `[ActiveIssue]` annotation. + +### Two-pass KBE → PR flow (across runs) + +Same-run KBE + PR is not possible: gh-aw strict mode forbids `issues: write` on the agent job, so the agent cannot create issues at runtime — it can only emit safe-outputs `create_issue` directives that are processed by a separate post-agent job after the agent finishes. Issue numbers are therefore never visible to the agent during execution. Patches cannot reference an issue number that doesn't exist yet. + +The agent must accept this constraint and produce KBEs in run N, then companion PRs in run N+1. The 12-hour cadence makes this acceptable: the KBE alone unblocks PR CI immediately (the moment the safe-outputs job processes it, ~1 min after the agent finishes), and the muting PR follows within 12h. + +For each actionable failure, in this order: + +1. **Search for existing artifacts** before creating anything new: + - `search_issues` for an open KBE: `is:issue is:open label:"Known Build Error" in:body ""`. Try variations on the signature (full `[FAIL]` line, assertion text, exception type + test name). + - `search_pull_requests` for an open muting PR that already silences this test: `is:pr is:open in:title "" "[ci-scan]"` and `is:pr is:open "" ActiveIssue`. + - `search_pull_requests` for an open small-fix PR: `is:pr is:open in:title "" "[ci-scan]"`. + - If a KBE + muting PR already cover this failure, **skip** — record it in the coverage tally as `→ already-covered: KBE # + PR #` and move on. Do not duplicate. +2. **No existing KBE → file one via safe-outputs `create_issue`**. The only labels permitted on KBE issues are `Known Build Error` and `blocking-clean-ci` (see "Outputs: title and labels" below). Title prefix: `[ci-scan] `. Body: the KBE format described in "Known Build Error issue" below. The safe-outputs handler will create the issue ~1 minute after the agent finishes; the issue number is not available to the agent during this run. +3. **Existing KBE found AND failure still occurring AND no muting PR exists yet → open the muting PR via safe-outputs `create_pull_request`** with the existing KBE issue number hardcoded in the diff: `[ActiveIssue("https://github.com/dotnet/runtime/issues/", ...)]` for unit tests, `true` (with an inline `` comment) for stress-incompatible JIT csproj families. PR title prefix `[ci-scan] `; **the PR body MUST include a top-level "Linked KBE" line of the form `Linked KBE: #` so the link is unambiguous and machine-readable**, in addition to the prose "Linked KBE" section. This PR must change **only test annotations / csproj test-config flags** — no product code, no diagnosis, no logic. Aim for ≤ 5 lines of diff. +4. **(Optional, alongside step 3) Open a small-fix PR via safe-outputs `create_pull_request`** if the failure satisfies the "small product fix opportunity" criteria above. Separate PR, separate branch, separate diff. PR body must (a) cite the failing test as evidence, (b) explain the root cause, (c) state explicitly why the fix is safe, (d) include `Linked KBE: #` as a top-level line, and (e) note "If this lands before #, that PR can be closed". Do not bundle the fix into the muting PR — keep them separate so a maintainer can take one without the other. + +Caps: safe-outputs `create_issue` max 5/run, `create_pull_request` max 10/run. When a cap is hit, fall back to "skipped: cap reached" rather than silently dropping signatures — subsequent runs will pick them up. + +After every run, you should be able to answer YES to **whichever of these applies to each failure**: + +- **First-encounter failure (no existing KBE):** "Did I file the KBE?" Muting/fix PRs are deferred to the next run — they cannot reference an issue number that doesn't exist yet at agent runtime. +- **Existing KBE, no muting PR yet:** "Did I open the muting PR (and, if criteria met, the small-fix PR)?" +- **Existing KBE + existing muting PR:** "Did I confirm both, skip silently, and record `→ already-covered: KBE # + PR #` in the coverage tally?" + +If the answer is NO for any failure, you have not done the job. + +### Per-failure-class rules + +The two-pass flow above applies to all classes below. "KBE + muting PR" means: KBE in the run that first encounters the failure, muting PR in the next run that finds the KBE already exists. + +- **Recurring failure with a stable error signature** (≥ 2 occurrences on `main` in the scanned window) → KBE (run N) + muting PR (run N+1) + fix PR (optional, run N+1, only if criteria met). +- **Per-test platform / configuration incompatibility** (e.g., test fails only under `jitstress=2`, `gcstress=0xC`, on a single mobile arch, on browser, on NativeAOT) → KBE (run N) + muting PR (run N+1). Allowed muting PR mechanisms: + - `[SkipOnPlatform(TestPlatforms., "")]` for platform-specific failures. + - `[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.))]` narrowed via existing helpers. + - `[ActiveIssue("https://github.com/dotnet/runtime/issues/", TestPlatforms.)]` referencing the KBE. + - For JIT/GC stress: `[ActiveIssue("...", typeof(TestLibrary.PlatformDetection), nameof(TestLibrary.PlatformDetection.IsStressTest))]` or `true` at the csproj level. **Tradeoff**: stress-guarded skips remove the test signal from the stress pipelines, so the bug becomes invisible in those pipelines until the JIT fix lands. The KBE filed in run N is what keeps the JIT team aware; without that KBE, the muting PR alone would silently lose the signal. +- **Build break on a single leg** (`Build product` or similar failed; `Send to Helix` skipped) → if the compile error has a clear, mechanical root cause and the fix is **≤ 20 lines in a single file** (e.g., obvious typo, missing `#if`, wrong type cast, missing `using`), open a fix PR (no KBE — Build Analysis explicitly forbids KBEs for build breaks). If the fix is non-trivial, file a regular tracking issue and reference the failing source file and compile error. +- **Anything else** — multi-assembly cluster, infrastructure (queue exhaustion / dead-letter / device-lost) — file a tracking issue (not a KBE). Group all infra failures from one run into a single issue. Before filing, `search_issues` for an open issue whose title or body matches the same failure signature and skip silently if one already exists (do not duplicate, do not append a comment — the agent only has read permission on existing issues). + +For each failure compute a `(definition_id, work_item_or_phase, queue, stress_mode, [FAIL] or compile-error signature)` signature. Look back through ~10 completed builds in the same definition to build first-seen-in-window timestamp and occurrence count. + +**Convergence target**: across two consecutive runs, every actionable test/runtime failure ends up with both (a) a KBE filed (immediate effect on PR CI via Build Analysis) and (b) a clean muting PR open against that KBE (permanent effect after merge, low review cost). The fix PR is a bonus when the root cause is obviously small. A tracking-issue-only outcome is acceptable only for build breaks (which Build Analysis cannot match) and infra failures. + +Do not emit `noop`. Either a PR or an issue must come out of every actionable failure. + +Cap: **10 PRs and 5 issues per run.** Group failures that share one fix into a single PR. Group failures with the same root cause into a single issue. + +## Data sources + +- AzDO REST: `https://dev.azure.com/dnceng-public/public/_apis/build/...`. Anonymous access only — do **not** call `_apis/test/...` or `vstmr.dev.azure.com`; both redirect to sign-in. Stay on `builds`, `builds/{id}/timeline`, `builds/{id}/logs/{logId}`. + - List builds: `?definitions={id}&branchName=refs/heads/main&statusFilter=completed&resultFilter=succeeded,failed,partiallySucceeded&%24top=20&api-version=7.1`. + - Timeline: `/builds/{id}/timeline?api-version=7.1` returns a flat `records[]` array; reconstruct the tree via `parentId`. + - Failed-leaf rule: a record with `result == "failed"` whose log id is non-null is a leaf to inspect; failed Stage/Phase records without a failed child Job indicate a build break — open the parent Phase log and the most recent non-succeeded Task log. +- Helix REST: `https://helix.dot.net/api/jobs/{jobId}/workitems?api-version=2019-06-17`. Helix job IDs come from the `Send to Helix` Task log, which is a child of the failed Job. Each work item has `Name`, `State`, `ExitCode`, `ConsoleOutputUri`. Failed: `ExitCode != 0` or `State == "Failed"`. Console URIs containing `helix-workitem-deadletter` are dead-lettered (queue had no agent) — group as infra. +- Build Analysis attachment (best-effort, may 404): `https://dev.azure.com/dnceng-public/public/_apis/build/builds/{id}/attachments/Build_Analysis_KnownIssues_v1?api-version=7.1`. Use to dedupe against already-known issues. A 404 means none were attached; do not fail. + +## Failure classification + +Classify every failed timeline record before deciding whether to PR or file an issue. The timeline graph is `Stage → Phase → Job → Task`. Walk it as follows: + +1. List every record with `result == "failed"`. For each failed Job, list its child Tasks (records whose `parentId == job.id`). +2. **Build break (no test ever ran)**: among the Job's Tasks, the failed Task is `Build product`, `Build native components`, `Configure CMake`, or any pre-test compile step, **and** the `Send to Helix` Task is `skipped`. → tracking issue. Do **not** attempt a test-side fix. +3. **Phase/Stage-only failure with no failed Job underneath**: typical of compile-time breaks aggregated at the phase level (e.g. `windows-arm64 checked` on the JIT stress pipelines). Open the Phase log and the latest log of any non-succeeded child Task; classify as build break and file a tracking issue. +4. **Send to Helix succeeded but the Job still failed**: open the `Send to Helix` log, extract Helix job IDs (look for `Job on ` or `JobId: `; the Helix info-mart log entry that always appears is `Sent Helix Job: `), then query Helix for failed work items. This is the test-failure path. +5. **Helix work item failure**: confirm via `ConsoleOutputUri`. `helix-workitem-deadletter` URIs → infra (group into one issue). Otherwise fetch the console log, find the `[FAIL]` line, and proceed to PR vs issue selection. +6. **Infra-shaped Job failure** without Helix workitems (e.g., `Initialize job` failed, agent disconnect, "Pool is offline") → file a single grouped infra issue, do not retry per-leg. + +Drill into one representative console log per signature to confirm the shape before classifying. + +## PR body + +Five H2 sections, in this exact order: + +1. **Reasoning** — why the test fails on the affected platform/configuration; why the chosen attribute is the right fix; why this is a test-side fix and not a product bug. +2. **Impact on platforms** — bullet list of `(pipeline + platform/arch + Helix queue + stress mode + exit code)` per affected occurrence. +3. **Errors log** — sanitized excerpt from the Helix console log (the `[FAIL]` line, the assertion or exception, and the `Failed tests:` summary). Strip JWTs, bearer tokens, `ApplicationGatewayAffinity*=`, and per-user paths. +4. **First build it occurred** — first build in the scanned window where this signature appeared: build link, finish time, commit SHA, occurrences-in-window count. State explicitly that this is computed within the scanned window and may not be the true origin. +5. **Linked issue** (optional) — if an `ActiveIssue` reference is used, link the issue. + +Branch from `origin/main`. Stage only the files you intend to change with `git add `; never `git add -A`. Verify with `git diff --name-only --cached` before committing. Do not include any labels in the PR (see "Outputs: title and labels" below). + +## Issue body + +Use this when a PR is not the right tool — product regression, native crash, multi-assembly cluster, infra requiring an owner, JIT/GC product bug. Same four sections as a PR (Reasoning, Impact on platforms, Errors log, First build it occurred), plus a fifth: + +5. **Recommended action** — concrete next step: which area owner, which file likely needs the fix, or what investigation would localize the root cause. For JIT/GC issues include the exact stress mode env vars and the JIT method-name from the log. Reference any related PR or issue you found via `search_issues`. The issue must be actionable — a checkbox-ready task list, not just "FYI". + +Do not include any labels in the issue creation request (see "Outputs: title and labels" below). + +### JIT pipeline issue template (definitions 109–160, 230, 235, 108, 137, 144–145, 150, 153) + +For tracking issues filed against a JIT, GC, PGO, or stress pipeline, use this body layout instead of the generic "five sections" above (matches the in-repo convention; see #125685 for the canonical example): + +``` +**Summary:** + + +**Failed in ():** +- [ ]() +- [ ]() +- ... + +**Console Log:** [Console Log]() + +**Failed tests:** +(use a fenced code block; per-pipeline, list the failing legs and tests) + +- + - + - + +- + - + +**Error Message:** +(fenced code block with the canonical error line) + +**Stack Trace:** +(fenced code block with the relevant stack trace; trim noise but keep the failing frame) +``` + +This format makes the issue immediately actionable for JIT/GC owners (@JulieLeeMSFT, @BruceForstall, @jakobbotsch, @dotnet/jit-contrib) without further drilldown. Area triage (`area-CodeGen-coreclr` / `area-GC-coreclr` / `area-PGO-coreclr` / `area-Tools-ILVerification`) is added later by a human reviewer — do not propose any `area-*` label yourself. + +## Outputs: title and labels + +- **All issues and PRs MUST have title prefix `[ci-scan] `**, including tracking issues, Known Build Error issues, and muting PRs. Examples: + - `[ci-scan] Test failure: on ` + - `[ci-scan] Known Build Error: ` + - `[ci-scan] Skip under (refs #)` +- **Do not use the word "Mute" or "Muting"** in titles. Use "Skip", "Disable", "Suppress", or "Exclude" depending on the mechanism. Examples: "Skip … under GCStress", "Disable … on tvOS", "Suppress … in MiniFull AOT mode". +- **Labels (hard restriction).** You **MUST NOT** propose any labels in your output. The workflow auto-applies `agentic-workflows` to every issue and PR, and additionally permits **only** `Known Build Error` and `blocking-clean-ci` on Known Build Error issues. Any other label — `os-*`, `area-*`, `arch-*`, `disabled-test`, `jit-stress`, `gc-stress`, `pgo`, `nativeaot`, `untriaged`, etc. — is rejected by `safe-outputs.allowed-labels` and **will be dropped**. Do not invent new labels under any name. Area, OS, and arch triage is performed by a human reviewer after the issue/PR is filed; do not attempt to pre-apply or guess them. + +## Known Build Error issue + +A Known Build Error is a tracking issue that Arcade Build Analysis (https://github.com/dotnet/arcade/blob/main/Documentation/Projects/Build%20Analysis/KnownIssueJsonStepByStep.md) automatically matches against future failures so PRs aren't blocked by an already-tracked flake. + +File one when **all** of the following hold: +- The failure has occurred ≥ 2 times in the scanned window on `main`. +- The error has a stable substring or regex signature that uniquely identifies it. +- No fix PR is currently open (verify via `search_pull_requests`). +- The failure is **not** a build break or an infrastructure failure — only test failures or hangs are eligible for a KBE. Build breaks and infra failures (for example dead-letter, device-lost, or agent-disconnect issues) must use a regular tracking issue. + +Required structure (Build Analysis is strict — match the headings exactly, and use **exactly three backticks** for the JSON code fence; never four. The opening and closing fence must be the same length, otherwise the fence is broken and Build Analysis silently skips the issue): + +``` +## Build Information +Build: +Build error leg or test failing: - +Pull request: + +## Error Message + + + +(open three backticks, then `json` on the same line) +{ + "ErrorMessage": "", + "ErrorPattern": "", + "BuildRetry": false, + "ExcludeConsoleLog": false +} +(close three backticks) +``` + +The pseudo-instructions `(open three backticks, then ...)` and `(close three backticks)` above are **placeholders** in this prompt because nesting fenced code blocks in the prompt itself is fragile; in the actual issue body emit literal ```` ``` `` (three backticks) on each side of the JSON object. Verify the open and close fences both consist of exactly three backticks before submitting. If you are uncertain, count them. + +Choose `ErrorMessage` (substring) by default. Use `ErrorPattern` only when a regex is genuinely needed and confirm it has no catastrophic backtracking. Set `BuildRetry: true` **only** for confirmed infra/queue-side flakes (dead-letter, device-lost, agent disconnect) where retrying is safe. + +### Signature specificity (mandatory) + +The `ErrorMessage` / `ErrorPattern` MUST uniquely identify **this specific failure mode**, not an entire category of crashes or build errors. A signature that would match unrelated future regressions is wrong and will mute legitimate failures. + +**Reject** signatures that consist only of: + +- A bare exit code or signal: `exitcode: 139`, `exit code 1`, `Segmentation fault`, `Aborted`, `SIGSEGV`, `SIGABRT`. +- A generic tool name + failure verb: `Crossgen2 failed`, `ilasm failed`, `dotnet build failed`, `xharness exited`. +- A bare exception type with no message: `BadImageFormatException`, `NullReferenceException`, `Fatal error. Invalid Program`, `Assertion failed`. +- A bare `[FAIL]` line with only the test class name and no exception/assertion text. +- Common infra strings: `Connection reset`, `Operation timed out`, `Resource temporarily unavailable`, `No space left on device`. + +**Prefer** signatures built from the most specific stable token in the log. In order of preference: + +1. The exact assertion text or exception **message** (not just the type), e.g. `Assertion failed 'comp->compHndBBtabCount == 0' in 'X' during 'Y'`. +2. The fully-qualified failing test name combined with a specific exception message, e.g. `System.Text.Json.Tests.Utf8JsonReaderTests.TestFoo … System.InvalidOperationException: Cannot read value of type X`. +3. A unique native stack frame or symbol from the crash dump excerpt, e.g. `coreclr!Compiler::fgMorphCall + 0x`. +4. A specific JIT method-being-compiled marker plus the specific stress mode, when the crash is JIT/GC stress only. + +**Combining signature parts** — a JSON array in `ErrorMessage` is AND-matched (all substrings must be present in the failure log). Do not pad an array with generic tokens like `exitcode: 139` or `Crash` alongside the specific message — those tokens add no specificity and only risk false negatives if the log format changes. Include at most one supplementary token, and only when it is itself non-generic (e.g. a specific assembly name or test name). + +If you cannot produce a signature that meets the bar above, **do not file a Known Build Error**. File a regular tracking issue instead and call out in "Recommended action" that the failure needs a stable signature before it can be muted. + +Title: `[ci-scan] Test failure: ` for test failures, or `[ci-scan] Known Build Error: ` for non-test build errors. The `[ci-scan] ` prefix is mandatory on every issue and PR this workflow files (see "Outputs: title and labels" above). + +Labels: only `Known Build Error` and `blocking-clean-ci` are permitted on Known Build Error issues. Do not include any other label (no `area-*`, `os-*`, `arch-*`, etc.) — they will be rejected by `safe-outputs.allowed-labels`. Area and platform triage is added later by a human reviewer. + +Before filing, search for an existing Known Build Error issue with a matching `ErrorMessage` (`label:"Known Build Error" in:body ""`). If one exists and is open, **skip silently — do not duplicate, do not append a comment**. Build Analysis already counts the new occurrence in its hit-count summary on the issue body; piling on issue comments per occurrence creates noise on already-noisy KBEs (some have tens of hits per run). If `search_issues` returns no matches, proceed to file the new KBE. + +## Hard environment constraints + +These look like permission errors but are physical: + +- **Pre-bind every URL to a shell variable on a line of its own, then `curl -s "$url"`.** Inline URLs with `?` or `&` are rejected as "Permission denied and could not request permission from user" even when single-quoted, because the Copilot CLI tool-approver treats query strings as interactive prompts. The only working pattern is: + ```bash + url='https://dev.azure.com/dnceng-public/public/_apis/build/builds?definitions=154&branchName=refs/heads/main&statusFilter=completed&resultFilter=succeeded,failed,partiallySucceeded&%24top=25&api-version=7.1' + curl -s "$url" | jq '.' | tee /tmp/gh-aw/agent/builds.json | jq -r '.value[0] | "\(.id) \(.result)"' + ``` + Do **not** retry an inline URL hoping the rejection will clear — it won't. Switch to the variable pattern immediately. +- `>` and `-o` redirection at the agent's command line is blocked. Use `| tee /path/to/file`. +- `$(...)` and `${var@P}` are blocked at the command line. Compose values via `xargs -I{}` or by reading files inline. +- OData `$top` must be encoded as `%24top` in URLs. +- Bash allowlist: `dotnet`, `git`, `find`, `ls`, `cat`, `grep`, `head`, `tail`, `wc`, `curl`, `jq`, `tee`, `sed`, `awk`, `tr`, `cut`, `sort`, `uniq`, `xargs`, `echo`, `date`, `mkdir`, `test`, `env`, `basename`, `dirname`, `bash`, `sh`, `chmod`. No `gh`, no `pwsh`, no `python`. Each call runs in a fresh subshell — persist intermediate state to files under `/tmp/gh-aw/agent/`. + +## Coverage discipline (avoid arbitrary selection) + +Failure selection must be **systematic, not opportunistic**. Process pipelines in the order listed in the "Pipelines to scan" table. For each pipeline: + +1. List every failed signature in the latest scanned build (sorted by occurrence count in the window, descending). +2. For each signature, decide and record one of: `→ filed-issue #aw_`, `→ filed-PR #aw_`, `→ existing-issue #`, `→ existing-PR #`, `→ skipped: `. A skipped signature MUST have a reason (e.g., "build canceled, not a test failure", "less than 2 occurrences and not blocking", "owned by area-Infrastructure rota and already triaged"). +3. Keep a per-pipeline tally on disk under `/tmp/gh-aw/agent/coverage/.txt`. At the end, print a summary table to the agent log: `pipeline | total-signatures | issues-filed | prs-filed | reused-existing | skipped-with-reason`. + +Caps still apply (10 PRs / 5 issues / run); when the cap is hit, fall back to "skipped: cap reached" rather than dropping signatures silently. Subsequent runs will pick them up. + +Do not jump between pipelines mid-investigation. Finish all classifications for pipeline N before moving to pipeline N+1. + +## Submit + +Search existing issues and PRs (`search_issues`, `search_pull_requests`) before creating anything new — never duplicate. Cross-check against issues filed by the existing JIT failure-tracking bot (e.g. open issues authored by `JulieLeeMSFT` for JIT pipelines) and reference rather than re-file them. When using `search_pull_requests`, filter to `is:merged OR review:approved` so the integrity filter does not silently drop low-trust results. If an issue already tracks the failure, **prefer opening a PR that references it via `[ActiveIssue("https://github.com/dotnet/runtime/issues/")]`** rather than filing another issue. If `search_issues` returns no matches, proceed to file the issue. diff --git a/.github/workflows/mobile-scan.md b/.github/workflows/mobile-scan.md deleted file mode 100644 index 3598c13b5a636e..00000000000000 --- a/.github/workflows/mobile-scan.md +++ /dev/null @@ -1,160 +0,0 @@ ---- -name: "Mobile Platform Failure Scanner" -description: "Daily scan of the runtime-extra-platforms pipeline for Apple mobile and Android failures. Fixes per-test failures via PR; files an actionable tracking issue otherwise." - -permissions: - contents: read - issues: read - pull-requests: read - -on: - schedule: daily - workflow_dispatch: - roles: [admin, maintainer, write] - -# ############################################################### -# Override the COPILOT_GITHUB_TOKEN secret usage for the workflow -# with a randomly-selected token from a pool of secrets. -# -# As soon as organization-level billing is offered for Agentic -# Workflows, this stop-gap approach will be removed. -# -# See: /.github/actions/select-copilot-pat/README.md -# ############################################################### - - # Add the pre-activation step of selecting a random PAT from the supplied secrets - steps: - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - name: Checkout the select-copilot-pat action folder - with: - persist-credentials: false - sparse-checkout: .github/actions/select-copilot-pat - sparse-checkout-cone-mode: true - fetch-depth: 1 - - - id: select-copilot-pat - name: Select Copilot token from pool - uses: ./.github/actions/select-copilot-pat - env: - SECRET_0: ${{ secrets.COPILOT_PAT_0 }} - SECRET_1: ${{ secrets.COPILOT_PAT_1 }} - SECRET_2: ${{ secrets.COPILOT_PAT_2 }} - SECRET_3: ${{ secrets.COPILOT_PAT_3 }} - SECRET_4: ${{ secrets.COPILOT_PAT_4 }} - SECRET_5: ${{ secrets.COPILOT_PAT_5 }} - SECRET_6: ${{ secrets.COPILOT_PAT_6 }} - SECRET_7: ${{ secrets.COPILOT_PAT_7 }} - SECRET_8: ${{ secrets.COPILOT_PAT_8 }} - SECRET_9: ${{ secrets.COPILOT_PAT_9 }} - -# Add the pre-activation output of the randomly selected PAT -jobs: - pre-activation: - outputs: - copilot_pat_number: ${{ steps.select-copilot-pat.outputs.copilot_pat_number }} - -# Override the COPILOT_GITHUB_TOKEN expression used in the activation job -# Consume the PAT number from the pre-activation step and select the corresponding secret -engine: - id: copilot - model: claude-sonnet-4.5 - env: - # We cannot use line breaks in this expression as it leads to a syntax error in the compiled workflow - # If none of the `COPILOT_PAT_#` secrets were selected, then the default COPILOT_GITHUB_TOKEN is used - COPILOT_GITHUB_TOKEN: ${{ case(needs.pre_activation.outputs.copilot_pat_number == '0', secrets.COPILOT_PAT_0, needs.pre_activation.outputs.copilot_pat_number == '1', secrets.COPILOT_PAT_1, needs.pre_activation.outputs.copilot_pat_number == '2', secrets.COPILOT_PAT_2, needs.pre_activation.outputs.copilot_pat_number == '3', secrets.COPILOT_PAT_3, needs.pre_activation.outputs.copilot_pat_number == '4', secrets.COPILOT_PAT_4, needs.pre_activation.outputs.copilot_pat_number == '5', secrets.COPILOT_PAT_5, needs.pre_activation.outputs.copilot_pat_number == '6', secrets.COPILOT_PAT_6, needs.pre_activation.outputs.copilot_pat_number == '7', secrets.COPILOT_PAT_7, needs.pre_activation.outputs.copilot_pat_number == '8', secrets.COPILOT_PAT_8, needs.pre_activation.outputs.copilot_pat_number == '9', secrets.COPILOT_PAT_9, secrets.COPILOT_GITHUB_TOKEN) }} - -concurrency: - group: "mobile-scan" - cancel-in-progress: true - -tools: - github: - toolsets: [pull_requests, repos, issues, search] - min-integrity: approved - edit: - bash: ["dotnet", "git", "find", "ls", "cat", "grep", "head", "tail", "wc", "curl", "jq", "tee", "sed", "awk", "tr", "cut", "sort", "uniq", "xargs", "echo", "date", "mkdir", "test", "env", "basename", "dirname", "bash", "sh", "chmod"] - -checkout: - fetch-depth: 50 - -safe-outputs: - create-pull-request: - title-prefix: "[mobile] " - draft: true - max: 5 - protected-files: blocked - allowed-files: - - "src/libraries/**/tests/**" - - "src/libraries/Common/tests/**" - labels: [agentic-workflows] - create-issue: - max: 3 - labels: [agentic-workflows] - -timeout-minutes: 60 - -network: - allowed: - - defaults - - github - - dev.azure.com - - helix.dot.net - - "*.blob.core.windows.net" ---- - -# Mobile Platform Failure Scanner - -Scan the latest completed build of the `runtime-extra-platforms` pipeline (AzDO definition `154`, org `dnceng-public`, project `public`, branch `main`) for Apple mobile and Android failures. Every actionable failure becomes either a draft PR (per-test fix) or a tracking issue (everything else). Read `.github/skills/mobile-platforms/SKILL.md` first for the pipeline layout, platform helpers, and code-path map. - -## Outcome - -For each failed mobile work item in the latest completed build: - -- **Per-test platform incompatibility** → open a draft PR. Use a per-test attribute change: `[SkipOnPlatform(...)]`, a narrowed `[ConditionalFact]` predicate built from existing `PlatformDetection.*` helpers, or `[ActiveIssue("https://github.com/dotnet/runtime/issues/", TestPlatforms.)]` referencing an **existing** issue. Touch only files matching the `allowed-files` policy (`src/libraries/**/tests/**`, including test `.csproj`). -- **Anything else** — product regression, native crash, multi-assembly cluster, infrastructure (including queue exhaustion / dead-letter / device-lost) — file a tracking issue. The issue is the deliverable; do not paper over a product bug with `SkipOnPlatform`. Group all dead-letter / queue exhaustion / device-lost failures from one run into a single infrastructure issue. Before filing, `search_issues` for an open issue with the matching `area-Infrastructure` + `os-*` label and update its description in place rather than creating a duplicate. - -Do not emit `noop`. Either a PR or an issue must come out of every actionable failure. - -Cap: **5 PRs and 3 issues per run.** Group failures that share one fix into a single PR. Group failures with the same root cause into a single issue. - -## Data sources - -- AzDO REST: `https://dev.azure.com/dnceng-public/public/_apis/build/...` — list completed builds (definition 154, branch main), get a build's timeline, download per-job AzDO logs. Mobile job names match the regex `(ios|tvos|maccatalyst|android)` (case-insensitive). -- Helix REST: `https://helix.dot.net/api/jobs/{jobId}/workitems?api-version=2019-06-17` — Helix job IDs appear in AzDO logs as `Job on `. Each work item has `Name`, `State`, `ExitCode`, `ConsoleOutputUri`. Failed: `ExitCode != 0` or `State == "Failed"`. Console URIs containing `helix-workitem-deadletter` are dead-lettered (queue had no agent) and are pure infra — drop them. - -Look back through roughly the last 20 completed builds to compute a "first seen in scanned window" timestamp and occurrence count per `(work_item, queue)` signature. - -Drill into one representative console log per signature to confirm the failure shape (`[FAIL]` markers, assertion text) before classifying. - -## PR body - -Four H2 sections, in this exact order: - -1. **Reasoning** — why the test fails on the affected mobile platforms; why the chosen attribute is the right fix. -2. **Impact on platforms** — bullet list of `(platform/arch + Helix queue + exit code)` per affected occurrence. -3. **Errors log** — sanitized excerpt from the Helix console log (the `[FAIL]` line, the assertion or exception, and the `Failed tests:` summary). Strip JWTs, bearer tokens, `ApplicationGatewayAffinity*=`, and per-user paths. -4. **First build it occurred** — first build (in the scanned window) where this signature appeared: build link, finish time, commit SHA, occurrences-in-window count. State explicitly that this is computed within the scanned window and may not be the true origin. - -Branch from `origin/main`. Stage only the files you intend to change with `git add `; never `git add -A`. Verify with `git diff --name-only --cached` before committing. Labels: one or more `os-*` (`os-android`, `os-ios`, `os-tvos`, `os-maccatalyst`) plus the test's `area-*` label. - -## Issue body - -Use this when a PR is not the right tool — product regression, native crash, multi-assembly cluster, infra requiring an owner. Same four sections as a PR (Reasoning, Impact on platforms, Errors log, First build it occurred), plus a fifth: - -5. **Recommended action** — concrete next step: which area owner, which file likely needs the fix, or what investigation would localize the root cause. Reference any related PR or issue you found via `search_issues`. The issue must be actionable — a checkbox-ready task list, not just "FYI". - -Same `os-*` and `area-*` labels. - -## Hard environment constraints - -These look like permission errors but are physical: - -- `curl` URLs containing `?` or `&` MUST be **single-quoted**. Double-quoted URLs trigger `Permission denied and could not request permission from user`. -- `>` and `-o` redirection at the agent's command line is blocked. Use `| tee /path/to/file`. -- `$(...)` and `${var@P}` are blocked at the command line. Compose values via `xargs -I{}` or by reading files inline. -- OData `$top` must be encoded as `%24top` in URLs. -- Bash allowlist: `dotnet`, `git`, `find`, `ls`, `cat`, `grep`, `head`, `tail`, `wc`, `curl`, `jq`, `tee`, `sed`, `awk`, `tr`, `cut`, `sort`, `uniq`, `xargs`, `echo`, `date`, `mkdir`, `test`, `env`, `basename`, `dirname`, `bash`, `sh`, `chmod`. No `gh`, no `pwsh`, no `python`. Each call runs in a fresh subshell — persist intermediate state to files under `/tmp/gh-aw/agent/` (just files; you do not need to author a helper script). - -## Submit - -Search existing issues and PRs (`search_issues`, `search_pull_requests`) before creating anything new — never duplicate. When using `search_pull_requests`, filter to `is:merged OR review:approved` so the integrity filter does not silently drop low-trust results. If an issue already tracks the failure, **prefer opening a PR that references it via `[ActiveIssue("https://github.com/dotnet/runtime/issues/")]`** rather than filing another issue. If `search_issues` returns no matches, proceed to file the issue. From fdfe877cb3624924295490d484c33b05d6c78170 Mon Sep 17 00:00:00 2001 From: Max Charlamb <44248479+max-charlamb@users.noreply.github.com> Date: Wed, 6 May 2026 15:21:50 -0400 Subject: [PATCH 024/109] [cDAC] Switch runtime-diagnostics SOS test filter to -method for wildcard support (#127878) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit > [!NOTE] > This PR was created with the assistance of GitHub Copilot (AI-generated content). ## Problem [dotnet/diagnostics PR #5821](https://github.com/dotnet/diagnostics/pull/5821) split the single ``SOS`` test class into 11 ``SOS``-prefixed classes (``SOSStackTraceTests``, ``SOSExceptionTests``, ``SOSGCTests``, ``SOSDumpTests``, etc.) to enable parallelism. The existing ``classFilter: SOS`` in ``runtime-diagnostics.yml`` no longer matches any class, so the cDAC, cDAC_no_fallback, and DAC test legs are now silently running **zero** tests. A naïve fix to ``classFilter: SOS*`` does not work either: xunit v2's ``-class`` filter is a ``HashSet`` with exact-match ``Contains()`` only; it has no wildcard support. I verified this by directly invoking ``XunitFilters.Filter()`` against ``xunit.runner.utility`` 2.9.2: | Filter | Matches ``SOSStackTraceTests.TestMethod1`` | |--------|--------------------------------------------| | ``-class SOS*`` | ❌ No (literal HashSet contains) | | **``-method SOS*``** | ✅ **Yes** | | Multiple ``-class`` entries | ✅ Yes (would require enumerating all 11) | ## Fix xunit v2's ``-method`` filter is regex-based and operates on the fully qualified ``ClassName.MethodName``, so ``SOS*`` matches every method on any SOS-prefixed class. This PR: 1. Adds a ``methodFilter`` parameter to ``eng/pipelines/diagnostics/runtime-diag-job.yml`` (parallel to the existing ``classFilter``), wiring it through to the diagnostics ``build.ps1``'s already-supported ``-methodfilter`` argument. 2. Switches the three SOS test legs in ``eng/pipelines/runtime-diagnostics.yml`` (cDAC, cDAC_no_fallback, DAC) to ``methodFilter: SOS*``. The existing ``classFilter`` parameter is left in place for any other consumer that needs exact-match class filtering. Co-authored-by: Max Charlamb Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- eng/pipelines/diagnostics/runtime-diag-job.yml | 6 ++++++ eng/pipelines/runtime-diagnostics.yml | 6 +++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/eng/pipelines/diagnostics/runtime-diag-job.yml b/eng/pipelines/diagnostics/runtime-diag-job.yml index 99b663d3dc9048..8f93002ff2f972 100644 --- a/eng/pipelines/diagnostics/runtime-diag-job.yml +++ b/eng/pipelines/diagnostics/runtime-diag-job.yml @@ -40,6 +40,7 @@ parameters: useCdac: false noFallback: false classFilter: '' + methodFilter: '' jobs: - template: /eng/common/${{ parameters.templatePath }}/job/job.yml @@ -92,6 +93,7 @@ jobs: - _CdacArgs: '' - _NoFallbackArgs: '' - _ClassFilterArgs: '' + - _MethodFilterArgs: '' - _buildScript: $(Build.SourcesDirectory)$(dir)build$(scriptExt) @@ -113,6 +115,9 @@ jobs: - ${{ if ne(parameters.classFilter, '') }}: - _ClassFilterArgs: '-classfilter ${{ parameters.classFilter }}' + - ${{ if ne(parameters.methodFilter, '') }}: + - _MethodFilterArgs: '-methodfilter ${{ parameters.methodFilter }}' + # For testing msrc's and service releases. The RuntimeSourceVersion is either "default" or the service release version to test - _InternalInstallArgs: '' - ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest'), eq(parameters.isCodeQLRun, 'false')) }}: @@ -212,6 +217,7 @@ jobs: $(_Cross) $(_InternalInstallArgs) $(_ClassFilterArgs) + $(_MethodFilterArgs) /p:OfficialBuildId=$(BUILD.BUILDNUMBER) ${{ if eq(parameters.testOnly, 'true') }}: displayName: Test diff --git a/eng/pipelines/runtime-diagnostics.yml b/eng/pipelines/runtime-diagnostics.yml index 3c47d4522dfa92..cd7b5a81f1f527 100644 --- a/eng/pipelines/runtime-diagnostics.yml +++ b/eng/pipelines/runtime-diagnostics.yml @@ -101,7 +101,7 @@ extends: jobParameters: name: cDAC useCdac: true - classFilter: SOS + methodFilter: SOS* isOfficialBuild: ${{ variables.isOfficialBuild }} liveRuntimeDir: $(Build.SourcesDirectory)/artifacts/runtime timeoutInMinutes: 360 @@ -155,7 +155,7 @@ extends: name: cDAC_no_fallback useCdac: true noFallback: true - classFilter: SOS + methodFilter: SOS* isOfficialBuild: ${{ variables.isOfficialBuild }} liveRuntimeDir: $(Build.SourcesDirectory)/artifacts/runtime timeoutInMinutes: 360 @@ -208,7 +208,7 @@ extends: jobParameters: name: DAC useCdac: false - classFilter: SOS + methodFilter: SOS* isOfficialBuild: ${{ variables.isOfficialBuild }} liveRuntimeDir: $(Build.SourcesDirectory)/artifacts/runtime timeoutInMinutes: 360 From a0694cddb47123d9c97335d5b22f445c2724d2e7 Mon Sep 17 00:00:00 2001 From: Linus Schwartz Hamlin <78953007+lilinus@users.noreply.github.com> Date: Wed, 6 May 2026 21:34:29 +0200 Subject: [PATCH 025/109] Fix TensorPrimitives.IndexOfMax (#127454) Fixes #124233 Fixes #127610 Tried to include feedback from https://github.com/dotnet/runtime/pull/124274#issuecomment-3885663457. Summary of changes: - Change interface `IIndexOfOperator` to specialized `IIndexOfMinMaxOperator`, where there are `Compare` methods that returns masks of results/indices. - `IndexOfMinMaxCore` delegates to ten different methods: - `IndexOfMinMaxVectorized128/256/512Size4Plus` when `sizeof(T)` is 4 or 8. The result index fits in one vector. - `IndexOfMinMaxVectorized128/256/512Size2` when `sizeof(T)` is 2. The result index fits in two vectors. - `IndexOfMinMaxVectorized128/256/512Size1` when `sizeof(T)` is 1. The result index fits in four vectors. - `IndexOfMinMaxFallback` as fallback. - For vector methods: the final aggregation is done by horizontal-aggregation values in the lanes. Then the corresponding index found by matching that value bitwise. - The search is done left-to-right so there is no need for the `IndexLessThan` methods - Reintroduces some commented out TODO unit tests related to `IndexOf` methods --- .../src/System.Numerics.Tensors.csproj | 2 +- ...TensorPrimitives.IIndexOfMinMaxOperator.cs | 778 ++++++++++++++++++ .../TensorPrimitives.IIndexOfOperator.cs | 132 --- .../netcore/TensorPrimitives.IndexOfMax.cs | 405 +-------- .../TensorPrimitives.IndexOfMaxMagnitude.cs | 145 ++-- .../netcore/TensorPrimitives.IndexOfMin.cs | 108 +-- .../TensorPrimitives.IndexOfMinMagnitude.cs | 145 ++-- .../System.Numerics.Tensors/tests/Helpers.cs | 3 + .../tests/TensorPrimitives.Generic.cs | 32 + .../tests/TensorPrimitivesTests.cs | 77 +- 10 files changed, 1078 insertions(+), 749 deletions(-) create mode 100644 src/libraries/System.Numerics.Tensors/src/System/Numerics/Tensors/netcore/Common/TensorPrimitives.IIndexOfMinMaxOperator.cs delete mode 100644 src/libraries/System.Numerics.Tensors/src/System/Numerics/Tensors/netcore/Common/TensorPrimitives.IIndexOfOperator.cs diff --git a/src/libraries/System.Numerics.Tensors/src/System.Numerics.Tensors.csproj b/src/libraries/System.Numerics.Tensors/src/System.Numerics.Tensors.csproj index 24fcfcbaf6225b..ca14c969a3494d 100644 --- a/src/libraries/System.Numerics.Tensors/src/System.Numerics.Tensors.csproj +++ b/src/libraries/System.Numerics.Tensors/src/System.Numerics.Tensors.csproj @@ -24,7 +24,7 @@ - + diff --git a/src/libraries/System.Numerics.Tensors/src/System/Numerics/Tensors/netcore/Common/TensorPrimitives.IIndexOfMinMaxOperator.cs b/src/libraries/System.Numerics.Tensors/src/System/Numerics/Tensors/netcore/Common/TensorPrimitives.IIndexOfMinMaxOperator.cs new file mode 100644 index 00000000000000..9887a65da80968 --- /dev/null +++ b/src/libraries/System.Numerics.Tensors/src/System/Numerics/Tensors/netcore/Common/TensorPrimitives.IIndexOfMinMaxOperator.cs @@ -0,0 +1,778 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Diagnostics; +using System.Runtime.CompilerServices; +using System.Runtime.Intrinsics; + +namespace System.Numerics.Tensors +{ + public static unsafe partial class TensorPrimitives + { + private interface IIndexOfMinMaxOperator + { + static abstract T Aggregate(Vector128 value); + static abstract T Aggregate(Vector256 value); + static abstract T Aggregate(Vector512 value); + static abstract bool Compare(T x, T y); + static abstract Vector128 Compare(Vector128 x, Vector128 y); + static abstract Vector256 Compare(Vector256 x, Vector256 y); + static abstract Vector512 Compare(Vector512 x, Vector512 y); + } + + private static int IndexOfMinMaxCore(ReadOnlySpan x) + where T : INumber where TOperator : struct, IIndexOfMinMaxOperator + { + if (x.IsEmpty) + { + return -1; + } + + if (Vector512.IsHardwareAccelerated && Vector512.IsSupported && x.Length >= Vector512.Count) + { + return sizeof(T) == 8 ? IndexOfMinMaxVectorized512Size4Plus(x) : + sizeof(T) == 4 ? IndexOfMinMaxVectorized512Size4Plus(x) : + sizeof(T) == 2 ? IndexOfMinMaxVectorized512Size2(x) : + IndexOfMinMaxVectorized512Size1(x); + } + + if (Vector256.IsHardwareAccelerated && Vector256.IsSupported && x.Length >= Vector256.Count) + { + return sizeof(T) == 8 ? IndexOfMinMaxVectorized256Size4Plus(x) : + sizeof(T) == 4 ? IndexOfMinMaxVectorized256Size4Plus(x) : + sizeof(T) == 2 ? IndexOfMinMaxVectorized256Size2(x) : + IndexOfMinMaxVectorized256Size1(x); + } + + if (Vector128.IsHardwareAccelerated && Vector128.IsSupported && x.Length >= Vector128.Count) + { + return sizeof(T) == 8 ? IndexOfMinMaxVectorized128Size4Plus(x) : + sizeof(T) == 4 ? IndexOfMinMaxVectorized128Size4Plus(x) : + sizeof(T) == 2 ? IndexOfMinMaxVectorized128Size2(x) : + IndexOfMinMaxVectorized128Size1(x); + } + + return IndexOfMinMaxFallback(x); + } + + private static int IndexOfMinMaxFallback(ReadOnlySpan x) + where T : INumber where TOperator : struct, IIndexOfMinMaxOperator + { + T result = x[0]; + int resultIndex = 0; + if (T.IsNaN(result)) + { + return resultIndex; + } + + for (int i = 1; i < x.Length; i++) + { + T current = x[i]; + if (T.IsNaN(current)) + { + return i; + } + if (TOperator.Compare(current, result)) + { + result = current; + resultIndex = i; + } + } + + return resultIndex; + } + + private static int IndexOfMinMaxVectorized128Size4Plus(ReadOnlySpan x) + where T : INumber where TOperator : struct, IIndexOfMinMaxOperator where TInt : IBinaryInteger + { + Debug.Assert(sizeof(T) == 4 || sizeof(T) == 8); + Debug.Assert(typeof(TInt) == typeof(uint) || typeof(TInt) == typeof(ulong)); + Debug.Assert(sizeof(TInt) == sizeof(T)); + + // Initialize result by reading first vector and quick return if possible. + Vector128 result = Vector128.Create(x); + if (typeof(T) == typeof(float) || typeof(T) == typeof(double)) + { + Vector128 nanMask = IsNaN(result); + if (nanMask != Vector128.Zero) + { + return IndexOfFirstMatch(nanMask); + } + } + + // Initialize indices. + Vector128 indexIncrement = Vector128.Create(TInt.CreateTruncating(Vector128.Count)); + Vector128 resultIndex = Vector128.Indices; + Vector128 currentIndex = resultIndex + indexIncrement; + ReadOnlySpan span = x.Slice(Vector128.Count); + + while (!span.IsEmpty) + { + Vector128 current; + if (span.Length >= Vector128.Count) + { + current = Vector128.Create(span); + span = span.Slice(Vector128.Count); + } + else + { + // Process a final back-shifted to cover remaining elements in x in one vector. + int start = x.Length - Vector128.Count; + current = Vector128.Create(x.Slice(start)); + currentIndex = Vector128.Create(TInt.CreateTruncating(start)) + Vector128.Indices; + span = ReadOnlySpan.Empty; + } + + // Quick return if possible. + if (typeof(T) == typeof(float) || typeof(T) == typeof(double)) + { + Vector128 nanMask = IsNaN(current); + if (nanMask != Vector128.Zero) + { + return int.CreateTruncating(currentIndex.ToScalar()) + IndexOfFirstMatch(nanMask); + } + } + + // Get mask for which lanes that should have result updated. + Vector128 mask = TOperator.Compare(current, result); + + // Update result and indices. + result = ElementWiseSelect(mask, current, result); + resultIndex = ElementWiseSelect(mask.As(), currentIndex, resultIndex); + currentIndex += indexIncrement; + } + + { + // Where result does not bitwise-equal the aggregate min/max value; replace indices with uint.MaxValue. Then find the min index. + T aggResult = TOperator.Aggregate(result); + Vector128 aggMask = ~Vector128.Equals(result.As(), Vector128.Create(aggResult).As()); + Vector128 aggIndex = resultIndex | aggMask; + return int.CreateTruncating(HorizontalAggregate>(aggIndex)); + } + } + + private static int IndexOfMinMaxVectorized128Size2(ReadOnlySpan x) + where T : INumber where TOperator : struct, IIndexOfMinMaxOperator + { + Debug.Assert(sizeof(T) == 2); + + // Initialize result by reading first vector and quick return if possible. + Vector128 result = Vector128.Create(x); + if (typeof(T) == typeof(float) || typeof(T) == typeof(double)) + { + Vector128 nanMask = IsNaN(result); + if (nanMask != Vector128.Zero) + { + return IndexOfFirstMatch(nanMask); + } + } + + // Initialize indices. + Vector128 indexIncrement = Vector128.Create((uint)Vector128.Count); + Vector128 resultIndex1 = Vector128.Indices; + Vector128 resultIndex2 = resultIndex1 + indexIncrement; + Vector128 currentIndex = resultIndex2 + indexIncrement; + ReadOnlySpan span = x.Slice(Vector128.Count); + + while (!span.IsEmpty) + { + Vector128 current; + if (span.Length >= Vector128.Count) + { + current = Vector128.Create(span); + span = span.Slice(Vector128.Count); + } + else + { + // Process a final back-shifted to cover remaining elements in x in one vector. + int start = x.Length - Vector128.Count; + current = Vector128.Create(x.Slice(start)); + currentIndex = Vector128.Create((uint)start) + Vector128.Indices; + span = ReadOnlySpan.Empty; + } + + // Quick return if possible. + if (typeof(T) == typeof(float) || typeof(T) == typeof(double)) + { + Vector128 nanMask = IsNaN(current); + if (nanMask != Vector128.Zero) + { + return (int)currentIndex.ToScalar() + IndexOfFirstMatch(nanMask); + } + } + + // Get mask for which lanes that should have result updated, also widen it for updating the indices. + Vector128 mask = TOperator.Compare(current, result); + (Vector128 mask1, Vector128 mask2) = Vector128.Widen(mask.AsInt16()); + + // Update result and indices. + result = ElementWiseSelect(mask, current, result); + resultIndex1 = ElementWiseSelect(mask1.AsUInt32(), currentIndex, resultIndex1); + currentIndex += indexIncrement; + resultIndex2 = ElementWiseSelect(mask2.AsUInt32(), currentIndex, resultIndex2); + currentIndex += indexIncrement; + } + + { + // Where result does not bitwise-equal the aggregate min/max value; replace indices with uint.MaxValue. Then find the min index. + T aggResult = TOperator.Aggregate(result); + Vector128 aggMask = ~Vector128.Equals(result.AsInt16(), Vector128.Create(aggResult).AsInt16()); + + (Vector128 mask1, Vector128 mask2) = Vector128.Widen(aggMask); + Vector128 aggIndex = resultIndex1 | mask1.AsUInt32(); + aggIndex = MinOperator.Invoke(aggIndex, resultIndex2 | mask2.AsUInt32()); + + return (int)HorizontalAggregate>(aggIndex); + } + } + + private static int IndexOfMinMaxVectorized128Size1(ReadOnlySpan x) + where T : INumber where TOperator : struct, IIndexOfMinMaxOperator + { + Debug.Assert(sizeof(T) == 1); + + // Initialize result by reading first vector and quick return if possible. + Vector128 result = Vector128.Create(x); + if (typeof(T) == typeof(float) || typeof(T) == typeof(double)) + { + Vector128 nanMask = IsNaN(result); + if (nanMask != Vector128.Zero) + { + return IndexOfFirstMatch(nanMask); + } + } + + // Initialize indices. + Vector128 indexIncrement = Vector128.Create((uint)Vector128.Count); + Vector128 resultIndex1 = Vector128.Indices; + Vector128 resultIndex2 = resultIndex1 + indexIncrement; + Vector128 resultIndex3 = resultIndex2 + indexIncrement; + Vector128 resultIndex4 = resultIndex3 + indexIncrement; + Vector128 currentIndex = resultIndex4 + indexIncrement; + ReadOnlySpan span = x.Slice(Vector128.Count); + + while (!span.IsEmpty) + { + Vector128 current; + if (span.Length >= Vector128.Count) + { + current = Vector128.Create(span); + span = span.Slice(Vector128.Count); + } + else + { + // Process a final back-shifted to cover remaining elements in x in one vector. + int start = x.Length - Vector128.Count; + current = Vector128.Create(x.Slice(start)); + currentIndex = Vector128.Create((uint)start) + Vector128.Indices; + span = ReadOnlySpan.Empty; + } + + // Quick return if possible. + if (typeof(T) == typeof(float) || typeof(T) == typeof(double)) + { + Vector128 nanMask = IsNaN(current); + if (nanMask != Vector128.Zero) + { + return (int)currentIndex.ToScalar() + IndexOfFirstMatch(nanMask); + } + } + + // Get mask for which lanes that should have result updated, also widen it for updating the indices. + Vector128 mask = TOperator.Compare(current, result); + (Vector128 lowerMask, Vector128 upperMask) = Vector128.Widen(mask.AsSByte()); + (Vector128 mask1, Vector128 mask2) = Vector128.Widen(lowerMask); + (Vector128 mask3, Vector128 mask4) = Vector128.Widen(upperMask); + + // Update result and indices. + result = ElementWiseSelect(mask, current, result); + resultIndex1 = ElementWiseSelect(mask1.AsUInt32(), currentIndex, resultIndex1); + currentIndex += indexIncrement; + resultIndex2 = ElementWiseSelect(mask2.AsUInt32(), currentIndex, resultIndex2); + currentIndex += indexIncrement; + resultIndex3 = ElementWiseSelect(mask3.AsUInt32(), currentIndex, resultIndex3); + currentIndex += indexIncrement; + resultIndex4 = ElementWiseSelect(mask4.AsUInt32(), currentIndex, resultIndex4); + currentIndex += indexIncrement; + } + + { + // Where result does not bitwise-equal the aggregate min/max value; replace indices with uint.MaxValue. Then find the min index. + T aggResult = TOperator.Aggregate(result); + Vector128 aggMask = ~Vector128.Equals(result.AsSByte(), Vector128.Create(aggResult).AsSByte()); + + (Vector128 lowerMask, Vector128 upperMask) = Vector128.Widen(aggMask); + (Vector128 mask1, Vector128 mask2) = Vector128.Widen(lowerMask); + (Vector128 mask3, Vector128 mask4) = Vector128.Widen(upperMask); + Vector128 aggIndex = resultIndex1 | mask1.AsUInt32(); + aggIndex = MinOperator.Invoke(aggIndex, resultIndex2 | mask2.AsUInt32()); + aggIndex = MinOperator.Invoke(aggIndex, resultIndex3 | mask3.AsUInt32()); + aggIndex = MinOperator.Invoke(aggIndex, resultIndex4 | mask4.AsUInt32()); + + return (int)HorizontalAggregate>(aggIndex); + } + } + + private static int IndexOfMinMaxVectorized256Size4Plus(ReadOnlySpan x) + where T : INumber where TOperator : struct, IIndexOfMinMaxOperator where TInt : IBinaryInteger + { + Debug.Assert(sizeof(T) == 4 || sizeof(T) == 8); + Debug.Assert(typeof(TInt) == typeof(uint) || typeof(TInt) == typeof(ulong)); + Debug.Assert(sizeof(TInt) == sizeof(T)); + + // Initialize result by reading first vector and quick return if possible. + Vector256 result = Vector256.Create(x); + if (typeof(T) == typeof(float) || typeof(T) == typeof(double)) + { + Vector256 nanMask = IsNaN(result); + if (nanMask != Vector256.Zero) + { + return IndexOfFirstMatch(nanMask); + } + } + + // Initialize indices. + Vector256 indexIncrement = Vector256.Create(TInt.CreateTruncating(Vector256.Count)); + Vector256 resultIndex = Vector256.Indices; + Vector256 currentIndex = resultIndex + indexIncrement; + ReadOnlySpan span = x.Slice(Vector256.Count); + + while (!span.IsEmpty) + { + Vector256 current; + if (span.Length >= Vector256.Count) + { + current = Vector256.Create(span); + span = span.Slice(Vector256.Count); + } + else + { + // Process a final back-shifted to cover remaining elements in x in one vector. + int start = x.Length - Vector256.Count; + current = Vector256.Create(x.Slice(start)); + currentIndex = Vector256.Create(TInt.CreateTruncating(start)) + Vector256.Indices; + span = ReadOnlySpan.Empty; + } + + // Quick return if possible. + if (typeof(T) == typeof(float) || typeof(T) == typeof(double)) + { + Vector256 nanMask = IsNaN(current); + if (nanMask != Vector256.Zero) + { + return int.CreateTruncating(currentIndex.ToScalar()) + IndexOfFirstMatch(nanMask); + } + } + + // Get mask for which lanes that should have result updated. + Vector256 mask = TOperator.Compare(current, result); + + // Update result and indices. + result = ElementWiseSelect(mask, current, result); + resultIndex = ElementWiseSelect(mask.As(), currentIndex, resultIndex); + currentIndex += indexIncrement; + } + + { + // Where result does not bitwise-equal the aggregate min/max value; replace indices with uint.MaxValue. Then find the min index. + T aggResult = TOperator.Aggregate(result); + Vector256 aggMask = ~Vector256.Equals(result.As(), Vector256.Create(aggResult).As()); + Vector256 aggIndex = resultIndex | aggMask; + return int.CreateTruncating(HorizontalAggregate>(aggIndex)); + } + } + + private static int IndexOfMinMaxVectorized256Size2(ReadOnlySpan x) + where T : INumber where TOperator : struct, IIndexOfMinMaxOperator + { + Debug.Assert(sizeof(T) == 2); + + // Initialize result by reading first vector and quick return if possible. + Vector256 result = Vector256.Create(x); + if (typeof(T) == typeof(float) || typeof(T) == typeof(double)) + { + Vector256 nanMask = IsNaN(result); + if (nanMask != Vector256.Zero) + { + return IndexOfFirstMatch(nanMask); + } + } + + // Initialize indices. + Vector256 indexIncrement = Vector256.Create((uint)Vector256.Count); + Vector256 resultIndex1 = Vector256.Indices; + Vector256 resultIndex2 = resultIndex1 + indexIncrement; + Vector256 currentIndex = resultIndex2 + indexIncrement; + ReadOnlySpan span = x.Slice(Vector256.Count); + + while (!span.IsEmpty) + { + Vector256 current; + if (span.Length >= Vector256.Count) + { + current = Vector256.Create(span); + span = span.Slice(Vector256.Count); + } + else + { + // Process a final back-shifted to cover remaining elements in x in one vector. + int start = x.Length - Vector256.Count; + current = Vector256.Create(x.Slice(start)); + currentIndex = Vector256.Create((uint)start) + Vector256.Indices; + span = ReadOnlySpan.Empty; + } + + // Quick return if possible. + if (typeof(T) == typeof(float) || typeof(T) == typeof(double)) + { + Vector256 nanMask = IsNaN(current); + if (nanMask != Vector256.Zero) + { + return (int)currentIndex.ToScalar() + IndexOfFirstMatch(nanMask); + } + } + + // Get mask for which lanes that should have result updated, also widen it for updating the indices. + Vector256 mask = TOperator.Compare(current, result); + (Vector256 mask1, Vector256 mask2) = Vector256.Widen(mask.AsInt16()); + + // Update result and indices. + result = ElementWiseSelect(mask, current, result); + resultIndex1 = ElementWiseSelect(mask1.AsUInt32(), currentIndex, resultIndex1); + currentIndex += indexIncrement; + resultIndex2 = ElementWiseSelect(mask2.AsUInt32(), currentIndex, resultIndex2); + currentIndex += indexIncrement; + } + + { + // Where result does not bitwise-equal the aggregate min/max value; replace indices with uint.MaxValue. Then find the min index. + T aggResult = TOperator.Aggregate(result); + Vector256 aggMask = ~Vector256.Equals(result.AsInt16(), Vector256.Create(aggResult).AsInt16()); + + (Vector256 mask1, Vector256 mask2) = Vector256.Widen(aggMask); + Vector256 aggIndex = resultIndex1 | mask1.AsUInt32(); + aggIndex = MinOperator.Invoke(aggIndex, resultIndex2 | mask2.AsUInt32()); + + return (int)HorizontalAggregate>(aggIndex); + } + } + + private static int IndexOfMinMaxVectorized256Size1(ReadOnlySpan x) + where T : INumber where TOperator : struct, IIndexOfMinMaxOperator + { + Debug.Assert(sizeof(T) == 1); + + // Initialize result by reading first vector and quick return if possible. + Vector256 result = Vector256.Create(x); + if (typeof(T) == typeof(float) || typeof(T) == typeof(double)) + { + Vector256 nanMask = IsNaN(result); + if (nanMask != Vector256.Zero) + { + return IndexOfFirstMatch(nanMask); + } + } + + // Initialize indices. + Vector256 indexIncrement = Vector256.Create((uint)Vector256.Count); + Vector256 resultIndex1 = Vector256.Indices; + Vector256 resultIndex2 = resultIndex1 + indexIncrement; + Vector256 resultIndex3 = resultIndex2 + indexIncrement; + Vector256 resultIndex4 = resultIndex3 + indexIncrement; + Vector256 currentIndex = resultIndex4 + indexIncrement; + ReadOnlySpan span = x.Slice(Vector256.Count); + + while (!span.IsEmpty) + { + Vector256 current; + if (span.Length >= Vector256.Count) + { + current = Vector256.Create(span); + span = span.Slice(Vector256.Count); + } + else + { + // Process a final back-shifted to cover remaining elements in x in one vector. + int start = x.Length - Vector256.Count; + current = Vector256.Create(x.Slice(start)); + currentIndex = Vector256.Create((uint)start) + Vector256.Indices; + span = ReadOnlySpan.Empty; + } + + // Quick return if possible. + if (typeof(T) == typeof(float) || typeof(T) == typeof(double)) + { + Vector256 nanMask = IsNaN(current); + if (nanMask != Vector256.Zero) + { + return (int)currentIndex.ToScalar() + IndexOfFirstMatch(nanMask); + } + } + + // Get mask for which lanes that should have result updated, also widen it for updating the indices. + Vector256 mask = TOperator.Compare(current, result); + (Vector256 lowerMask, Vector256 upperMask) = Vector256.Widen(mask.AsSByte()); + (Vector256 mask1, Vector256 mask2) = Vector256.Widen(lowerMask); + (Vector256 mask3, Vector256 mask4) = Vector256.Widen(upperMask); + + // Update result and indices. + result = ElementWiseSelect(mask, current, result); + resultIndex1 = ElementWiseSelect(mask1.AsUInt32(), currentIndex, resultIndex1); + currentIndex += indexIncrement; + resultIndex2 = ElementWiseSelect(mask2.AsUInt32(), currentIndex, resultIndex2); + currentIndex += indexIncrement; + resultIndex3 = ElementWiseSelect(mask3.AsUInt32(), currentIndex, resultIndex3); + currentIndex += indexIncrement; + resultIndex4 = ElementWiseSelect(mask4.AsUInt32(), currentIndex, resultIndex4); + currentIndex += indexIncrement; + } + + { + // Where result does not bitwise-equal the aggregate min/max value; replace indices with uint.MaxValue. Then find the min index. + T aggResult = TOperator.Aggregate(result); + Vector256 aggMask = ~Vector256.Equals(result.AsSByte(), Vector256.Create(aggResult).AsSByte()); + + (Vector256 lowerMask, Vector256 upperMask) = Vector256.Widen(aggMask); + (Vector256 mask1, Vector256 mask2) = Vector256.Widen(lowerMask); + (Vector256 mask3, Vector256 mask4) = Vector256.Widen(upperMask); + Vector256 aggIndex = resultIndex1 | mask1.AsUInt32(); + aggIndex = MinOperator.Invoke(aggIndex, resultIndex2 | mask2.AsUInt32()); + aggIndex = MinOperator.Invoke(aggIndex, resultIndex3 | mask3.AsUInt32()); + aggIndex = MinOperator.Invoke(aggIndex, resultIndex4 | mask4.AsUInt32()); + + return (int)HorizontalAggregate>(aggIndex); + } + } + + private static int IndexOfMinMaxVectorized512Size4Plus(ReadOnlySpan x) + where T : INumber where TOperator : struct, IIndexOfMinMaxOperator where TInt : IBinaryInteger + { + Debug.Assert(sizeof(T) == 4 || sizeof(T) == 8); + Debug.Assert(typeof(TInt) == typeof(uint) || typeof(TInt) == typeof(ulong)); + Debug.Assert(sizeof(TInt) == sizeof(T)); + + // Initialize result by reading first vector and quick return if possible. + Vector512 result = Vector512.Create(x); + if (typeof(T) == typeof(float) || typeof(T) == typeof(double)) + { + Vector512 nanMask = IsNaN(result); + if (nanMask != Vector512.Zero) + { + return IndexOfFirstMatch(nanMask); + } + } + + // Initialize indices. + Vector512 indexIncrement = Vector512.Create(TInt.CreateTruncating(Vector512.Count)); + Vector512 resultIndex = Vector512.Indices; + Vector512 currentIndex = resultIndex + indexIncrement; + ReadOnlySpan span = x.Slice(Vector512.Count); + + while (!span.IsEmpty) + { + Vector512 current; + if (span.Length >= Vector512.Count) + { + current = Vector512.Create(span); + span = span.Slice(Vector512.Count); + } + else + { + // Process a final back-shifted to cover remaining elements in x in one vector. + int start = x.Length - Vector512.Count; + current = Vector512.Create(x.Slice(start)); + currentIndex = Vector512.Create(TInt.CreateTruncating(start)) + Vector512.Indices; + span = ReadOnlySpan.Empty; + } + + // Quick return if possible. + if (typeof(T) == typeof(float) || typeof(T) == typeof(double)) + { + Vector512 nanMask = IsNaN(current); + if (nanMask != Vector512.Zero) + { + return int.CreateTruncating(currentIndex.ToScalar()) + IndexOfFirstMatch(nanMask); + } + } + + // Get mask for which lanes that should have result updated. + Vector512 mask = TOperator.Compare(current, result); + + // Update result and indices. + result = ElementWiseSelect(mask, current, result); + resultIndex = ElementWiseSelect(mask.As(), currentIndex, resultIndex); + currentIndex += indexIncrement; + } + + { + // Where result does not bitwise-equal the aggregate min/max value; replace indices with uint.MaxValue. Then find the min index. + T aggResult = TOperator.Aggregate(result); + Vector512 aggMask = ~Vector512.Equals(result.As(), Vector512.Create(aggResult).As()); + Vector512 aggIndex = resultIndex | aggMask; + return int.CreateTruncating(HorizontalAggregate>(aggIndex)); + } + } + + private static int IndexOfMinMaxVectorized512Size2(ReadOnlySpan x) + where T : INumber where TOperator : struct, IIndexOfMinMaxOperator + { + Debug.Assert(sizeof(T) == 2); + + // Initialize result by reading first vector and quick return if possible. + Vector512 result = Vector512.Create(x); + if (typeof(T) == typeof(float) || typeof(T) == typeof(double)) + { + Vector512 nanMask = IsNaN(result); + if (nanMask != Vector512.Zero) + { + return IndexOfFirstMatch(nanMask); + } + } + + // Initialize indices. + Vector512 indexIncrement = Vector512.Create((uint)Vector512.Count); + Vector512 resultIndex1 = Vector512.Indices; + Vector512 resultIndex2 = resultIndex1 + indexIncrement; + Vector512 currentIndex = resultIndex2 + indexIncrement; + ReadOnlySpan span = x.Slice(Vector512.Count); + + while (!span.IsEmpty) + { + Vector512 current; + if (span.Length >= Vector512.Count) + { + current = Vector512.Create(span); + span = span.Slice(Vector512.Count); + } + else + { + // Process a final back-shifted to cover remaining elements in x in one vector. + int start = x.Length - Vector512.Count; + current = Vector512.Create(x.Slice(start)); + currentIndex = Vector512.Create((uint)start) + Vector512.Indices; + span = ReadOnlySpan.Empty; + } + + // Quick return if possible. + if (typeof(T) == typeof(float) || typeof(T) == typeof(double)) + { + Vector512 nanMask = IsNaN(current); + if (nanMask != Vector512.Zero) + { + return (int)currentIndex.ToScalar() + IndexOfFirstMatch(nanMask); + } + } + + // Get mask for which lanes that should have result updated, also widen it for updating the indices. + Vector512 mask = TOperator.Compare(current, result); + (Vector512 mask1, Vector512 mask2) = Vector512.Widen(mask.AsInt16()); + + // Update result and indices. + result = ElementWiseSelect(mask, current, result); + resultIndex1 = ElementWiseSelect(mask1.AsUInt32(), currentIndex, resultIndex1); + currentIndex += indexIncrement; + resultIndex2 = ElementWiseSelect(mask2.AsUInt32(), currentIndex, resultIndex2); + currentIndex += indexIncrement; + } + + { + // Where result does not bitwise-equal the aggregate min/max value; replace indices with uint.MaxValue. Then find the min index. + T aggResult = TOperator.Aggregate(result); + Vector512 aggMask = ~Vector512.Equals(result.AsInt16(), Vector512.Create(aggResult).AsInt16()); + + (Vector512 mask1, Vector512 mask2) = Vector512.Widen(aggMask); + Vector512 aggIndex = resultIndex1 | mask1.AsUInt32(); + aggIndex = MinOperator.Invoke(aggIndex, resultIndex2 | mask2.AsUInt32()); + + return (int)HorizontalAggregate>(aggIndex); + } + } + + private static int IndexOfMinMaxVectorized512Size1(ReadOnlySpan x) + where T : INumber where TOperator : struct, IIndexOfMinMaxOperator + { + Debug.Assert(sizeof(T) == 1); + + // Initialize result by reading first vector and quick return if possible. + Vector512 result = Vector512.Create(x); + if (typeof(T) == typeof(float) || typeof(T) == typeof(double)) + { + Vector512 nanMask = IsNaN(result); + if (nanMask != Vector512.Zero) + { + return IndexOfFirstMatch(nanMask); + } + } + + // Initialize indices. + Vector512 indexIncrement = Vector512.Create((uint)Vector512.Count); + Vector512 resultIndex1 = Vector512.Indices; + Vector512 resultIndex2 = resultIndex1 + indexIncrement; + Vector512 resultIndex3 = resultIndex2 + indexIncrement; + Vector512 resultIndex4 = resultIndex3 + indexIncrement; + Vector512 currentIndex = resultIndex4 + indexIncrement; + ReadOnlySpan span = x.Slice(Vector512.Count); + + while (!span.IsEmpty) + { + Vector512 current; + if (span.Length >= Vector512.Count) + { + current = Vector512.Create(span); + span = span.Slice(Vector512.Count); + } + else + { + // Process a final back-shifted to cover remaining elements in x in one vector. + int start = x.Length - Vector512.Count; + current = Vector512.Create(x.Slice(start)); + currentIndex = Vector512.Create((uint)start) + Vector512.Indices; + span = ReadOnlySpan.Empty; + } + + // Quick return if possible. + if (typeof(T) == typeof(float) || typeof(T) == typeof(double)) + { + Vector512 nanMask = IsNaN(current); + if (nanMask != Vector512.Zero) + { + return (int)currentIndex.ToScalar() + IndexOfFirstMatch(nanMask); + } + } + + // Get mask for which lanes that should have result updated, also widen it for updating the indices. + Vector512 mask = TOperator.Compare(current, result); + (Vector512 lowerMask, Vector512 upperMask) = Vector512.Widen(mask.AsSByte()); + (Vector512 mask1, Vector512 mask2) = Vector512.Widen(lowerMask); + (Vector512 mask3, Vector512 mask4) = Vector512.Widen(upperMask); + + // Update result and indices. + result = ElementWiseSelect(mask, current, result); + resultIndex1 = ElementWiseSelect(mask1.AsUInt32(), currentIndex, resultIndex1); + currentIndex += indexIncrement; + resultIndex2 = ElementWiseSelect(mask2.AsUInt32(), currentIndex, resultIndex2); + currentIndex += indexIncrement; + resultIndex3 = ElementWiseSelect(mask3.AsUInt32(), currentIndex, resultIndex3); + currentIndex += indexIncrement; + resultIndex4 = ElementWiseSelect(mask4.AsUInt32(), currentIndex, resultIndex4); + currentIndex += indexIncrement; + } + + { + // Where result does not bitwise-equal the aggregate min/max value; replace indices with uint.MaxValue. Then find the min index. + T aggResult = TOperator.Aggregate(result); + Vector512 aggMask = ~Vector512.Equals(result.AsSByte(), Vector512.Create(aggResult).AsSByte()); + + (Vector512 lowerMask, Vector512 upperMask) = Vector512.Widen(aggMask); + (Vector512 mask1, Vector512 mask2) = Vector512.Widen(lowerMask); + (Vector512 mask3, Vector512 mask4) = Vector512.Widen(upperMask); + Vector512 aggIndex = resultIndex1 | mask1.AsUInt32(); + aggIndex = MinOperator.Invoke(aggIndex, resultIndex2 | mask2.AsUInt32()); + aggIndex = MinOperator.Invoke(aggIndex, resultIndex3 | mask3.AsUInt32()); + aggIndex = MinOperator.Invoke(aggIndex, resultIndex4 | mask4.AsUInt32()); + + return (int)HorizontalAggregate>(aggIndex); + } + } + } +} diff --git a/src/libraries/System.Numerics.Tensors/src/System/Numerics/Tensors/netcore/Common/TensorPrimitives.IIndexOfOperator.cs b/src/libraries/System.Numerics.Tensors/src/System/Numerics/Tensors/netcore/Common/TensorPrimitives.IIndexOfOperator.cs deleted file mode 100644 index 09492ac64eb075..00000000000000 --- a/src/libraries/System.Numerics.Tensors/src/System/Numerics/Tensors/netcore/Common/TensorPrimitives.IIndexOfOperator.cs +++ /dev/null @@ -1,132 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System.Diagnostics; -using System.Runtime.CompilerServices; -using System.Runtime.Intrinsics; - -namespace System.Numerics.Tensors -{ - public static unsafe partial class TensorPrimitives - { - private interface IIndexOfOperator - { - static abstract int Invoke(ref T result, T current, int resultIndex, int currentIndex); - static abstract void Invoke(ref Vector128 result, Vector128 current, ref Vector128 resultIndex, Vector128 currentIndex); - static abstract void Invoke(ref Vector256 result, Vector256 current, ref Vector256 resultIndex, Vector256 currentIndex); - static abstract void Invoke(ref Vector512 result, Vector512 current, ref Vector512 resultIndex, Vector512 currentIndex); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - private static int IndexOfFinalAggregate(Vector128 result, Vector128 resultIndex) - where TIndexOfOperator : struct, IIndexOfOperator - { - Vector128 tmpResult; - Vector128 tmpIndex; - - if (sizeof(T) == 8) - { - // Compare 0 with 1 - tmpResult = Vector128.Shuffle(result.AsInt64(), Vector128.Create(1, 0)).As(); - tmpIndex = Vector128.Shuffle(resultIndex.AsInt64(), Vector128.Create(1, 0)).As(); - TIndexOfOperator.Invoke(ref result, tmpResult, ref resultIndex, tmpIndex); - - // Return 0 - return (int)resultIndex.As().ToScalar(); - } - - if (sizeof(T) == 4) - { - // Compare 0,1 with 2,3 - tmpResult = Vector128.Shuffle(result.AsInt32(), Vector128.Create(2, 3, 0, 1)).As(); - tmpIndex = Vector128.Shuffle(resultIndex.AsInt32(), Vector128.Create(2, 3, 0, 1)).As(); - TIndexOfOperator.Invoke(ref result, tmpResult, ref resultIndex, tmpIndex); - - // Compare 0 with 1 - tmpResult = Vector128.Shuffle(result.AsInt32(), Vector128.Create(1, 0, 3, 2)).As(); - tmpIndex = Vector128.Shuffle(resultIndex.AsInt32(), Vector128.Create(1, 0, 3, 2)).As(); - TIndexOfOperator.Invoke(ref result, tmpResult, ref resultIndex, tmpIndex); - - // Return 0 - return resultIndex.As().ToScalar(); - } - - if (sizeof(T) == 2) - { - // Compare 0,1,2,3 with 4,5,6,7 - tmpResult = Vector128.Shuffle(result.AsInt16(), Vector128.Create(4, 5, 6, 7, 0, 1, 2, 3)).As(); - tmpIndex = Vector128.Shuffle(resultIndex.AsInt16(), Vector128.Create(4, 5, 6, 7, 0, 1, 2, 3)).As(); - TIndexOfOperator.Invoke(ref result, tmpResult, ref resultIndex, tmpIndex); - - // Compare 0,1 with 2,3 - tmpResult = Vector128.Shuffle(result.AsInt16(), Vector128.Create(2, 3, 0, 1, 4, 5, 6, 7)).As(); - tmpIndex = Vector128.Shuffle(resultIndex.AsInt16(), Vector128.Create(2, 3, 0, 1, 4, 5, 6, 7)).As(); - TIndexOfOperator.Invoke(ref result, tmpResult, ref resultIndex, tmpIndex); - - // Compare 0 with 1 - tmpResult = Vector128.Shuffle(result.AsInt16(), Vector128.Create(1, 0, 2, 3, 4, 5, 6, 7)).As(); - tmpIndex = Vector128.Shuffle(resultIndex.AsInt16(), Vector128.Create(1, 0, 2, 3, 4, 5, 6, 7)).As(); - TIndexOfOperator.Invoke(ref result, tmpResult, ref resultIndex, tmpIndex); - - // Return 0 - return resultIndex.As().ToScalar(); - } - - Debug.Assert(sizeof(T) == 1); - { - // Compare 0,1,2,3,4,5,6,7 with 8,9,10,11,12,13,14,15 - tmpResult = Vector128.Shuffle(result.AsByte(), Vector128.Create((byte)8, 9, 10, 11, 12, 13, 14, 15, 0, 1, 2, 3, 4, 5, 6, 7)).As(); - tmpIndex = Vector128.Shuffle(resultIndex.AsByte(), Vector128.Create((byte)8, 9, 10, 11, 12, 13, 14, 15, 0, 1, 2, 3, 4, 5, 6, 7)).As(); - TIndexOfOperator.Invoke(ref result, tmpResult, ref resultIndex, tmpIndex); - - // Compare 0,1,2,3 with 4,5,6,7 - tmpResult = Vector128.Shuffle(result.AsByte(), Vector128.Create((byte)4, 5, 6, 7, 0, 1, 2, 3, 8, 9, 10, 11, 12, 13, 14, 15)).As(); - tmpIndex = Vector128.Shuffle(resultIndex.AsByte(), Vector128.Create((byte)4, 5, 6, 7, 0, 1, 2, 3, 8, 9, 10, 11, 12, 13, 14, 15)).As(); - TIndexOfOperator.Invoke(ref result, tmpResult, ref resultIndex, tmpIndex); - - // Compare 0,1 with 2,3 - tmpResult = Vector128.Shuffle(result.AsByte(), Vector128.Create((byte)2, 3, 0, 1, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15)).As(); - tmpIndex = Vector128.Shuffle(resultIndex.AsByte(), Vector128.Create((byte)2, 3, 0, 1, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15)).As(); - TIndexOfOperator.Invoke(ref result, tmpResult, ref resultIndex, tmpIndex); - - // Compare 0 with 1 - tmpResult = Vector128.Shuffle(result.AsByte(), Vector128.Create((byte)1, 0, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15)).As(); - tmpIndex = Vector128.Shuffle(resultIndex.AsByte(), Vector128.Create((byte)1, 0, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15)).As(); - TIndexOfOperator.Invoke(ref result, tmpResult, ref resultIndex, tmpIndex); - - // Return 0 - return resultIndex.As().ToScalar(); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - private static int IndexOfFinalAggregate(Vector256 result, Vector256 resultIndex) - where TIndexOfOperator : struct, IIndexOfOperator - { - // Min the upper/lower halves of the Vector256 - Vector128 resultLower = result.GetLower(); - Vector128 indexLower = resultIndex.GetLower(); - - TIndexOfOperator.Invoke(ref resultLower, result.GetUpper(), ref indexLower, resultIndex.GetUpper()); - return IndexOfFinalAggregate(resultLower, indexLower); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - private static int IndexOfFinalAggregate(Vector512 result, Vector512 resultIndex) - where TIndexOfOperator : struct, IIndexOfOperator - { - Vector256 resultLower = result.GetLower(); - Vector256 indexLower = resultIndex.GetLower(); - - TIndexOfOperator.Invoke(ref resultLower, result.GetUpper(), ref indexLower, resultIndex.GetUpper()); - return IndexOfFinalAggregate(resultLower, indexLower); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - private static Vector128 IndexLessThan(Vector128 indices1, Vector128 indices2) => - sizeof(T) == sizeof(long) ? Vector128.LessThan(indices1.AsInt64(), indices2.AsInt64()).As() : - sizeof(T) == sizeof(int) ? Vector128.LessThan(indices1.AsInt32(), indices2.AsInt32()).As() : - sizeof(T) == sizeof(short) ? Vector128.LessThan(indices1.AsInt16(), indices2.AsInt16()).As() : - Vector128.LessThan(indices1.AsByte(), indices2.AsByte()).As(); - } -} diff --git a/src/libraries/System.Numerics.Tensors/src/System/Numerics/Tensors/netcore/TensorPrimitives.IndexOfMax.cs b/src/libraries/System.Numerics.Tensors/src/System/Numerics/Tensors/netcore/TensorPrimitives.IndexOfMax.cs index f40f7e1e2e2ba0..7ea6f2f349a797 100644 --- a/src/libraries/System.Numerics.Tensors/src/System/Numerics/Tensors/netcore/TensorPrimitives.IndexOfMax.cs +++ b/src/libraries/System.Numerics.Tensors/src/System/Numerics/Tensors/netcore/TensorPrimitives.IndexOfMax.cs @@ -1,9 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -using System.Diagnostics; using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; using System.Runtime.Intrinsics; using System.Runtime.Intrinsics.X86; @@ -29,394 +27,66 @@ public static int IndexOfMax(ReadOnlySpan x) IndexOfMinMaxCore>(x); /// Returns the index of MathF.Max(x, y) - internal readonly struct IndexOfMaxOperator : IIndexOfOperator where T : INumber + internal readonly struct IndexOfMaxOperator : IIndexOfMinMaxOperator where T : INumber { - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static void Invoke(ref Vector128 result, Vector128 current, ref Vector128 resultIndex, Vector128 currentIndex) - { - Vector128 useResult = Vector128.GreaterThan(result, current); - Vector128 equalMask = Vector128.Equals(result, current); - - if (equalMask != Vector128.Zero) - { - Vector128 lessThanIndexMask = IndexLessThan(resultIndex, currentIndex); - if (typeof(T) == typeof(float) || typeof(T) == typeof(double)) - { - // bool useResult = equal && ((IsNegative(result) == IsNegative(current)) ? (resultIndex < currentIndex) : IsNegative(current)); - Vector128 currentNegative = IsNegative(current); - Vector128 sameSign = Vector128.Equals(IsNegative(result).AsInt32(), currentNegative.AsInt32()).As(); - useResult |= equalMask & ElementWiseSelect(sameSign, lessThanIndexMask, currentNegative); - } - else - { - useResult |= equalMask & lessThanIndexMask; - } - } - - result = ElementWiseSelect(useResult, result, current); - resultIndex = ElementWiseSelect(useResult, resultIndex, currentIndex); - } + public static T Aggregate(Vector128 x) => HorizontalAggregate>(x); + public static T Aggregate(Vector256 x) => HorizontalAggregate>(x); + public static T Aggregate(Vector512 x) => HorizontalAggregate>(x); [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static void Invoke(ref Vector256 result, Vector256 current, ref Vector256 resultIndex, Vector256 currentIndex) + public static bool Compare(T x, T y) { - Vector256 useResult = Vector256.GreaterThan(result, current); - Vector256 equalMask = Vector256.Equals(result, current); - - if (equalMask != Vector256.Zero) + if (x == y) { - Vector256 lessThanIndexMask = IndexLessThan(resultIndex, currentIndex); - if (typeof(T) == typeof(float) || typeof(T) == typeof(double)) - { - // bool useResult = equal && ((IsNegative(result) == IsNegative(current)) ? (resultIndex < currentIndex) : IsNegative(current)); - Vector256 currentNegative = IsNegative(current); - Vector256 sameSign = Vector256.Equals(IsNegative(result).AsInt32(), currentNegative.AsInt32()).As(); - useResult |= equalMask & ElementWiseSelect(sameSign, lessThanIndexMask, currentNegative); - } - else - { - useResult |= equalMask & lessThanIndexMask; - } + return T.IsPositive(x) && T.IsNegative(y); } - - result = ElementWiseSelect(useResult, result, current); - resultIndex = ElementWiseSelect(useResult, resultIndex, currentIndex); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static void Invoke(ref Vector512 result, Vector512 current, ref Vector512 resultIndex, Vector512 currentIndex) - { - Vector512 useResult = Vector512.GreaterThan(result, current); - Vector512 equalMask = Vector512.Equals(result, current); - - if (equalMask != Vector512.Zero) + else { - Vector512 lessThanIndexMask = IndexLessThan(resultIndex, currentIndex); - if (typeof(T) == typeof(float) || typeof(T) == typeof(double)) - { - // bool useResult = equal && ((IsNegative(result) == IsNegative(current)) ? (resultIndex < currentIndex) : IsNegative(current)); - Vector512 currentNegative = IsNegative(current); - Vector512 sameSign = Vector512.Equals(IsNegative(result).AsInt32(), currentNegative.AsInt32()).As(); - useResult |= equalMask & ElementWiseSelect(sameSign, lessThanIndexMask, currentNegative); - } - else - { - useResult |= equalMask & lessThanIndexMask; - } + return x > y; } - - result = ElementWiseSelect(useResult, result, current); - resultIndex = ElementWiseSelect(useResult, resultIndex, currentIndex); } [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static int Invoke(ref T result, T current, int resultIndex, int currentIndex) + public static Vector128 Compare(Vector128 x, Vector128 y) { - if (result == current) + if (typeof(T) == typeof(double) || typeof(T) == typeof(float)) { - bool resultNegative = IsNegative(result); - if ((resultNegative == IsNegative(current)) ? (currentIndex < resultIndex) : resultNegative) - { - result = current; - return currentIndex; - } + Vector128 equalResult = IsPositive(x) & IsNegative(y); + return Vector128.GreaterThan(x, y) | (Vector128.Equals(x, y) & equalResult); } - else if (current > result) + else { - result = current; - return currentIndex; + return Vector128.GreaterThan(x, y); } - - return resultIndex; } - } - private static unsafe int IndexOfMinMaxCore(ReadOnlySpan x) - where T : INumber - where TIndexOfMinMax : struct, IIndexOfOperator - { - if (x.IsEmpty) - { - return -1; - } - - // This matches the IEEE 754:2019 `maximum`/`minimum` functions. - // It propagates NaN inputs back to the caller and - // otherwise returns the index of the greater of the inputs. - // It treats +0 as greater than -0 as per the specification. - - if (Vector512.IsHardwareAccelerated && Vector512.IsSupported && x.Length >= Vector512.Count) + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector256 Compare(Vector256 x, Vector256 y) { - Debug.Assert(sizeof(T) is 1 or 2 or 4 or 8); - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - static Vector512 CreateVector512T(int i) => - sizeof(T) == sizeof(long) ? Vector512.Create((long)i).As() : - sizeof(T) == sizeof(int) ? Vector512.Create(i).As() : - sizeof(T) == sizeof(short) ? Vector512.Create((short)i).As() : - Vector512.Create((byte)i).As(); - - ref T xRef = ref MemoryMarshal.GetReference(x); - Vector512 resultIndex = - sizeof(T) == sizeof(long) ? Vector512.Indices.As() : - sizeof(T) == sizeof(int) ? Vector512.Indices.As() : - sizeof(T) == sizeof(short) ? Vector512.Indices.As() : - Vector512.Indices.As(); - Vector512 currentIndex = resultIndex; - Vector512 increment = CreateVector512T(Vector512.Count); - - // Load the first vector as the initial set of results, and bail immediately - // to scalar handling if it contains any NaNs (which don't compare equally to themselves). - Vector512 result = Vector512.LoadUnsafe(ref xRef); - Vector512 current; - - Vector512 nanMask; - if (typeof(T) == typeof(float) || typeof(T) == typeof(double)) + if (typeof(T) == typeof(double) || typeof(T) == typeof(float)) { - nanMask = ~Vector512.Equals(result, result); - if (nanMask != Vector512.Zero) - { - return IndexOfFirstMatch(nanMask); - } + Vector256 equalResult = IsPositive(x) & IsNegative(y); + return Vector256.GreaterThan(x, y) | (Vector256.Equals(x, y) & equalResult); } - - int oneVectorFromEnd = x.Length - Vector512.Count; - int i = Vector512.Count; - - // Aggregate additional vectors into the result as long as there's at least one full vector left to process. - while (i <= oneVectorFromEnd) + else { - // Load the next vector, and early exit on NaN. - current = Vector512.LoadUnsafe(ref xRef, (uint)i); - currentIndex += increment; - - if (typeof(T) == typeof(float) || typeof(T) == typeof(double)) - { - nanMask = ~Vector512.Equals(current, current); - if (nanMask != Vector512.Zero) - { - return i + IndexOfFirstMatch(nanMask); - } - } - - TIndexOfMinMax.Invoke(ref result, current, ref resultIndex, currentIndex); - - i += Vector512.Count; + return Vector256.GreaterThan(x, y); } - - // If any elements remain, handle them in one final vector. - if (i != x.Length) - { - current = Vector512.LoadUnsafe(ref xRef, (uint)(x.Length - Vector512.Count)); - currentIndex += CreateVector512T(x.Length - i); - - if (typeof(T) == typeof(float) || typeof(T) == typeof(double)) - { - nanMask = ~Vector512.Equals(current, current); - if (nanMask != Vector512.Zero) - { - int indexInVectorOfFirstMatch = IndexOfFirstMatch(nanMask); - return typeof(T) == typeof(double) ? - (int)(long)(object)currentIndex.As()[indexInVectorOfFirstMatch] : - (int)(object)currentIndex.As()[indexInVectorOfFirstMatch]; - } - } - - TIndexOfMinMax.Invoke(ref result, current, ref resultIndex, currentIndex); - } - - // Aggregate the lanes in the vector to create the final scalar result. - return IndexOfFinalAggregate(result, resultIndex); } - if (Vector256.IsHardwareAccelerated && Vector256.IsSupported && x.Length >= Vector256.Count) - { - Debug.Assert(sizeof(T) is 1 or 2 or 4 or 8); - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - static Vector256 CreateVector256T(int i) => - sizeof(T) == sizeof(long) ? Vector256.Create((long)i).As() : - sizeof(T) == sizeof(int) ? Vector256.Create(i).As() : - sizeof(T) == sizeof(short) ? Vector256.Create((short)i).As() : - Vector256.Create((byte)i).As(); - - ref T xRef = ref MemoryMarshal.GetReference(x); - Vector256 resultIndex = - sizeof(T) == sizeof(long) ? Vector256.Indices.As() : - sizeof(T) == sizeof(int) ? Vector256.Indices.As() : - sizeof(T) == sizeof(short) ? Vector256.Indices.As() : - Vector256.Indices.As(); - Vector256 currentIndex = resultIndex; - Vector256 increment = CreateVector256T(Vector256.Count); - - // Load the first vector as the initial set of results, and bail immediately - // to scalar handling if it contains any NaNs (which don't compare equally to themselves). - Vector256 result = Vector256.LoadUnsafe(ref xRef); - Vector256 current; - - Vector256 nanMask; - if (typeof(T) == typeof(float) || typeof(T) == typeof(double)) - { - nanMask = ~Vector256.Equals(result, result); - if (nanMask != Vector256.Zero) - { - return IndexOfFirstMatch(nanMask); - } - } - - int oneVectorFromEnd = x.Length - Vector256.Count; - int i = Vector256.Count; - - // Aggregate additional vectors into the result as long as there's at least one full vector left to process. - while (i <= oneVectorFromEnd) - { - // Load the next vector, and early exit on NaN. - current = Vector256.LoadUnsafe(ref xRef, (uint)i); - currentIndex += increment; - - if (typeof(T) == typeof(float) || typeof(T) == typeof(double)) - { - nanMask = ~Vector256.Equals(current, current); - if (nanMask != Vector256.Zero) - { - return i + IndexOfFirstMatch(nanMask); - } - } - - TIndexOfMinMax.Invoke(ref result, current, ref resultIndex, currentIndex); - - i += Vector256.Count; - } - - // If any elements remain, handle them in one final vector. - if (i != x.Length) - { - current = Vector256.LoadUnsafe(ref xRef, (uint)(x.Length - Vector256.Count)); - currentIndex += CreateVector256T(x.Length - i); - - if (typeof(T) == typeof(float) || typeof(T) == typeof(double)) - { - nanMask = ~Vector256.Equals(current, current); - if (nanMask != Vector256.Zero) - { - int indexInVectorOfFirstMatch = IndexOfFirstMatch(nanMask); - return typeof(T) == typeof(double) ? - (int)(long)(object)currentIndex.As()[indexInVectorOfFirstMatch] : - (int)(object)currentIndex.As()[indexInVectorOfFirstMatch]; - } - } - - TIndexOfMinMax.Invoke(ref result, current, ref resultIndex, currentIndex); - } - - // Aggregate the lanes in the vector to create the final scalar result. - return IndexOfFinalAggregate(result, resultIndex); - } - - if (Vector128.IsHardwareAccelerated && Vector128.IsSupported && x.Length >= Vector128.Count) + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vector512 Compare(Vector512 x, Vector512 y) { - Debug.Assert(sizeof(T) is 1 or 2 or 4 or 8); - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - static Vector128 CreateVector128T(int i) => - sizeof(T) == sizeof(long) ? Vector128.Create((long)i).As() : - sizeof(T) == sizeof(int) ? Vector128.Create(i).As() : - sizeof(T) == sizeof(short) ? Vector128.Create((short)i).As() : - Vector128.Create((byte)i).As(); - - ref T xRef = ref MemoryMarshal.GetReference(x); - Vector128 resultIndex = - sizeof(T) == sizeof(long) ? Vector128.Indices.As() : - sizeof(T) == sizeof(int) ? Vector128.Indices.As() : - sizeof(T) == sizeof(short) ? Vector128.Indices.As() : - Vector128.Indices.As(); - Vector128 currentIndex = resultIndex; - Vector128 increment = CreateVector128T(Vector128.Count); - - // Load the first vector as the initial set of results, and bail immediately - // to scalar handling if it contains any NaNs (which don't compare equally to themselves). - Vector128 result = Vector128.LoadUnsafe(ref xRef); - Vector128 current; - - Vector128 nanMask; - if (typeof(T) == typeof(float) || typeof(T) == typeof(double)) + if (typeof(T) == typeof(double) || typeof(T) == typeof(float)) { - nanMask = ~Vector128.Equals(result, result); - if (nanMask != Vector128.Zero) - { - return IndexOfFirstMatch(nanMask); - } + Vector512 equalResult = IsPositive(x) & IsNegative(y); + return Vector512.GreaterThan(x, y) | (Vector512.Equals(x, y) & equalResult); } - - int oneVectorFromEnd = x.Length - Vector128.Count; - int i = Vector128.Count; - - // Aggregate additional vectors into the result as long as there's at least one full vector left to process. - while (i <= oneVectorFromEnd) + else { - // Load the next vector, and early exit on NaN. - current = Vector128.LoadUnsafe(ref xRef, (uint)i); - currentIndex += increment; - - if (typeof(T) == typeof(float) || typeof(T) == typeof(double)) - { - nanMask = ~Vector128.Equals(current, current); - if (nanMask != Vector128.Zero) - { - return i + IndexOfFirstMatch(nanMask); - } - } - - TIndexOfMinMax.Invoke(ref result, current, ref resultIndex, currentIndex); - - i += Vector128.Count; - } - - // If any elements remain, handle them in one final vector. - if (i != x.Length) - { - current = Vector128.LoadUnsafe(ref xRef, (uint)(x.Length - Vector128.Count)); - currentIndex += CreateVector128T(x.Length - i); - - if (typeof(T) == typeof(float) || typeof(T) == typeof(double)) - { - nanMask = ~Vector128.Equals(current, current); - if (nanMask != Vector128.Zero) - { - int indexInVectorOfFirstMatch = IndexOfFirstMatch(nanMask); - return typeof(T) == typeof(double) ? - (int)(long)(object)currentIndex.As()[indexInVectorOfFirstMatch] : - (int)(object)currentIndex.As()[indexInVectorOfFirstMatch]; - } - } - - TIndexOfMinMax.Invoke(ref result, current, ref resultIndex, currentIndex); - } - - // Aggregate the lanes in the vector to create the final scalar result. - return IndexOfFinalAggregate(result, resultIndex); - } - - // Scalar path used when either vectorization is not supported or the input is too small to vectorize. - T curResult = x[0]; - int curIn = 0; - if (T.IsNaN(curResult)) - { - return curIn; - } - - for (int i = 1; i < x.Length; i++) - { - T current = x[i]; - if (T.IsNaN(current)) - { - return i; + return Vector512.GreaterThan(x, y); } - - curIn = TIndexOfMinMax.Invoke(ref curResult, current, curIn, i); } - - return curIn; } private static int IndexOfFirstMatch(Vector128 mask) => @@ -428,23 +98,6 @@ private static int IndexOfFirstMatch(Vector256 mask) => private static int IndexOfFirstMatch(Vector512 mask) => BitOperations.TrailingZeroCount(mask.ExtractMostSignificantBits()); - [MethodImpl(MethodImplOptions.AggressiveInlining)] - private static unsafe Vector256 IndexLessThan(Vector256 indices1, Vector256 indices2) => - sizeof(T) == sizeof(long) ? Vector256.LessThan(indices1.AsInt64(), indices2.AsInt64()).As() : - sizeof(T) == sizeof(int) ? Vector256.LessThan(indices1.AsInt32(), indices2.AsInt32()).As() : - sizeof(T) == sizeof(short) ? Vector256.LessThan(indices1.AsInt16(), indices2.AsInt16()).As() : - Vector256.LessThan(indices1.AsByte(), indices2.AsByte()).As(); - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - private static unsafe Vector512 IndexLessThan(Vector512 indices1, Vector512 indices2) => - sizeof(T) == sizeof(long) ? Vector512.LessThan(indices1.AsInt64(), indices2.AsInt64()).As() : - sizeof(T) == sizeof(int) ? Vector512.LessThan(indices1.AsInt32(), indices2.AsInt32()).As() : - sizeof(T) == sizeof(short) ? Vector512.LessThan(indices1.AsInt16(), indices2.AsInt16()).As() : - Vector512.LessThan(indices1.AsByte(), indices2.AsByte()).As(); - - /// Gets whether the specified is negative. - private static bool IsNegative(T f) where T : INumberBase => T.IsNegative(f); - [MethodImpl(MethodImplOptions.AggressiveInlining)] private static unsafe Vector128 ElementWiseSelect(Vector128 mask, Vector128 left, Vector128 right) { diff --git a/src/libraries/System.Numerics.Tensors/src/System/Numerics/Tensors/netcore/TensorPrimitives.IndexOfMaxMagnitude.cs b/src/libraries/System.Numerics.Tensors/src/System/Numerics/Tensors/netcore/TensorPrimitives.IndexOfMaxMagnitude.cs index f1f5016a86b13e..5ca77310c5fa3d 100644 --- a/src/libraries/System.Numerics.Tensors/src/System/Numerics/Tensors/netcore/TensorPrimitives.IndexOfMaxMagnitude.cs +++ b/src/libraries/System.Numerics.Tensors/src/System/Numerics/Tensors/netcore/TensorPrimitives.IndexOfMaxMagnitude.cs @@ -26,111 +26,106 @@ public static int IndexOfMaxMagnitude(ReadOnlySpan x) where T : INumber => IndexOfMinMaxCore>(x); - internal readonly struct IndexOfMaxMagnitudeOperator : IIndexOfOperator where T : INumber + internal readonly struct IndexOfMaxMagnitudeOperator : IIndexOfMinMaxOperator where T : INumber { + public static T Aggregate(Vector128 x) => HorizontalAggregate>(x); + public static T Aggregate(Vector256 x) => HorizontalAggregate>(x); + public static T Aggregate(Vector512 x) => HorizontalAggregate>(x); + [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static void Invoke(ref Vector128 result, Vector128 current, ref Vector128 resultIndex, Vector128 currentIndex) + public static bool Compare(T x, T y) { - Vector128 resultMag = Vector128.Abs(result), currentMag = Vector128.Abs(current); - Vector128 useResult = Vector128.GreaterThan(resultMag, currentMag); - Vector128 equalMask = Vector128.Equals(resultMag, currentMag); - - if (equalMask != Vector128.Zero) + // Don't use T.Abs since it can throw OverflowException. + T result = T.MaxMagnitude(x, y); + if (result == x) { - Vector128 lessThanIndexMask = IndexLessThan(resultIndex, currentIndex); - if (typeof(T) == typeof(float) || typeof(T) == typeof(double)) + if (result == y) { - // bool useResult = equal && ((IsNegative(result) == IsNegative(current)) ? (resultIndex < currentIndex) : IsNegative(current)); - Vector128 currentNegative = IsNegative(current); - Vector128 sameSign = Vector128.Equals(IsNegative(result).AsInt32(), currentNegative.AsInt32()).As(); - useResult |= equalMask & ElementWiseSelect(sameSign, lessThanIndexMask, currentNegative); + // x and y are equal in magnitude + return T.IsPositive(x) && T.IsNegative(y); } else { - useResult |= equalMask & lessThanIndexMask; + // x == result && y != result means x has larger magnitude than y. + return true; } } - - result = ElementWiseSelect(useResult, result, current); - resultIndex = ElementWiseSelect(useResult, resultIndex, currentIndex); + else + { + return false; + } } [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static void Invoke(ref Vector256 result, Vector256 current, ref Vector256 resultIndex, Vector256 currentIndex) + public static Vector128 Compare(Vector128 x, Vector128 y) { - Vector256 resultMag = Vector256.Abs(result), currentMag = Vector256.Abs(current); - Vector256 useResult = Vector256.GreaterThan(resultMag, currentMag); - Vector256 equalMask = Vector256.Equals(resultMag, currentMag); - - if (equalMask != Vector256.Zero) + Vector128 xMag = Vector128.Abs(x), yMag = Vector128.Abs(y); + if (typeof(T) == typeof(double) || typeof(T) == typeof(float)) { - Vector256 lessThanIndexMask = IndexLessThan(resultIndex, currentIndex); - if (typeof(T) == typeof(float) || typeof(T) == typeof(double)) - { - // bool useResult = equal && ((IsNegative(result) == IsNegative(current)) ? (resultIndex < currentIndex) : IsNegative(current)); - Vector256 currentNegative = IsNegative(current); - Vector256 sameSign = Vector256.Equals(IsNegative(result).AsInt32(), currentNegative.AsInt32()).As(); - useResult |= equalMask & ElementWiseSelect(sameSign, lessThanIndexMask, currentNegative); - } - else - { - useResult |= equalMask & lessThanIndexMask; - } + Vector128 equalResult = IsPositive(x) & IsNegative(y); + return Vector128.GreaterThan(xMag, yMag) | (Vector128.Equals(xMag, yMag) & equalResult); + } + else if (typeof(T) == typeof(sbyte) + || typeof(T) == typeof(short) + || typeof(T) == typeof(int) + || typeof(T) == typeof(long) + || typeof(T) == typeof(nint)) + { + // Consider overflows (when IsNegative(Abs(x))) from Abs(MinValue) which implies maximum magnitude. + return Vector128.AndNot(Vector128.GreaterThan(xMag, yMag) | IsNegative(xMag), IsNegative(yMag)); + } + else + { + return Vector128.GreaterThan(xMag, yMag); } - - result = ElementWiseSelect(useResult, result, current); - resultIndex = ElementWiseSelect(useResult, resultIndex, currentIndex); } [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static void Invoke(ref Vector512 result, Vector512 current, ref Vector512 resultIndex, Vector512 currentIndex) + public static Vector256 Compare(Vector256 x, Vector256 y) { - Vector512 resultMag = Vector512.Abs(result), currentMag = Vector512.Abs(current); - Vector512 useResult = Vector512.GreaterThan(resultMag, currentMag); - Vector512 equalMask = Vector512.Equals(resultMag, currentMag); - - if (equalMask != Vector512.Zero) + Vector256 xMag = Vector256.Abs(x), yMag = Vector256.Abs(y); + if (typeof(T) == typeof(double) || typeof(T) == typeof(float)) { - Vector512 lessThanIndexMask = IndexLessThan(resultIndex, currentIndex); - if (typeof(T) == typeof(float) || typeof(T) == typeof(double)) - { - // bool useResult = equal && ((IsNegative(result) == IsNegative(current)) ? (resultIndex < currentIndex) : IsNegative(current)); - Vector512 currentNegative = IsNegative(current); - Vector512 sameSign = Vector512.Equals(IsNegative(result).AsInt32(), currentNegative.AsInt32()).As(); - useResult |= equalMask & ElementWiseSelect(sameSign, lessThanIndexMask, currentNegative); - } - else - { - useResult |= equalMask & lessThanIndexMask; - } + Vector256 equalResult = IsPositive(x) & IsNegative(y); + return Vector256.GreaterThan(xMag, yMag) | (Vector256.Equals(xMag, yMag) & equalResult); + } + else if (typeof(T) == typeof(sbyte) + || typeof(T) == typeof(short) + || typeof(T) == typeof(int) + || typeof(T) == typeof(long) + || typeof(T) == typeof(nint)) + { + // Consider overflows (when IsNegative(Abs(x))) from Abs(MinValue) which implies maximum magnitude. + return Vector256.AndNot(Vector256.GreaterThan(xMag, yMag) | IsNegative(xMag), IsNegative(yMag)); + } + else + { + return Vector256.GreaterThan(xMag, yMag); } - - result = ElementWiseSelect(useResult, result, current); - resultIndex = ElementWiseSelect(useResult, resultIndex, currentIndex); } [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static int Invoke(ref T result, T current, int resultIndex, int currentIndex) + public static Vector512 Compare(Vector512 x, Vector512 y) { - T resultMag = T.Abs(result); - T currentMag = T.Abs(current); - - if (resultMag == currentMag) + Vector512 xMag = Vector512.Abs(x), yMag = Vector512.Abs(y); + if (typeof(T) == typeof(double) || typeof(T) == typeof(float)) { - bool resultNegative = IsNegative(result); - if ((resultNegative == IsNegative(current)) ? (currentIndex < resultIndex) : resultNegative) - { - result = current; - return currentIndex; - } + Vector512 equalResult = IsPositive(x) & IsNegative(y); + return Vector512.GreaterThan(xMag, yMag) | (Vector512.Equals(xMag, yMag) & equalResult); } - else if (currentMag > resultMag) + else if (typeof(T) == typeof(sbyte) + || typeof(T) == typeof(short) + || typeof(T) == typeof(int) + || typeof(T) == typeof(long) + || typeof(T) == typeof(nint)) { - result = current; - return currentIndex; + // Consider overflows (when IsNegative(Abs(x))) from Abs(MinValue) which implies maximum magnitude. + return Vector512.AndNot(Vector512.GreaterThan(xMag, yMag) | IsNegative(xMag), IsNegative(yMag)); + } + else + { + return Vector512.GreaterThan(xMag, yMag); } - - return resultIndex; } } } diff --git a/src/libraries/System.Numerics.Tensors/src/System/Numerics/Tensors/netcore/TensorPrimitives.IndexOfMin.cs b/src/libraries/System.Numerics.Tensors/src/System/Numerics/Tensors/netcore/TensorPrimitives.IndexOfMin.cs index 011021b6c0015f..135ca0ac294cc6 100644 --- a/src/libraries/System.Numerics.Tensors/src/System/Numerics/Tensors/netcore/TensorPrimitives.IndexOfMin.cs +++ b/src/libraries/System.Numerics.Tensors/src/System/Numerics/Tensors/netcore/TensorPrimitives.IndexOfMin.cs @@ -26,105 +26,65 @@ public static int IndexOfMin(ReadOnlySpan x) IndexOfMinMaxCore>(x); /// Returns the index of MathF.Min(x, y) - internal readonly struct IndexOfMinOperator : IIndexOfOperator where T : INumber + internal readonly struct IndexOfMinOperator : IIndexOfMinMaxOperator where T : INumber { + public static T Aggregate(Vector128 x) => HorizontalAggregate>(x); + public static T Aggregate(Vector256 x) => HorizontalAggregate>(x); + public static T Aggregate(Vector512 x) => HorizontalAggregate>(x); + [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static void Invoke(ref Vector128 result, Vector128 current, ref Vector128 resultIndex, Vector128 currentIndex) + public static bool Compare(T x, T y) { - Vector128 useResult = Vector128.LessThan(result, current); - Vector128 equalMask = Vector128.Equals(result, current); - - if (equalMask != Vector128.Zero) + if (x == y) { - Vector128 lessThanIndexMask = IndexLessThan(resultIndex, currentIndex); - if (typeof(T) == typeof(float) || typeof(T) == typeof(double)) - { - // bool useResult = equal && ((IsNegative(result) == IsNegative(current)) ? (resultIndex < currentIndex) : IsNegative(result)); - Vector128 resultNegative = IsNegative(result); - Vector128 sameSign = Vector128.Equals(resultNegative.AsInt32(), IsNegative(current).AsInt32()).As(); - useResult |= equalMask & ElementWiseSelect(sameSign, lessThanIndexMask, resultNegative); - } - else - { - useResult |= equalMask & lessThanIndexMask; - } + return T.IsNegative(x) && T.IsPositive(y); + } + else + { + return x < y; } - - result = ElementWiseSelect(useResult, result, current); - resultIndex = ElementWiseSelect(useResult, resultIndex, currentIndex); } [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static void Invoke(ref Vector256 result, Vector256 current, ref Vector256 resultIndex, Vector256 currentIndex) + public static Vector128 Compare(Vector128 x, Vector128 y) { - Vector256 useResult = Vector256.LessThan(result, current); - Vector256 equalMask = Vector256.Equals(result, current); - - if (equalMask != Vector256.Zero) + if (typeof(T) == typeof(double) || typeof(T) == typeof(float)) { - Vector256 lessThanIndexMask = IndexLessThan(resultIndex, currentIndex); - if (typeof(T) == typeof(float) || typeof(T) == typeof(double)) - { - // bool useResult = equal && ((IsNegative(result) == IsNegative(current)) ? (resultIndex < currentIndex) : IsNegative(result)); - Vector256 resultNegative = IsNegative(result); - Vector256 sameSign = Vector256.Equals(resultNegative.AsInt32(), IsNegative(current).AsInt32()).As(); - useResult |= equalMask & ElementWiseSelect(sameSign, lessThanIndexMask, resultNegative); - } - else - { - useResult |= equalMask & lessThanIndexMask; - } + Vector128 equalResult = IsNegative(x) & IsPositive(y); + return Vector128.LessThan(x, y) | (Vector128.Equals(x, y) & equalResult); + } + else + { + return Vector128.LessThan(x, y); } - - result = ElementWiseSelect(useResult, result, current); - resultIndex = ElementWiseSelect(useResult, resultIndex, currentIndex); } [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static void Invoke(ref Vector512 result, Vector512 current, ref Vector512 resultIndex, Vector512 currentIndex) + public static Vector256 Compare(Vector256 x, Vector256 y) { - Vector512 useResult = Vector512.LessThan(result, current); - Vector512 equalMask = Vector512.Equals(result, current); - - if (equalMask != Vector512.Zero) + if (typeof(T) == typeof(double) || typeof(T) == typeof(float)) { - Vector512 lessThanIndexMask = IndexLessThan(resultIndex, currentIndex); - if (typeof(T) == typeof(float) || typeof(T) == typeof(double)) - { - // bool useResult = equal && ((IsNegative(result) == IsNegative(current)) ? (resultIndex < currentIndex) : IsNegative(result)); - Vector512 resultNegative = IsNegative(result); - Vector512 sameSign = Vector512.Equals(resultNegative.AsInt32(), IsNegative(current).AsInt32()).As(); - useResult |= equalMask & ElementWiseSelect(sameSign, lessThanIndexMask, resultNegative); - } - else - { - useResult |= equalMask & lessThanIndexMask; - } + Vector256 equalResult = IsNegative(x) & IsPositive(y); + return Vector256.LessThan(x, y) | (Vector256.Equals(x, y) & equalResult); + } + else + { + return Vector256.LessThan(x, y); } - - result = ElementWiseSelect(useResult, result, current); - resultIndex = ElementWiseSelect(useResult, resultIndex, currentIndex); } [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static int Invoke(ref T result, T current, int resultIndex, int currentIndex) + public static Vector512 Compare(Vector512 x, Vector512 y) { - if (result == current) + if (typeof(T) == typeof(double) || typeof(T) == typeof(float)) { - bool currentNegative = IsNegative(current); - if ((IsNegative(result) == currentNegative) ? (currentIndex < resultIndex) : currentNegative) - { - result = current; - return currentIndex; - } + Vector512 equalResult = IsNegative(x) & IsPositive(y); + return Vector512.LessThan(x, y) | (Vector512.Equals(x, y) & equalResult); } - else if (current < result) + else { - result = current; - return currentIndex; + return Vector512.LessThan(x, y); } - - return resultIndex; } } } diff --git a/src/libraries/System.Numerics.Tensors/src/System/Numerics/Tensors/netcore/TensorPrimitives.IndexOfMinMagnitude.cs b/src/libraries/System.Numerics.Tensors/src/System/Numerics/Tensors/netcore/TensorPrimitives.IndexOfMinMagnitude.cs index 813bcf4637dd12..437c9537e6962e 100644 --- a/src/libraries/System.Numerics.Tensors/src/System/Numerics/Tensors/netcore/TensorPrimitives.IndexOfMinMagnitude.cs +++ b/src/libraries/System.Numerics.Tensors/src/System/Numerics/Tensors/netcore/TensorPrimitives.IndexOfMinMagnitude.cs @@ -26,111 +26,106 @@ public static int IndexOfMinMagnitude(ReadOnlySpan x) where T : INumber => IndexOfMinMaxCore>(x); - internal readonly struct IndexOfMinMagnitudeOperator : IIndexOfOperator where T : INumber + internal readonly struct IndexOfMinMagnitudeOperator : IIndexOfMinMaxOperator where T : INumber { + public static T Aggregate(Vector128 x) => HorizontalAggregate>(x); + public static T Aggregate(Vector256 x) => HorizontalAggregate>(x); + public static T Aggregate(Vector512 x) => HorizontalAggregate>(x); + [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static void Invoke(ref Vector128 result, Vector128 current, ref Vector128 resultIndex, Vector128 currentIndex) + public static bool Compare(T x, T y) { - Vector128 resultMag = Vector128.Abs(result), currentMag = Vector128.Abs(current); - Vector128 useResult = Vector128.LessThan(resultMag, currentMag); - Vector128 equalMask = Vector128.Equals(resultMag, currentMag); - - if (equalMask != Vector128.Zero) + // Don't use T.Abs since it can throw OverflowException. + T result = T.MinMagnitude(x, y); + if (result == x) { - Vector128 lessThanIndexMask = IndexLessThan(resultIndex, currentIndex); - if (typeof(T) == typeof(float) || typeof(T) == typeof(double)) + if (result == y) { - // bool useResult = equal && ((IsNegative(result) == IsNegative(current)) ? (resultIndex < currentIndex) : IsNegative(result)); - Vector128 resultNegative = IsNegative(result); - Vector128 sameSign = Vector128.Equals(resultNegative.AsInt32(), IsNegative(current).AsInt32()).As(); - useResult |= equalMask & ElementWiseSelect(sameSign, lessThanIndexMask, resultNegative); + // x and y are equal in magnitude + return T.IsNegative(x) && T.IsPositive(y); } else { - useResult |= equalMask & lessThanIndexMask; + // x == result && y != result means x has lesser magnitude than y. + return true; } } - - result = ElementWiseSelect(useResult, result, current); - resultIndex = ElementWiseSelect(useResult, resultIndex, currentIndex); + else + { + return false; + } } [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static void Invoke(ref Vector256 result, Vector256 current, ref Vector256 resultIndex, Vector256 currentIndex) + public static Vector128 Compare(Vector128 x, Vector128 y) { - Vector256 resultMag = Vector256.Abs(result), currentMag = Vector256.Abs(current); - Vector256 useResult = Vector256.LessThan(resultMag, currentMag); - Vector256 equalMask = Vector256.Equals(resultMag, currentMag); - - if (equalMask != Vector256.Zero) + Vector128 xMag = Vector128.Abs(x), yMag = Vector128.Abs(y); + if (typeof(T) == typeof(double) || typeof(T) == typeof(float)) { - Vector256 lessThanIndexMask = IndexLessThan(resultIndex, currentIndex); - if (typeof(T) == typeof(float) || typeof(T) == typeof(double)) - { - // bool useResult = equal && ((IsNegative(result) == IsNegative(current)) ? (resultIndex < currentIndex) : IsNegative(result)); - Vector256 resultNegative = IsNegative(result); - Vector256 sameSign = Vector256.Equals(resultNegative.AsInt32(), IsNegative(current).AsInt32()).As(); - useResult |= equalMask & ElementWiseSelect(sameSign, lessThanIndexMask, resultNegative); - } - else - { - useResult |= equalMask & lessThanIndexMask; - } + Vector128 equalResult = IsNegative(x) & IsPositive(y); + return Vector128.LessThan(xMag, yMag) | (Vector128.Equals(xMag, yMag) & equalResult); + } + else if (typeof(T) == typeof(sbyte) + || typeof(T) == typeof(short) + || typeof(T) == typeof(int) + || typeof(T) == typeof(long) + || typeof(T) == typeof(nint)) + { + // Consider overflows (when IsNegative(Abs(x))) from Abs(MinValue) which implies maximum magnitude. + return Vector128.AndNot(Vector128.LessThan(xMag, yMag) | IsNegative(yMag), IsNegative(xMag)); + } + else + { + return Vector128.LessThan(xMag, yMag); } - - result = ElementWiseSelect(useResult, result, current); - resultIndex = ElementWiseSelect(useResult, resultIndex, currentIndex); } [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static void Invoke(ref Vector512 result, Vector512 current, ref Vector512 resultIndex, Vector512 currentIndex) + public static Vector256 Compare(Vector256 x, Vector256 y) { - Vector512 resultMag = Vector512.Abs(result), currentMag = Vector512.Abs(current); - Vector512 useResult = Vector512.LessThan(resultMag, currentMag); - Vector512 equalMask = Vector512.Equals(resultMag, currentMag); - - if (equalMask != Vector512.Zero) + Vector256 xMag = Vector256.Abs(x), yMag = Vector256.Abs(y); + if (typeof(T) == typeof(double) || typeof(T) == typeof(float)) { - Vector512 lessThanIndexMask = IndexLessThan(resultIndex, currentIndex); - if (typeof(T) == typeof(float) || typeof(T) == typeof(double)) - { - // bool useResult = equal && ((IsNegative(result) == IsNegative(current)) ? (resultIndex < currentIndex) : IsNegative(result)); - Vector512 resultNegative = IsNegative(result); - Vector512 sameSign = Vector512.Equals(resultNegative.AsInt32(), IsNegative(current).AsInt32()).As(); - useResult |= equalMask & ElementWiseSelect(sameSign, lessThanIndexMask, resultNegative); - } - else - { - useResult |= equalMask & lessThanIndexMask; - } + Vector256 equalResult = IsNegative(x) & IsPositive(y); + return Vector256.LessThan(xMag, yMag) | (Vector256.Equals(xMag, yMag) & equalResult); + } + else if (typeof(T) == typeof(sbyte) + || typeof(T) == typeof(short) + || typeof(T) == typeof(int) + || typeof(T) == typeof(long) + || typeof(T) == typeof(nint)) + { + // Consider overflows (when IsNegative(Abs(x))) from Abs(MinValue) which implies maximum magnitude. + return Vector256.AndNot(Vector256.LessThan(xMag, yMag) | IsNegative(yMag), IsNegative(xMag)); + } + else + { + return Vector256.LessThan(xMag, yMag); } - - result = ElementWiseSelect(useResult, result, current); - resultIndex = ElementWiseSelect(useResult, resultIndex, currentIndex); } [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static int Invoke(ref T result, T current, int resultIndex, int currentIndex) + public static Vector512 Compare(Vector512 x, Vector512 y) { - T resultMag = T.Abs(result); - T currentMag = T.Abs(current); - - if (resultMag == currentMag) + Vector512 xMag = Vector512.Abs(x), yMag = Vector512.Abs(y); + if (typeof(T) == typeof(double) || typeof(T) == typeof(float)) { - bool currentNegative = IsNegative(current); - if ((IsNegative(result) == currentNegative) ? (currentIndex < resultIndex) : currentNegative) - { - result = current; - return currentIndex; - } + Vector512 equalResult = IsNegative(x) & IsPositive(y); + return Vector512.LessThan(xMag, yMag) | (Vector512.Equals(xMag, yMag) & equalResult); } - else if (currentMag < resultMag) + else if (typeof(T) == typeof(sbyte) + || typeof(T) == typeof(short) + || typeof(T) == typeof(int) + || typeof(T) == typeof(long) + || typeof(T) == typeof(nint)) { - result = current; - return currentIndex; + // Consider overflows (when IsNegative(Abs(x))) from Abs(MinValue) which implies maximum magnitude. + return Vector512.AndNot(Vector512.LessThan(xMag, yMag) | IsNegative(yMag), IsNegative(xMag)); + } + else + { + return Vector512.LessThan(xMag, yMag); } - - return resultIndex; } } } diff --git a/src/libraries/System.Numerics.Tensors/tests/Helpers.cs b/src/libraries/System.Numerics.Tensors/tests/Helpers.cs index 4e5e89bbb3cad8..27a32a3b27a0ae 100644 --- a/src/libraries/System.Numerics.Tensors/tests/Helpers.cs +++ b/src/libraries/System.Numerics.Tensors/tests/Helpers.cs @@ -10,6 +10,9 @@ namespace System.Numerics.Tensors.Tests { public static class Helpers { + public static int SizeGreaterThanByte => 260; + public static int SizeGreaterThanInt16 => 65540; + public static IEnumerable TensorLengthsIncluding0 => Enumerable.Range(0, 257); public static IEnumerable TensorLengths => Enumerable.Range(1, 256); diff --git a/src/libraries/System.Numerics.Tensors/tests/TensorPrimitives.Generic.cs b/src/libraries/System.Numerics.Tensors/tests/TensorPrimitives.Generic.cs index f505a2ab77eb1f..f9ed5e03bb1869 100644 --- a/src/libraries/System.Numerics.Tensors/tests/TensorPrimitives.Generic.cs +++ b/src/libraries/System.Numerics.Tensors/tests/TensorPrimitives.Generic.cs @@ -1807,6 +1807,38 @@ public void SumOfMagnitudes_MinValue_Throws() Assert.Throws(() => TensorPrimitives.SumOfMagnitudes(x.Span)); }); } + + [Fact] + public void IndexOfMaxMagnitude_HandlesMinValue() + { + Assert.All(Helpers.TensorLengths, tensorLength => + { + foreach (int expected in new[] { 0, tensorLength / 2, tensorLength - 1 }) + { + using BoundedMemory x = CreateAndFillTensor(tensorLength); + x.Span.Fill(One); + x[expected] = MinValue; + x[tensorLength - 1] = MinValue; + Assert.Equal(expected, IndexOfMaxMagnitude(x)); + } + }); + } + + [Fact] + public void IndexOfMinMagnitude_HandlesMinValue() + { + Assert.All(Helpers.TensorLengths, tensorLength => + { + foreach (int expected in new[] { 0, tensorLength / 2, tensorLength - 1 }) + { + using BoundedMemory x = CreateAndFillTensor(tensorLength); + x.Span.Fill(MinValue); + x[expected] = One; + x[tensorLength - 1] = One; + Assert.Equal(expected, IndexOfMinMagnitude(x)); + } + }); + } } public unsafe abstract class GenericIntegerTensorPrimitivesTests : GenericNumberTensorPrimitivesTests diff --git a/src/libraries/System.Numerics.Tensors/tests/TensorPrimitivesTests.cs b/src/libraries/System.Numerics.Tensors/tests/TensorPrimitivesTests.cs index b21666434904f1..55dc2be94487d9 100644 --- a/src/libraries/System.Numerics.Tensors/tests/TensorPrimitivesTests.cs +++ b/src/libraries/System.Numerics.Tensors/tests/TensorPrimitivesTests.cs @@ -106,6 +106,11 @@ public abstract class TensorPrimitivesTests where T : unmanaged, IEquatable typeof(T) == typeof(float) || typeof(T) == typeof(double); + protected virtual int? IndexOfSizeExceedingMaxValue() => + (typeof(T) == typeof(byte) || typeof(T) == typeof(sbyte)) ? Helpers.SizeGreaterThanByte : + (typeof(T) == typeof(ushort) || typeof(T) == typeof(short) || typeof(T) == typeof(char)) ? Helpers.SizeGreaterThanInt16 : + null; + protected abstract T ConvertFromSingle(float f); protected abstract IEnumerable GetSpecialValues(); @@ -1134,6 +1139,18 @@ public void IndexOfMax_Negative0LesserThanPositive0() Assert.Equal(1, IndexOfMax([ConvertFromSingle(-1), ConvertFromSingle(-0f)])); Assert.Equal(2, IndexOfMax([ConvertFromSingle(-1), ConvertFromSingle(-0f), ConvertFromSingle(1f)])); } + + [Fact] + public void IndexOfMax_IndexAboveMaxValue() + { + var size = IndexOfSizeExceedingMaxValue(); + if (size == null) return; + + using BoundedMemory x = CreateTensor(size.Value); + x.Span.Fill(ConvertFromSingle(1)); + x.Span[size.Value - 1] = ConvertFromSingle(2); + Assert.Equal(size.Value - 1, IndexOfMax(x)); + } #endregion #region IndexOfMaxMagnitude @@ -1211,6 +1228,18 @@ public void IndexOfMaxMagnitude_Negative0LesserThanPositive0() Assert.Equal(0, IndexOfMaxMagnitude([ConvertFromSingle(-1), ConvertFromSingle(-0f)])); Assert.Equal(2, IndexOfMaxMagnitude([ConvertFromSingle(-1), ConvertFromSingle(-0f), ConvertFromSingle(1f)])); } + + [Fact] + public void IndexOfMaxMagnitude_IndexAboveMaxValue() + { + var size = IndexOfSizeExceedingMaxValue(); + if (size == null) return; + + using BoundedMemory x = CreateTensor(size.Value); + x.Span.Fill(ConvertFromSingle(1)); + x.Span[size.Value - 1] = ConvertFromSingle(2); + Assert.Equal(size.Value - 1, IndexOfMaxMagnitude(x)); + } #endregion #region IndexOfMin @@ -1263,6 +1292,18 @@ public void IndexOfMin_Negative0LesserThanPositive0() Assert.Equal(0, IndexOfMin([ConvertFromSingle(-1), ConvertFromSingle(-0f)])); Assert.Equal(0, IndexOfMin([ConvertFromSingle(-1), ConvertFromSingle(-0f), ConvertFromSingle(1f)])); } + + [Fact] + public void IndexOfMin_IndexAboveMaxValue() + { + var size = IndexOfSizeExceedingMaxValue(); + if (size == null) return; + + using BoundedMemory x = CreateTensor(size.Value); + x.Span.Fill(ConvertFromSingle(1)); + x.Span[size.Value - 1] = ConvertFromSingle(0); + Assert.Equal(size.Value - 1, IndexOfMin(x)); + } #endregion #region IndexOfMinMagnitude @@ -1340,6 +1381,18 @@ public void IndexOfMinMagnitude_Negative0LesserThanPositive0() Assert.Equal(1, IndexOfMinMagnitude([ConvertFromSingle(-1), ConvertFromSingle(-0f)])); Assert.Equal(1, IndexOfMinMagnitude([ConvertFromSingle(-1), ConvertFromSingle(-0f), ConvertFromSingle(1f)])); } + + [Fact] + public void IndexOfMinMagnitude_IndexAboveMaxValue() + { + var size = IndexOfSizeExceedingMaxValue(); + if (size == null) return; + + using BoundedMemory x = CreateTensor(size.Value); + x.Span.Fill(ConvertFromSingle(1)); + x.Span[size.Value - 1] = ConvertFromSingle(0); + Assert.Equal(size.Value - 1, IndexOfMinMagnitude(x)); + } #endregion #region Log @@ -1536,8 +1589,7 @@ public void Max_Tensor() Assert.Equal(max, Max(x)); - // TODO: Put a variant of this back once we have IndexOf routines - // Assert.Equal(SingleToUInt32(x[IndexOfMax(x)]), SingleToUInt32(Max(x))); + Assert.Equal(x[IndexOfMax(x)], Max(x)); }); } @@ -1558,8 +1610,7 @@ public void Max_Tensor_SpecialValues() Assert.Equal(max, Max(x)); - // TODO: Put a variant of this back once we have IndexOf routines - // Assert.Equal(SingleToUInt32(x[IndexOfMax(x)]), SingleToUInt32(Max(x))); + Assert.Equal(x[IndexOfMax(x)], Max(x)); }, x); }); } @@ -1721,8 +1772,7 @@ public void MaxMagnitude_Tensor() Assert.Equal(maxMagnitude, MaxMagnitude(x)); - // TODO: Put a variant of this back once we have IndexOf routines - // Assert.Equal(SingleToUInt32(x[IndexOfMaxMagnitude(x)]), SingleToUInt32(MaxMagnitude(x))); + Assert.Equal(x[IndexOfMaxMagnitude(x)], MaxMagnitude(x)); }); } @@ -1743,8 +1793,7 @@ public void MaxMagnitude_Tensor_SpecialValues() Assert.Equal(maxMagnitude, MaxMagnitude(x)); - // TODO: Put a variant of this back once we have IndexOf routines - // Assert.Equal(SingleToUInt32(x[IndexOfMaxMagnitude(x)]), SingleToUInt32(MaxMagnitude(x))); + Assert.Equal(x[IndexOfMaxMagnitude(x)], MaxMagnitude(x)); }, x); }); } @@ -1910,8 +1959,7 @@ public void Min_Tensor() Assert.Equal(min, Min(x)); - // TODO: Put a variant of this back once we have IndexOf routines - // Assert.Equal(SingleToUInt32(x[IndexOfMin(x)]), SingleToUInt32(Min(x))); + Assert.Equal(x[IndexOfMin(x)], Min(x)); }); } @@ -1932,8 +1980,7 @@ public void Min_Tensor_SpecialValues() Assert.Equal(min, Min(x)); - // TODO: Put a variant of this back once we have IndexOf routines - // Assert.Equal(SingleToUInt32(x[IndexOfMin(x)]), SingleToUInt32(Min(x))); + Assert.Equal(x[IndexOfMin(x)], Min(x)); }, x); }); } @@ -2095,8 +2142,7 @@ public void MinMagnitude_Tensor() Assert.Equal(minMagnitude, MinMagnitude(x)); - // TODO: Put a variant of this back once we have IndexOf routines - // Assert.Equal(SingleToUInt32(x[IndexOfMinMagnitude(x)]), SingleToUInt32(MinMagnitude(x))); + Assert.Equal(x[IndexOfMinMagnitude(x)], MinMagnitude(x)); }); } @@ -2117,8 +2163,7 @@ public void MinMagnitude_Tensor_SpecialValues() Assert.Equal(minMagnitude, MinMagnitude(x)); - // TODO: Put a variant of this back once we have IndexOf routines - // Assert.Equal(SingleToUInt32(x[IndexOfMinMagnitude(x)]), SingleToUInt32(MinMagnitude(x))); + Assert.Equal(x[IndexOfMinMagnitude(x)], MinMagnitude(x)); }, x); }); } From 4ffb643d1eac6b915f0693882e31b876c7ea3bf5 Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Wed, 6 May 2026 13:26:59 -0700 Subject: [PATCH 026/109] Add cDAC ObjectiveCMarshal contract and IsTrackedReferenceWithFinalizer API (#125895) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Summary Implements cDAC APIs for Objective-C interop diagnostics as a new `ObjectiveCMarshal` contract, plus adds `IsTrackedReferenceWithFinalizer` to the `RuntimeTypeSystem` contract. > [!NOTE] > This PR was generated with GitHub Copilot. ## Changes ### New `ObjectiveCMarshal` cDAC Contract - **`IObjectiveCMarshal`** (`Abstractions/Contracts/IObjectiveCMarshal.cs`): Interface with a single API: ```csharp TargetPointer GetTaggedMemory(TargetPointer address, out TargetNUInt size); ``` Returns the tagged memory pointer for an Objective-C tracked reference object (or `TargetPointer.Null` if none). Sets `size` to `2 * pointerSize` bytes only on success. - **`ObjectiveCMarshal_1`** (`Contracts/ObjectiveCMarshal_1.cs`): Version 1 implementation — reads the sync block from the object header, then extracts `InteropSyncBlockInfo.TaggedMemory`. - **`ObjectiveCMarshalFactory`** (`Contracts/ObjectiveCMarshalFactory.cs`): Contract factory. - Registered in `ContractRegistry` and `CachingContractRegistry`. - **`datadescriptor.inc`**: Added `TaggedMemory` field to `InteropSyncBlockInfo` type (under `#ifdef FEATURE_OBJCMARSHAL`) and `CDAC_GLOBAL_CONTRACT(ObjectiveCMarshal, 1)` (also guarded). - **`syncblk.h`**: Added `TaggedMemory` offset to `cdac_data` under `#ifdef FEATURE_OBJCMARSHAL`. - **`InteropSyncBlockInfo.cs`** (Data class): Added `TaggedMemory` property using `TryGetValue` to handle the optional `FEATURE_OBJCMARSHAL` field. ### `IsTrackedReferenceWithFinalizer` on `RuntimeTypeSystem` - Added `IsTrackedReferenceWithFinalizer = 0x04000000` to `WFLAGS_HIGH` enum in `MethodTableFlags_1.cs`, plus a convenience property `bool IsTrackedReferenceWithFinalizer`. - Added `IsTrackedReferenceWithFinalizer(TypeHandle)` to `IRuntimeTypeSystem.cs` and implemented it in `RuntimeTypeSystem_1.cs`. ### `SOSDacImpl.cs` — `ISOSDacInterface11` Replaced the stub implementations of `IsTrackedType` and `GetTaggedMemory` with full cDAC implementations: - `IsTrackedType`: uses `IRuntimeTypeSystem.IsTrackedReferenceWithFinalizer` and `IObjectiveCMarshal.GetTaggedMemory`; returns `S_OK` if tracked, `S_FALSE` if not, `E_INVALIDARG` for null inputs. - `GetTaggedMemory`: uses `IObjectiveCMarshal.GetTaggedMemory`; returns `S_OK` with address and size if tagged memory exists, `S_FALSE` otherwise. Both methods include `#if DEBUG` assertions against the legacy DAC implementation for validation. ### Documentation - **`docs/design/datacontracts/ObjectiveCMarshal.md`**: New contract documentation. - **`docs/design/datacontracts/RuntimeTypeSystem.md`**: Added `IsTrackedReferenceWithFinalizer` to API listing and pseudocode. ## Testing All 1322 existing cDAC unit tests pass. The new contract will be exercised when running on an Apple platform with `FEATURE_OBJCMARSHAL` enabled. --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: rcj1 <77995559+rcj1@users.noreply.github.com> Co-authored-by: rcj1 --- docs/design/datacontracts/Object.md | 31 +++-- .../design/datacontracts/ObjectiveCMarshal.md | 45 +++++++ .../design/datacontracts/RuntimeTypeSystem.md | 6 + .../vm/datadescriptor/datadescriptor.inc | 6 + src/coreclr/vm/methodtable.h | 2 +- src/coreclr/vm/syncblk.h | 3 + .../ContractRegistry.cs | 4 + .../Contracts/IObject.cs | 2 + .../Contracts/IObjectiveCMarshal.cs | 17 +++ .../Contracts/IRuntimeTypeSystem.cs | 2 + .../Contracts/Object_1.cs | 37 ++--- .../Contracts/ObjectiveCMarshal_1.cs | 29 ++++ .../Contracts/RuntimeTypeSystem_1.cs | 1 + .../CoreCLRContracts.cs | 1 + .../Data/InteropSyncBlockInfo.cs | 4 + .../MethodTableFlags_1.cs | 2 + .../SOSDacImpl.cs | 96 ++++++++++++- .../Debuggees/Directory.Build.targets | 1 + .../ObjectiveCMarshal.csproj | 8 ++ .../Debuggees/ObjectiveCMarshal/Program.cs | 76 +++++++++++ .../cdac/tests/DumpTests/DumpTests.targets | 15 +++ .../DumpTests/ObjectiveCMarshalDumpTests.cs | 70 ++++++++++ .../MockDescriptors/MockDescriptors.Object.cs | 8 +- .../MockDescriptors.SyncBlock.cs | 17 ++- .../cdac/tests/ObjectiveCMarshalTests.cs | 127 ++++++++++++++++++ 25 files changed, 569 insertions(+), 41 deletions(-) create mode 100644 docs/design/datacontracts/ObjectiveCMarshal.md create mode 100644 src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Abstractions/Contracts/IObjectiveCMarshal.cs create mode 100644 src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/ObjectiveCMarshal_1.cs create mode 100644 src/native/managed/cdac/tests/DumpTests/Debuggees/ObjectiveCMarshal/ObjectiveCMarshal.csproj create mode 100644 src/native/managed/cdac/tests/DumpTests/Debuggees/ObjectiveCMarshal/Program.cs create mode 100644 src/native/managed/cdac/tests/DumpTests/ObjectiveCMarshalDumpTests.cs create mode 100644 src/native/managed/cdac/tests/ObjectiveCMarshalTests.cs diff --git a/docs/design/datacontracts/Object.md b/docs/design/datacontracts/Object.md index d3ca3c626c206c..abc6ecf8fc37c5 100644 --- a/docs/design/datacontracts/Object.md +++ b/docs/design/datacontracts/Object.md @@ -20,6 +20,9 @@ bool GetBuiltInComData(TargetPointer address, out TargetPointer rcw, out TargetP // Try to get the runtime-assigned hash code for the object. Returns 0 if the runtime has not // assigned a default hash code. This will never be 0 for objects that have been hashed. int TryGetHashCode(TargetPointer address); + +// Returns the SyncBlock address for the object, or TargetPointer.Null if no sync block is associated with it. +TargetPointer GetSyncBlockAddress(TargetPointer address); ``` ## Version 1 @@ -119,17 +122,7 @@ bool GetBuiltInComData(TargetPointer address, out TargetPointer rcw, out TargetP ccw = TargetPointer.Null; ccf = TargetPointer.Null; - uint syncBlockValue = target.Read(address - target.ReadGlobal("SyncBlockValueToObjectOffset")); - - // Check if the sync block value represents a sync block index - if ((syncBlockValue & (target.ReadGlobal("SyncBlockIsHashCode") | target.ReadGlobal("SyncBlockIsHashOrSyncBlockIndex"))) - != target.ReadGlobal("SyncBlockIsHashOrSyncBlockIndex")) - return false; - - uint index = syncBlockValue & target.ReadGlobal("SyncBlockIndexMask"); - ulong offsetInSyncTableEntries = index * /* SyncTableEntry size */; - - TargetPointer syncBlockPtr = target.ReadPointer(_syncTableEntries + offsetInSyncTableEntries + /* SyncTableEntry::SyncBlock offset */); + TargetPointer syncBlockPtr = GetSyncBlockAddress(address); if (syncBlockPtr == TargetPointer.Null) return false; @@ -153,11 +146,23 @@ int TryGetHashCode(TargetPointer address) } // Hash code is stored in the sync block - uint index = syncBlockValue & target.ReadGlobal("SyncBlockIndexMask"); - TargetPointer syncBlock = target.Contracts.SyncBlock.GetSyncBlock(index); + TargetPointer syncBlock = GetSyncBlockAddress(address); if (syncBlock == TargetPointer.Null) return 0; return (int)target.Read(syncBlock + /* SyncBlock::HashCode offset */); } + +TargetPointer GetSyncBlockAddress(TargetPointer address) +{ + uint syncBlockValue = target.Read(address - target.ReadGlobal("SyncBlockValueToObjectOffset")); + + // Check if the sync block value represents a sync block index (not a hash code) + if ((syncBlockValue & (target.ReadGlobal("SyncBlockIsHashCode") | target.ReadGlobal("SyncBlockIsHashOrSyncBlockIndex"))) + != target.ReadGlobal("SyncBlockIsHashOrSyncBlockIndex")) + return TargetPointer.Null; + + uint index = syncBlockValue & target.ReadGlobal("SyncBlockIndexMask"); + return target.Contracts.SyncBlock.GetSyncBlock(index); +} ``` diff --git a/docs/design/datacontracts/ObjectiveCMarshal.md b/docs/design/datacontracts/ObjectiveCMarshal.md new file mode 100644 index 00000000000000..f2d7f80c613c45 --- /dev/null +++ b/docs/design/datacontracts/ObjectiveCMarshal.md @@ -0,0 +1,45 @@ +# Contract ObjectiveCMarshal + +This contract is for getting information related to Objective-C interop marshaling. + +## APIs of contract + +``` csharp +// Get the tagged memory for an Objective-C tracked reference object. +// Returns TargetPointer.Null if the object does not have tagged memory. +// On success, size is set to the size of the tagged memory in bytes; otherwise size is set to default. +TargetPointer GetTaggedMemory(TargetPointer address, out TargetNUInt size); +``` + +## Version 1 + +Data descriptors used: +| Data Descriptor Name | Field | Meaning | +| --- | --- | --- | +| `SyncBlock` | `InteropInfo` | Pointer to interop info (RCW, tagged memory, etc) | +| `InteropSyncBlockInfo` | `TaggedMemory` | Pointer to the tagged memory for the object (if it exists) | + +Contracts used: +| Contract Name | +| --- | +| `Object` | + +``` csharp +TargetPointer GetTaggedMemory(TargetPointer address, out TargetNUInt size) +{ + size = default; + + TargetPointer syncBlockPtr = target.Contracts.Object.GetSyncBlockAddress(address); + if (syncBlockPtr == TargetPointer.Null) + return TargetPointer.Null; + + TargetPointer interopInfoPtr = target.ReadPointer(syncBlockPtr + /* SyncBlock::InteropInfo offset */); + if (interopInfoPtr == TargetPointer.Null) + return TargetPointer.Null; + + TargetPointer taggedMemory = target.ReadPointer(interopInfoPtr + /* InteropSyncBlockInfo::TaggedMemory offset */); + if (taggedMemory != TargetPointer.Null) + size = new TargetNUInt(2 * target.PointerSize); + return taggedMemory; +} +``` diff --git a/docs/design/datacontracts/RuntimeTypeSystem.md b/docs/design/datacontracts/RuntimeTypeSystem.md index 08adc08c19855b..28605efe3c70b3 100644 --- a/docs/design/datacontracts/RuntimeTypeSystem.md +++ b/docs/design/datacontracts/RuntimeTypeSystem.md @@ -79,6 +79,8 @@ partial interface IRuntimeTypeSystem : IContract public TargetPointer GetGCThreadStaticsBasePointer(TypeHandle typeHandle, TargetPointer threadPtr); public TargetPointer GetNonGCThreadStaticsBasePointer(TypeHandle typeHandle, TargetPointer threadPtr); public TargetPointer GetFieldDescList(TypeHandle typeHandle); + // True if the MethodTable represents a type tracked as an Objective-C reference type with a finalizer + public bool IsTrackedReferenceWithFinalizer(TypeHandle typeHandle); public TargetPointer GetGCStaticsBasePointer(TypeHandle typeHandle); public TargetPointer GetNonGCStaticsBasePointer(TypeHandle typeHandle); public virtual ReadOnlySpan GetInstantiation(TypeHandle typeHandle); @@ -298,6 +300,7 @@ internal partial struct RuntimeTypeSystem_1 Collectible = 0x00200000, RequiresAlign8 = 0x00800000, ContainsGCPointers = 0x01000000, + IsTrackedReferenceWithFinalizer = 0x04000000, ContainsGenericVariables = 0x20000000, HasComponentSize = 0x80000000, // This is set if lower 16 bits is used for the component size, // otherwise the lower bits are used for WFLAGS_LOW @@ -346,6 +349,7 @@ internal partial struct RuntimeTypeSystem_1 public bool RequiresAlign8 => GetFlag(WFLAGS_HIGH.RequiresAlign8) != 0; public bool IsCollectible => GetFlag(WFLAGS_HIGH.Collectible) != 0; public bool IsDynamicStatics => GetFlag(WFLAGS2_ENUM.DynamicStatics) != 0; + public bool IsTrackedReferenceWithFinalizer => GetFlag(WFLAGS_HIGH.IsTrackedReferenceWithFinalizer) != 0; public bool IsGenericTypeDefinition => TestFlagWithMask(WFLAGS_LOW.GenericsMask, WFLAGS_LOW.GenericsMask_TypicalInstantiation); } @@ -656,6 +660,8 @@ Contracts used: public TargetPointer GetFieldDescList(TypeHandle typeHandle) => !typeHandle.IsMethodTable() ? TargetPointer.Null : GetClassData(typeHandle).FieldDescList; + public bool IsTrackedReferenceWithFinalizer(TypeHandle typeHandle) => typeHandle.IsMethodTable() && _methodTables[typeHandle.Address].Flags.IsTrackedReferenceWithFinalizer; + public TargetPointer GetGCStaticsBasePointer(TypeHandle typeHandle) { if (!typeHandle.IsMethodTable()) diff --git a/src/coreclr/vm/datadescriptor/datadescriptor.inc b/src/coreclr/vm/datadescriptor/datadescriptor.inc index f1026a91424dea..dbf0dcc7de9434 100644 --- a/src/coreclr/vm/datadescriptor/datadescriptor.inc +++ b/src/coreclr/vm/datadescriptor/datadescriptor.inc @@ -195,6 +195,9 @@ CDAC_TYPE_FIELD(InteropSyncBlockInfo, T_POINTER, CCW, cdac_data::RCW) CDAC_TYPE_FIELD(InteropSyncBlockInfo, T_POINTER, CCF, cdac_data::CCF) #endif // FEATURE_COMINTEROP +#ifdef FEATURE_OBJCMARSHAL +CDAC_TYPE_FIELD(InteropSyncBlockInfo, T_POINTER, TaggedMemory, cdac_data::TaggedMemory) +#endif // FEATURE_OBJCMARSHAL CDAC_TYPE_END(InteropSyncBlockInfo) CDAC_TYPE_BEGIN(SyncBlock) @@ -1565,6 +1568,9 @@ CDAC_GLOBAL_CONTRACT(ExecutionManager, c2) CDAC_GLOBAL_CONTRACT(GCInfo, c1) CDAC_GLOBAL_CONTRACT(Loader, c1) CDAC_GLOBAL_CONTRACT(Notifications, c1) +#ifdef FEATURE_OBJCMARSHAL +CDAC_GLOBAL_CONTRACT(ObjectiveCMarshal, c1) +#endif // FEATURE_OBJCMARSHAL CDAC_GLOBAL_CONTRACT(Object, c1) CDAC_GLOBAL_CONTRACT(PlatformMetadata, c1) CDAC_GLOBAL_CONTRACT(PrecodeStubs, c3) diff --git a/src/coreclr/vm/methodtable.h b/src/coreclr/vm/methodtable.h index b2357f362c9410..402b0cde9b15bd 100644 --- a/src/coreclr/vm/methodtable.h +++ b/src/coreclr/vm/methodtable.h @@ -3818,7 +3818,7 @@ public : enum_flag_ContainsGCPointers = 0x01000000, // Contains object references. [cDAC] [RuntimeTypeSystem]: Contract depends on this value enum_flag_HasTypeEquivalence = 0x02000000, // can be equivalent to another type - enum_flag_IsTrackedReferenceWithFinalizer = 0x04000000, + enum_flag_IsTrackedReferenceWithFinalizer = 0x04000000, // [cDAC] [RuntimeTypeSystem]: Contract depends on this value // unused = 0x08000000, enum_flag_IDynamicInterfaceCastable = 0x10000000, // class implements IDynamicInterfaceCastable interface diff --git a/src/coreclr/vm/syncblk.h b/src/coreclr/vm/syncblk.h index e995eeea2282bc..10cfd96621a493 100644 --- a/src/coreclr/vm/syncblk.h +++ b/src/coreclr/vm/syncblk.h @@ -383,6 +383,9 @@ struct cdac_data static constexpr size_t RCW = offsetof(InteropSyncBlockInfo, m_pRCW); static constexpr size_t CCF = offsetof(InteropSyncBlockInfo, m_pCCF); #endif // FEATURE_COMINTEROP +#ifdef FEATURE_OBJCMARSHAL + static constexpr size_t TaggedMemory = offsetof(InteropSyncBlockInfo, m_taggedMemory); +#endif // FEATURE_OBJCMARSHAL }; typedef DPTR(InteropSyncBlockInfo) PTR_InteropSyncBlockInfo; diff --git a/src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Abstractions/ContractRegistry.cs b/src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Abstractions/ContractRegistry.cs index 9d4088ee27b15c..174272de29e519 100644 --- a/src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Abstractions/ContractRegistry.cs +++ b/src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Abstractions/ContractRegistry.cs @@ -109,6 +109,10 @@ public abstract class ContractRegistry /// public virtual IBuiltInCOM BuiltInCOM => GetContract(); /// + /// Gets an instance of the ObjectiveCMarshal contract for the target. + /// + public virtual IObjectiveCMarshal ObjectiveCMarshal => GetContract(); + /// /// Gets an instance of the ConditionalWeakTable contract for the target. /// public virtual IConditionalWeakTable ConditionalWeakTable => GetContract(); diff --git a/src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Abstractions/Contracts/IObject.cs b/src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Abstractions/Contracts/IObject.cs index e6ca9783cb81ae..ffec5e19f5daf0 100644 --- a/src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Abstractions/Contracts/IObject.cs +++ b/src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Abstractions/Contracts/IObject.cs @@ -13,6 +13,8 @@ public interface IObject : IContract TargetPointer GetArrayData(TargetPointer address, out uint count, out TargetPointer boundsStart, out TargetPointer lowerBounds) => throw new NotImplementedException(); bool GetBuiltInComData(TargetPointer address, out TargetPointer rcw, out TargetPointer ccw, out TargetPointer ccf) => throw new NotImplementedException(); int TryGetHashCode(TargetPointer address) => throw new NotImplementedException(); + // Returns the SyncBlock address for the object, or TargetPointer.Null if no sync block is associated with it. + TargetPointer GetSyncBlockAddress(TargetPointer address) => throw new NotImplementedException(); } public readonly struct Object : IObject diff --git a/src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Abstractions/Contracts/IObjectiveCMarshal.cs b/src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Abstractions/Contracts/IObjectiveCMarshal.cs new file mode 100644 index 00000000000000..7d4e8886bd466f --- /dev/null +++ b/src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Abstractions/Contracts/IObjectiveCMarshal.cs @@ -0,0 +1,17 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System; + +namespace Microsoft.Diagnostics.DataContractReader.Contracts; + +public interface IObjectiveCMarshal : IContract +{ + static string IContract.Name { get; } = nameof(ObjectiveCMarshal); + TargetPointer GetTaggedMemory(TargetPointer address, out TargetNUInt size) => throw new NotImplementedException(); +} + +public readonly struct ObjectiveCMarshal : IObjectiveCMarshal +{ + // Everything throws NotImplementedException +} diff --git a/src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Abstractions/Contracts/IRuntimeTypeSystem.cs b/src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Abstractions/Contracts/IRuntimeTypeSystem.cs index 6bdde7301068bb..4ba56875057856 100644 --- a/src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Abstractions/Contracts/IRuntimeTypeSystem.cs +++ b/src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Abstractions/Contracts/IRuntimeTypeSystem.cs @@ -141,6 +141,8 @@ public interface IRuntimeTypeSystem : IContract ushort GetNumStaticFields(TypeHandle typeHandle) => throw new NotImplementedException(); ushort GetNumThreadStaticFields(TypeHandle typeHandle) => throw new NotImplementedException(); TargetPointer GetFieldDescList(TypeHandle typeHandle) => throw new NotImplementedException(); + // True if the MethodTable represents a type tracked as an Objective-C reference type with a finalizer + bool IsTrackedReferenceWithFinalizer(TypeHandle typeHandle) => throw new NotImplementedException(); TargetPointer GetGCStaticsBasePointer(TypeHandle typeHandle) => throw new NotImplementedException(); TargetPointer GetNonGCStaticsBasePointer(TypeHandle typeHandle) => throw new NotImplementedException(); TargetPointer GetGCThreadStaticsBasePointer(TypeHandle typeHandle, TargetPointer threadPtr) => throw new NotImplementedException(); diff --git a/src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/Object_1.cs b/src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/Object_1.cs index ca3ca25c801122..cf062e84be1a69 100644 --- a/src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/Object_1.cs +++ b/src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/Object_1.cs @@ -13,7 +13,6 @@ namespace Microsoft.Diagnostics.DataContractReader.Contracts; private readonly ulong _methodTableOffset; private readonly byte _objectToMethodTableUnmask; private readonly TargetPointer _stringMethodTable; - private readonly TargetPointer _syncTableEntries; private readonly uint _syncBlockIsHashOrSyncBlockIndex; private readonly uint _syncBlockIsHashCode; private readonly uint _syncBlockHashCodeMask; @@ -25,7 +24,6 @@ internal Object_1(Target target) _methodTableOffset = (ulong)target.GetTypeInfo(DataType.Object).Fields["m_pMethTab"].Offset; _objectToMethodTableUnmask = target.ReadGlobal(Constants.Globals.ObjectToMethodTableUnmask); _stringMethodTable = target.ReadPointer(target.ReadGlobalPointer(Constants.Globals.StringMethodTable)); - _syncTableEntries = target.ReadPointer(target.ReadGlobalPointer(Constants.Globals.SyncTableEntries)); _syncBlockIsHashOrSyncBlockIndex = target.ReadGlobal(Constants.Globals.SyncBlockIsHashOrSyncBlockIndex); _syncBlockIsHashCode = target.ReadGlobal(Constants.Globals.SyncBlockIsHashCode); _syncBlockHashCodeMask = target.ReadGlobal(Constants.Globals.SyncBlockHashCodeMask); @@ -100,22 +98,11 @@ public bool GetBuiltInComData(TargetPointer address, out TargetPointer rcw, out ccw = TargetPointer.Null; ccf = TargetPointer.Null; - ulong objectHeaderSize = _target.GetTypeInfo(DataType.ObjectHeader).Size!.Value; - Data.ObjectHeader header = _target.ProcessedData.GetOrAdd(address - objectHeaderSize); - uint syncBlockValue = header.SyncBlockValue; - - // Check if the sync block value represents a sync block index - if ((syncBlockValue & (_syncBlockIsHashCode | _syncBlockIsHashOrSyncBlockIndex)) - != _syncBlockIsHashOrSyncBlockIndex) + TargetPointer syncBlockPtr = GetSyncBlockAddress(address); + if (syncBlockPtr == TargetPointer.Null) return false; - uint index = syncBlockValue & _syncBlockIndexMask; - ulong offsetInSyncTableEntries = index * (ulong)_target.GetTypeInfo(DataType.SyncTableEntry).Size!; - Data.SyncTableEntry entry = _target.ProcessedData.GetOrAdd(_syncTableEntries + offsetInSyncTableEntries); - if (entry.SyncBlock is not Data.SyncBlock syncBlock) - return false; - - return _target.Contracts.SyncBlock.GetBuiltInComData(syncBlock.Address, out rcw, out ccw, out ccf); + return _target.Contracts.SyncBlock.GetBuiltInComData(syncBlockPtr, out rcw, out ccw, out ccf); } int IObject.TryGetHashCode(TargetPointer address) @@ -132,8 +119,7 @@ int IObject.TryGetHashCode(TargetPointer address) } else { - uint index = syncBlockValue & _syncBlockIndexMask; - TargetPointer syncBlockPtr = _target.Contracts.SyncBlock.GetSyncBlock(index); + TargetPointer syncBlockPtr = GetSyncBlockAddress(address); if (syncBlockPtr != TargetPointer.Null) { Data.SyncBlock syncBlock = _target.ProcessedData.GetOrAdd(syncBlockPtr); @@ -144,4 +130,19 @@ int IObject.TryGetHashCode(TargetPointer address) return 0; } + + public TargetPointer GetSyncBlockAddress(TargetPointer address) + { + ulong objectHeaderSize = _target.GetTypeInfo(DataType.ObjectHeader).Size!.Value; + Data.ObjectHeader header = _target.ProcessedData.GetOrAdd(address - objectHeaderSize); + uint syncBlockValue = header.SyncBlockValue; + + // Check if the sync block value represents a sync block index (not a hash code) + if ((syncBlockValue & (_syncBlockIsHashCode | _syncBlockIsHashOrSyncBlockIndex)) + != _syncBlockIsHashOrSyncBlockIndex) + return TargetPointer.Null; + + uint index = syncBlockValue & _syncBlockIndexMask; + return _target.Contracts.SyncBlock.GetSyncBlock(index); + } } diff --git a/src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/ObjectiveCMarshal_1.cs b/src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/ObjectiveCMarshal_1.cs new file mode 100644 index 00000000000000..5fec96d68afcd2 --- /dev/null +++ b/src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/ObjectiveCMarshal_1.cs @@ -0,0 +1,29 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +namespace Microsoft.Diagnostics.DataContractReader.Contracts; + +internal readonly struct ObjectiveCMarshal_1 : IObjectiveCMarshal +{ + private readonly Target _target; + + internal ObjectiveCMarshal_1(Target target) + { + _target = target; + } + + public TargetPointer GetTaggedMemory(TargetPointer address, out TargetNUInt size) + { + size = default; + + TargetPointer syncBlock = _target.Contracts.Object.GetSyncBlockAddress(address); + if (syncBlock == TargetPointer.Null) + return TargetPointer.Null; + + Data.SyncBlock sb = _target.ProcessedData.GetOrAdd(syncBlock); + TargetPointer taggedMemory = sb.InteropInfo?.TaggedMemory ?? TargetPointer.Null; + if (taggedMemory != TargetPointer.Null) + size = new TargetNUInt(2 * (ulong)_target.PointerSize); + return taggedMemory; + } +} diff --git a/src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/RuntimeTypeSystem_1.cs b/src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/RuntimeTypeSystem_1.cs index 706c016420e3ba..26debd447f39ec 100644 --- a/src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/RuntimeTypeSystem_1.cs +++ b/src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/RuntimeTypeSystem_1.cs @@ -665,6 +665,7 @@ public ushort GetNumVtableSlots(TypeHandle typeHandle) public ushort GetNumStaticFields(TypeHandle typeHandle) => !typeHandle.IsMethodTable() ? (ushort)0 : GetClassData(typeHandle).NumStaticFields; public ushort GetNumThreadStaticFields(TypeHandle typeHandle) => !typeHandle.IsMethodTable() ? (ushort)0 : GetClassData(typeHandle).NumThreadStaticFields; public TargetPointer GetFieldDescList(TypeHandle typeHandle) => !typeHandle.IsMethodTable() ? TargetPointer.Null : GetClassData(typeHandle).FieldDescList; + public bool IsTrackedReferenceWithFinalizer(TypeHandle typeHandle) => typeHandle.IsMethodTable() && _methodTables[typeHandle.Address].Flags.IsTrackedReferenceWithFinalizer; private TargetPointer GetDynamicStaticsInfo(TypeHandle typeHandle) { if (!typeHandle.IsMethodTable()) diff --git a/src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/CoreCLRContracts.cs b/src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/CoreCLRContracts.cs index f84ae929637aaa..c60f905bbe6fd8 100644 --- a/src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/CoreCLRContracts.cs +++ b/src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/CoreCLRContracts.cs @@ -27,6 +27,7 @@ public static void Register(ContractRegistry registry) registry.Register("c1", static t => new CodeNotifications_1(t)); registry.Register("c1", static t => new SignatureDecoder_1(t)); registry.Register("c1", static t => new BuiltInCOM_1(t)); + registry.Register("c1", static t => new ObjectiveCMarshal_1(t)); registry.Register("c1", static t => new ConditionalWeakTable_1(t)); registry.Register("c1", static t => new AuxiliarySymbols_1(t)); registry.Register("c1", static t => new Debugger_1(t)); diff --git a/src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Data/InteropSyncBlockInfo.cs b/src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Data/InteropSyncBlockInfo.cs index a38a57f1688603..e0791156275acc 100644 --- a/src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Data/InteropSyncBlockInfo.cs +++ b/src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Data/InteropSyncBlockInfo.cs @@ -21,9 +21,13 @@ public InteropSyncBlockInfo(Target target, TargetPointer address) CCF = type.Fields.TryGetValue(nameof(CCF), out Target.FieldInfo ccfField) ? target.ReadPointer(address + (ulong)ccfField.Offset) : TargetPointer.Null; + TaggedMemory = type.Fields.TryGetValue(nameof(TaggedMemory), out Target.FieldInfo taggedMemoryField) + ? target.ReadPointer(address + (ulong)taggedMemoryField.Offset) + : TargetPointer.Null; } public TargetPointer RCW { get; init; } public TargetPointer CCW { get; init; } public TargetPointer CCF { get; init; } + public TargetPointer TaggedMemory { get; init; } } diff --git a/src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/RuntimeTypeSystemHelpers/MethodTableFlags_1.cs b/src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/RuntimeTypeSystemHelpers/MethodTableFlags_1.cs index d18b688a1244b1..466d45a4ee4975 100644 --- a/src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/RuntimeTypeSystemHelpers/MethodTableFlags_1.cs +++ b/src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/RuntimeTypeSystemHelpers/MethodTableFlags_1.cs @@ -49,6 +49,7 @@ internal enum WFLAGS_HIGH : uint RequiresAlign8 = 0x00800000, ContainsGCPointers = 0x01000000, + IsTrackedReferenceWithFinalizer = 0x04000000, // [cDAC] [RuntimeTypeSystem]: Contract depends on this value ContainsGenericVariables = 0x20000000, HasComponentSize = 0x80000000, // This is set if lower 16 bits is used for the component size, // otherwise the lower bits are used for WFLAGS_LOW @@ -104,6 +105,7 @@ private bool TestFlagWithMask(WFLAGS2_ENUM mask, WFLAGS2_ENUM flag) public bool ContainsGCPointers => GetFlag(WFLAGS_HIGH.ContainsGCPointers) != 0; public bool RequiresAlign8 => GetFlag(WFLAGS_HIGH.RequiresAlign8) != 0; public bool IsCollectible => GetFlag(WFLAGS_HIGH.Collectible) != 0; + public bool IsTrackedReferenceWithFinalizer => GetFlag(WFLAGS_HIGH.IsTrackedReferenceWithFinalizer) != 0; public bool IsDynamicStatics => GetFlag(WFLAGS2_ENUM.DynamicStatics) != 0; public bool IsGenericTypeDefinition => TestFlagWithMask(WFLAGS_LOW.GenericsMask, WFLAGS_LOW.GenericsMask_TypicalInstantiation); public bool ContainsGenericVariables => GetFlag(WFLAGS_HIGH.ContainsGenericVariables) != 0; diff --git a/src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Legacy/SOSDacImpl.cs b/src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Legacy/SOSDacImpl.cs index d75018d735878f..b058d026347fd3 100644 --- a/src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Legacy/SOSDacImpl.cs +++ b/src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Legacy/SOSDacImpl.cs @@ -6265,9 +6265,101 @@ int ISOSDacInterface10.GetComWrappersRCWData(ClrDataAddress rcw, ClrDataAddress* #region ISOSDacInterface11 int ISOSDacInterface11.IsTrackedType(ClrDataAddress objAddr, Interop.BOOL* isTrackedType, Interop.BOOL* hasTaggedMemory) - => LegacyFallbackHelper.CanFallback() && _legacyImpl11 is not null ? _legacyImpl11.IsTrackedType(objAddr, isTrackedType, hasTaggedMemory) : HResults.E_NOTIMPL; + { + int hr = HResults.S_OK; + try + { + if (objAddr == 0 || isTrackedType == null || hasTaggedMemory == null) + throw new ArgumentException(); + + *isTrackedType = Interop.BOOL.FALSE; + *hasTaggedMemory = Interop.BOOL.FALSE; + + TargetPointer objPtr = objAddr.ToTargetPointer(_target); + Contracts.IObject objectContract = _target.Contracts.Object; + + TargetPointer mt = objectContract.GetMethodTableAddress(objPtr); + if (mt == TargetPointer.Null) + throw new ArgumentException(); + + Contracts.IRuntimeTypeSystem rtsContract = _target.Contracts.RuntimeTypeSystem; + TypeHandle mtHandle = rtsContract.GetTypeHandle(mt); + if (rtsContract.IsTrackedReferenceWithFinalizer(mtHandle)) + *isTrackedType = Interop.BOOL.TRUE; + + hr = (*isTrackedType == Interop.BOOL.TRUE) ? HResults.S_OK : HResults.S_FALSE; + + if (_target.Contracts.TryGetContract(out IObjectiveCMarshal? objcContract)) + { + TargetPointer taggedMemoryPtr = objcContract.GetTaggedMemory(objPtr, out _); + if (taggedMemoryPtr != TargetPointer.Null) + *hasTaggedMemory = Interop.BOOL.TRUE; + } + } + catch (System.Exception ex) + { + hr = ex.HResult; + } +#if DEBUG + if (_legacyImpl11 is not null) + { + Interop.BOOL isTrackedTypeLocal; + Interop.BOOL hasTaggedMemoryLocal; + int hrLocal = _legacyImpl11.IsTrackedType(objAddr, &isTrackedTypeLocal, &hasTaggedMemoryLocal); + Debug.ValidateHResult(hr, hrLocal); + if (hr == HResults.S_OK || hr == HResults.S_FALSE) + { + Debug.Assert(*isTrackedType == isTrackedTypeLocal); + Debug.Assert(*hasTaggedMemory == hasTaggedMemoryLocal); + } + } +#endif + return hr; + } + int ISOSDacInterface11.GetTaggedMemory(ClrDataAddress objAddr, ClrDataAddress* taggedMemory, nuint* taggedMemorySizeInBytes) - => LegacyFallbackHelper.CanFallback() && _legacyImpl11 is not null ? _legacyImpl11.GetTaggedMemory(objAddr, taggedMemory, taggedMemorySizeInBytes) : HResults.E_NOTIMPL; + { + int hr = HResults.S_FALSE; + try + { + if (objAddr == 0 || taggedMemory == null || taggedMemorySizeInBytes == null) + throw new ArgumentException(); + + *taggedMemory = 0; + *taggedMemorySizeInBytes = 0; + + TargetPointer objPtr = objAddr.ToTargetPointer(_target); + if (_target.Contracts.TryGetContract(out IObjectiveCMarshal? objcContract)) + { + TargetPointer taggedMemoryPtr = objcContract.GetTaggedMemory(objPtr, out TargetNUInt taggedMemorySizeNUInt); + if (taggedMemoryPtr != TargetPointer.Null) + { + *taggedMemory = taggedMemoryPtr.ToClrDataAddress(_target); + *taggedMemorySizeInBytes = (nuint)taggedMemorySizeNUInt.Value; + hr = HResults.S_OK; + } + } + } + catch (System.Exception ex) + { + hr = ex.HResult; + } +#if DEBUG + if (_legacyImpl11 is not null) + { + ClrDataAddress taggedMemoryLocal; + nuint taggedMemorySizeInBytesLocal; + int hrLocal = _legacyImpl11.GetTaggedMemory(objAddr, &taggedMemoryLocal, &taggedMemorySizeInBytesLocal); + Debug.ValidateHResult(hr, hrLocal); + if (hr == HResults.S_OK || hr == HResults.S_FALSE) + { + Debug.Assert(*taggedMemory == taggedMemoryLocal); + Debug.Assert(*taggedMemorySizeInBytes == taggedMemorySizeInBytesLocal); + } + } +#endif + return hr; + } #endregion ISOSDacInterface11 #region ISOSDacInterface12 diff --git a/src/native/managed/cdac/tests/DumpTests/Debuggees/Directory.Build.targets b/src/native/managed/cdac/tests/DumpTests/Debuggees/Directory.Build.targets index 8728cd5eac9853..4341b74a20714c 100644 --- a/src/native/managed/cdac/tests/DumpTests/Debuggees/Directory.Build.targets +++ b/src/native/managed/cdac/tests/DumpTests/Debuggees/Directory.Build.targets @@ -25,6 +25,7 @@ DumpTypes="$(DumpTypes)" R2RModes="$(R2RModes)" WindowsOnly="$(WindowsOnly)" + MacOnly="$(MacOnly)" ProjectPath="$(MSBuildProjectFullPath)" /> diff --git a/src/native/managed/cdac/tests/DumpTests/Debuggees/ObjectiveCMarshal/ObjectiveCMarshal.csproj b/src/native/managed/cdac/tests/DumpTests/Debuggees/ObjectiveCMarshal/ObjectiveCMarshal.csproj new file mode 100644 index 00000000000000..3da9cf927e9eca --- /dev/null +++ b/src/native/managed/cdac/tests/DumpTests/Debuggees/ObjectiveCMarshal/ObjectiveCMarshal.csproj @@ -0,0 +1,8 @@ + + + + $(NoWarn);CA1416 + Full + true + + diff --git a/src/native/managed/cdac/tests/DumpTests/Debuggees/ObjectiveCMarshal/Program.cs b/src/native/managed/cdac/tests/DumpTests/Debuggees/ObjectiveCMarshal/Program.cs new file mode 100644 index 00000000000000..6e482ab247404f --- /dev/null +++ b/src/native/managed/cdac/tests/DumpTests/Debuggees/ObjectiveCMarshal/Program.cs @@ -0,0 +1,76 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System; +using System.Runtime.InteropServices; +using System.Runtime.InteropServices.ObjectiveC; + +/// +/// Debuggee for cDAC dump tests — exercises the ObjectiveCMarshal contract's tagged memory APIs. +/// Creates an Objective-C tracked reference object with tagged memory allocated and keeps it +/// alive via a strong GC handle so dump tests can find it. This debuggee is macOS-only, as +/// tagged memory support requires FEATURE_OBJCMARSHAL. +/// +internal static partial class Program +{ + [ObjectiveCTrackedTypeAttribute] + private sealed class TrackedObject + { +#pragma warning disable CA1821 // Intentionally empty — the runtime requires a finalizer for IsTrackedReferenceWithFinalizer + ~TrackedObject() { } +#pragma warning restore CA1821 + } + + private static unsafe void Main() + { + if (OperatingSystem.IsMacOS()) + { + SetupAndCrash(); + } + + Environment.FailFast("cDAC dump test: ObjectiveCMarshal debuggee intentional crash"); + } + + [System.Runtime.Versioning.SupportedOSPlatform("macos")] + private static unsafe void SetupAndCrash() + { + var obj = new TrackedObject(); + + // Initialize the ObjectiveC marshal runtime + ObjectiveCMarshal.Initialize( + &BeginEndCallback, + &IsReferencedCallback, + &TrackedObjectEnteredFinalization, + OnUnhandledExceptionPropagationHandler); + + // Create a reference tracking handle — this allocates tagged memory + GCHandle handle = ObjectiveCMarshal.CreateReferenceTrackingHandle(obj, out _); + + // Keep the object alive via a strong handle so the dump test can find it + GCHandle strongHandle = GCHandle.Alloc(obj, GCHandleType.Normal); + + GC.KeepAlive(handle); + GC.KeepAlive(strongHandle); + GC.KeepAlive(obj); + + Environment.FailFast("cDAC dump test: ObjectiveCMarshal debuggee intentional crash"); + } + + [System.Runtime.InteropServices.UnmanagedCallersOnly] + private static void BeginEndCallback() { } + + [System.Runtime.InteropServices.UnmanagedCallersOnly] + private static int IsReferencedCallback(IntPtr ptr) => 1; + + [System.Runtime.InteropServices.UnmanagedCallersOnly] + private static void TrackedObjectEnteredFinalization(IntPtr ptr) { } + + private static unsafe delegate* unmanaged OnUnhandledExceptionPropagationHandler( + Exception e, + System.RuntimeMethodHandle lastMethod, + out IntPtr context) + { + context = IntPtr.Zero; + return null; + } +} diff --git a/src/native/managed/cdac/tests/DumpTests/DumpTests.targets b/src/native/managed/cdac/tests/DumpTests/DumpTests.targets index ae8228ffa7f7fd..433dcdf50b9939 100644 --- a/src/native/managed/cdac/tests/DumpTests/DumpTests.targets +++ b/src/native/managed/cdac/tests/DumpTests/DumpTests.targets @@ -120,6 +120,21 @@ + + + + + + + + + + diff --git a/src/native/managed/cdac/tests/DumpTests/ObjectiveCMarshalDumpTests.cs b/src/native/managed/cdac/tests/DumpTests/ObjectiveCMarshalDumpTests.cs new file mode 100644 index 00000000000000..d7ece25db165d5 --- /dev/null +++ b/src/native/managed/cdac/tests/DumpTests/ObjectiveCMarshalDumpTests.cs @@ -0,0 +1,70 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Collections.Generic; +using Microsoft.Diagnostics.DataContractReader.Contracts; +using Xunit; + +namespace Microsoft.Diagnostics.DataContractReader.DumpTests; + +/// +/// Dump-based integration tests for the ObjectiveCMarshal contract's tagged memory APIs. +/// Uses the ObjectiveCMarshal debuggee which creates a tracked reference object with +/// tagged memory allocated before crashing. +/// These tests only run on macOS dumps, as FEATURE_OBJCMARSHAL requires macOS. +/// +public class ObjectiveCMarshalDumpTests : DumpTestBase +{ + protected override string DebuggeeName => "ObjectiveCMarshal"; + protected override string DumpType => "full"; + + /// + /// Walks all strong GC handles and returns the addresses of tracked objects + /// (those for which returns true). + /// + private List FindTrackedObjects() + { + IGC gcContract = Target.Contracts.GC; + IObject objectContract = Target.Contracts.Object; + IRuntimeTypeSystem rtsContract = Target.Contracts.RuntimeTypeSystem; + var results = new List(); + + foreach (HandleData handleData in gcContract.GetHandles([HandleType.Strong])) + { + TargetPointer objectAddress = Target.ReadPointer(handleData.Handle); + if (objectAddress == TargetPointer.Null) + continue; + + TargetPointer mt = objectContract.GetMethodTableAddress(objectAddress); + if (mt == TargetPointer.Null) + continue; + + TypeHandle typeHandle = rtsContract.GetTypeHandle(mt); + if (rtsContract.IsTrackedReferenceWithFinalizer(typeHandle)) + results.Add(objectAddress); + } + + return results; + } + + [ConditionalTheory] + [MemberData(nameof(TestConfigurations))] + [SkipOnOS(IncludeOnly = "osx", Reason = "Objective-C interop (tagged memory) is only supported on macOS")] + public void GetTaggedMemory_TrackedObject_HasTaggedMemory(TestConfiguration config) + { + InitializeDumpTest(config); + IObjectiveCMarshal objcContract = Target.Contracts.ObjectiveCMarshal; + + List trackedObjects = FindTrackedObjects(); + Assert.NotEmpty(trackedObjects); + + // Every tracked object found should have tagged memory + foreach (TargetPointer objPtr in trackedObjects) + { + TargetPointer taggedMemory = objcContract.GetTaggedMemory(objPtr, out TargetNUInt size); + Assert.NotEqual(TargetPointer.Null, taggedMemory); + // Tagged memory size is always 2 * pointer size + Assert.Equal(2ul * (ulong)Target.PointerSize, size.Value); + } + } +} diff --git a/src/native/managed/cdac/tests/MockDescriptors/MockDescriptors.Object.cs b/src/native/managed/cdac/tests/MockDescriptors/MockDescriptors.Object.cs index 0e3ceb9bb0683a..5474218db2172c 100644 --- a/src/native/managed/cdac/tests/MockDescriptors/MockDescriptors.Object.cs +++ b/src/native/managed/cdac/tests/MockDescriptors/MockDescriptors.Object.cs @@ -203,7 +203,7 @@ internal ulong AddObject(ulong methodTable, uint prefixSize = 0) return mockObject.Address; } - internal ulong AddObjectWithSyncBlock(ulong methodTable, uint syncBlockIndex, ulong rcw, ulong ccw, ulong ccf) + internal ulong AddObjectWithSyncBlock(ulong methodTable, uint syncBlockIndex, ulong rcw, ulong ccw, ulong ccf, ulong taggedMemory = 0) { const uint IsSyncBlockIndexBits = 0x08000000; const uint SyncBlockIndexMask = (1 << 26) - 1; @@ -218,7 +218,7 @@ internal ulong AddObjectWithSyncBlock(ulong methodTable, uint syncBlockIndex, ul ulong syncTableValueAddress = address - TestSyncBlockValueToObjectOffset; Builder.TargetTestHelpers.Write(Builder.BorrowAddressRange(syncTableValueAddress, sizeof(uint)), syncTableValue); - AddSyncBlock(syncBlockIndex, rcw, ccw, ccf); + AddSyncBlock(syncBlockIndex, rcw, ccw, ccf, taggedMemory); return address; } @@ -303,9 +303,9 @@ private void AddSyncTableEntriesPointer() Builder.AddHeapFragment(fragment); } - private void AddSyncBlock(uint index, ulong rcw, ulong ccw, ulong ccf) + private void AddSyncBlock(uint index, ulong rcw, ulong ccw, ulong ccf, ulong taggedMemory = 0) { - MockSyncBlock syncBlock = SyncBlockBuilder.AddSyncBlock(rcw, ccw, ccf, name: $"Sync Block {index}"); + MockSyncBlock syncBlock = SyncBlockBuilder.AddSyncBlock(rcw, ccw, ccf, taggedMemory: taggedMemory, name: $"Sync Block {index}"); ulong syncTableEntryAddress = TestSyncTableEntriesAddress + ((ulong)index * (ulong)SyncTableEntryLayout.Size); MockMemorySpace.HeapFragment syncTableEntryFragment = new() diff --git a/src/native/managed/cdac/tests/MockDescriptors/MockDescriptors.SyncBlock.cs b/src/native/managed/cdac/tests/MockDescriptors/MockDescriptors.SyncBlock.cs index 69e4da037e6637..c62c075bd1cd08 100644 --- a/src/native/managed/cdac/tests/MockDescriptors/MockDescriptors.SyncBlock.cs +++ b/src/native/managed/cdac/tests/MockDescriptors/MockDescriptors.SyncBlock.cs @@ -33,12 +33,14 @@ internal sealed class MockInteropSyncBlockInfo : TypedView private const string RCWFieldName = "RCW"; private const string CCWFieldName = "CCW"; private const string CCFFieldName = "CCF"; + private const string TaggedMemoryFieldName = "TaggedMemory"; public static Layout CreateLayout(MockTarget.Architecture architecture) => new SequentialLayoutBuilder("InteropSyncBlockInfo", architecture) .AddPointerField(RCWFieldName) .AddPointerField(CCWFieldName) .AddPointerField(CCFFieldName) + .AddPointerField(TaggedMemoryFieldName) .Build(); public ulong RCW @@ -58,6 +60,12 @@ public ulong CCF get => ReadPointerField(CCFFieldName); set => WritePointerField(CCFFieldName, value); } + + public ulong TaggedMemory + { + get => ReadPointerField(TaggedMemoryFieldName); + set => WritePointerField(TaggedMemoryFieldName, value); + } } internal sealed class MockSyncBlock : TypedView @@ -151,7 +159,8 @@ internal MockSyncBlock AddSyncBlock( ulong ccw, ulong ccf, bool hasInteropInfo = true, - string name = "SyncBlock") + string name = "SyncBlock", + ulong taggedMemory = 0) { int totalSize = SyncBlockLayout.Size + (hasInteropInfo ? InteropSyncBlockInfoLayout.Size : 0); MockMemorySpace.HeapFragment fragment = _allocator.Allocate((ulong)totalSize, name); @@ -168,6 +177,7 @@ internal MockSyncBlock AddSyncBlock( interopInfo.RCW = rcw; interopInfo.CCW = ccw; interopInfo.CCF = ccf; + interopInfo.TaggedMemory = taggedMemory; syncBlock.InteropInfo = interopAddress; } @@ -181,15 +191,16 @@ internal MockSyncBlock AddSyncBlock( /// CCW pointer to store (pass 0 for none). /// CCF pointer to store (pass 0 for none). /// When false, the InteropInfo pointer in the SyncBlock is left null. + /// Tagged memory pointer to store (pass 0 for none). internal MockSyncBlock AddSyncBlockToCleanupList( - ulong rcw, ulong ccw, ulong ccf, bool hasInteropInfo = true) + ulong rcw, ulong ccw, ulong ccf, bool hasInteropInfo = true, ulong taggedMemory = 0) { if (_syncBlockCache is null) { throw new InvalidOperationException("Cleanup-list support requires the cache/global initialization path."); } - MockSyncBlock syncBlock = AddSyncBlock(rcw, ccw, ccf, hasInteropInfo, "SyncBlock (cleanup)"); + MockSyncBlock syncBlock = AddSyncBlock(rcw, ccw, ccf, hasInteropInfo, "SyncBlock (cleanup)", taggedMemory); syncBlock.LinkNext = _cleanupListHeadAddress; _cleanupListHeadAddress = syncBlock.Address; _syncBlockCache.CleanupBlockList = _cleanupListHeadAddress; diff --git a/src/native/managed/cdac/tests/ObjectiveCMarshalTests.cs b/src/native/managed/cdac/tests/ObjectiveCMarshalTests.cs new file mode 100644 index 00000000000000..d328f99e6e4adb --- /dev/null +++ b/src/native/managed/cdac/tests/ObjectiveCMarshalTests.cs @@ -0,0 +1,127 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System; +using System.Collections.Generic; +using Microsoft.Diagnostics.DataContractReader.Contracts; +using Xunit; + +namespace Microsoft.Diagnostics.DataContractReader.Tests; + +public class ObjectiveCMarshalTests +{ + private const uint SyncBlockIsHashOrSyncBlockIndex = 0x08000000; + private const uint SyncBlockIsHashCode = 0x04000000; + private const uint SyncBlockIndexMask = (1u << 26) - 1; + + private static TestPlaceholderTarget CreateObjectiveCMarshalTarget( + MockTarget.Architecture arch, + Action configure) + { + var targetBuilder = new TestPlaceholderTarget.Builder(arch); + MockDescriptors.RuntimeTypeSystem rtsBuilder = new(targetBuilder.MemoryBuilder); + MockDescriptors.MockObjectBuilder objectBuilder = new(rtsBuilder); + + configure(objectBuilder); + + targetBuilder + .AddTypes(CreateContractTypes(objectBuilder)) + .AddGlobals(CreateContractGlobals(objectBuilder)) + .AddContract(version: "c1") + .AddContract(version: "c1") + .AddContract(version: "c1"); + + return targetBuilder.Build(); + } + + private static Dictionary CreateContractTypes(MockDescriptors.MockObjectBuilder objectBuilder) + => new Dictionary + { + [DataType.Object] = TargetTestHelpers.CreateTypeInfo(objectBuilder.ObjectLayout), + [DataType.ObjectHeader] = TargetTestHelpers.CreateTypeInfo(objectBuilder.ObjectHeaderLayout), + [DataType.SyncTableEntry] = TargetTestHelpers.CreateTypeInfo(objectBuilder.SyncTableEntryLayout), + [DataType.SyncBlock] = TargetTestHelpers.CreateTypeInfo(objectBuilder.SyncBlockLayout), + [DataType.InteropSyncBlockInfo] = TargetTestHelpers.CreateTypeInfo(objectBuilder.InteropSyncBlockInfoLayout), + }; + + private static (string Name, ulong Value)[] CreateContractGlobals(MockDescriptors.MockObjectBuilder objectBuilder) + => + [ + (nameof(Constants.Globals.ObjectToMethodTableUnmask), MockDescriptors.MockObjectBuilder.TestObjectToMethodTableUnmask), + (nameof(Constants.Globals.StringMethodTable), MockDescriptors.MockObjectBuilder.TestStringMethodTableGlobalAddress), + (nameof(Constants.Globals.SyncTableEntries), MockDescriptors.MockObjectBuilder.TestSyncTableEntriesGlobalAddress), + (nameof(Constants.Globals.SyncBlockValueToObjectOffset), MockDescriptors.MockObjectBuilder.TestSyncBlockValueToObjectOffset), + (nameof(Constants.Globals.SyncBlockIsHashOrSyncBlockIndex), SyncBlockIsHashOrSyncBlockIndex), + (nameof(Constants.Globals.SyncBlockIsHashCode), SyncBlockIsHashCode), + (nameof(Constants.Globals.SyncBlockIndexMask), SyncBlockIndexMask), + (nameof(Constants.Globals.SyncBlockHashCodeMask), SyncBlockIndexMask), + ]; + + [Theory] + [ClassData(typeof(MockTarget.StdArch))] + public void GetTaggedMemory_NoSyncBlockIndex_ReturnsNull(MockTarget.Architecture arch) + { + ulong testObjectAddress = 0; + TestPlaceholderTarget target = CreateObjectiveCMarshalTarget(arch, + objectBuilder => + { + // AddObject with only the ObjectHeader prefix but no sync block index + testObjectAddress = objectBuilder.AddObject(0, prefixSize: (uint)objectBuilder.ObjectHeaderLayout.Size); + }); + + IObjectiveCMarshal contract = target.Contracts.ObjectiveCMarshal; + TargetPointer result = contract.GetTaggedMemory(testObjectAddress, out TargetNUInt size); + + Assert.Equal(TargetPointer.Null, result); + Assert.Equal(default, size); + } + + [Theory] + [ClassData(typeof(MockTarget.StdArch))] + public void GetTaggedMemory_NullTaggedMemory_ReturnsNull(MockTarget.Architecture arch) + { + ulong testObjectAddress = 0; + TestPlaceholderTarget target = CreateObjectiveCMarshalTarget(arch, + objectBuilder => + { + testObjectAddress = objectBuilder.AddObjectWithSyncBlock( + methodTable: 0, + syncBlockIndex: 1, + rcw: 0, + ccw: 0, + ccf: 0, + taggedMemory: 0); + }); + + IObjectiveCMarshal contract = target.Contracts.ObjectiveCMarshal; + TargetPointer result = contract.GetTaggedMemory(testObjectAddress, out TargetNUInt size); + + Assert.Equal(TargetPointer.Null, result); + Assert.Equal(default, size); + } + + [Theory] + [ClassData(typeof(MockTarget.StdArch))] + public void GetTaggedMemory_HasTaggedMemory_ReturnsPointerAndSize(MockTarget.Architecture arch) + { + ulong testObjectAddress = 0; + const ulong expectedTaggedMemory = 0x5000; + TestPlaceholderTarget target = CreateObjectiveCMarshalTarget(arch, + objectBuilder => + { + testObjectAddress = objectBuilder.AddObjectWithSyncBlock( + methodTable: 0, + syncBlockIndex: 1, + rcw: 0, + ccw: 0, + ccf: 0, + taggedMemory: expectedTaggedMemory); + }); + + IObjectiveCMarshal contract = target.Contracts.ObjectiveCMarshal; + TargetPointer result = contract.GetTaggedMemory(testObjectAddress, out TargetNUInt size); + + Assert.Equal(expectedTaggedMemory, result.Value); + Assert.Equal(2ul * (ulong)target.PointerSize, size.Value); + } +} From 8b06ce0e84bcbcbd16ae4c9cbcdd3959fbbe498a Mon Sep 17 00:00:00 2001 From: Rich Lander <2608468+richlander@users.noreply.github.com> Date: Wed, 6 May 2026 15:24:12 -0700 Subject: [PATCH 027/109] Add Azure Linux 4 to libraries Helix extra-platforms (linux_x64) (#127842) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit > [!NOTE] > This PR description was AI/Copilot-generated. Adds Azure Linux 4 to the libraries Helix extra-platforms queue set for `linux_x64` (CoreCLR inner-loop) in `eng/pipelines/libraries/helix-queues-setup.yml`. Replaces #127613, which got tangled up in merge history. This is a clean, single-commit version with the digest refreshed to the current `azurelinux-4.0-helix-amd64` image (`sha256:d86d3499…`). ## Change | File | Distro | Slot | Action | |------|--------|------|--------| | `eng/pipelines/libraries/helix-queues-setup.yml` | AzureLinux 4.0 | extra-platforms `linux_x64` | Added | Queue entry: ``` (AzureLinux.4.0.Amd64.Open)AzureLinux.3.Amd64.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-4.0-helix-amd64@sha256:d86d3499ccba1cc92ad045fbd3e055fdde21ed5c757f25d1245fea978711b3a6 ``` Host queue is `AzureLinux.3.Amd64.Open`, matching the other container-backed entries in the same section (Debian 13, Fedora 44, openSUSE 16.0). ## Scope `helix-platforms.yml` is intentionally **not** updated — those values are reserved for GA releases, and Azure Linux 4 has not yet GA'd. This change only adds opt-in coverage via the extra-platforms pipeline. ## CI ``` /azp run runtime-extra-platforms ``` ## References - #127613 (previous attempt) - [OS onboarding guide](https://github.com/dotnet/runtime/blob/main/docs/project/os-onboarding.md) - [.NET OS Support Tracking](https://github.com/dotnet/core/issues/9638) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- eng/pipelines/libraries/helix-queues-setup.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/eng/pipelines/libraries/helix-queues-setup.yml b/eng/pipelines/libraries/helix-queues-setup.yml index 925362ecd58495..4e49deb6490f08 100644 --- a/eng/pipelines/libraries/helix-queues-setup.yml +++ b/eng/pipelines/libraries/helix-queues-setup.yml @@ -61,6 +61,7 @@ jobs: # CoreCLR path - ${{ if and(eq(parameters.jobParameters.isExtraPlatformsBuild, true), ne(parameters.jobParameters.testScope, 'outerloop'))}}: # extra-platforms CoreCLR (inner loop only) + - (AzureLinux.4.0.Amd64.Open)AzureLinux.3.Amd64.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-4.0-helix-amd64@sha256:d86d3499ccba1cc92ad045fbd3e055fdde21ed5c757f25d1245fea978711b3a6 - (Debian.13.Amd64.Open)AzureLinux.3.Amd64.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:debian-13-helix-amd64@sha256:4bf6a0a32b1e4dbe3e0cc0b453d0bea775d9898336cdb3c92c84862c05d822ea - (Fedora.44.Amd64.Open)AzureLinux.3.Amd64.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:fedora-44-helix-amd64@sha256:d61f2b7f64797109f37109b55183751847b62eb23734698c9b056cb25194577e - (openSUSE.16.0.Amd64.Open)AzureLinux.3.Amd64.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:opensuse-16.0-helix-amd64@sha256:010211f9ab9e8238ffb0656edee4c8a411e5a4a9fb4718037614c8c94350e45c From 06ca6751830996c1c815bfdd73a3fb4c8b53d77f Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Wed, 6 May 2026 18:08:18 -0700 Subject: [PATCH 028/109] Merge ThreadTasks into ThreadState, remove ThreadTasks (#127884) `ThreadTasks` was a single-entry enum (`TT_CleanupSyncBlock`) backed by a separate `m_ThreadTasks` field on `Thread`, even though `ThreadState` had an unused bit (`0x00000020`) and already supported atomic set/reset via `InterlockedOr`/`InterlockedAnd` on `m_State`. The old code even contained a TODO noting the two should probably be merged. Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: jkotas <6668460+jkotas@users.noreply.github.com> Co-authored-by: Jan Kotas --- src/coreclr/vm/threads.cpp | 4 +--- src/coreclr/vm/threads.h | 20 ++++---------------- 2 files changed, 5 insertions(+), 19 deletions(-) diff --git a/src/coreclr/vm/threads.cpp b/src/coreclr/vm/threads.cpp index 5e1f114f56d5a4..54d954bd02ef3d 100644 --- a/src/coreclr/vm/threads.cpp +++ b/src/coreclr/vm/threads.cpp @@ -1290,11 +1290,9 @@ Thread::Thread() m_fHasDeadThreadBeenConsideredForGCTrigger = false; m_TraceCallCount = 0; m_ThrewControlForThread = 0; - m_ThreadTasks = (ThreadTasks)0; - // The state and the tasks must be 32-bit aligned for atomicity to be guaranteed. + // The state must be 32-bit aligned for atomicity to be guaranteed. _ASSERTE((((size_t) &m_State) & 3) == 0); - _ASSERTE((((size_t) &m_ThreadTasks) & 3) == 0); // On all callbacks, call the trap code, which we now have // wired to cause a GC. Thus we will do a GC on all Transition Frame Transitions (and more). diff --git a/src/coreclr/vm/threads.h b/src/coreclr/vm/threads.h index 195a01434d8ed3..03dff6556b8bf3 100644 --- a/src/coreclr/vm/threads.h +++ b/src/coreclr/vm/threads.h @@ -511,7 +511,7 @@ class Thread TS_DebugSuspendPending = 0x00000008, // Is the debugger suspending threads? TS_GCOnTransitions = 0x00000010, // Force a GC on stub transitions (GCStress only) - // unused = 0x00000020, + TS_SyncBlockCleanup = 0x00000020, // The synch block needs to be cleaned up. TS_ExecutingOnAltStack = 0x00000040, // Runtime is executing on an alternate stack located anywhere in the memory @@ -570,17 +570,8 @@ class Thread TS_CatchAtSafePoint = (TS_AbortRequested | TS_DebugSuspendPending | TS_GCOnTransitions), }; - // Thread flags that aren't really states in themselves but rather things the thread - // has to do. - enum ThreadTasks - { - TT_CleanupSyncBlock = 0x00000001, // The synch block needs to be cleaned up. - }; - // Thread flags that have no concurrency issues (i.e., they are only manipulated by the owning thread). Use these // state flags when you have a new thread state that doesn't belong in the ThreadState enum above. - // - // @TODO: its possible that the ThreadTasks from above and these flags should be merged. enum ThreadStateNoConcurrency { TSNC_Unknown = 0x00000000, // threads are initialized this way @@ -710,19 +701,19 @@ class Thread DWORD RequireSyncBlockCleanup() { LIMITED_METHOD_CONTRACT; - return (m_ThreadTasks & TT_CleanupSyncBlock); + return (m_State & TS_SyncBlockCleanup); } void SetSyncBlockCleanup() { LIMITED_METHOD_CONTRACT; - InterlockedOr((LONG*)&m_ThreadTasks, TT_CleanupSyncBlock); + InterlockedOr((LONG*)&m_State, TS_SyncBlockCleanup); } void ResetSyncBlockCleanup() { LIMITED_METHOD_CONTRACT; - InterlockedAnd((LONG*)&m_ThreadTasks, ~TT_CleanupSyncBlock); + InterlockedAnd((LONG*)&m_State, ~TS_SyncBlockCleanup); } #ifdef FEATURE_COMINTEROP_APARTMENT_SUPPORT @@ -915,9 +906,6 @@ class Thread inline TypeHandle GetTHAllocContextObj() {LIMITED_METHOD_CONTRACT; return m_thAllocContextObj; } - // Flags used to indicate tasks the thread has to do. - ThreadTasks m_ThreadTasks; - // Flags for thread states that have no concurrency issues. ThreadStateNoConcurrency m_StateNC; From 343e8a062357daddb3046f9403590d48f84cb418 Mon Sep 17 00:00:00 2001 From: Rachel Jarvi Date: Wed, 6 May 2026 19:53:19 -0700 Subject: [PATCH 029/109] [cDAC] Update allowlist in LegacyFallbackHelper (#127887) Removed newly implemented methods from the allowlist. --- .../LegacyFallbackHelper.cs | 9 --------- 1 file changed, 9 deletions(-) diff --git a/src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Legacy/LegacyFallbackHelper.cs b/src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Legacy/LegacyFallbackHelper.cs index 5dbb7d5dd85993..057cdd4a742dc7 100644 --- a/src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Legacy/LegacyFallbackHelper.cs +++ b/src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Legacy/LegacyFallbackHelper.cs @@ -25,15 +25,6 @@ internal static class LegacyFallbackHelper { // Dump creation — the cDAC does not implement memory enumeration. nameof(ICLRDataEnumMemoryRegions.EnumMemoryRegions), - - // IXCLRDataModule — not yet implemented in the cDAC. - nameof(IXCLRDataModule.GetMethodDefinitionByToken), - - // GC heap analysis — not yet implemented in the cDAC (PR #125895). - nameof(ISOSDacInterface11.IsTrackedType), - - // Loader heap traversal — not yet implemented in the cDAC (PR #125129). - nameof(ISOSDacInterface.TraverseLoaderHeap), }; // Files whose methods are all allowed to fall back. From ba1cb48e84e5fad8d8ac6044057ca666b59a7a31 Mon Sep 17 00:00:00 2001 From: Max Charlamb <44248479+max-charlamb@users.noreply.github.com> Date: Wed, 6 May 2026 23:26:04 -0400 Subject: [PATCH 030/109] Fix cDAC x-plat dump tests: pre-zip payloads and exclude osx legs (#127871) > [!NOTE] > This PR was authored with assistance from GitHub Copilot. ## Problem The cDAC x-plat dump tests (`CdacXPlatDumpTest` stages) hit two distinct failure modes when running with `cdacDumpTestMode=xplat`: 1. **Helix SDK 2 GB `MemoryStream` cap.** `` (`DirectoryPayload.UploadAsync`) zips the source directory into a `MemoryStream` before uploading. `MemoryStream`'s backing array is capped at `int.MaxValue` (~2 GiB), so per-platform dump payloads that approach that size fail with `IOException: Stream was too long`. 2. **Helix host disk pressure on osx source dumps.** Even with the SDK cap removed, x-plat tests download every source platform's dump artifacts onto each host. The `osx_arm64` / `osx_x64` payloads are large enough that the combined working set exceeds available disk and the affected work items abort with exit code -3 (`Crash`). Fixes #127859. ## Fix **1. Pre-zip per-platform dumps with `ZipDirectory` + ``.** `ZipDirectory` calls `ZipFile.CreateFromDirectory`, which writes the archive directly to a `FileStream` -- no 2 GiB cap. The Helix SDK's `ArchivePayload` (selected by ``) uses `File.OpenRead` and streams the existing zip to blob storage without any in-memory buffering. `CompressionLevel="Fastest"` keeps the local zip step cheap; dump files don't compress meaningfully anyway. This is the same pattern already used in `src/tests/Common/helixpublishwitharcade.proj`. **2. Drop osx from the x-plat dump set (TODO).** Adds a separate `cdacXPlatDumpPlatforms` parameter to `eng/pipelines/runtime-diagnostics.yml` that excludes `osx_arm64` / `osx_x64`, used by the three x-plat stages (`CdacXPlatDumpGen`, `CdacXPlatDumpTests` host platforms + artifact downloads, and the `SourcePlatforms` env var). Single-leg mode (`cdacDumpTestMode=single-leg`) still uses the full `cdacDumpPlatforms` list, so osx coverage there is preserved. Re-enable osx in the x-plat flow once the dump set shrinks or the Helix queues provide more disk. ## Validation - Verified locally that `ZipDirectory` + target-batching produces one `.zip` per source platform with `Overwrite="true"`. - Re-validating by re-running `runtime-diagnostics` with `cdacDumpTestMode=xplat` against this PR. --------- Co-authored-by: Max Charlamb Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- eng/pipelines/runtime-diagnostics.yml | 23 ++++++++++++---- .../DumpTests/cdac-dump-xplat-test-helix.proj | 27 ++++++++++++++++--- 2 files changed, 41 insertions(+), 9 deletions(-) diff --git a/eng/pipelines/runtime-diagnostics.yml b/eng/pipelines/runtime-diagnostics.yml index cd7b5a81f1f527..d394167a81efd0 100644 --- a/eng/pipelines/runtime-diagnostics.yml +++ b/eng/pipelines/runtime-diagnostics.yml @@ -17,6 +17,19 @@ parameters: - linux_arm - osx_arm64 - osx_x64 +# osx_arm64 / osx_x64 are intentionally excluded from x-plat coverage. +# Their dump payloads are large enough that downloading every platform's dumps +# onto a single Helix host exceeds available disk space. +- name: cdacXPlatDumpPlatforms + displayName: cDAC X-Plat Dump Platforms + type: object + default: + - windows_x64 + - windows_x86 + - linux_x64 + - windows_arm64 + - linux_arm64 + - linux_arm - name: cdacDumpTestMode displayName: cDAC Dump Test Mode type: string @@ -304,7 +317,7 @@ extends: parameters: jobTemplate: /eng/pipelines/common/global-build-job.yml buildConfig: release - platforms: ${{ parameters.cdacDumpPlatforms }} + platforms: ${{ parameters.cdacXPlatDumpPlatforms }} shouldContinueOnError: true jobParameters: nameSuffix: CdacXPlatDumpGen @@ -351,7 +364,7 @@ extends: parameters: jobTemplate: /eng/pipelines/common/global-build-job.yml buildConfig: release - platforms: ${{ parameters.cdacDumpPlatforms }} + platforms: ${{ parameters.cdacXPlatDumpPlatforms }} shouldContinueOnError: true jobParameters: nameSuffix: CdacXPlatDumpTest @@ -363,7 +376,7 @@ extends: buildDebuggees: false skipDebuggeeCopy: true # Download dump artifacts from all source platforms - - ${{ each platform in parameters.cdacDumpPlatforms }}: + - ${{ each platform in parameters.cdacXPlatDumpPlatforms }}: - task: DownloadPipelineArtifact@2 inputs: artifactName: CdacDumps_${{ platform }} @@ -371,7 +384,7 @@ extends: displayName: 'Download dumps from ${{ platform }}' # Extract dump tars into the Helix payload - pwsh: | - $platforms = "${{ join(';', parameters.cdacDumpPlatforms) }}".Split(';') + $platforms = "${{ join(';', parameters.cdacXPlatDumpPlatforms) }}".Split(';') $payloadDumpsDir = "$(Build.SourcesDirectory)/artifacts/helixPayload/cdac/dumps" foreach ($platform in $platforms) { $downloadDir = "$(Build.SourcesDirectory)/artifacts/xplatDumps/$platform" @@ -396,7 +409,7 @@ extends: _Creator: dotnet-bot SYSTEM_ACCESSTOKEN: $(System.AccessToken) NUGET_PACKAGES: $(Build.SourcesDirectory)$(dir).packages - SourcePlatforms: ${{ join(';', parameters.cdacDumpPlatforms) }} + SourcePlatforms: ${{ join(';', parameters.cdacXPlatDumpPlatforms) }} - pwsh: | if ("$(Agent.JobStatus)" -ne "Succeeded") { Write-Error "One or more cDAC x-plat dump test failures were detected. Failing the job." diff --git a/src/native/managed/cdac/tests/DumpTests/cdac-dump-xplat-test-helix.proj b/src/native/managed/cdac/tests/DumpTests/cdac-dump-xplat-test-helix.proj index a8e869fca5bde3..03ac8d812e31c9 100644 --- a/src/native/managed/cdac/tests/DumpTests/cdac-dump-xplat-test-helix.proj +++ b/src/native/managed/cdac/tests/DumpTests/cdac-dump-xplat-test-helix.proj @@ -8,9 +8,11 @@ CDAC_DUMP_ROOT pointing to that platform's dump subdirectory. This gives each platform independent exit code tracking and test result reporting. - The dumps are sent as per-work-item payloads (one platform per work item) to - avoid exceeding the 2 GB MemoryStream/ZipArchive limit that occurs when all - platforms' dumps are zipped into a single payload. + The dumps are pre-zipped per platform with the MSBuild ZipDirectory task and + sent as a . This avoids the Helix SDK's + code path which builds the zip in a MemoryStream and so caps the payload at + int.MaxValue (~2 GB). ZipDirectory writes the archive directly to a + FileStream, so per-platform dump payloads can grow well past that limit. The test DLLs are sent as a correlation payload (shared across work items). @@ -84,12 +86,18 @@ Create one Helix work item per source platform. Target batching (Outputs) iterates once per _SourcePlatform. Each work item gets its own dump payload (per-platform subdirectory) and uses shared test DLLs from the correlation payload. + + The per-platform dump directory is pre-zipped to a instead of + using . The Helix SDK's directory payload zips through a + MemoryStream (capped at ~2 GB); ZipDirectory + PayloadArchive streams to a + FileStream and has no such limit. --> <_HelixCommandFile>$(DumpPayloadBase)/%(_SourcePlatform.Identity)/HelixCommand.txt + <_DumpPayloadArchive>$(DumpPayloadBase)/%(_SourcePlatform.Identity).zip @@ -108,9 +116,20 @@ + + + - $(DumpPayloadBase)/%(_SourcePlatform.Identity) + $(_DumpPayloadArchive) $([System.IO.File]::ReadAllText('$(_HelixCommandFile)')) $(WorkItemTimeout) From cdbf0c2ba8a84fdc9d83f019baa2103a0afd580b Mon Sep 17 00:00:00 2001 From: Adeel Mujahid <3840695+am11@users.noreply.github.com> Date: Thu, 7 May 2026 06:53:49 +0300 Subject: [PATCH 031/109] Inline remaining usages of OpenProcess on Unix (#127795) Two usages of OpenProcess and one of OpenProcessMemory. Follow-up: https://github.com/dotnet/runtime/pull/127604#issuecomment-4364909476. --- src/coreclr/debug/di/dbgtransportmanager.cpp | 133 +- src/coreclr/debug/di/dbgtransportmanager.h | 18 +- src/coreclr/debug/di/shimremotedatatarget.cpp | 97 +- src/coreclr/debug/ee/debugger.cpp | 7 +- .../dlls/mscordac/mscordac_unixexports.src | 4 - src/coreclr/pal/inc/pal.h | 99 +- src/coreclr/pal/src/debug/debug.cpp | 188 --- src/coreclr/pal/src/include/pal/procobj.hpp | 16 +- .../pal/src/include/pal/synchobjects.hpp | 2 - src/coreclr/pal/src/include/pal/thread.hpp | 19 - src/coreclr/pal/src/init/pal.cpp | 14 - src/coreclr/pal/src/loader/module.cpp | 7 - .../pal/src/synchmgr/synchcontrollers.cpp | 118 -- src/coreclr/pal/src/synchmgr/synchmanager.cpp | 1426 +---------------- src/coreclr/pal/src/synchmgr/synchmanager.hpp | 109 +- src/coreclr/pal/src/synchmgr/wait.cpp | 33 - src/coreclr/pal/src/thread/process.cpp | 366 ----- src/coreclr/pal/src/thread/thread.cpp | 15 +- src/coreclr/pal/src/thread/threadsusp.cpp | 7 - src/coreclr/pal/tests/palsuite/CMakeLists.txt | 15 - .../pal/tests/palsuite/compilableTests.txt | 1 - .../tests/palsuite/compileDisabledTests.txt | 7 - .../event/nonshared/event.cpp | 346 ---- .../event/nonshared/main.cpp | 227 --- .../object_management/event/shared/event.cpp | 359 ----- .../object_management/event/shared/main.cpp | 264 --- .../composite/object_management/readme.txt | 27 - .../semaphore/nonshared/main.cpp | 227 --- .../semaphore/nonshared/semaphore.cpp | 331 ---- .../semaphore/shared/main.cpp | 276 ---- .../semaphore/shared/semaphore.cpp | 343 ---- .../WriteProcessMemory/test1/commonconsts.h | 45 - .../WriteProcessMemory/test1/helper.cpp | 242 --- .../WriteProcessMemory/test1/test1.cpp | 188 --- .../WriteProcessMemory/test3/commonconsts.h | 49 - .../WriteProcessMemory/test3/helper.cpp | 255 --- .../WriteProcessMemory/test3/test3.cpp | 204 --- .../WriteProcessMemory/test4/helper.cpp | 66 - .../WriteProcessMemory/test4/test4.cpp | 123 -- .../pal/tests/palsuite/paltestlist.txt | 1 - .../palsuite/paltestlist_to_be_reviewed.txt | 5 - .../threading/SwitchToThread/test1/test1.cpp | 2 +- .../WaitForMultipleObjects/test1/test1.cpp | 223 --- .../WaitForMultipleObjectsEx/test1/test1.cpp | 4 +- .../WFSOSemaphoreTest/WFSOSemaphoreTest.cpp | 2 +- .../threading/YieldProcessor/test1/test1.cpp | 2 +- 46 files changed, 250 insertions(+), 6262 deletions(-) delete mode 100644 src/coreclr/pal/tests/palsuite/composite/object_management/event/nonshared/event.cpp delete mode 100644 src/coreclr/pal/tests/palsuite/composite/object_management/event/nonshared/main.cpp delete mode 100644 src/coreclr/pal/tests/palsuite/composite/object_management/event/shared/event.cpp delete mode 100644 src/coreclr/pal/tests/palsuite/composite/object_management/event/shared/main.cpp delete mode 100644 src/coreclr/pal/tests/palsuite/composite/object_management/readme.txt delete mode 100644 src/coreclr/pal/tests/palsuite/composite/object_management/semaphore/nonshared/main.cpp delete mode 100644 src/coreclr/pal/tests/palsuite/composite/object_management/semaphore/nonshared/semaphore.cpp delete mode 100644 src/coreclr/pal/tests/palsuite/composite/object_management/semaphore/shared/main.cpp delete mode 100644 src/coreclr/pal/tests/palsuite/composite/object_management/semaphore/shared/semaphore.cpp delete mode 100644 src/coreclr/pal/tests/palsuite/debug_api/WriteProcessMemory/test1/commonconsts.h delete mode 100644 src/coreclr/pal/tests/palsuite/debug_api/WriteProcessMemory/test1/helper.cpp delete mode 100644 src/coreclr/pal/tests/palsuite/debug_api/WriteProcessMemory/test1/test1.cpp delete mode 100644 src/coreclr/pal/tests/palsuite/debug_api/WriteProcessMemory/test3/commonconsts.h delete mode 100644 src/coreclr/pal/tests/palsuite/debug_api/WriteProcessMemory/test3/helper.cpp delete mode 100644 src/coreclr/pal/tests/palsuite/debug_api/WriteProcessMemory/test3/test3.cpp delete mode 100644 src/coreclr/pal/tests/palsuite/debug_api/WriteProcessMemory/test4/helper.cpp delete mode 100644 src/coreclr/pal/tests/palsuite/debug_api/WriteProcessMemory/test4/test4.cpp delete mode 100644 src/coreclr/pal/tests/palsuite/threading/WaitForMultipleObjects/test1/test1.cpp diff --git a/src/coreclr/debug/di/dbgtransportmanager.cpp b/src/coreclr/debug/di/dbgtransportmanager.cpp index 7c17adadde2784..677d30854b6503 100644 --- a/src/coreclr/debug/di/dbgtransportmanager.cpp +++ b/src/coreclr/debug/di/dbgtransportmanager.cpp @@ -7,8 +7,64 @@ #ifdef FEATURE_DBGIPC_TRANSPORT_DI +#ifdef HOST_UNIX +#include +#include +#include +#include +#endif + DbgTransportTarget g_DbgTransportTarget{}; +#ifdef HOST_UNIX +// Polling interval for the per-process exit poller thread. +static const useconds_t s_processExitPollIntervalUsec = 250 * 1000; + +// Polls the target PID for exit. Uses waitpid(WNOHANG) for child processes +// (immune to PID reuse) and falls back to kill(pid, 0) for non-children +// (best-effort, racy under PID reuse). Signals m_hProcessExited on exit. +/* static */ +void *DbgTransportTarget::ProcessExitPollerThread(void *arg) +{ + ProcessEntry *entry = static_cast(arg); + + while (!entry->m_fStopPoller) + { + bool exited = false; + + int status; + pid_t r; + do + { + r = waitpid(entry->m_dwPID, &status, WNOHANG); + } while (r == -1 && errno == EINTR); + + if (r == (pid_t)entry->m_dwPID) + { + exited = true; + } + else if (r == -1 && errno == ECHILD) + { + // Not our child; fall back to kill(pid, 0). + if (kill(entry->m_dwPID, 0) != 0 && errno == ESRCH) + { + exited = true; + } + } + + if (exited) + { + SetEvent(entry->m_hProcessExited); + break; + } + + usleep(s_processExitPollIntervalUsec); + } + + return NULL; +} +#endif // HOST_UNIX + DbgTransportTarget::DbgTransportTarget() : m_pProcessList{} , m_sLock{} @@ -68,26 +124,58 @@ HRESULT DbgTransportTarget::GetTransportForProcess(const ProcessDescriptor *pPr } - HANDLE hProcess = OpenProcess(PROCESS_ALL_ACCESS, FALSE, dwPID); - if (hProcess == NULL) + // Probe the process to make sure it exists, then create a waitable handle that becomes + // signaled on process exit. On HOST_WINDOWS the process handle itself is waitable; on + // HOST_UNIX we create a manual-reset event and start a thread to poll for exit. +#ifdef HOST_UNIX + if (kill(dwPID, 0) != 0) + { + transport->Shutdown(); + return (errno == ESRCH) ? E_INVALIDARG : E_FAIL; + } + + HANDLE hProcessExited = CreateEvent(NULL, TRUE, FALSE, NULL); + if (hProcessExited == NULL) { transport->Shutdown(); return HRESULT_FROM_GetLastError(); } +#else // HOST_UNIX + HANDLE hProcessExited = OpenProcess(PROCESS_ALL_ACCESS, FALSE, dwPID); + if (hProcessExited == NULL) + { + transport->Shutdown(); + return HRESULT_FROM_GetLastError(); + } +#endif // HOST_UNIX + + newEntry->m_dwPID = dwPID; + newEntry->m_hProcessExited = hProcessExited; +#ifdef HOST_UNIX + newEntry->m_fStopPoller = false; + newEntry->m_fPollerStarted = false; + + if (pthread_create(&newEntry->m_pollerThread, NULL, &ProcessExitPollerThread, newEntry.GetValue()) != 0) + { + transport->Shutdown(); + CloseHandle(hProcessExited); + newEntry->m_hProcessExited = NULL; + return E_FAIL; + } + newEntry->m_fPollerStarted = true; +#endif // HOST_UNIX // Initialize it (this immediately starts the remote connection process). - hr = transport->Init(*pProcessDescriptor, hProcess); + hr = transport->Init(*pProcessDescriptor, hProcessExited); if (FAILED(hr)) { transport->Shutdown(); - CloseHandle(hProcess); + // ProcessEntry destructor stops the poller thread and closes the event handle. return hr; } entry = newEntry; newEntry.SuppressRelease(); - entry->m_dwPID = dwPID; - entry->m_hProcess = hProcess; entry->m_transport = transport; transport.SuppressRelease(); entry->m_cProcessRef = 0; @@ -100,11 +188,11 @@ HRESULT DbgTransportTarget::GetTransportForProcess(const ProcessDescriptor *pPr entry->m_cProcessRef++; _ASSERTE(entry->m_cProcessRef > 0); _ASSERTE(entry->m_transport != NULL); - _ASSERTE((intptr_t)entry->m_hProcess > 0); + _ASSERTE((intptr_t)entry->m_hProcessExited > 0); *ppTransport = entry->m_transport; if (!DuplicateHandle(GetCurrentProcess(), - entry->m_hProcess, + entry->m_hProcessExited, GetCurrentProcess(), phProcessHandle, 0, // ignored since we are going to pass DUPLICATE_SAME_ACCESS @@ -137,7 +225,7 @@ void DbgTransportTarget::ReleaseTransport(DbgTransportSession *pTransport) _ASSERTE(entry->m_cProcessRef > 0); _ASSERTE(entry->m_transport != NULL); - _ASSERTE((intptr_t)entry->m_hProcess > 0); + _ASSERTE((intptr_t)entry->m_hProcessExited > 0); if (entry->m_transport == pTransport) { @@ -163,21 +251,40 @@ void DbgTransportTarget::ReleaseTransport(DbgTransportSession *pTransport) // Kill the process identified by PID. void DbgTransportTarget::KillProcess(DWORD dwPID) { +#ifdef HOST_UNIX + kill(dwPID, SIGKILL); +#else HANDLE hProcess = OpenProcess(PROCESS_TERMINATE, FALSE, dwPID); if (hProcess != NULL) { TerminateProcess(hProcess, 0); CloseHandle(hProcess); } +#endif } DbgTransportTarget::ProcessEntry::~ProcessEntry() { - CloseHandle(m_hProcess); - m_hProcess = NULL; +#ifdef HOST_UNIX + if (m_fPollerStarted) + { + m_fStopPoller = true; + pthread_join(m_pollerThread, NULL); + m_fPollerStarted = false; + } +#endif - m_transport->Shutdown(); - m_transport = NULL; + if (m_hProcessExited != NULL) + { + CloseHandle(m_hProcessExited); + m_hProcessExited = NULL; + } + + if (m_transport != NULL) + { + m_transport->Shutdown(); + m_transport = NULL; + } } // Locate a process entry by PID. Assumes the lock is already held. diff --git a/src/coreclr/debug/di/dbgtransportmanager.h b/src/coreclr/debug/di/dbgtransportmanager.h index d7f2273b171949..76e150ccbfb7ef 100644 --- a/src/coreclr/debug/di/dbgtransportmanager.h +++ b/src/coreclr/debug/di/dbgtransportmanager.h @@ -7,6 +7,10 @@ #ifdef FEATURE_DBGIPC_TRANSPORT_DI +#ifdef HOST_UNIX +#include +#endif + // TODO: Ideally we'd like to remove this class and don't do any process related book keeping in DBI. // This is a registry of all the processes a debugger knows about, different components call it in order to @@ -52,13 +56,25 @@ class DbgTransportTarget { ProcessEntry *m_pNext; // Next entry in the list DWORD m_dwPID; // Process ID for this entry - HANDLE m_hProcess; // Process handle + HANDLE m_hProcessExited; // Waitable handle that becomes signaled when the + // process exits. On HOST_WINDOWS this is the process + // handle itself; on HOST_UNIX it is a manual-reset + // event signaled by the poller thread below. DbgTransportSession *m_transport; // Debugger's connection to the process DWORD m_cProcessRef; // Ref count +#ifdef HOST_UNIX + pthread_t m_pollerThread; // Thread that polls m_dwPID for exit + bool m_fPollerStarted; // True once m_pollerThread has been created + Volatile m_fStopPoller; // Set to true to ask the poller thread to exit +#endif // HOST_UNIX ~ProcessEntry(); }; +#ifdef HOST_UNIX + static void *ProcessExitPollerThread(void *arg); +#endif + ProcessEntry *m_pProcessList; // Head of list of currently alive processes (unsorted) RSLock m_sLock; // Lock protecting read and write access to the target list diff --git a/src/coreclr/debug/di/shimremotedatatarget.cpp b/src/coreclr/debug/di/shimremotedatatarget.cpp index 92dbfb64be6db7..1c37159ca061db 100644 --- a/src/coreclr/debug/di/shimremotedatatarget.cpp +++ b/src/coreclr/debug/di/shimremotedatatarget.cpp @@ -1,11 +1,6 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -//***************************************************************************** -// -// File: ShimRemoteDataTarget.cpp -// -//***************************************************************************** #include "stdafx.h" #include "safewrap.h" @@ -19,6 +14,12 @@ #include "dbgtransportsession.h" #include "dbgtransportmanager.h" +#ifdef __APPLE__ +#include +#else +#include +#endif + class ShimRemoteDataTarget : public ShimDataTarget { public: @@ -68,7 +69,7 @@ class ShimRemoteDataTarget : public ShimDataTarget DbgTransportTarget * m_pProxy; DbgTransportSession * m_pTransport; #ifdef FEATURE_REMOTE_PROC_MEM - DWORD m_memoryHandle; // PAL_ReadProcessMemory handle or UINT32_MAX if fallback + DWORD m_memoryHandle; // Remote-memory handle or UINT32_MAX if fallback #endif }; @@ -106,8 +107,23 @@ ShimRemoteDataTarget::ShimRemoteDataTarget(DWORD processId, m_pContinueStatusChangedUserData = NULL; #ifdef FEATURE_REMOTE_PROC_MEM - PAL_OpenProcessMemory(m_processId, &m_memoryHandle); + m_memoryHandle = UINT32_MAX; +#ifdef __APPLE__ + mach_port_name_t port; + if (::task_for_pid(mach_task_self(), (int)m_processId, &port) == KERN_SUCCESS) + { + m_memoryHandle = port; + } +#else + char memPath[128]; + snprintf(memPath, sizeof(memPath), "/proc/%lu/mem", (unsigned long)m_processId); + int fd = open(memPath, O_RDONLY); + if (fd != -1) + { + m_memoryHandle = (DWORD)fd; + } #endif +#endif // FEATURE_REMOTE_PROC_MEM } //--------------------------------------------------------------------------------------- @@ -133,8 +149,15 @@ ShimRemoteDataTarget::~ShimRemoteDataTarget() void ShimRemoteDataTarget::Dispose() { #ifdef FEATURE_REMOTE_PROC_MEM - PAL_CloseProcessMemory(m_memoryHandle); - m_memoryHandle = UINT32_MAX; + if (m_memoryHandle != UINT32_MAX) + { +#ifdef __APPLE__ + ::mach_port_deallocate(mach_task_self(), (mach_port_name_t)m_memoryHandle); +#else + close((int)m_memoryHandle); +#endif + m_memoryHandle = UINT32_MAX; + } #endif if (m_pTransport != NULL) { @@ -272,13 +295,65 @@ ShimRemoteDataTarget::ReadVirtual( #ifdef FEATURE_REMOTE_PROC_MEM if (m_memoryHandle != UINT32_MAX) { - if (!PAL_ReadProcessMemory(m_memoryHandle, (ULONG64)address, pBuffer, cbRequestSize, &read)) + read = 0; +#ifdef __APPLE__ + // vm_read_overwrite usually requires the address be page-aligned and the size be a multiple + // of the page size, so we always page-align ourselves and copy out the relevant slice. + const size_t pageSize = (size_t)sysconf(_SC_PAGESIZE); + vm_address_t addressAligned = (vm_address_t)(address & ~(ULONG64)(pageSize - 1)); + ssize_t offset = (ssize_t)(address & (pageSize - 1)); + ssize_t bytesLeft = (ssize_t)cbRequestSize; + + char * data = (char *)malloc(pageSize); + if (data != nullptr) + { + while (bytesLeft > 0) + { + vm_size_t bytesRead = pageSize; + if (::vm_read_overwrite((vm_map_t)m_memoryHandle, addressAligned, pageSize, + (vm_address_t)data, &bytesRead) != KERN_SUCCESS + || bytesRead != pageSize) + { + break; + } + ssize_t bytesToCopy = pageSize - offset; + if (bytesToCopy > bytesLeft) + { + bytesToCopy = bytesLeft; + } + memcpy((LPSTR)pBuffer + read, data + offset, bytesToCopy); + addressAligned += pageSize; + read += bytesToCopy; + bytesLeft -= bytesToCopy; + offset = 0; + } + free(data); + } + if (cbRequestSize != 0 && read == 0) { hr = E_FAIL; } +#else + // Android's heap allocator (scudo) uses ARM64 Top-Byte Ignore (TBI) for memory tagging. + // pread on /proc//mem treats the offset as a file position, not a virtual address, + // so the kernel does not apply TBI -- tagged pointers cause EINVAL. + // See https://www.kernel.org/doc/html/latest/arch/arm64/tagged-address-abi.html +#ifdef TARGET_ARM64 + address &= 0x00FFFFFFFFFFFFFFULL; +#endif + ssize_t r = pread((int)m_memoryHandle, pBuffer, cbRequestSize, (off_t)address); + if (r == -1) + { + hr = E_FAIL; + } + else + { + read = (size_t)r; + } +#endif } else -#endif +#endif // FEATURE_REMOTE_PROC_MEM { hr = m_pTransport->ReadMemory(reinterpret_cast(CORDB_ADDRESS_TO_PTR(address)), pBuffer, cbRequestSize); } diff --git a/src/coreclr/debug/ee/debugger.cpp b/src/coreclr/debug/ee/debugger.cpp index 1e853b149fbc7c..37ee6590142c02 100644 --- a/src/coreclr/debug/ee/debugger.cpp +++ b/src/coreclr/debug/ee/debugger.cpp @@ -6768,6 +6768,11 @@ HRESULT Debugger::LaunchJitDebuggerAndNativeAttach(Thread * pThread, EXCEPTION_P } CONTRACTL_END; +#ifdef TARGET_UNIX + // JIT-attach via CreateProcess + waitable process handle is Windows-only. + // The caller treats a failing HRESULT as "no debugger attached" and unwinds via PostJitAttach. + return E_NOTIMPL; +#else // You need to have called PreJitAttach first to determine which thread gets to launch the debugger _ASSERTE(m_jitAttachInProgress); @@ -6847,7 +6852,7 @@ HRESULT Debugger::LaunchJitDebuggerAndNativeAttach(Thread * pThread, EXCEPTION_P _ASSERTE((res == WAIT_OBJECT_0) && "WaitForMultipleObjectsEx failed!"); LOG( (LF_CORDB, LL_INFO10000, "D::LJDANA: Leaving\n") ); return S_OK; - +#endif // TARGET_UNIX } // Blocks until the debugger completes jit attach diff --git a/src/coreclr/dlls/mscordac/mscordac_unixexports.src b/src/coreclr/dlls/mscordac/mscordac_unixexports.src index ebbe8c166a92af..479c850b781f4b 100644 --- a/src/coreclr/dlls/mscordac/mscordac_unixexports.src +++ b/src/coreclr/dlls/mscordac/mscordac_unixexports.src @@ -35,9 +35,6 @@ nativeStringResourceTable_mscorrc #PAL_GetTransportPipeName #PAL_InitializeDLL #PAL_TerminateEx -#PAL_OpenProcessMemory -#PAL_CloseProcessMemory -#PAL_ReadProcessMemory #PAL_ProbeMemory #PAL__wcstoui64 #PAL_wcstoul @@ -95,7 +92,6 @@ nativeStringResourceTable_mscorrc #MapViewOfFile #MapViewOfFileEx #MultiByteToWideChar -#OpenProcess #OutputDebugStringW #OpenEventW #OutputDebugStringA diff --git a/src/coreclr/pal/inc/pal.h b/src/coreclr/pal/inc/pal.h index 87df075da108d5..ed96882ab468ea 100644 --- a/src/coreclr/pal/inc/pal.h +++ b/src/coreclr/pal/inc/pal.h @@ -348,32 +348,6 @@ PALAPI PAL_UnregisterModule( IN HINSTANCE hInstance); -PALIMPORT -BOOL -PALAPI -PAL_OpenProcessMemory( - IN DWORD processId, - OUT DWORD* pHandle -); - -PALIMPORT -VOID -PALAPI -PAL_CloseProcessMemory( - IN DWORD handle -); - -PALIMPORT -BOOL -PALAPI -PAL_ReadProcessMemory( - IN DWORD handle, - IN ULONG64 address, - IN LPVOID buffer, - IN SIZE_T size, - OUT SIZE_T* numberOfBytesRead -); - PALIMPORT BOOL PALAPI @@ -714,40 +688,11 @@ GetCurrentThread(); #define STARTF_USESTDHANDLES 0x00000100 -typedef struct _STARTUPINFOW { - DWORD cb; - LPWSTR lpReserved_PAL_Undefined; - LPWSTR lpDesktop_PAL_Undefined; - LPWSTR lpTitle_PAL_Undefined; - DWORD dwX_PAL_Undefined; - DWORD dwY_PAL_Undefined; - DWORD dwXSize_PAL_Undefined; - DWORD dwYSize_PAL_Undefined; - DWORD dwXCountChars_PAL_Undefined; - DWORD dwYCountChars_PAL_Undefined; - DWORD dwFillAttribute_PAL_Undefined; - DWORD dwFlags; - WORD wShowWindow_PAL_Undefined; - WORD cbReserved2_PAL_Undefined; - LPBYTE lpReserved2_PAL_Undefined; - HANDLE hStdInput; - HANDLE hStdOutput; - HANDLE hStdError; -} STARTUPINFOW, *LPSTARTUPINFOW; - +typedef struct _STARTUPINFOW STARTUPINFOW, *LPSTARTUPINFOW; typedef STARTUPINFOW STARTUPINFO; typedef LPSTARTUPINFOW LPSTARTUPINFO; -#define CREATE_NEW_CONSOLE 0x00000010 - -#define NORMAL_PRIORITY_CLASS 0x00000020 - -typedef struct _PROCESS_INFORMATION { - HANDLE hProcess; - HANDLE hThread; - DWORD dwProcessId; - DWORD dwThreadId_PAL_Undefined; -} PROCESS_INFORMATION, *PPROCESS_INFORMATION, *LPPROCESS_INFORMATION; +typedef struct _PROCESS_INFORMATION PROCESS_INFORMATION, *PPROCESS_INFORMATION, *LPPROCESS_INFORMATION; PALIMPORT PAL_NORETURN @@ -763,13 +708,6 @@ TerminateProcess( IN HANDLE hProcess, IN UINT uExitCode); -PALIMPORT -BOOL -PALAPI -GetExitCodeProcess( - IN HANDLE hProcess, - IN LPDWORD lpExitCode); - #define MAXIMUM_WAIT_OBJECTS 64 #define WAIT_OBJECT_0 0 #define WAIT_TIMEOUT 258 @@ -792,15 +730,6 @@ WaitForSingleObjectEx( IN DWORD dwMilliseconds, IN BOOL bAlertable); -PALIMPORT -DWORD -PALAPI -WaitForMultipleObjects( - IN DWORD nCount, - IN CONST HANDLE *lpHandles, - IN BOOL bWaitAll, - IN DWORD dwMilliseconds); - PALIMPORT DWORD PALAPI @@ -2753,30 +2682,6 @@ typedef struct _RUNTIME_FUNCTION { #define SEMAPHORE_MODIFY_STATE (0x0002) #define SEMAPHORE_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE | 0x3) -#define PROCESS_TERMINATE (0x0001) -#define PROCESS_CREATE_THREAD (0x0002) -#define PROCESS_SET_SESSIONID (0x0004) -#define PROCESS_VM_OPERATION (0x0008) -#define PROCESS_VM_READ (0x0010) -#define PROCESS_VM_WRITE (0x0020) -#define PROCESS_DUP_HANDLE (0x0040) -#define PROCESS_CREATE_PROCESS (0x0080) -#define PROCESS_SET_QUOTA (0x0100) -#define PROCESS_SET_INFORMATION (0x0200) -#define PROCESS_QUERY_INFORMATION (0x0400) -#define PROCESS_SUSPEND_RESUME (0x0800) -#define PROCESS_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE | \ - 0xFFF) - -PALIMPORT -HANDLE -PALAPI -OpenProcess( - IN DWORD dwDesiredAccess, /* PROCESS_DUP_HANDLE or PROCESS_ALL_ACCESS */ - IN BOOL bInheritHandle, - IN DWORD dwProcessId - ); - PALIMPORT VOID PALAPI diff --git a/src/coreclr/pal/src/debug/debug.cpp b/src/coreclr/pal/src/debug/debug.cpp index f52709c3f0ae06..b06b37534dbafd 100644 --- a/src/coreclr/pal/src/debug/debug.cpp +++ b/src/coreclr/pal/src/debug/debug.cpp @@ -76,7 +76,6 @@ SET_DEFAULT_DEBUG_CHANNEL(DEBUG); // some headers have code with asserts, so do using namespace CorUnix; extern "C" void DBG_DebugBreak_End(); -extern size_t OffsetWithinPage(off_t addr); #if HAVE_PROCFS_CTL #define CTL_ATTACH "attach" @@ -557,193 +556,6 @@ SetThreadContext( return ret; } -/*++ -Function: - PAL_OpenProcessMemory - -Abstract - Creates the handle for PAL_ReadProcessMemory. - -Parameter - processId : process id to read memory - pHandle : returns a platform specific handle or UINT32_MAX if failed - -Return - true successful, false invalid process id or not supported. ---*/ -BOOL -PALAPI -PAL_OpenProcessMemory( - IN DWORD processId, - OUT DWORD* pHandle -) -{ - ENTRY("PAL_OpenProcessMemory(pid=%d)\n", processId); - _ASSERTE(pHandle != nullptr); - *pHandle = UINT32_MAX; -#ifdef __APPLE__ - mach_port_name_t port; - kern_return_t result = ::task_for_pid(mach_task_self(), (int)processId, &port); - if (result != KERN_SUCCESS) - { - ERROR("task_for_pid(%d) FAILED %x %s\n", processId, result, mach_error_string(result)); - LOGEXIT("PAL_OpenProcessMemory FALSE\n"); - return FALSE; - } - *pHandle = port; -#else - char memPath[128]; - _snprintf_s(memPath, sizeof(memPath), sizeof(memPath), "/proc/%lu/mem", processId); - - int fd = open(memPath, O_RDONLY); - if (fd == -1) - { - ERROR("open(%s) FAILED %d (%s)\n", memPath, errno, strerror(errno)); - LOGEXIT("PAL_OpenProcessMemory FALSE\n"); - return FALSE; - } - *pHandle = fd; -#endif - LOGEXIT("PAL_OpenProcessMemory TRUE\n"); - return TRUE; -} - -/*++ -Function: - PAL_CloseProcessMemory - -Abstract - Closes the PAL_OpenProcessMemory handle. - -Parameter - handle : from PAL_OpenProcessMemory - -Return - none ---*/ -VOID -PALAPI -PAL_CloseProcessMemory( - IN DWORD handle -) -{ - ENTRY("PAL_CloseProcessMemory(handle=%x)\n", handle); - if (handle != UINT32_MAX) - { -#ifdef __APPLE__ - kern_return_t result = ::mach_port_deallocate(mach_task_self(), (mach_port_name_t)handle); - if (result != KERN_SUCCESS) - { - ERROR("mach_port_deallocate FAILED %x %s\n", result, mach_error_string(result)); - } -#else - close(handle); -#endif - } - LOGEXIT("PAL_CloseProcessMemory\n"); -} - -/*++ -Function: - PAL_ReadProcessMemory - -Abstract - Reads process memory. - -Parameter - handle : from PAL_OpenProcessMemory - address : address of memory to read - buffer : buffer to read memory to - size : number of bytes to read - numberOfBytesRead: number of bytes read (optional) - -Return - true read memory is successful, false if not. ---*/ -BOOL -PALAPI -PAL_ReadProcessMemory( - IN DWORD handle, - IN ULONG64 address, - IN LPVOID buffer, - IN SIZE_T size, - OUT SIZE_T* numberOfBytesRead) -{ - ENTRY("PAL_ReadProcessMemory(handle=%x, address=%p buffer=%p size=%d)\n", handle, (void*)address, buffer, size); - _ASSERTE(handle != 0); - _ASSERTE(numberOfBytesRead != nullptr); - BOOL result = TRUE; - size_t read = 0; -#ifdef __APPLE__ - vm_map_t task = (vm_map_t)handle; - - // vm_read_overwrite usually requires that the address be page-aligned - // and the size be a multiple of the page size. We can't differentiate - // between the cases in which that's required and those in which it - // isn't, so we do it all the time. - const size_t pageSize = GetVirtualPageSize(); - vm_address_t addressAligned = ALIGN_DOWN(address, pageSize); - ssize_t offset = OffsetWithinPage(address); - ssize_t bytesLeft = size; - - char *data = (char*)malloc(pageSize); - if (data != nullptr) - { - while (bytesLeft > 0) - { - vm_size_t bytesRead = pageSize; - kern_return_t result = ::vm_read_overwrite(task, addressAligned, pageSize, (vm_address_t)data, &bytesRead); - if (result != KERN_SUCCESS || bytesRead != pageSize) - { - TRACE("PAL_ReadProcessMemory(%p %d): vm_read_overwrite failed bytesLeft %d bytesRead %d from %p: %x %s\n", - (void*)address, size, bytesLeft, bytesRead, (void*)addressAligned, result, mach_error_string(result)); - break; - } - ssize_t bytesToCopy = pageSize - offset; - if (bytesToCopy > bytesLeft) - { - bytesToCopy = bytesLeft; - } - memcpy((LPSTR)buffer + read, data + offset, bytesToCopy); - addressAligned = addressAligned + pageSize; - read += bytesToCopy; - bytesLeft -= bytesToCopy; - offset = 0; - } - result = size == 0 || read > 0; - } - else - { - ERROR("malloc(%d) FAILED\n", pageSize); - result = FALSE; - } - - if (data != nullptr) - { - free(data); - } -#else - // Android's heap allocator (scudo) uses ARM64 Top-Byte Ignore (TBI) for memory tagging. - // pread on /proc//mem treats the offset as a file position, not a virtual address, - // so the kernel does not apply TBI — tagged pointers cause EINVAL. - // See https://www.kernel.org/doc/html/latest/arch/arm64/tagged-address-abi.html - // - // Currently only Android allocators set a non-zero top byte, so on other ARM64 Linux - // configurations this is a no-op. However, any future use of TBI tagging (e.g., ARM MTE) - // on other Linux distros would hit the same issue. -#ifdef TARGET_ARM64 - address &= 0x00FFFFFFFFFFFFFFULL; -#endif - read = pread(handle, buffer, size, address); - if (read == (size_t)-1) - { - result = FALSE; - } -#endif - *numberOfBytesRead = read; - LOGEXIT("PAL_ReadProcessMemory result=%d bytes read=%d\n", result, read); - return result; -} /*++ Function: diff --git a/src/coreclr/pal/src/include/pal/procobj.hpp b/src/coreclr/pal/src/include/pal/procobj.hpp index a412afea1ca3ad..c1e10df2b44166 100644 --- a/src/coreclr/pal/src/include/pal/procobj.hpp +++ b/src/coreclr/pal/src/include/pal/procobj.hpp @@ -25,14 +25,6 @@ namespace CorUnix { extern CObjectType otProcess; - typedef enum - { - PS_IDLE, - PS_STARTING, - PS_RUNNING, - PS_DONE - } PROCESS_STATE; - // // Ideally dwProcessId would be part of the process object's immutable // data. Doing so, though, creates complications in CreateProcess. The @@ -57,10 +49,7 @@ namespace CorUnix public: CProcProcessLocalData() : - dwProcessId(0), - ps(PS_IDLE), - dwExitCode(0), - lAttachCount(0) + dwProcessId(0) { }; @@ -69,9 +58,6 @@ namespace CorUnix }; DWORD dwProcessId; - PROCESS_STATE ps; - DWORD dwExitCode; - LONG lAttachCount; }; PAL_ERROR diff --git a/src/coreclr/pal/src/include/pal/synchobjects.hpp b/src/coreclr/pal/src/include/pal/synchobjects.hpp index e1ddc641f81538..b7d93660ded768 100644 --- a/src/coreclr/pal/src/include/pal/synchobjects.hpp +++ b/src/coreclr/pal/src/include/pal/synchobjects.hpp @@ -158,8 +158,6 @@ namespace CorUnix public: static IPalSynchronizationManager * CreatePalSynchronizationManager(); - static PAL_ERROR StartWorker(CPalThread * pthrCurrent); - static PAL_ERROR PrepareForShutdown(void); static PAL_ERROR Shutdown(CPalThread *pthrCurrent, bool fFullCleanup); diff --git a/src/coreclr/pal/src/include/pal/thread.hpp b/src/coreclr/pal/src/include/pal/thread.hpp index 9b1f92eb3c3ba9..d7b159f631c502 100644 --- a/src/coreclr/pal/src/include/pal/thread.hpp +++ b/src/coreclr/pal/src/include/pal/thread.hpp @@ -35,13 +35,6 @@ Module Name: namespace CorUnix { - enum PalThreadType - { - UserCreatedThread, - PalWorkerThread, - SignalHandlerThread - }; - PAL_ERROR InternalCreateThread( CPalThread *pThread, @@ -50,7 +43,6 @@ namespace CorUnix LPTHREAD_START_ROUTINE lpStartAddress, LPVOID lpParameter, DWORD dwCreationFlags, - PalThreadType eThreadType, SIZE_T* pThreadId, HANDLE *phThread ); @@ -162,7 +154,6 @@ namespace CorUnix LPTHREAD_START_ROUTINE, LPVOID, DWORD, - PalThreadType, SIZE_T*, HANDLE* ); @@ -253,7 +244,6 @@ namespace CorUnix BOOL m_bCreateSuspended; int m_iThreadPriority; - PalThreadType m_eThreadType; // // pthread mutex / condition variable for gating thread startup. @@ -321,7 +311,6 @@ namespace CorUnix m_lpStartParameter(NULL), m_bCreateSuspended(FALSE), m_iThreadPriority(THREAD_PRIORITY_NORMAL), - m_eThreadType(UserCreatedThread), m_fStartItemsInitialized(FALSE), m_fStartStatus(FALSE), m_fStartStatusSet(FALSE), @@ -523,14 +512,6 @@ namespace CorUnix return m_bCreateSuspended; }; - PalThreadType - GetThreadType( - void - ) - { - return m_eThreadType; - }; - int GetThreadPriority( void diff --git a/src/coreclr/pal/src/init/pal.cpp b/src/coreclr/pal/src/init/pal.cpp index 78fbc214f1e3fa..d261ce80c898a7 100644 --- a/src/coreclr/pal/src/init/pal.cpp +++ b/src/coreclr/pal/src/init/pal.cpp @@ -554,20 +554,6 @@ Initialize( } } -#ifndef TARGET_WASM - if (flags & PAL_INITIALIZE_SYNC_THREAD) - { - // - // Tell the synchronization manager to start its worker thread - // - palError = CPalSynchMgrController::StartWorker(pThread); - if (NO_ERROR != palError) - { - ERROR("Synch manager failed to start worker thread\n"); - goto CLEANUP13; - } - } -#endif // !TARGET_WASM /* initialize structured exception handling stuff (signals, etc) */ if (FALSE == SEHInitialize(pThread, flags)) { diff --git a/src/coreclr/pal/src/loader/module.cpp b/src/coreclr/pal/src/loader/module.cpp index 76fdb966afb6ac..b0da58148f4d1f 100644 --- a/src/coreclr/pal/src/loader/module.cpp +++ b/src/coreclr/pal/src/loader/module.cpp @@ -1131,13 +1131,6 @@ void LOADCallDllMain(DWORD dwReason, LPVOID lpReserved) { MODSTRUCT *module = nullptr; BOOL InLoadOrder = TRUE; /* true if in load order, false for reverse */ - CPalThread *pThread; - - pThread = InternalGetCurrentThread(); - if (UserCreatedThread != pThread->GetThreadType()) - { - return; - } /* Validate dwReason */ switch(dwReason) diff --git a/src/coreclr/pal/src/synchmgr/synchcontrollers.cpp b/src/coreclr/pal/src/synchmgr/synchcontrollers.cpp index 8cbee65aef2540..63e8fb57053f06 100644 --- a/src/coreclr/pal/src/synchmgr/synchcontrollers.cpp +++ b/src/coreclr/pal/src/synchmgr/synchcontrollers.cpp @@ -144,64 +144,6 @@ namespace CorUnix fRetVal = m_psdSynchData->CanWaiterWaitWithoutBlocking(m_pthrOwner); - if(!fRetVal && otiProcess == m_psdSynchData->GetObjectTypeId()) - { - // Note: if the target object is a process, here we need to check - // whether or not it has already exited. In fact, since currently - // we do not monitor a process status as long as there is no - // thread waiting on it, in general if the process already exited - // the process object is likely not to be signaled yet, therefore - // the above CanWaiterWaitWithoutBlocking call probably returned - // false, and, without the check below, that would cause the - // current thread to eventually go to sleep for a short time - // (until the worker thread notifies that the waited process has - // indeed exited), while it would not be necessary. - // As side effect that would cause a WaitForSingleObject with zero - // timeout to always return WAIT_TIMEOUT, even though the target - // process already exited. WaitForSingleObject with zero timeout - // is a common way to probe whether or not a process has already - // exited, and it is supposed to return WAIT_OBJECT_0 if the - // process exited, and WAIT_TIMEOUT if it is still active. - // In order to support this feature we need to check at this time - // whether or not the process has already exited. - - CProcProcessLocalData * pProcLocalData = GetProcessLocalData(); - DWORD dwExitCode = 0; - bool fIsActualExitCode = false; - - _ASSERT_MSG(NULL != pProcLocalData, - "Process synch data pointer is missing\n"); - - if (NULL != pProcLocalData && - CPalSynchronizationManager::HasProcessExited(pProcLocalData->dwProcessId, - &dwExitCode, - &fIsActualExitCode)) - { - TRACE("Process pid=%u exited with %s exitcode=%u\n", - pProcLocalData->dwProcessId, - fIsActualExitCode ? "actual" : "guessed", - dwExitCode); - - // Store the exit code in the process local data - if (fIsActualExitCode) - { - pProcLocalData->dwExitCode = dwExitCode; - } - - // Set process status to PS_DONE - pProcLocalData->ps = PS_DONE; - - // Set signal count - m_psdSynchData->SetSignalCount(1); - - // Releasing all local waiters - // (see comments in DoMonitorProcesses) - m_psdSynchData->ReleaseAllLocalWaiters(m_pthrOwner); - - fRetVal = true; - } - } - *pfCanWaitWithoutBlocking = fRetVal; return NO_ERROR; } @@ -305,31 +247,6 @@ namespace CorUnix ptwiWaitInfo->rgpWTLNodes[ptwiWaitInfo->lObjCount] = pwtlnNewNode; - if(otiProcess == m_psdSynchData->GetObjectTypeId()) - { - CProcProcessLocalData * pProcLocalData = GetProcessLocalData(); - - if (NULL == pProcLocalData) - { - // Process local data pointer not set in the controller. - // This pointer is set in CSynchWaitController only when the - // wait controller for the object is created by calling - // GetSynchWaitControllersForObjects - ASSERT("Process synch data pointer is missing\n"); - palErr = ERROR_INTERNAL_ERROR; - goto RWT_exit; - } - - palErr = pSynchManager->RegisterProcessForMonitoring(m_pthrOwner, - m_psdSynchData, - m_pProcessObject, - pProcLocalData); - if (NO_ERROR != palErr) - { - goto RWT_exit; - } - } - if (0 == ptwiWaitInfo->lObjCount) { DWORD dwWaitState; @@ -424,41 +341,6 @@ namespace CorUnix Release(); } - /*++ - Method: - CSynchWaitController::GetProcessLocalData - - Accessor Get method for process local data of the target object - --*/ - CProcProcessLocalData * CSynchWaitController::GetProcessLocalData() - { - VALIDATEOBJECT(m_psdSynchData); - - _ASSERTE(InternalGetCurrentThread() == m_pthrOwner); - _ASSERT_MSG(NULL != m_pProcLocalData, - "Pointer to process local data not yet initialized\n"); - - return m_pProcLocalData; - } - - /*++ - Method: - CSynchWaitController::SetProcessData - - Accessor Set method for process local data of the target object - --*/ - void CSynchWaitController::SetProcessData(IPalObject* pProcessObject, CProcProcessLocalData * pProcLocalData) - { - VALIDATEOBJECT(m_psdSynchData); - - _ASSERTE(InternalGetCurrentThread() == m_pthrOwner); - _ASSERT_MSG(m_pProcessObject == nullptr, "SetProcessData should not be called more than once"); - _ASSERT_MSG(pProcessObject != nullptr && pProcessObject->GetObjectType()->GetId() == otiProcess, "Invalid process object passed to SetProcessData"); - - m_pProcessObject = pProcessObject; - m_pProcLocalData = pProcLocalData; - } - ///////////////////////////// // // // CSynchStateController // diff --git a/src/coreclr/pal/src/synchmgr/synchmanager.cpp b/src/coreclr/pal/src/synchmgr/synchmanager.cpp index 5745b99298bad6..8690734fdd6f68 100644 --- a/src/coreclr/pal/src/synchmgr/synchmanager.cpp +++ b/src/coreclr/pal/src/synchmgr/synchmanager.cpp @@ -107,18 +107,6 @@ namespace CorUnix return CPalSynchronizationManager::CreatePalSynchronizationManager(); }; - /*++ - Method: - CPalSynchMgrController::StartWorker - - Starts the Synchronization Manager's Worker Thread - --*/ - PAL_ERROR CPalSynchMgrController::StartWorker( - CPalThread * pthrCurrent) - { - return CPalSynchronizationManager::StartWorker(pthrCurrent); - } - /*++ Method: CPalSynchMgrController::PrepareForShutdown @@ -142,29 +130,15 @@ namespace CorUnix CPalSynchronizationManager * CPalSynchronizationManager::s_pObjSynchMgr = NULL; Volatile CPalSynchronizationManager::s_lInitStatus = SynchMgrStatusIdle; minipal_mutex CPalSynchronizationManager::s_csSynchProcessLock; - minipal_mutex CPalSynchronizationManager::s_csMonitoredProcessesLock; CPalSynchronizationManager::CPalSynchronizationManager() - : m_dwWorkerThreadTid(0), - m_pipoThread(NULL), - m_pthrWorker(NULL), - m_iProcessPipeRead(-1), - m_iProcessPipeWrite(-1), - m_pmplnMonitoredProcesses(NULL), - m_lMonitoredProcessesCount(0), - m_pmplnExitedNodes(NULL), - m_cacheWaitCtrlrs(CtrlrsCacheMaxSize), + : m_cacheWaitCtrlrs(CtrlrsCacheMaxSize), m_cacheStateCtrlrs(CtrlrsCacheMaxSize), m_cacheSynchData(SynchDataCacheMaxSize), m_cacheSHRSynchData(SynchDataCacheMaxSize), m_cacheWTListNodes(WTListNodeCacheMaxSize), m_cacheSHRWTListNodes(WTListNodeCacheMaxSize) { -#if HAVE_KQUEUE && !HAVE_BROKEN_FIFO_KEVENT - m_iKQueue = -1; - // Initialize data to 0 and flags to EV_EOF - EV_SET(&m_keProcessPipeEvent, 0, 0, EV_EOF, 0, 0, 0); -#endif // HAVE_KQUEUE } CPalSynchronizationManager::~CPalSynchronizationManager() @@ -629,33 +603,6 @@ namespace CorUnix potObjectType, psdSynchData); } - - if (CSynchControllerBase::WaitController == ctCtrlrType && - otiProcess == potObjectType->GetId()) - { - CProcProcessLocalData * pProcLocData; - IDataLock * pDataLock; - - palErr = rgObjects[uIdx]->GetProcessLocalData( - pthrCurrent, - ReadLock, - &pDataLock, - (void **)&pProcLocData); - - if (NO_ERROR != palErr) - { - // In case of failure here, bail out of the loop, but - // keep track (by incrementing the counter 'uIdx') of the - // fact that this controller has already being initialized - // and therefore need to be Release'd rather than just - // returned to the cache - uIdx++; - break; - } - - Ctrlrs.pWaitCtrlrs[uIdx]->SetProcessData(rgObjects[uIdx], pProcLocData); - pDataLock->ReleaseLock(pthrCurrent, false); - } } if (NO_ERROR != palErr) { @@ -912,7 +859,6 @@ namespace CorUnix } minipal_mutex_init(&s_csSynchProcessLock); - minipal_mutex_init(&s_csMonitoredProcessesLock); pSynchManager = new(std::nothrow) CPalSynchronizationManager(); if (NULL == pSynchManager) @@ -922,14 +868,6 @@ namespace CorUnix goto I_exit; } -#ifndef __wasm__ - if (!pSynchManager->CreateProcessPipe()) - { - ERROR("Unable to create process pipe \n"); - palErr = ERROR_OPEN_FAILED; - goto I_exit; - } -#endif s_pObjSynchMgr = pSynchManager; // Initialization was successful @@ -941,10 +879,6 @@ namespace CorUnix if (NO_ERROR != palErr) { s_lInitStatus = (LONG)SynchMgrStatusError; - if (NULL != pSynchManager) - { - pSynchManager->ShutdownProcessPipe(); - } s_pObjSynchMgr = NULL; g_pSynchronizationManager = NULL; @@ -954,62 +888,6 @@ namespace CorUnix return palErr; } - /*++ - Method: - CPalSynchronizationManager::StartWorker - - Starts the Synchronization Manager's Worker Thread. - Private method, it is called only by CPalSynchMgrController. - --*/ - PAL_ERROR CPalSynchronizationManager::StartWorker( - CPalThread * pthrCurrent) - { - PAL_ERROR palErr = NO_ERROR; - CPalSynchronizationManager * pSynchManager = GetInstance(); - - if ((NULL == pSynchManager) || ((LONG)SynchMgrStatusRunning != s_lInitStatus)) - { - ERROR("Trying to create worker thread in invalid state\n"); - return ERROR_INTERNAL_ERROR; - } - - HANDLE hWorkerThread = NULL; - SIZE_T osThreadId = 0; - palErr = InternalCreateThread(pthrCurrent, - NULL, - 0, - &WorkerThread, - (PVOID)pSynchManager, - 0, - PalWorkerThread, - &osThreadId, - &hWorkerThread); - - if (NO_ERROR == palErr) - { - pSynchManager->m_dwWorkerThreadTid = (DWORD)osThreadId; - palErr = InternalGetThreadDataFromHandle(pthrCurrent, - hWorkerThread, - &pSynchManager->m_pthrWorker, - &pSynchManager->m_pipoThread); - if (NO_ERROR != palErr) - { - ERROR("Unable to get worker thread data\n"); - } - } - else - { - ERROR("Unable to create worker thread\n"); - } - - if (NULL != hWorkerThread) - { - CloseHandle(hWorkerThread); - } - - return palErr; - } - /*++ Method: CPalSynchronizationManager::PrepareForShutdown @@ -1021,11 +899,6 @@ namespace CorUnix PAL_ERROR CPalSynchronizationManager::PrepareForShutdown() { PAL_ERROR palErr = NO_ERROR; - CPalSynchronizationManager * pSynchManager = GetInstance(); - CPalThread * pthrCurrent = InternalGetCurrentThread(); - int iRet; - ThreadNativeWaitData * ptnwdWorkerThreadNativeData; - struct timespec tsAbsTmo = { 0, 0 }; LONG lInit = InterlockedCompareExchange(&s_lInitStatus, (LONG)SynchMgrStatusShuttingDown, (LONG)SynchMgrStatusRunning); @@ -1035,552 +908,15 @@ namespace CorUnix ASSERT("Unexpected initialization status found " "in PrepareForShutdown [expected=%d current=%d]\n", SynchMgrStatusRunning, lInit); - // We intentionally not set s_lInitStatus to SynchMgrStatusError - // cause this could interfere with a previous thread already - // executing shutdown - palErr = ERROR_INTERNAL_ERROR; - goto PFS_exit; - } - - // Discard process monitoring for process waits - pSynchManager->DiscardMonitoredProcesses(pthrCurrent); - - if (NULL == pSynchManager->m_pipoThread) - { - // If m_pipoThread is NULL here, that means that StartWorker has - // never been called. That may happen if PAL_Initialize fails - // sometime after having called CreatePalSynchronizationManager, - // but before calling StartWorker. Nothing else to do here. - goto PFS_exit; - } - - palErr = pSynchManager->WakeUpLocalWorkerThread(SynchWorkerCmdShutdown); - if (NO_ERROR != palErr) - { - ERROR("Failed stopping worker thread [palErr=%u]\n", palErr); - s_lInitStatus = SynchMgrStatusError; - goto PFS_exit; - } - - ptnwdWorkerThreadNativeData = - &pSynchManager->m_pthrWorker->synchronizationInfo.m_tnwdNativeData; - - palErr = GetAbsoluteTimeout(WorkerThreadTerminationTimeout, &tsAbsTmo); - if (NO_ERROR != palErr) - { - ERROR("Failed to convert timeout to absolute timeout\n"); - s_lInitStatus = SynchMgrStatusError; - goto PFS_exit; - } - - // Using the worker thread's predicate/condition/mutex - // to wait for worker thread to be done - iRet = pthread_mutex_lock(&ptnwdWorkerThreadNativeData->mutex); - if (0 != iRet) - { - // pthread calls might fail if the shutdown is called - // from a signal handler. In this case just don't wait - // for the worker thread - ERROR("Cannot lock mutex [err=%d]\n", iRet); - palErr = ERROR_INTERNAL_ERROR; - s_lInitStatus = SynchMgrStatusError; - goto PFS_exit; - } - - while (FALSE == ptnwdWorkerThreadNativeData->iPred) - { - iRet = pthread_cond_timedwait(&ptnwdWorkerThreadNativeData->cond, - &ptnwdWorkerThreadNativeData->mutex, - &tsAbsTmo); - if (0 != iRet) - { - if (ETIMEDOUT == iRet) - { - WARN("Timed out waiting for worker thread to exit " - "(tmo=%u ms)\n", WorkerThreadTerminationTimeout); - } - else - { - ERROR("pthread_cond_timedwait returned %d [errno=%d (%s)]\n", - iRet, errno, strerror(errno)); - } - break; - } - } - if (0 == iRet) - { - ptnwdWorkerThreadNativeData->iPred = FALSE; - } - iRet = pthread_mutex_unlock(&ptnwdWorkerThreadNativeData->mutex); - if (0 != iRet) - { - ERROR("Cannot unlock mutex [err=%d]\n", iRet); - palErr = ERROR_INTERNAL_ERROR; - s_lInitStatus = SynchMgrStatusError; - goto PFS_exit; - } - - PFS_exit: - if (NO_ERROR == palErr) - { - if (NULL != pSynchManager->m_pipoThread) - { - pSynchManager->m_pipoThread->ReleaseReference(pthrCurrent); - - // After this release both m_pipoThread and m_pthrWorker - // are no longer valid - pSynchManager->m_pipoThread = NULL; - pSynchManager->m_pthrWorker = NULL; - } - - // Ready for process shutdown - s_lInitStatus = SynchMgrStatusReadyForProcessShutDown; - } - - return palErr; - } - - /*++ - Method: - CPalSynchronizationManager::WorkerThread - - Synchronization Manager's Worker Thread - --*/ - DWORD PALAPI CPalSynchronizationManager::WorkerThread(LPVOID pArg) - { - PAL_ERROR palErr; - bool fShuttingDown = false; - bool fWorkerIsDone = false; - int iPollTimeout = INFTIM; - SynchWorkerCmd swcCmd; - ThreadWakeupReason twrWakeUpReason; - SharedID shridMarshaledData; - DWORD dwData; - CPalSynchronizationManager * pSynchManager = - reinterpret_cast(pArg); - CPalThread * pthrWorker = InternalGetCurrentThread(); - - SetThreadDescription(PAL_GetCurrentThread(), W(".NET Sync Mgr")); - - while (!fWorkerIsDone) - { - LONG lProcessCount; - - palErr = pSynchManager->ReadCmdFromProcessPipe(iPollTimeout, - &swcCmd, - &shridMarshaledData, - &dwData); - if (NO_ERROR != palErr) - { - ERROR("Received error %x from ReadCmdFromProcessPipe()\n", - palErr); - continue; - } - switch (swcCmd) - { - case SynchWorkerCmdNop: - TRACE("Synch Worker: received SynchWorkerCmdNop\n"); - if (fShuttingDown) - { - TRACE("Synch Worker: received a timeout when " - "fShuttingDown==true: worker is done, bailing " - "out from the loop\n"); - - // Whether WorkerThreadShuttingDownTimeout has elapsed - // or the last process with a descriptor opened for - // write on our process pipe, has just closed it, - // causing an EOF on the read fd (that can happen only - // at shutdown time since during normal run time we - // hold a fd opened for write within this process). - // In both the case it is time to go for the worker - // thread. - fWorkerIsDone = true; - } - else - { - lProcessCount = pSynchManager->DoMonitorProcesses(pthrWorker); - if (lProcessCount > 0) - { - iPollTimeout = WorkerThreadProcMonitoringTimeout; - } - else - { - iPollTimeout = INFTIM; - } - } - break; - case SynchWorkerCmdShutdown: - TRACE("Synch Worker: received SynchWorkerCmdShutdown\n"); - - // Shutdown the process pipe: this will cause the process - // pipe to be unlinked and its write-only file descriptor - // to be closed, so that when the last fd opened for write - // on the fifo (from another process) will be closed, we - // will receive an EOF on the read end (i.e. poll in - // ReadBytesFromProcessPipe will return 1 with no data to - // be read). That will allow the worker thread to process - // possible commands already successfully written to the - // pipe by some other process, before shutting down. - pSynchManager->ShutdownProcessPipe(); - - // Shutting down: this will cause the worker thread to - // fetch residual cmds from the process pipe until an - // EOF is converted to a SynchWorkerCmdNop or the - // WorkerThreadShuttingDownTimeout has elapsed without - // receiving any cmd. - fShuttingDown = true; - - // Set the timeout to WorkerThreadShuttingDownTimeout - iPollTimeout = WorkerThreadShuttingDownTimeout; - break; - default: - ASSERT("Synch Worker: Unknown worker cmd [swcWorkerCmd=%d]\n", - swcCmd); - break; - } - } - - int iRet; - ThreadNativeWaitData * ptnwdWorkerThreadNativeData = - &pthrWorker->synchronizationInfo.m_tnwdNativeData; - - // Using the worker thread's predicate/condition/mutex - // (that normally are never used) to signal the shutting - // down thread that the worker thread is done - iRet = pthread_mutex_lock(&ptnwdWorkerThreadNativeData->mutex); - _ASSERT_MSG(0 == iRet, "Cannot lock mutex [err=%d]\n", iRet); - - ptnwdWorkerThreadNativeData->iPred = TRUE; - - iRet = pthread_cond_signal(&ptnwdWorkerThreadNativeData->cond); - if (0 != iRet) - { - ERROR ("pthread_cond_signal returned %d [errno=%d (%s)]\n", - iRet, errno, strerror(errno)); - } - - iRet = pthread_mutex_unlock(&ptnwdWorkerThreadNativeData->mutex); - _ASSERT_MSG(0 == iRet, "Cannot lock mutex [err=%d]\n", iRet); - - // Sleep forever - ThreadPrepareForShutdown(); - - return 0; - } - - /*++ - Method: - CPalSynchronizationManager::ReadCmdFromProcessPipe - - Reads a worker thread cmd from the process pipe. If there is no data - to be read on the pipe, it blocks until there is data available or the - timeout expires. - --*/ - PAL_ERROR CPalSynchronizationManager::ReadCmdFromProcessPipe( - int iPollTimeout, - SynchWorkerCmd * pswcWorkerCmd, - SharedID * pshridMarshaledData, - DWORD * pdwData) - { - int iRet; - BYTE byVal; - SynchWorkerCmd swcWorkerCmd = SynchWorkerCmdNop; - - _ASSERTE(NULL != pswcWorkerCmd); - _ASSERTE(NULL != pshridMarshaledData); - _ASSERTE(NULL != pdwData); - - iRet = ReadBytesFromProcessPipe(iPollTimeout, &byVal, sizeof(BYTE)); - - if (0 > iRet) - { - ERROR("Failed polling the process pipe [ret=%d errno=%d (%s)]\n", - iRet, errno, strerror(errno)); - + // We intentionally do not set s_lInitStatus to SynchMgrStatusError + // because this could interfere with a previous thread already + // executing shutdown. return ERROR_INTERNAL_ERROR; } - if (iRet != 0) - { - _ASSERT_MSG(sizeof(BYTE) == iRet, - "Got %d bytes from process pipe while expecting for %d\n", - iRet, sizeof(BYTE)); - - swcWorkerCmd = (SynchWorkerCmd)byVal; - - if (SynchWorkerCmdLast <= swcWorkerCmd) - { - ERROR("Got unknown worker command code %d from the process " - "pipe!\n", swcWorkerCmd); - - return ERROR_INTERNAL_ERROR; - } - - _ASSERT_MSG(SynchWorkerCmdNop == swcWorkerCmd || - SynchWorkerCmdShutdown == swcWorkerCmd, - "Unknown worker command code %u\n", swcWorkerCmd); - - TRACE("Got cmd %u from process pipe\n", swcWorkerCmd); - } - - *pswcWorkerCmd = swcWorkerCmd; - return NO_ERROR; - } - - /*++ - Method: - CPalSynchronizationManager::ReadBytesFromProcessPipe - - Reads the specified number of bytes from the process pipe. If there is - no data to be read on the pipe, it blocks until there is data available - or the timeout expires. - --*/ - int CPalSynchronizationManager::ReadBytesFromProcessPipe( - int iTimeout, - BYTE * pRecvBuf, - LONG iBytes) - { -#if !HAVE_KQUEUE - struct pollfd Poll; -#endif // !HAVE_KQUEUE - int iRet = -1; - int iConsecutiveEintrs = 0; - LONG iBytesRead = 0; - BYTE * pPos = pRecvBuf; -#if HAVE_KQUEUE && !HAVE_BROKEN_FIFO_KEVENT - struct kevent keChanges; - struct timespec ts, *pts; - int iNChanges; -#endif // HAVE_KQUEUE - - _ASSERTE(0 <= iBytes); - - do - { - while (TRUE) - { - int iErrno = 0; -#if HAVE_KQUEUE -#if HAVE_BROKEN_FIFO_KEVENT -#if HAVE_BROKEN_FIFO_SELECT -#error Found no way to wait on a FIFO. -#endif - - timeval *ptv; - timeval tv; - - if (INFTIM == iTimeout) - { - ptv = NULL; - } - else - { - tv.tv_usec = (iTimeout % tccSecondsToMilliSeconds) * - tccMilliSecondsToMicroSeconds; - tv.tv_sec = iTimeout / tccSecondsToMilliSeconds; - ptv = &tv; - } - - fd_set readfds; - FD_ZERO(&readfds); - FD_SET(m_iProcessPipeRead, &readfds); - iRet = select(m_iProcessPipeRead + 1, &readfds, NULL, NULL, ptv); - -#else // HAVE_BROKEN_FIFO_KEVENT - - // Note: FreeBSD needs to use kqueue/kevent support here, since on this - // platform the EOF notification on FIFOs is not surfaced through poll, - // and process pipe shutdown relies on this feature. - // If a thread is polling a FIFO or a pipe for POLLIN, when the last - // write descriptor for that pipe is closed, poll() is supposed to - // return with a POLLIN event but no data to be read on the FIFO/pipe, - // which means EOF. - // On FreeBSD such feature works for pipes but it doesn't for FIFOs. - // Using kevent the EOF is instead surfaced correctly. - - if (iBytes > m_keProcessPipeEvent.data) - { - if (INFTIM == iTimeout) - { - pts = NULL; - } - else - { - ts.tv_nsec = (iTimeout % tccSecondsToMilliSeconds) * - tccMilliSecondsToNanoSeconds; - ts.tv_sec = iTimeout / tccSecondsToMilliSeconds; - pts = &ts; - } - - if (0 != (EV_EOF & m_keProcessPipeEvent.flags)) - { - TRACE("Refreshing kevent settings\n"); - EV_SET(&keChanges, m_iProcessPipeRead, EVFILT_READ, - EV_ADD | EV_CLEAR, 0, 0, 0); - iNChanges = 1; - } - else - { - iNChanges = 0; - } - - iRet = kevent(m_iKQueue, &keChanges, iNChanges, - &m_keProcessPipeEvent, 1, pts); - - if (0 < iRet) - { - _ASSERTE(1 == iRet); - _ASSERTE(EVFILT_READ == m_keProcessPipeEvent.filter); - - if (EV_ERROR & m_keProcessPipeEvent.flags) - { - ERROR("EV_ERROR from kevent [ident=%d filter=%d flags=%x]\n", m_keProcessPipeEvent.ident, m_keProcessPipeEvent.filter, m_keProcessPipeEvent.flags); - iRet = -1; - iErrno = m_keProcessPipeEvent.data; - m_keProcessPipeEvent.data = 0; - } - } - else if (0 > iRet) - { - iErrno = errno; - } - - TRACE("Woken up from kevent() with ret=%d flags=%#x data=%d " - "[iTimeout=%d]\n", iRet, m_keProcessPipeEvent.flags, - m_keProcessPipeEvent.data, iTimeout); - } - else - { - // There is enough data already available in the buffer, just use that. - iRet = 1; - } - -#endif // HAVE_BROKEN_FIFO_KEVENT -#else // HAVE_KQUEUE - - Poll.fd = m_iProcessPipeRead; - Poll.events = POLLIN; - Poll.revents = 0; - - iRet = poll(&Poll, 1, iTimeout); - - TRACE("Woken up from poll() with ret=%d [iTimeout=%d]\n", - iRet, iTimeout); - - if (1 == iRet && - ((POLLERR | POLLHUP | POLLNVAL) & Poll.revents)) - { - // During PAL shutdown the pipe gets closed and Poll.revents is set to POLLHUP - // (note: no other flags are set). We will also receive an EOF on from the read call. - // Please see the comment for SynchWorkerCmdShutdown in CPalSynchronizationManager::WorkerThread. - if (!PALIsShuttingDown() || (Poll.revents != POLLHUP)) - { - ERROR("Unexpected revents=%x while polling pipe %d\n", - Poll.revents, Poll.fd); - iErrno = EINVAL; - iRet = -1; - } - } - else if (0 > iRet) - { - iErrno = errno; - } - -#endif // HAVE_KQUEUE - - if (0 == iRet || 1 == iRet) - { - // 0 == wait timed out - // 1 == FIFO has data available - break; - } - else - { - if (1 < iRet) - { - // Unexpected iRet > 1 - ASSERT("Unexpected return code %d from blocking poll/kevent call\n", - iRet); - goto RBFPP_exit; - } - - if (EINTR != iErrno) - { - // Unexpected error - ASSERT("Unexpected error from blocking poll/kevent call: %d (%s)\n", - iErrno, strerror(iErrno)); - goto RBFPP_exit; - } - - iConsecutiveEintrs++; - TRACE("poll() failed with EINTR; re-polling\n"); - - if (iConsecutiveEintrs >= MaxWorkerConsecutiveEintrs) - { - if (iTimeout != INFTIM) - { - WARN("Receiving too many EINTRs; converting one of them " - "to a timeout"); - iRet = 0; - break; - } - else if (0 == (iConsecutiveEintrs % MaxWorkerConsecutiveEintrs)) - { - WARN("Receiving too many EINTRs [%d so far]", - iConsecutiveEintrs); - } - } - } - } - - if (0 == iRet) - { - // Time out - break; - } - else - { -#if HAVE_KQUEUE && !HAVE_BROKEN_FIFO_KEVENT - if (0 != (EV_EOF & m_keProcessPipeEvent.flags) && 0 == m_keProcessPipeEvent.data) - { - // EOF - TRACE("Received an EOF on process pipe via kevent\n"); - goto RBFPP_exit; - } -#endif // HAVE_KQUEUE - - iRet = read(m_iProcessPipeRead, pPos, iBytes - iBytesRead); - - if (0 == iRet) - { - // Poll returned 1 and read returned zero: this is an EOF, - // i.e. no other process has the pipe still open for write - TRACE("Received an EOF on process pipe via poll\n"); - goto RBFPP_exit; - } - else if (0 > iRet) - { - ERROR("Unable to read %d bytes from the process pipe " - "[pipe=%d ret=%d errno=%d (%s)]\n", iBytes - iBytesRead, - m_iProcessPipeRead, iRet, errno, strerror(errno)); - goto RBFPP_exit; - } - - TRACE("Read %d bytes from process pipe\n", iRet); - - iBytesRead += iRet; - pPos += iRet; - -#if HAVE_KQUEUE && !HAVE_BROKEN_FIFO_KEVENT - // Update available data count - m_keProcessPipeEvent.data -= iRet; - _ASSERTE(0 <= m_keProcessPipeEvent.data); -#endif // HAVE_KQUEUE - } - } while(iBytesRead < iBytes); - - RBFPP_exit: - return (iRet < 0) ? iRet : iBytesRead; + // Ready for process shutdown. + s_lInitStatus = SynchMgrStatusReadyForProcessShutDown; + return palErr; } /*++ @@ -1739,57 +1075,7 @@ namespace CorUnix return palErr; } - - /*++ - Method: - CPalSynchronizationManager::WakeUpLocalWorkerThread - - Wakes up the local worker thread by writing a 'nop' cmd to the - process pipe. - --*/ - PAL_ERROR CPalSynchronizationManager::WakeUpLocalWorkerThread( - SynchWorkerCmd swcWorkerCmd) - { - PAL_ERROR palErr = NO_ERROR; - - _ASSERT_MSG((swcWorkerCmd & 0xFF) == swcWorkerCmd, - "Value too big for swcWorkerCmd\n"); - - _ASSERT_MSG((SynchWorkerCmdNop == swcWorkerCmd) || - (SynchWorkerCmdShutdown == swcWorkerCmd), - "WakeUpLocalWorkerThread supports only SynchWorkerCmdNop and SynchWorkerCmdShutdown." - "[received cmd=%d]\n", swcWorkerCmd); - - BYTE byCmd = (BYTE)(swcWorkerCmd & 0xFF); - - TRACE("Waking up Synch Worker Thread for %u [byCmd=%u]\n", - swcWorkerCmd, (unsigned int)byCmd); - - // As long as we use pipes and we keep the message size - // within PIPE_BUF, there's no need to lock here, since the - // write is guaranteed not to be interleaved with/into other - // writes of PIPE_BUF bytes or less. - _ASSERT_MSG(sizeof(BYTE) <= PIPE_BUF, "Message too long\n"); - - int iRetryCount = 0; - ssize_t sszWritten; - do - { - sszWritten = write(m_iProcessPipeWrite, &byCmd, sizeof(BYTE)); - } while (-1 == sszWritten && - EAGAIN == errno && - ++iRetryCount < MaxConsecutiveEagains && - 0 == sched_yield()); - - if (sszWritten != sizeof(BYTE)) - { - ERROR("Unable to write to the process pipe to wake up the " - "worker thread [errno=%d (%s)]\n", errno, strerror(errno)); - palErr = ERROR_INTERNAL_ERROR; - } - - return palErr; - } + /*++ Method: @@ -1934,164 +1220,7 @@ namespace CorUnix _ASSERT_MSG(bOriginatingNodeFound, "Couldn't find originating node while unsignaling rest of the wait all\n"); } - /*++ - Method: - CPalSynchronizationManager::RegisterProcessForMonitoring - - Registers the process object represented by the passed psdSynchData and - pProcLocalData. The worker thread will monitor the actual process and, - upon process termination, it will set the exit code in pProcLocalData, - and it will signal the process object, by signaling its psdSynchData. - --*/ - PAL_ERROR CPalSynchronizationManager::RegisterProcessForMonitoring( - CPalThread * pthrCurrent, - CSynchData *psdSynchData, - IPalObject *pProcessObject, - CProcProcessLocalData * pProcLocalData) - { - PAL_ERROR palErr = NO_ERROR; - MonitoredProcessesListNode * pmpln; - bool fWakeUpWorker = false; - bool fMonitoredProcessesLock = false; - - VALIDATEOBJECT(psdSynchData); - - minipal_mutex_enter(&s_csMonitoredProcessesLock); - - fMonitoredProcessesLock = true; - - pmpln = m_pmplnMonitoredProcesses; - while (pmpln) - { - if (psdSynchData == pmpln->psdSynchData) - { - _ASSERT_MSG(pmpln->dwPid == pProcLocalData->dwProcessId, "Invalid node in Monitored Processes List\n"); - break; - } - - pmpln = pmpln->pNext; - } - - if (pmpln) - { - pmpln->lRefCount++; - } - else - { - pmpln = new(std::nothrow) MonitoredProcessesListNode(); - if (NULL == pmpln) - { - ERROR("No memory to allocate MonitoredProcessesListNode structure\n"); - palErr = ERROR_NOT_ENOUGH_MEMORY; - goto RPFM_exit; - } - - pmpln->lRefCount = 1; - pmpln->dwPid = pProcLocalData->dwProcessId; - pmpln->dwExitCode = 0; - pmpln->pProcessObject = pProcessObject; - pmpln->pProcessObject->AddReference(); - pmpln->pProcLocalData = pProcLocalData; - - // Acquire SynchData and AddRef it - pmpln->psdSynchData = psdSynchData; - psdSynchData->AddRef(); - - pmpln->pNext = m_pmplnMonitoredProcesses; - m_pmplnMonitoredProcesses = pmpln; - m_lMonitoredProcessesCount++; - - fWakeUpWorker = true; - } - - // Unlock - minipal_mutex_leave(&s_csMonitoredProcessesLock); - fMonitoredProcessesLock = false; - - if (fWakeUpWorker) - { - CPalSynchronizationManager * pSynchManager = GetInstance(); - - palErr = pSynchManager->WakeUpLocalWorkerThread(SynchWorkerCmdNop); - if (NO_ERROR != palErr) - { - ERROR("Failed waking up worker thread for process " - "monitoring registration [errno=%d {%s%}]\n", - errno, strerror(errno)); - palErr = ERROR_INTERNAL_ERROR; - } - } - - RPFM_exit: - if (fMonitoredProcessesLock) - { - minipal_mutex_leave(&s_csMonitoredProcessesLock); - } - - return palErr; - } - - /*++ - Method: - CPalSynchronizationManager::UnRegisterProcessForMonitoring - - Unregisters a process object currently monitored by the worker thread - (typically called if the wait timed out before the process exited, or - if the wait was a normal (i.e. non wait-all) wait that involved othter - objects, and another object has been signaled). - --*/ - PAL_ERROR CPalSynchronizationManager::UnRegisterProcessForMonitoring( - CPalThread * pthrCurrent, - CSynchData *psdSynchData, - DWORD dwPid) - { - PAL_ERROR palErr = NO_ERROR; - MonitoredProcessesListNode * pmpln, * pmplnPrev = NULL; - - VALIDATEOBJECT(psdSynchData); - - minipal_mutex_enter(&s_csMonitoredProcessesLock); - - pmpln = m_pmplnMonitoredProcesses; - while (pmpln) - { - if (psdSynchData == pmpln->psdSynchData) - { - _ASSERT_MSG(dwPid == pmpln->dwPid, "Invalid node in Monitored Processes List\n"); - break; - } - pmplnPrev = pmpln; - pmpln = pmpln->pNext; - } - - if (pmpln) - { - if (0 == --pmpln->lRefCount) - { - if (NULL != pmplnPrev) - { - pmplnPrev->pNext = pmpln->pNext; - } - else - { - m_pmplnMonitoredProcesses = pmpln->pNext; - } - - m_lMonitoredProcessesCount--; - pmpln->pProcessObject->ReleaseReference(pthrCurrent); - pmpln->psdSynchData->Release(pthrCurrent); - delete pmpln; - } - } - else - { - palErr = ERROR_NOT_FOUND; - } - - minipal_mutex_leave(&s_csMonitoredProcessesLock); - return palErr; - } /*++ Method: @@ -2114,443 +1243,7 @@ namespace CorUnix ASSERT("This code should never be executed\n"); } - /*++ - Method: - CPalSynchronizationManager::DoMonitorProcesses - - This method is called by the worker thread to execute one step of - monitoring for all the process currently registered for monitoring - --*/ - LONG CPalSynchronizationManager::DoMonitorProcesses( - CPalThread * pthrCurrent) - { - MonitoredProcessesListNode * pNode, * pPrev = NULL, * pNext; - LONG lInitialNodeCount; - LONG lRemovingCount = 0; - bool fLocalSynchLock = false; - bool fMonitoredProcessesLock = false; - - // Note: we first need to grab the monitored processes lock to walk - // the list of monitored processes, and then, if there is any - // which exited, to grab the synchronization lock(s) to signal - // the process object. Anyway we cannot grab the synchronization - // lock(s) while holding the monitored processes lock; that - // would cause deadlock, since RegisterProcessForMonitoring and - // UnRegisterProcessForMonitoring call stacks grab the locks - // in the opposite order. Grabbing the synch lock(s) first (and - // therefore all the times) would cause unacceptable contention - // (process monitoring is done in polling mode). - // Therefore we need to remove list nodes for processes that - // exited copying them to the exited array, while holding only - // the monitored processes lock, and then to signal them from that - // array holding synch lock(s) and monitored processes lock, - // acquired in this order. Holding again the monitored processes - // lock is needed in order to support object promotion. - - // Grab the monitored processes lock - minipal_mutex_enter(&s_csMonitoredProcessesLock); - fMonitoredProcessesLock = true; - - lInitialNodeCount = m_lMonitoredProcessesCount; - - pNode = m_pmplnMonitoredProcesses; - while (pNode) - { - pNext = pNode->pNext; - - if (HasProcessExited(pNode->dwPid, - &pNode->dwExitCode, - &pNode->fIsActualExitCode)) - { - TRACE("Process %u exited with return code %u\n", - pNode->dwPid, - pNode->fIsActualExitCode ? "actual" : "guessed", - pNode->dwExitCode); - - if (NULL != pPrev) - { - pPrev->pNext = pNext; - } - else - { - m_pmplnMonitoredProcesses = pNext; - } - - m_lMonitoredProcessesCount--; - - // Insert in the list of nodes for exited processes - pNode->pNext = m_pmplnExitedNodes; - m_pmplnExitedNodes = pNode; - lRemovingCount++; - } - else - { - pPrev = pNode; - } - - // Go to the next - pNode = pNext; - } - - // Release the monitored processes lock - minipal_mutex_leave(&s_csMonitoredProcessesLock); - fMonitoredProcessesLock = false; - - if (lRemovingCount > 0) - { - // First grab the local synch lock - AcquireLocalSynchLock(pthrCurrent); - fLocalSynchLock = true; - - // Acquire the monitored processes lock - minipal_mutex_enter(&s_csMonitoredProcessesLock); - fMonitoredProcessesLock = true; - - // Start from the beginning of the exited processes list - pNode = m_pmplnExitedNodes; - // Invalidate the list - m_pmplnExitedNodes = NULL; - - while (pNode) - { - pNext = pNode->pNext; - - TRACE("Process pid=%u exited with exitcode=%u\n", - pNode->dwPid, pNode->dwExitCode); - - // Store the exit code in the process local data - if (pNode->fIsActualExitCode) - { - pNode->pProcLocalData->dwExitCode = pNode->dwExitCode; - } - - // Set process status to PS_DONE - pNode->pProcLocalData->ps = PS_DONE; - - // Set signal count - pNode->psdSynchData->SetSignalCount(1); - - // Releasing all local waiters - // - // We just called directly in CSynchData::SetSignalCount(), so - // we need to take care of waking up waiting threads according - // to the Process object semantics (i.e. every thread must be - // awakend). Anyway if a process object is shared among two or - // more processes and threads from different processes are - // waiting on it, the object will be registered for monitoring - // in each of the processes. As result its signal count will - // be set to one more times (which is not a problem, given the - // process object semantics) and each worker thread will wake - // up waiting threads. Therefore we need to make sure that each - // worker wakes up only threads in its own process: we do that - // by calling ReleaseAllLocalWaiters - pNode->psdSynchData->ReleaseAllLocalWaiters(pthrCurrent); - - // We are done with pProcLocalData, so we can release the process object - pNode->pProcessObject->ReleaseReference(pthrCurrent); - - // Release the reference to the SynchData - pNode->psdSynchData->Release(pthrCurrent); - - // Delete the node - delete pNode; - - // Go to the next - pNode = pNext; - } - } - - if (fMonitoredProcessesLock) - { - minipal_mutex_leave(&s_csMonitoredProcessesLock); - } - - if (fLocalSynchLock) - { - ReleaseLocalSynchLock(pthrCurrent); - } - - return (lInitialNodeCount - lRemovingCount); - } - - /*++ - Method: - CPalSynchronizationManager::DiscardMonitoredProcesses - - This method is called at shutdown time to discard all the registration - for the processes currently monitored by the worker thread. - This method must be called at shutdown time, otherwise some shared memory - may be leaked at process shutdown. - --*/ - void CPalSynchronizationManager::DiscardMonitoredProcesses( - CPalThread * pthrCurrent) - { - MonitoredProcessesListNode * pNode; - - // Grab the monitored processes lock - minipal_mutex_enter(&s_csMonitoredProcessesLock); - - while (m_pmplnMonitoredProcesses) - { - pNode = m_pmplnMonitoredProcesses; - m_pmplnMonitoredProcesses = pNode->pNext; - pNode->pProcessObject->ReleaseReference(pthrCurrent); - pNode->psdSynchData->Release(pthrCurrent); - delete pNode; - } - - // Release the monitored processes lock - minipal_mutex_leave(&s_csMonitoredProcessesLock); - } - - /*++ - Method: - CPalSynchronizationManager::CreateProcessPipe - - Creates the process pipe for the current process - --*/ - bool CPalSynchronizationManager::CreateProcessPipe() - { - bool fRet = true; -#if HAVE_KQUEUE && !HAVE_BROKEN_FIFO_KEVENT - int iKq = -1; -#endif // HAVE_KQUEUE && !HAVE_BROKEN_FIFO_KEVENT - -#ifndef CORECLR - int iPipeRd = -1, iPipeWr = -1; - char szPipeFilename[MAX_PATH]; - - /* Create the blocking pipe */ - if (!GetProcessPipeName(szPipeFilename, MAX_PATH, gPID)) - { - ERROR("couldn't get process pipe's name\n"); - szPipeFilename[0] = 0; - fRet = false; - goto CPP_exit; - } - - /* create the pipe, with full access to the owner only */ - if (mkfifo(szPipeFilename, S_IRWXU) == -1) - { - if (errno == EEXIST) - { - /* Some how no one deleted the pipe, perhaps it was left behind - from a crash?? Delete the pipe and try again. */ - if (-1 == unlink(szPipeFilename)) - { - ERROR( "Unable to delete the process pipe that was left behind.\n" ); - fRet = false; - goto CPP_exit; - } - else - { - if (mkfifo(szPipeFilename, S_IRWXU) == -1) - { - ERROR( "Still unable to create the process pipe...giving up!\n" ); - fRet = false; - goto CPP_exit; - } - } - } - else - { - ERROR( "Unable to create the process pipe.\n" ); - fRet = false; - goto CPP_exit; - } - } - - iPipeRd = InternalOpen(szPipeFilename, O_RDONLY | O_NONBLOCK); - if (iPipeRd == -1) - { - ERROR("Unable to open the process pipe for read\n"); - fRet = false; - goto CPP_exit; - } - - iPipeWr = InternalOpen(szPipeFilename, O_WRONLY | O_NONBLOCK); - if (iPipeWr == -1) - { - ERROR("Unable to open the process pipe for write\n"); - fRet = false; - goto CPP_exit; - } -#else // !CORECLR - int rgiPipe[] = { -1, -1 }; - int pipeRv = -#if HAVE_PIPE2 - pipe2(rgiPipe, O_CLOEXEC); -#else - pipe(rgiPipe); -#endif // HAVE_PIPE2 - if (pipeRv == -1) - { - ERROR("Unable to create the process pipe\n"); - fRet = false; - goto CPP_exit; - } -#if !HAVE_PIPE2 - fcntl(rgiPipe[0], F_SETFD, FD_CLOEXEC); // make pipe non-inheritable, if possible - fcntl(rgiPipe[1], F_SETFD, FD_CLOEXEC); -#endif // !HAVE_PIPE2 -#endif // !CORECLR - -#if HAVE_KQUEUE && !HAVE_BROKEN_FIFO_KEVENT - iKq = kqueue(); - if (-1 == iKq) - { - ERROR("Failed to create kqueue associated to process pipe\n"); - fRet = false; - goto CPP_exit; - } -#endif // HAVE_KQUEUE - - CPP_exit: - if (fRet) - { - // Succeeded -#ifndef CORECLR - m_iProcessPipeRead = iPipeRd; - m_iProcessPipeWrite = iPipeWr; -#else // !CORECLR - m_iProcessPipeRead = rgiPipe[0]; - m_iProcessPipeWrite = rgiPipe[1]; -#endif // !CORECLR -#if HAVE_KQUEUE && !HAVE_BROKEN_FIFO_KEVENT - m_iKQueue = iKq; -#endif // HAVE_KQUEUE - } - else - { -#ifndef CORECLR - // Failed - if (0 != szPipeFilename[0]) - { - unlink(szPipeFilename); - } - if (-1 != iPipeRd) - { - close(iPipeRd); - } - if (-1 != iPipeWr) - { - close(iPipeWr); - } -#else // !CORECLR - if (-1 != rgiPipe[0]) - { - close(rgiPipe[0]); - close(rgiPipe[1]); - } -#endif // !CORECLR -#if HAVE_KQUEUE && !HAVE_BROKEN_FIFO_KEVENT - if (-1 != iKq) - { - close(iKq); - } -#endif // HAVE_KQUEUE - } - - return fRet; - } - - /*++ - Method: - CPalSynchronizationManager::ShutdownProcessPipe - - Shuts down the process pipe and removes the fifo so that other processes - can no longer open it. It also closes the local write end of the pipe (see - comment below). From this moment on the worker thread will process any - possible data already received in the pipe (but not yet consumed) and any - data written by processes that still have a opened write end of this pipe; - it will wait (with timeout) until the last remote process which has a write - end opened closes it, and then it will yield to process shutdown. - --*/ - PAL_ERROR CPalSynchronizationManager::ShutdownProcessPipe() - { - PAL_ERROR palErr = NO_ERROR; -#ifndef CORECLR - char szPipeFilename[MAX_PATH]; - - if (GetProcessPipeName(szPipeFilename, MAX_PATH, gPID)) - { - if (unlink(szPipeFilename) == -1) - { - ERROR("Unable to unlink the pipe file name errno=%d (%s)\n", - errno, strerror(errno)); - palErr = ERROR_INTERNAL_ERROR; - // go on anyway - } - } - else - { - ERROR("Couldn't get the process pipe's name\n"); - palErr = ERROR_INTERNAL_ERROR; - // go on anyway - } -#endif // CORECLR - - if (-1 != m_iProcessPipeWrite) - { - // Closing the write end of the process pipe. When the last process - // that still has a open write-fd on this pipe will close it, the - // worker thread will receive an EOF; the worker thread will wait - // for this EOF before shutting down, so to ensure to process any - // possible data already written to the pipe by other processes - // when the shutdown has been initiated in the current process. - // Note: no need here to worry about platforms where close(pipe) - // blocks on outstanding syscalls, since we are the only one using - // this fd. - TRACE("Closing the write end of process pipe\n"); - if (close(m_iProcessPipeWrite) == -1) - { - ERROR("Unable to close the write end of process pipe\n"); - palErr = ERROR_INTERNAL_ERROR; - } - - m_iProcessPipeWrite = -1; - } - - return palErr; - } - -#ifndef CORECLR - /*++ - Method: - CPalSynchronizationManager::GetProcessPipeName - - Returns the process pipe name for the target process (identified by its PID) - --*/ - bool CPalSynchronizationManager::GetProcessPipeName( - LPSTR pDest, - int iDestSize, - DWORD dwPid) - { - CHAR config_dir[MAX_PATH]; - int needed_size; - - _ASSERT_MSG(NULL != pDest, "Destination pointer is NULL!\n"); - _ASSERT_MSG(0 < iDestSize,"Invalid buffer size %d\n", iDestSize); - - if (!PALGetPalConfigDir(config_dir, MAX_PATH)) - { - ASSERT("Unable to determine the PAL config directory.\n"); - pDest[0] = '\0'; - return false; - } - needed_size = snprintf(pDest, iDestSize, "%s/%s-%u", config_dir, - PROCESS_PIPE_NAME_PREFIX, dwPid); - pDest[iDestSize-1] = 0; - if(needed_size >= iDestSize) - { - ERROR("threadpipe name needs %d characters, buffer only has room for " - "%d\n", needed_size, iDestSize+1); - return false; - } - return true; - } -#endif // !CORECLR /*++ Method: @@ -2882,109 +1575,6 @@ namespace CorUnix #endif // SYNCHMGR_SUSPENSION_SAFE_CONDITION_SIGNALING - /*++ - Method: - CPalSynchronizationManager::HasProcessExited - - Tests whether or not a process has exited - --*/ - bool CPalSynchronizationManager::HasProcessExited( - DWORD dwPid, - DWORD * pdwExitCode, - bool * pfIsActualExitCode) - { - pid_t pidWaitRetval; - int iStatus; - bool fRet = false; - - TRACE("Looking for status of process; trying wait()\n"); - - while(1) - { - /* try to get state of process, using non-blocking call */ - pidWaitRetval = waitpid(dwPid, &iStatus, WNOHANG); - - if ((DWORD)pidWaitRetval == dwPid) - { - /* success; get the exit code */ - if (WIFEXITED(iStatus)) - { - *pdwExitCode = WEXITSTATUS(iStatus); - *pfIsActualExitCode = true; - TRACE("Exit code was %d\n", *pdwExitCode); - } - else if (WIFSIGNALED(iStatus)) - { - *pdwExitCode = 128 + WTERMSIG(iStatus); - *pfIsActualExitCode = true; - TRACE("Exited by signal %d = exit code %d\n", WTERMSIG(iStatus), *pdwExitCode); - } - else - { - WARN("Process terminated without exiting; can't get exit " - "code. Assuming EXIT_FAILURE.\n"); - *pfIsActualExitCode = true; - *pdwExitCode = EXIT_FAILURE; - } - - fRet = true; - } - else if (0 == pidWaitRetval) - { - // The process is still running. - TRACE("Process %#x is still active.\n", dwPid); - } - else - { - // A legitimate cause of failure is EINTR; if this happens we - // have to try again. A second legitimate cause is ECHILD, which - // happens if we're trying to retrieve the status of a currently- - // running process that isn't a child of this process. - if(EINTR == errno) - { - TRACE("waitpid() failed with EINTR; re-waiting\n"); - continue; - } - else if (ECHILD == errno) - { - TRACE("waitpid() failed with ECHILD; calling kill instead\n"); - if (kill(dwPid, 0) != 0) - { - if (ESRCH == errno) - { - WARN("kill() failed with ESRCH, i.e. target " - "process exited and it wasn't a child, " - "so can't get the exit code, assuming " - "it was 0.\n"); - *pfIsActualExitCode = false; - *pdwExitCode = 0; - } - else - { - ERROR("kill(pid, 0) failed; errno is %d (%s)\n", - errno, strerror(errno)); - *pfIsActualExitCode = false; - *pdwExitCode = EXIT_FAILURE; - } - - fRet = true; - } - } - else - { - // Ignoring unexpected waitpid errno and assuming that - // the process is still running - ERROR("waitpid(pid=%u) failed with errno=%d (%s)\n", - dwPid, errno, strerror(errno)); - } - } - - // Break out of the loop in all cases except EINTR. - break; - } - - return fRet; - } /*++ Method: diff --git a/src/coreclr/pal/src/synchmgr/synchmanager.hpp b/src/coreclr/pal/src/synchmgr/synchmanager.hpp index 32939732a5ff9e..361cd2d3362488 100644 --- a/src/coreclr/pal/src/synchmgr/synchmanager.hpp +++ b/src/coreclr/pal/src/synchmgr/synchmanager.hpp @@ -29,9 +29,6 @@ Module Name: #include #include -#if HAVE_KQUEUE -#include -#endif // HAVE_KQUEUE #include "pal/dbgmsg.h" #ifdef _DEBUG @@ -337,14 +334,8 @@ namespace CorUnix class CSynchWaitController : public CSynchControllerBase, public ISynchWaitController { - // Per-object-type specific data - // - // Process (otiProcess) - IPalObject *m_pProcessObject; // process that owns m_pProcLocalData, this is stored without a reference - CProcProcessLocalData * m_pProcLocalData; - public: - CSynchWaitController() : m_pProcessObject(NULL), m_pProcLocalData(NULL) {} + CSynchWaitController() = default; virtual ~CSynchWaitController() = default; // @@ -360,10 +351,6 @@ namespace CorUnix DWORD dwIndex); virtual void ReleaseController(void); - - CProcProcessLocalData * GetProcessLocalData(void); - - void SetProcessData(IPalObject* pProcessObject, CProcProcessLocalData * pProcLocalData); }; class CSynchStateController : public CSynchControllerBase, @@ -408,60 +395,17 @@ namespace CorUnix SynchMgrStatusReadyForProcessShutDown, SynchMgrStatusError }; - enum SynchWorkerCmd - { - SynchWorkerCmdNop, - SynchWorkerCmdShutdown, - SynchWorkerCmdLast - }; - - typedef struct _MonitoredProcessesListNode - { - struct _MonitoredProcessesListNode * pNext; - LONG lRefCount; - CSynchData * psdSynchData; - DWORD dwPid; - DWORD dwExitCode; - bool fIsActualExitCode; - - // Object that owns pProcLocalData. This is stored, with a reference, to - // ensure that pProcLocalData is not deleted. - IPalObject *pProcessObject; - CProcProcessLocalData * pProcLocalData; - } MonitoredProcessesListNode; // constants static const int CtrlrsCacheMaxSize = 256; static const int SynchDataCacheMaxSize = 256; static const int WTListNodeCacheMaxSize = 256; - static const int MaxWorkerConsecutiveEintrs = 128; - static const int MaxConsecutiveEagains = 128; - static const int WorkerThreadProcMonitoringTimeout = 250; // ms - static const int WorkerThreadShuttingDownTimeout = 1000; // ms - static const int WorkerCmdCompletionTimeout = 250; // ms static const DWORD SecondNativeWaitTimeout = INFINITE; - static const DWORD WorkerThreadTerminationTimeout = 2000; // ms // static members static CPalSynchronizationManager * s_pObjSynchMgr; static Volatile s_lInitStatus; static minipal_mutex s_csSynchProcessLock; - static minipal_mutex s_csMonitoredProcessesLock; - - // members - DWORD m_dwWorkerThreadTid; - IPalObject * m_pipoThread; - CPalThread * m_pthrWorker; - int m_iProcessPipeRead; - int m_iProcessPipeWrite; -#if HAVE_KQUEUE - int m_iKQueue; - struct kevent m_keProcessPipeEvent; -#endif // HAVE_KQUEUE - - MonitoredProcessesListNode * m_pmplnMonitoredProcesses; - LONG m_lMonitoredProcessesCount; - MonitoredProcessesListNode * m_pmplnExitedNodes; // caches CSynchWaitControllerCache m_cacheWaitCtrlrs; @@ -473,7 +417,6 @@ namespace CorUnix // static methods static PAL_ERROR Initialize(); - static DWORD PALAPI WorkerThread(LPVOID pArg); protected: CPalSynchronizationManager(); @@ -487,7 +430,6 @@ namespace CorUnix private: static IPalSynchronizationManager * CreatePalSynchronizationManager(); - static PAL_ERROR StartWorker(CPalThread * pthrCurrent); static PAL_ERROR PrepareForShutdown(void); public: @@ -709,39 +651,6 @@ namespace CorUnix static void ThreadPrepareForShutdown(void); -#ifndef CORECLR - static bool GetProcessPipeName( - LPSTR pDest, - int iDestSize, - DWORD dwPid); -#endif // !CORECLR - - // - // Non-static helper methods - // - private: - LONG DoMonitorProcesses(CPalThread * pthrCurrent); - - void DiscardMonitoredProcesses(CPalThread * pthrCurrent); - - PAL_ERROR ReadCmdFromProcessPipe( - int iPollTimeout, - SynchWorkerCmd * pswcWorkerCmd, - SharedID * pshridMarshaledData, - DWORD * pdwData); - - PAL_ERROR WakeUpLocalWorkerThread( - SynchWorkerCmd swcWorkerCmd); - - int ReadBytesFromProcessPipe( - int iTimeout, - BYTE * pRecvBuf, - LONG lBytes); - - bool CreateProcessPipe(); - - PAL_ERROR ShutdownProcessPipe(); - public: // // The following methods must be called only by a Sync*Controller or @@ -751,25 +660,9 @@ namespace CorUnix CPalThread * pthrCurrent, ThreadWaitInfo * ptwiWaitInfo); - PAL_ERROR RegisterProcessForMonitoring( - CPalThread * pthrCurrent, - CSynchData *psdSynchData, - IPalObject *pProcessObject, - CProcProcessLocalData * pProcLocalData); - - PAL_ERROR UnRegisterProcessForMonitoring( - CPalThread * pthrCurrent, - CSynchData *psdSynchData, - DWORD dwPid); - // // Utility static methods, no lock required // - static bool HasProcessExited( - DWORD dwPid, - DWORD * pdwExitCode, - bool * pfIsActualExitCode); - static bool InterlockedAwaken( DWORD *pWaitState); diff --git a/src/coreclr/pal/src/synchmgr/wait.cpp b/src/coreclr/pal/src/synchmgr/wait.cpp index 7efa82c01a8c4f..dab1f05c1a4f4d 100644 --- a/src/coreclr/pal/src/synchmgr/wait.cpp +++ b/src/coreclr/pal/src/synchmgr/wait.cpp @@ -39,7 +39,6 @@ static PalObjectTypeId sg_rgWaitObjectsIds[] = otiAutoResetEvent, otiManualResetEvent, otiSemaphore, - otiProcess, otiThread }; static CAllowedObjectTypes sg_aotWaitObject(sg_rgWaitObjectsIds, @@ -109,37 +108,6 @@ WaitForSingleObjectEx(IN HANDLE hHandle, } -/*++ -Function: - WaitForMultipleObjects - -See MSDN doc. - ---*/ -DWORD -PALAPI -WaitForMultipleObjects(IN DWORD nCount, - IN CONST HANDLE *lpHandles, - IN BOOL bWaitAll, - IN DWORD dwMilliseconds) -{ - DWORD dwRet; - - PERF_ENTRY(WaitForMultipleObjects); - ENTRY("WaitForMultipleObjects(nCount=%d, lpHandles=%p," - " bWaitAll=%d, dwMilliseconds=%u)\n", - nCount, lpHandles, bWaitAll, dwMilliseconds); - - CPalThread * pThread = InternalGetCurrentThread(); - - dwRet = InternalWaitForMultipleObjectsEx(pThread, nCount, lpHandles, - bWaitAll, dwMilliseconds); - - LOGEXIT("WaitForMultipleObjects returns DWORD %u\n", dwRet); - PERF_EXIT(WaitForMultipleObjects); - return dwRet; -} - /*++ Function: WaitForMultipleObjectsEx @@ -553,4 +521,3 @@ DWORD CorUnix::InternalSleepEx ( return dwRet; #endif // !FEATURE_MULTITHREADING } - diff --git a/src/coreclr/pal/src/thread/process.cpp b/src/coreclr/pal/src/thread/process.cpp index a77427191c17db..25902fcea08b8c 100644 --- a/src/coreclr/pal/src/thread/process.cpp +++ b/src/coreclr/pal/src/thread/process.cpp @@ -243,12 +243,6 @@ GetProcessIdDisambiguationKey( IN DWORD processId, OUT UINT64 *disambiguationKey); -PAL_ERROR -PROCGetProcessStatus( - CPalThread *pThread, - HANDLE hProcess, - PROCESS_STATE *pps, - DWORD *pdwExitCode); static void @@ -322,70 +316,6 @@ GetCurrentProcess( } -/*++ -Function: - GetExitCodeProcess - -See MSDN doc. ---*/ -BOOL -PALAPI -GetExitCodeProcess( - IN HANDLE hProcess, - IN LPDWORD lpExitCode) -{ - CPalThread *pThread; - PAL_ERROR palError = NO_ERROR; - DWORD dwExitCode; - PROCESS_STATE ps; - - PERF_ENTRY(GetExitCodeProcess); - ENTRY("GetExitCodeProcess(hProcess = %p, lpExitCode = %p)\n", - hProcess, lpExitCode); - - pThread = InternalGetCurrentThread(); - - if(NULL == lpExitCode) - { - WARN("Got NULL lpExitCode\n"); - palError = ERROR_INVALID_PARAMETER; - goto done; - } - - palError = PROCGetProcessStatus( - pThread, - hProcess, - &ps, - &dwExitCode - ); - - if (NO_ERROR != palError) - { - ASSERT("Couldn't get process status information!\n"); - goto done; - } - - if( PS_DONE == ps ) - { - *lpExitCode = dwExitCode; - } - else - { - *lpExitCode = STILL_ACTIVE; - } - -done: - - if (NO_ERROR != palError) - { - pThread->SetLastError(palError); - } - - LOGEXIT("GetExitCodeProcess returns BOOL %d\n", NO_ERROR == palError); - PERF_EXIT(GetExitCodeProcess); - - return NO_ERROR == palError; -} /*++ Function: @@ -1404,113 +1334,6 @@ GetCommandLineW( return lpwstr; } -/*++ -Function: - OpenProcess - -See MSDN doc. - -Notes : -dwDesiredAccess is ignored (all supported operations will be allowed) -bInheritHandle is ignored (no inheritance) ---*/ -HANDLE -PALAPI -OpenProcess( - DWORD dwDesiredAccess, - BOOL bInheritHandle, - DWORD dwProcessId) -{ - PAL_ERROR palError; - CPalThread *pThread; - IPalObject *pobjProcess = NULL; - IPalObject *pobjProcessRegistered = NULL; - IDataLock *pDataLock; - CProcProcessLocalData *pLocalData; - CObjectAttributes oa; - HANDLE hProcess = NULL; - - PERF_ENTRY(OpenProcess); - ENTRY("OpenProcess(dwDesiredAccess=0x%08x, bInheritHandle=%d, " - "dwProcessId = 0x%08x)\n", - dwDesiredAccess, bInheritHandle, dwProcessId ); - - pThread = InternalGetCurrentThread(); - - if (0 == dwProcessId) - { - palError = ERROR_INVALID_PARAMETER; - goto OpenProcessExit; - } - - palError = g_pObjectManager->AllocateObject( - pThread, - &otProcess, - &oa, - &pobjProcess - ); - - if (NO_ERROR != palError) - { - goto OpenProcessExit; - } - - palError = pobjProcess->GetProcessLocalData( - pThread, - WriteLock, - &pDataLock, - reinterpret_cast(&pLocalData) - ); - - if (NO_ERROR != palError) - { - goto OpenProcessExit; - } - - pLocalData->dwProcessId = dwProcessId; - pDataLock->ReleaseLock(pThread, TRUE); - - palError = g_pObjectManager->RegisterObject( - pThread, - pobjProcess, - &aotProcess, - &hProcess, - &pobjProcessRegistered - ); - - // - // pobjProcess was invalidated by the above call, so NULL - // it out here - // - - pobjProcess = NULL; - - // - // TODO: check to see if the process actually exists? - // - -OpenProcessExit: - - if (NULL != pobjProcess) - { - pobjProcess->ReleaseReference(pThread); - } - - if (NULL != pobjProcessRegistered) - { - pobjProcessRegistered->ReleaseReference(pThread); - } - - if (NO_ERROR != palError) - { - pThread->SetLastError(palError); - } - - LOGEXIT("OpenProcess returns HANDLE %p\n", hProcess); - PERF_EXIT(OpenProcess); - return hProcess; -} - /*++ Function PROCNotifyProcessShutdown @@ -2439,7 +2262,6 @@ CorUnix::CreateInitialProcessAndThreadObjects( } pLocalData->dwProcessId = gPID; - pLocalData->ps = PS_RUNNING; pDataLock->ReleaseLock(pThread, TRUE); palError = g_pObjectManager->RegisterObject( @@ -2575,194 +2397,6 @@ CorUnix::TerminateCurrentProcessNoExit(BOOL bTerminateUnconditionally) } } -/*++ -Function: - PROCGetProcessStatus - -Abstract: - Retrieve process state information (state & exit code). - -Parameters: - DWORD process_id : PID of process to retrieve state for - PROCESS_STATE *state : state of process (starting, running, done) - DWORD *exit_code : exit code of process (from ExitProcess, etc.) - -Return value : - TRUE on success ---*/ -PAL_ERROR -PROCGetProcessStatus( - CPalThread *pThread, - HANDLE hProcess, - PROCESS_STATE *pps, - DWORD *pdwExitCode - ) -{ - PAL_ERROR palError = NO_ERROR; - IPalObject *pobjProcess = NULL; - IDataLock *pDataLock; - CProcProcessLocalData *pLocalData; - pid_t wait_retval; - int status; - - // - // First, check if we already know the status of this process. This will be - // the case if this function has already been called for the same process. - // - - palError = g_pObjectManager->ReferenceObjectByHandle( - pThread, - hProcess, - &aotProcess, - &pobjProcess - ); - - if (NO_ERROR != palError) - { - goto PROCGetProcessStatusExit; - } - - palError = pobjProcess->GetProcessLocalData( - pThread, - WriteLock, - &pDataLock, - reinterpret_cast(&pLocalData) - ); - - if (PS_DONE == pLocalData->ps) - { - TRACE("We already called waitpid() on process ID %#x; process has " - "terminated, exit code is %d\n", - pLocalData->dwProcessId, pLocalData->dwExitCode); - - *pps = pLocalData->ps; - *pdwExitCode = pLocalData->dwExitCode; - - pDataLock->ReleaseLock(pThread, FALSE); - - goto PROCGetProcessStatusExit; - } - - /* By using waitpid(), we can even retrieve the exit code of a non-PAL - process. However, note that waitpid() can only provide the low 8 bits - of the exit code. This is all that is required for the PAL spec. */ - TRACE("Looking for status of process; trying wait()"); - - while(1) - { - /* try to get state of process, using non-blocking call */ - wait_retval = waitpid(pLocalData->dwProcessId, &status, WNOHANG); - - if ( wait_retval == (pid_t) pLocalData->dwProcessId ) - { - /* success; get the exit code */ - if ( WIFEXITED( status ) ) - { - *pdwExitCode = WEXITSTATUS(status); - TRACE("Exit code was %d\n", *pdwExitCode); - } - else if ( WIFSIGNALED( status ) ) - { - *pdwExitCode = 128 + WTERMSIG(status); - TRACE("Exit code was signal %d = exit code %d\n", WTERMSIG(status), *pdwExitCode); - } - else - { - WARN("process terminated without exiting; can't get exit " - "code. faking it.\n"); - *pdwExitCode = EXIT_FAILURE; - } - *pps = PS_DONE; - } - else if (0 == wait_retval) - { - // The process is still running. - TRACE("Process %#x is still active.\n", pLocalData->dwProcessId); - *pps = PS_RUNNING; - *pdwExitCode = 0; - } - else if (-1 == wait_retval) - { - // This might happen if waitpid() had already been called, but - // this shouldn't happen - we call waitpid once, store the - // result, and use that afterwards. - // One legitimate cause of failure is EINTR; if this happens we - // have to try again. A second legitimate cause is ECHILD, which - // happens if we're trying to retrieve the status of a currently- - // running process that isn't a child of this process. - if (EINTR == errno) - { - TRACE("waitpid() failed with EINTR; re-waiting"); - continue; - } - else if (ECHILD == errno) - { - TRACE("waitpid() failed with ECHILD; calling kill instead"); - if (kill(pLocalData->dwProcessId, 0) != 0) - { - if(ESRCH == errno) - { - WARN("kill() failed with ESRCH, i.e. target " - "process exited and it wasn't a child, " - "so can't get the exit code, assuming " - "it was 0.\n"); - *pdwExitCode = 0; - } - else - { - ERROR("kill(pid, 0) failed; errno is %d (%s)\n", - errno, strerror(errno)); - *pdwExitCode = EXIT_FAILURE; - } - *pps = PS_DONE; - } - else - { - *pps = PS_RUNNING; - *pdwExitCode = 0; - } - } - else - { - // Ignoring unexpected waitpid errno and assuming that - // the process is still running - ERROR("waitpid(pid=%u) failed with unexpected errno=%d (%s)\n", - pLocalData->dwProcessId, errno, strerror(errno)); - *pps = PS_RUNNING; - *pdwExitCode = 0; - } - } - else - { - ASSERT("waitpid returned unexpected value %d\n",wait_retval); - *pdwExitCode = EXIT_FAILURE; - *pps = PS_DONE; - } - // Break out of the loop in all cases except EINTR. - break; - } - - // Save the exit code for future reference (waitpid will only work once). - if(PS_DONE == *pps) - { - pLocalData->ps = PS_DONE; - pLocalData->dwExitCode = *pdwExitCode; - } - - TRACE( "State of process 0x%08x : %d (exit code %d)\n", - pLocalData->dwProcessId, *pps, *pdwExitCode ); - - pDataLock->ReleaseLock(pThread, TRUE); - -PROCGetProcessStatusExit: - - if (NULL != pobjProcess) - { - pobjProcess->ReleaseReference(pThread); - } - - return palError; -} #ifdef __APPLE__ bool GetApplicationContainerFolder(PathCharString& buffer, const char *applicationGroupId, int applicationGroupIdLength) diff --git a/src/coreclr/pal/src/thread/thread.cpp b/src/coreclr/pal/src/thread/thread.cpp index 6d956b86d50e4f..611758bd356ed5 100644 --- a/src/coreclr/pal/src/thread/thread.cpp +++ b/src/coreclr/pal/src/thread/thread.cpp @@ -347,7 +347,6 @@ CreateThread( lpStartAddress, lpParameter, dwCreationFlags, - UserCreatedThread, &osThreadId, &hNewThread ); @@ -405,7 +404,6 @@ PAL_CreateThread64( lpStartAddress, lpParameter, dwCreationFlags, - UserCreatedThread, pThreadId, &hNewThread ); @@ -429,7 +427,6 @@ CorUnix::InternalCreateThread( LPTHREAD_START_ROUTINE lpStartAddress, LPVOID lpParameter, DWORD dwCreationFlags, - PalThreadType eThreadType, SIZE_T* pThreadId, HANDLE *phThread ) @@ -506,7 +503,6 @@ CorUnix::InternalCreateThread( pNewThread->m_lpStartAddress = lpStartAddress; pNewThread->m_lpStartParameter = lpParameter; pNewThread->m_bCreateSuspended = (dwCreationFlags & CREATE_SUSPENDED) == CREATE_SUSPENDED; - pNewThread->m_eThreadType = eThreadType; if (0 != pthread_attr_init(&pthreadAttr)) { @@ -1497,13 +1493,10 @@ CPalThread::ThreadEntry( pThread->synchronizationInfo.SetThreadState(TS_RUNNING); - if (UserCreatedThread == pThread->GetThreadType()) - { - /* Inform all loaded modules that a thread has been created */ - /* note : no need to take a critical section to serialize here; the loader - will take the module critical section */ - LOADCallDllMain(DLL_THREAD_ATTACH, NULL); - } + /* Inform all loaded modules that a thread has been created */ + /* note : no need to take a critical section to serialize here; the loader + will take the module critical section */ + LOADCallDllMain(DLL_THREAD_ATTACH, NULL); /* call the startup routine */ pfnStartRoutine = pThread->GetStartAddress(); diff --git a/src/coreclr/pal/src/thread/threadsusp.cpp b/src/coreclr/pal/src/thread/threadsusp.cpp index 92f23f9537c47a..d9ac0a33923f08 100644 --- a/src/coreclr/pal/src/thread/threadsusp.cpp +++ b/src/coreclr/pal/src/thread/threadsusp.cpp @@ -239,13 +239,6 @@ CThreadSuspensionInfo::InternalResumeThreadFromData( int nWrittenBytes = -1; - if (SignalHandlerThread == pthrTarget->GetThreadType()) - { - ASSERT("Attempting to resume the signal handling thread, which can never be suspended.\n"); - palError = ERROR_INVALID_HANDLE; - goto InternalResumeThreadFromDataExit; - } - // Acquire suspension mutex AcquireSuspensionLocks(pthrResumer, pthrTarget); diff --git a/src/coreclr/pal/tests/palsuite/CMakeLists.txt b/src/coreclr/pal/tests/palsuite/CMakeLists.txt index c32f205182c5e0..cb6f541087d2b7 100644 --- a/src/coreclr/pal/tests/palsuite/CMakeLists.txt +++ b/src/coreclr/pal/tests/palsuite/CMakeLists.txt @@ -36,14 +36,6 @@ add_executable_clr(paltests EXCLUDE_FROM_ALL paltests.cpp common/palsuite.cpp - #composite/object_management/event/nonshared/event.cpp - #composite/object_management/event/nonshared/main.cpp - #composite/object_management/event/shared/event.cpp - #composite/object_management/event/shared/main.cpp - #composite/object_management/semaphore/nonshared/main.cpp - #composite/object_management/semaphore/nonshared/semaphore.cpp - #composite/object_management/semaphore/shared/main.cpp - #composite/object_management/semaphore/shared/semaphore.cpp c_runtime/atof/test1/test1.cpp c_runtime/atoi/test1/test1.cpp c_runtime/isalnum/test1/test1.cpp @@ -141,12 +133,6 @@ add_executable_clr(paltests c_runtime/_wtoi/test1/test1.cpp #debug_api/DebugBreak/test1/test1.cpp debug_api/OutputDebugStringW/test1/test1.cpp - #debug_api/WriteProcessMemory/test1/helper.cpp - #debug_api/WriteProcessMemory/test1/test1.cpp - #debug_api/WriteProcessMemory/test3/helper.cpp - #debug_api/WriteProcessMemory/test3/test3.cpp - #debug_api/WriteProcessMemory/test4/helper.cpp - #debug_api/WriteProcessMemory/test4/test4.cpp #exception_handling/pal_except/test1/test1.cpp #exception_handling/pal_except/test2/test2.cpp #exception_handling/pal_except/test3/test3.cpp @@ -402,7 +388,6 @@ add_executable_clr(paltests threading/SwitchToThread/test1/test1.cpp threading/TerminateProcess/test1/TerminateProcess.cpp threading/ThreadPriority/test1/ThreadPriority.cpp - threading/WaitForMultipleObjects/test1/test1.cpp threading/WaitForMultipleObjectsEx/test1/test1.cpp threading/WaitForSingleObject/test1/test1.cpp threading/WaitForSingleObject/WFSOSemaphoreTest/WFSOSemaphoreTest.cpp diff --git a/src/coreclr/pal/tests/palsuite/compilableTests.txt b/src/coreclr/pal/tests/palsuite/compilableTests.txt index 5553e413c6cccb..61943a5515492f 100644 --- a/src/coreclr/pal/tests/palsuite/compilableTests.txt +++ b/src/coreclr/pal/tests/palsuite/compilableTests.txt @@ -311,7 +311,6 @@ threading/SleepEx/test1/paltest_sleepex_test1 threading/SwitchToThread/test1/paltest_switchtothread_test1 threading/TerminateProcess/test1/paltest_terminateprocess_test1 threading/ThreadPriority/test1/paltest_threadpriority_test1 -threading/WaitForMultipleObjects/test1/paltest_waitformultipleobjects_test1 threading/WaitForMultipleObjectsEx/test1/paltest_waitformultipleobjectsex_test1 threading/WaitForSingleObject/test1/paltest_waitforsingleobject_test1 threading/WaitForSingleObject/WFSOSemaphoreTest/paltest_waitforsingleobject_wfsosemaphoretest diff --git a/src/coreclr/pal/tests/palsuite/compileDisabledTests.txt b/src/coreclr/pal/tests/palsuite/compileDisabledTests.txt index 4ca3275daaeb48..959509c0204672 100644 --- a/src/coreclr/pal/tests/palsuite/compileDisabledTests.txt +++ b/src/coreclr/pal/tests/palsuite/compileDisabledTests.txt @@ -1,9 +1,5 @@ -composite/object_management/event/nonshared/paltest_event_nonshared -composite/object_management/event/shared/paltest_event_shared composite/object_management/mutex/nonshared/paltest_mutex_nonshared composite/object_management/mutex/shared/paltest_mutex_shared -composite/object_management/semaphore/nonshared/paltest_semaphore_nonshared -composite/object_management/semaphore/shared/paltest_semaphore_shared composite/synchronization/criticalsection/paltest_synchronization_criticalsection composite/synchronization/nativecriticalsection/paltest_synchronization_nativecriticalsection composite/synchronization/nativecs_interlocked/paltest_synchronization_nativecs_interlocked @@ -11,9 +7,6 @@ composite/wfmo/paltest_composite_wfmo c_runtime/iswprint/test1/paltest_iswprint_test1 c_runtime/vprintf/test1/paltest_vprintf_test1 debug_api/DebugBreak/test1/paltest_debugbreak_test1 -debug_api/WriteProcessMemory/test1/paltest_writeprocessmemory_test1 -debug_api/WriteProcessMemory/test3/paltest_writeprocessmemory_test3 -debug_api/WriteProcessMemory/test4/paltest_writeprocessmemory_test4 exception_handling/pal_except/test1/paltest_pal_except_test1 exception_handling/pal_except/test2/paltest_pal_except_test2 exception_handling/pal_except/test3/paltest_pal_except_test3 diff --git a/src/coreclr/pal/tests/palsuite/composite/object_management/event/nonshared/event.cpp b/src/coreclr/pal/tests/palsuite/composite/object_management/event/nonshared/event.cpp deleted file mode 100644 index fab380597d7386..00000000000000 --- a/src/coreclr/pal/tests/palsuite/composite/object_management/event/nonshared/event.cpp +++ /dev/null @@ -1,346 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -/*============================================================ -** -** Source Code: main.c and event.c -** main.c creates process and waits for all processes to get over -** event.c creates a event and then calls threads which will contend for the event -** -** This test is for Object Management Test case for event where Object type is shareable. -** Algorithm -** o Main Process Creates OBJECT_TYPE Object -** o Create PROCESS_COUNT processes aware of the Shared Object -** -** Author: ShamitP -** -** -**============================================================ -*/ - -#include -#include "resultbuffer.h" -#include "resulttime.h" - -#define TIMEOUT 5000 -/* Test Input Variables */ -unsigned int USE_PROCESS_COUNT = 0; -unsigned int THREAD_COUNT = 0; -unsigned int REPEAT_COUNT = 0; -unsigned int RELATION_ID= 0; - -/* Event variables */ -//unsigned long lInitialCount = 1; /* Signaled */ -//unsigned long lMaximumCount = 1; /* Maximum value of 1 */ - -/* Capture statistics at per thread basis */ -struct statistics{ - unsigned int processId; - unsigned int operationsFailed; - unsigned int operationsPassed; - unsigned int operationsTotal; - DWORD operationTime; - unsigned int relationId; -}; - -struct ProcessStats{ - unsigned int processId; - DWORD operationTime; - unsigned int relationId; -}; - -HANDLE StartTestsEvHandle = NULL; -HANDLE hEventHandle = NULL; - -/* Results Buffer */ -ResultBuffer *resultBuffer = NULL; - -int testStatus; - -const char sTmpEventName[MAX_PATH_FNAME] = "StartTestEvent"; - -void PALAPI Run_Thread_event_nonshared(LPVOID lpParam); - -int GetParameters( int argc, char **argv) -{ - if( (argc != 5) || ((argc == 1) && !strcmp(argv[1],"/?")) - || !strcmp(argv[1],"/h") || !strcmp(argv[1],"/H")) - { - printf("PAL -Composite Object Management Event Test\n"); - printf("Usage:\n"); - printf("Event\n\t[USE_PROCESS_COUNT [greater than 1] \n"); - printf("\t[THREAD_COUNT [greater than 1] \n"); - printf("\t[REPEAT_COUNT [greater than 1]\n"); - printf("\t[RELATION_ID [greater than or Equal to 1]\n"); - - return -1; - } - - USE_PROCESS_COUNT = atoi(argv[1]); - if( USE_PROCESS_COUNT < 0) - { - printf("\nInvalid USE_PROCESS_COUNT number, Pass greater than 1\n"); - return -1; - } - - THREAD_COUNT = atoi(argv[2]); - if( (THREAD_COUNT < 1) || (THREAD_COUNT > MAXIMUM_WAIT_OBJECTS) ) - { - printf("\nInvalid THREAD_COUNT number, Pass greater than 1 and less than %d\n", MAXIMUM_WAIT_OBJECTS); - return -1; - } - - REPEAT_COUNT = atoi(argv[3]); - if( REPEAT_COUNT < 1) - { - printf("\nInvalid REPEAT_COUNT number, Pass greater than 1\n"); - return -1; - } - - RELATION_ID = atoi(argv[4]); - if( RELATION_ID < 1) - { - printf("\nMain Process:Invalid RELATION_ID number, Pass greater than 1\n"); - return -1; - } - - - return 0; -} - -PALTEST(composite_object_management_event_nonshared_paltest_event_nonshared, "composite/object_management/event/nonshared/paltest_event_nonshared") -{ - unsigned int i = 0; - HANDLE hThread[MAXIMUM_WAIT_OBJECTS]; - DWORD threadId[MAXIMUM_WAIT_OBJECTS]; - int returnCode = 0; - - DWORD dwParam = 0; - - /* Variables to capture the file name and the file pointer at thread level*/ - char fileName[MAX_LONGPATH]; - FILE *pFile = NULL; - struct statistics* buffer = NULL; - int statisticsSize = 0; - - /* Variables to capture the file name and the file pointer at process level*/ - char processFileName[MAX_LONGPATH]; - FILE *pProcessFile = NULL; - struct ProcessStats processStats; - DWORD dwStartTime; - - testStatus = PASS; - - if(0 != (PAL_Initialize(argc, argv))) - { - return ( FAIL ); - } - - if(GetParameters(argc, argv)) - { - Fail("Error in obtaining the parameters\n"); - } - - /* Register the start time */ - dwStartTime = (DWORD)minipal_lowres_ticks(); - processStats.relationId = RELATION_ID; - processStats.processId = USE_PROCESS_COUNT; - - _snprintf(processFileName, MAX_LONGPATH, "%d_process_event_%d_.txt", USE_PROCESS_COUNT, RELATION_ID); - pProcessFile = fopen(processFileName, "w+"); - if(pProcessFile == NULL) - { - Fail("Error in opening process File file for write for process [%d]\n", USE_PROCESS_COUNT); - } - - statisticsSize = sizeof(struct statistics); - - _snprintf(fileName, MAX_LONGPATH, "%d_thread_event_%d_.txt", USE_PROCESS_COUNT, RELATION_ID); - pFile = fopen(fileName, "w+"); - - if(pFile == NULL) - { - Fail("Error in opening thread File for write for process [%d]\n", USE_PROCESS_COUNT); - } - // For each thread we will log operations failed (int), passed (int), total (int) - // and number of ticks (DWORD) for the operations - resultBuffer = new ResultBuffer( THREAD_COUNT, statisticsSize); - - StartTestsEvHandle = CreateEvent( - NULL, /* lpEventAttributes*/ - TRUE, /* bManualReset */ - FALSE, /* bInitialState */ - NULL /* name of Event */ - ); - - if( StartTestsEvHandle == NULL ) - { - Fail("Error:%d: Unexpected failure " - "to create %s Event for process count %d\n", GetLastError(), sTmpEventName, USE_PROCESS_COUNT ); - - } - - /* Create StartTest Event */ - - hEventHandle = CreateEvent( - NULL, /* lpEventAttributes, inheritable to child processes*/ - TRUE, /* bAutomaticReset */ - TRUE, /* bInitialState */ - NULL - ); - - if( hEventHandle == NULL) - { - Fail("Unable to create Event handle for process id [%d], returned error [%d]\n", i, GetLastError()); - } - /* We already assume that the Event was created previously*/ - - for( i = 0; i < THREAD_COUNT; i++ ) - { - dwParam = (int) i; - //Create thread - hThread[i] = CreateThread( - NULL, /* no security attributes */ - 0, /* use default stack size */ - (LPTHREAD_START_ROUTINE)Run_Thread_event_nonshared,/* thread function */ - (LPVOID)dwParam, /* argument to thread function */ - 0, /* use default creation flags */ - &threadId[i] /* returns the thread identifier*/ - ); - - - if(hThread[i] == NULL) - { - Fail("Create Thread failed for %d process, and GetLastError value is %d\n", USE_PROCESS_COUNT, GetLastError()); - } - - } - - if (!SetEvent(StartTestsEvHandle)) - { - Fail("Set Event for Start Tests failed for %d process, and GetLastError value is %d\n", USE_PROCESS_COUNT, GetLastError()); - } - /* Test running */ - returnCode = WaitForMultipleObjects( THREAD_COUNT, hThread, TRUE, INFINITE); - - if( WAIT_OBJECT_0 != returnCode ) - { - Trace("Wait for Object(s) for %d process returned %d, and GetLastError value is %d\n", USE_PROCESS_COUNT, returnCode, GetLastError()); - testStatus = FAIL; - } - - processStats.operationTime = GetTimeDiff(dwStartTime); - - /* Write to a file*/ - if(pFile!= NULL) - { - for( i = 0; i < THREAD_COUNT; i++ ) - { - buffer = (struct statistics *)resultBuffer->getResultBuffer(i); - returnCode = fprintf(pFile, "%d,%d,%d,%d,%lu,%d\n", buffer->processId, buffer->operationsFailed, buffer->operationsPassed, buffer->operationsTotal, buffer->operationTime, buffer->relationId ); - } - } - if(fclose(pFile)) - { - Trace("Error: fclose failed for pFile\n"); - testStatus = FAIL; - } - - fprintf(pProcessFile, "%d,%d,%d\n", USE_PROCESS_COUNT, processStats.operationTime, processStats.relationId ); - if(fclose(pProcessFile)) - { - Trace("Error: fclose failed for pProcessFile at Process %d\n", USE_PROCESS_COUNT); - testStatus = FAIL; - } - - /* Logging for the test case over, clean up the handles */ - - /* Clean Up */ - for( i = 0; i < THREAD_COUNT; i++ ) - { - if(!CloseHandle(hThread[i]) ) - { - Trace("Error:%d: CloseHandle failed for Process [%d] hThread[%d]\n", GetLastError(), USE_PROCESS_COUNT, i); - testStatus = FAIL; - } - } - - if(!CloseHandle(StartTestsEvHandle)) - { - Trace("Error:%d: CloseHandle failed for Process [%d] StartTestsEvHandle\n", GetLastError(), USE_PROCESS_COUNT); - testStatus = FAIL; - } - - if(!CloseHandle(hEventHandle)) - { - Trace("Error:%d: CloseHandle failed for Process [%d] hEventHandle\n", GetLastError(), USE_PROCESS_COUNT); - testStatus = FAIL; - } - - PAL_TerminateEx(testStatus); - return testStatus; - -} - -void PALAPI Run_Thread_event_nonshared (LPVOID lpParam) -{ - unsigned int i = 0; - DWORD dwWaitResult; - - struct statistics stats; - DWORD dwStartTime; - - stats.relationId = RELATION_ID; - stats.processId = USE_PROCESS_COUNT; - stats.operationsFailed = 0; - stats.operationsPassed = 0; - stats.operationsTotal = 0; - stats.operationTime = 0; - - int Id=(int)lpParam; - - dwWaitResult = WaitForSingleObject( - StartTestsEvHandle, // handle to start test handle - TIMEOUT); - - if(dwWaitResult != WAIT_OBJECT_0) - { - Fail("Error while waiting for StartTest Event@ thread %d, RC is %d, Error is %d\n", Id, dwWaitResult, GetLastError()); - } - - dwStartTime = (DWORD)minipal_lowres_ticks(); - - for( i = 0; i < REPEAT_COUNT; i++ ) - { - dwWaitResult = WaitForSingleObject( - hEventHandle, // handle to Event - TIMEOUT); - - if(dwWaitResult != WAIT_OBJECT_0) - { - stats.operationsFailed += 1; - stats.operationsTotal += 1; - testStatus = FAIL; - continue; - } - - if (! SetEvent(hEventHandle)) - { - // Deal with error. - stats.operationsFailed += 1; - stats.operationsTotal += 1; - // Do we need to have while true loop to attempt to set event? - testStatus = FAIL; - continue; - } - - stats.operationsTotal += 1; - stats.operationsPassed += 1; - } - - stats.operationTime = GetTimeDiff(dwStartTime); - if(resultBuffer->LogResult(Id, (char *)&stats)) - { - Fail("Error:%d: while writing to shared memory, Thread Id is[%d] and Process id is [%d]\n", GetLastError(), Id, USE_PROCESS_COUNT); - } -} diff --git a/src/coreclr/pal/tests/palsuite/composite/object_management/event/nonshared/main.cpp b/src/coreclr/pal/tests/palsuite/composite/object_management/event/nonshared/main.cpp deleted file mode 100644 index 65a82a38ca0885..00000000000000 --- a/src/coreclr/pal/tests/palsuite/composite/object_management/event/nonshared/main.cpp +++ /dev/null @@ -1,227 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -/*============================================================ -** -** Source Code: main.c and event.c -** main.c creates process and waits for all processes to get over -** event.c creates a event and then calls threads which will contend for the event -** -** This test is for Object Management Test case for event where Object type is not shareable. -** Algorithm -** o Create PROCESS_COUNT processes. -** o Main Thread of each process creates OBJECT_TYPE Object -** -** Author: ShamitP -**============================================================ -*/ - -#include -#include "resulttime.h" - -/* Test Input Variables */ -unsigned int PROCESS_COUNT = 10; -unsigned int THREAD_COUNT = 20; -unsigned int REPEAT_COUNT = 20000; -unsigned int RELATION_ID = 1001; - - -struct TestStats{ - DWORD operationTime; - unsigned int relationId; - unsigned int processCount; - unsigned int threadCount; - unsigned int repeatCount; - char* buildNumber; - -}; - - -int GetParameters( int argc, char **argv) -{ - if( (argc != 5) || ((argc == 1) && !strcmp(argv[1],"/?")) - || !strcmp(argv[1],"/h") || !strcmp(argv[1],"/H")) - { - printf("PAL -Composite Object Management event Test\n"); - printf("Usage:\n"); - printf("main\n\t[PROCESS_COUNT [greater than 1] \n"); - printf("\t[THREAD_COUNT [greater than 1] \n"); - printf("\t[REPEAT_COUNT [greater than 1]\n"); - printf("\t[RELATION_ID [greater than or Equal to 1]\n"); - return -1; - } - - PROCESS_COUNT = atoi(argv[1]); - if( (PROCESS_COUNT < 1) || (PROCESS_COUNT > MAXIMUM_WAIT_OBJECTS) ) - { - printf("\nMain Process:Invalid PROCESS_COUNT number, Pass greater than 1 and less than PROCESS_COUNT %d\n", MAXIMUM_WAIT_OBJECTS); - return -1; - } - - THREAD_COUNT = atoi(argv[2]); - if( (THREAD_COUNT < 1) || (THREAD_COUNT > MAXIMUM_WAIT_OBJECTS) ) - { - printf("\nInvalid THREAD_COUNT number, Pass greater than 1 and less than %d\n", MAXIMUM_WAIT_OBJECTS); - return -1; - } - - REPEAT_COUNT = atoi(argv[3]); - if( REPEAT_COUNT < 1) - { - printf("\nMain Process:Invalid REPEAT_COUNT number, Pass greater than 1\n"); - return -1; - } - - RELATION_ID = atoi(argv[4]); - if( RELATION_ID < 1) - { - printf("\nMain Process:Invalid RELATION_ID number, Pass greater than 1\n"); - return -1; - } - - - return 0; -} - -PALTEST(composite_object_management_event_nonshared_paltest_event_nonshared, "composite/object_management/event/nonshared/paltest_event_nonshared") -{ - unsigned int i = 0; - HANDLE hProcess[MAXIMUM_WAIT_OBJECTS]; - - STARTUPINFO si[MAXIMUM_WAIT_OBJECTS]; - PROCESS_INFORMATION pi[MAXIMUM_WAIT_OBJECTS]; - - char lpCommandLine[MAX_LONGPATH] = ""; - const char *ObjName = "Event"; - - int returnCode = 0; - DWORD processReturnCode = 0; - int testReturnCode = PASS; - - char fileName[MAX_LONGPATH]; - FILE *pFile = NULL; - DWORD dwStartTime = 0; - struct TestStats testStats; - - if(0 != (PAL_Initialize(argc, argv))) - { - return ( FAIL ); - } - - if(GetParameters(argc, argv)) - { - Fail("Error in obtaining the parameters\n"); - } - - /* Register the start time */ - dwStartTime = (DWORD)minipal_lowres_ticks(); - testStats.relationId = RELATION_ID; - testStats.processCount = PROCESS_COUNT; - testStats.threadCount = THREAD_COUNT; - testStats.repeatCount = REPEAT_COUNT; - testStats.buildNumber = getBuildNumber(); - - - _snprintf(fileName, MAX_LONGPATH, "main_event_%d_.txt", RELATION_ID); - pFile = fopen(fileName, "w+"); - if(pFile == NULL) - { - Fail("Error in opening main file for write\n"); - } - - for( i = 0; i < PROCESS_COUNT; i++ ) - { - - ZeroMemory( lpCommandLine, MAX_PATH ); - if ( _snprintf( lpCommandLine, MAX_LONGPATH-1, "event %d %d %d %d", i, THREAD_COUNT, REPEAT_COUNT, RELATION_ID) < 0 ) - { - Fail ("Error: Insufficient Event name string length for %s for iteration [%d]\n", ObjName, i); - } - - /* Zero the data structure space */ - ZeroMemory ( &pi[i], sizeof(pi[i]) ); - ZeroMemory ( &si[i], sizeof(si[i]) ); - - /* Set the process flags and standard io handles */ - si[i].cb = sizeof(si[i]); - - //Create Process - if(!CreateProcess( NULL, /* lpApplicationName*/ - lpCommandLine, /* lpCommandLine */ - NULL, /* lpProcessAttributes */ - NULL, /* lpThreadAttributes */ - TRUE, /* bInheritHandles */ - 0, /* dwCreationFlags, */ - NULL, /* lpEnvironment */ - NULL, /* pCurrentDirectory */ - &si[i], /* lpStartupInfo */ - &pi[i] /* lpProcessInformation */ - )) - { - Fail("Process Not created for [%d], the error code is [%d]\n", i, GetLastError()); - } - else - { - hProcess[i] = pi[i].hProcess; - //Trace("Process created for [%d]\n", i); - - } - - } - - returnCode = WaitForMultipleObjects( PROCESS_COUNT, hProcess, TRUE, INFINITE); - if( WAIT_OBJECT_0 != returnCode ) - { - Trace("Wait for Object(s) @ Main thread for %d processes returned %d, and GetLastError value is %d\n", PROCESS_COUNT, returnCode, GetLastError()); - testReturnCode = FAIL; - } - - for( i = 0; i < PROCESS_COUNT; i++ ) - { - /* check the exit code from the process */ - if( ! GetExitCodeProcess( pi[i].hProcess, &processReturnCode ) ) - { - Trace( "GetExitCodeProcess call failed for iteration %d with error code %u\n", - i, GetLastError() ); - - testReturnCode = FAIL; - } - - if(processReturnCode == FAIL) - { - Trace( "Process [%d] failed and returned FAIL\n", i); - testReturnCode = FAIL; - } - - if(!CloseHandle(pi[i].hThread)) - { - Trace("Error:%d: CloseHandle failed for Process [%d] hThread\n", GetLastError(), i); - testReturnCode = FAIL; - } - - if(!CloseHandle(pi[i].hProcess) ) - { - Trace("Error:%d: CloseHandle failed for Process [%d] hProcess\n", GetLastError(), i); - testReturnCode = FAIL; - } - } - - testStats.operationTime = GetTimeDiff(dwStartTime); - fprintf(pFile, "%d,%d,%d,%d,%d,%s\n", testStats.operationTime, testStats.relationId, testStats.processCount, testStats.threadCount, testStats.repeatCount, testStats.buildNumber); - if(fclose(pFile)) - { - Trace("Error: fclose failed for pFile\n"); - testReturnCode = FAIL; - } - - if( testReturnCode == PASS) - { - Trace("Test Passed\n"); - } - else - { - Trace("Test Failed\n"); - } - PAL_Terminate(); - return testReturnCode; -} diff --git a/src/coreclr/pal/tests/palsuite/composite/object_management/event/shared/event.cpp b/src/coreclr/pal/tests/palsuite/composite/object_management/event/shared/event.cpp deleted file mode 100644 index 26f528a3e80ff9..00000000000000 --- a/src/coreclr/pal/tests/palsuite/composite/object_management/event/shared/event.cpp +++ /dev/null @@ -1,359 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -/*============================================================ -** -** Source Code: main.c and event.c -** main.c creates process and waits for all processes to get over -** event.c creates a event and then calls threads which will contend for the event -** -** This test is for Object Management Test case for event where Object type is shareable. -** Algorithm -** o Main Process Creates OBJECT_TYPE Object -** o Create PROCESS_COUNT processes aware of the Shared Object -** -** Author: ShamitP -** Author: ShamitP -** -** -**============================================================ -*/ - -#include -#include "resultbuffer.h" -#include "resulttime.h" - -#define TIMEOUT 5000 -/* Test Input Variables */ -unsigned int USE_PROCESS_COUNT = 0; -unsigned int THREAD_COUNT = 0; -unsigned int REPEAT_COUNT = 0; -unsigned int RELATION_ID = 0; - -/* Capture statistics at per thread basis */ -struct statistics{ - unsigned int processId; - unsigned int operationsFailed; - unsigned int operationsPassed; - unsigned int operationsTotal; - DWORD operationTime; - unsigned int relationId; -}; - -struct ProcessStats{ - unsigned int processId; - DWORD operationTime; - unsigned int relationId; -}; - -HANDLE StartTestsEvHandle = NULL; -HANDLE hEventHandle = NULL; - -/* Results Buffer */ -ResultBuffer *resultBuffer= NULL; - -int testStatus; - -const char sTmpEventName[MAX_PATH] = "StartTestEvent"; -char objectSuffix[MAX_PATH]; - -void PALAPI Run_Thread_event_shared(LPVOID lpParam); - -int GetParameters( int argc, char **argv) -{ - if( (!((argc == 5) || (argc == 6) ) )|| ((argc == 1) && !strcmp(argv[1],"/?")) - || !strcmp(argv[1],"/h") || !strcmp(argv[1],"/H")) - { - printf("PAL -Composite Object Management event Test\n"); - printf("Usage:\n"); - printf("main\n\t[USE_PROCESS_COUNT (greater than 1)] \n"); - printf("\t[THREAD_COUNT (greater than 1)] \n"); - printf("\t[REPEAT_COUNT (greater than 1)]\n"); - printf("\t[RELATION_ID [greater than or equal to 1]\n"); - printf("\t[Object Name Suffix]\n"); - - return -1; - } - - USE_PROCESS_COUNT = atoi(argv[1]); - if( USE_PROCESS_COUNT < 0) - { - printf("\nInvalid USE_PROCESS_COUNT number, Pass greater than 1\n"); - return -1; - } - - THREAD_COUNT = atoi(argv[2]); - if( (THREAD_COUNT < 1) || (THREAD_COUNT > MAXIMUM_WAIT_OBJECTS) ) - { - printf("\nInvalid THREAD_COUNT number, Pass greater than 1 and less than %d\n", MAXIMUM_WAIT_OBJECTS); - return -1; - } - - REPEAT_COUNT = atoi(argv[3]); - if( REPEAT_COUNT < 1) - { - printf("\nInvalid REPEAT_COUNT number, Pass greater than 1\n"); - return -1; - } - - RELATION_ID = atoi(argv[4]); - if( RELATION_ID < 1) - { - printf("\nMain Process:Invalid RELATION_ID number, Pass greater than 1\n"); - return -1; - } - - if(argc == 6) - { - strncpy(objectSuffix, argv[5], MAX_PATH-1); - } - - return 0; -} - -PALTEST(composite_object_management_event_shared_paltest_event_shared, "composite/object_management/event/shared/paltest_event_shared") -{ - unsigned int i = 0; - HANDLE hThread[MAXIMUM_WAIT_OBJECTS]; - DWORD threadId[MAXIMUM_WAIT_OBJECTS]; - - WCHAR *wcObjName = NULL; - - char ObjName[MAX_PATH] = "SHARED_EVENT"; - DWORD dwParam = 0; - - int returnCode = 0; - - /* Variables to capture the file name and the file pointer at thread level*/ - char fileName[MAX_PATH]; - FILE *pFile = NULL; - struct statistics* buffer = NULL; - int statisticsSize = 0; - - /* Variables to capture the file name and the file pointer at process level*/ - char processFileName[MAX_PATH]; - FILE *pProcessFile = NULL; - struct ProcessStats processStats; - DWORD dwStartTime; - - testStatus = PASS; - - if(0 != (PAL_Initialize(argc, argv))) - { - return ( FAIL ); - } - - ZeroMemory( objectSuffix, MAX_PATH ); - - if(GetParameters(argc, argv)) - { - Fail("Error in obtaining the parameters\n"); - } - - if(argc == 5) - { - strncat(ObjName, objectSuffix, MAX_PATH - (sizeof(ObjName) + 1) ); - } - - /* Register the start time */ - dwStartTime = (DWORD)minipal_lowres_ticks(); - processStats.relationId = RELATION_ID; - processStats.processId = USE_PROCESS_COUNT; - - _snprintf(processFileName, MAX_PATH, "%d_process_event_%d_.txt", USE_PROCESS_COUNT, RELATION_ID); - pProcessFile = fopen(processFileName, "w+"); - if(pProcessFile == NULL) - { - Fail("Error:%d: in opening Process File for write for process [%d]\n", GetLastError(), USE_PROCESS_COUNT); - } - - statisticsSize = sizeof(struct statistics); - - _snprintf(fileName, MAX_PATH, "%d_thread_event_%d_.txt", USE_PROCESS_COUNT, RELATION_ID); - pFile = fopen(fileName, "w+"); - - if(pFile == NULL) - { - Fail("Error:%d: in opening thread file for write for process [%d]\n", GetLastError(), USE_PROCESS_COUNT); - } - // For each thread we will log operations failed (int), passed (int), total (int) - // and number of ticks (DWORD) for the operations - resultBuffer = new ResultBuffer( THREAD_COUNT, statisticsSize); - - wcObjName = convert(ObjName); - - StartTestsEvHandle = CreateEvent( NULL, /* lpEventAttributes*/ - TRUE, /* bManualReset */ - FALSE, /* bInitialState */ - NULL); /* name of Event */ - - if( StartTestsEvHandle == NULL ) - { - Fail("Error:%d: Unexpected failure " - "to create %s Event for process count %d\n", GetLastError(), sTmpEventName, USE_PROCESS_COUNT ); - - } - - /* Create StartTest Event */ - - hEventHandle = OpenEventW( - EVENT_ALL_ACCESS, /* lpEventAttributes, inheritable to child processes*/ - FALSE, /* bAutomaticReset */ - wcObjName - ); - - if( hEventHandle == NULL) - { - Fail("Unable to create Event handle for process id [%d], returned error [%d]\n", i, GetLastError()); - } - /* We already assume that the Event was created previously*/ - - for( i = 0; i < THREAD_COUNT; i++ ) - { - dwParam = (int) i; - //Create thread - hThread[i] = CreateThread( - NULL, /* no security attributes */ - 0, /* use default stack size */ - (LPTHREAD_START_ROUTINE)Run_Thread_event_shared,/* thread function */ - (LPVOID)dwParam, /* argument to thread function */ - 0, /* use default creation flags */ - &threadId[i] /* returns the thread identifier*/ - ); - - if(hThread[i] == NULL) - { - Fail("Create Thread failed for %d process, and GetLastError value is %d\n", USE_PROCESS_COUNT, GetLastError()); - } - - } - - if (!SetEvent(StartTestsEvHandle)) - { - Fail("Set Event for Start Tests failed for %d process, and GetLastError value is %d\n", USE_PROCESS_COUNT, GetLastError()); - } - - /* Test running */ - returnCode = WaitForMultipleObjects( THREAD_COUNT, hThread, TRUE, INFINITE); - - if( WAIT_OBJECT_0 != returnCode ) - { - Trace("Wait for Object(s) for %d process returned %d, and GetLastError value is %d\n", USE_PROCESS_COUNT, returnCode, GetLastError()); - testStatus = FAIL; - } - - processStats.operationTime = GetTimeDiff(dwStartTime); - - /* Write to a file*/ - if(pFile!= NULL) - { - for( i = 0; i < THREAD_COUNT; i++ ) - { - buffer = (struct statistics *)resultBuffer->getResultBuffer(i); - returnCode = fprintf(pFile, "%d,%d,%d,%d,%lu,%d\n", buffer->processId, buffer->operationsFailed, buffer->operationsPassed, buffer->operationsTotal, buffer->operationTime, buffer->relationId ); - } - } - - if(fclose(pFile)) - { - Trace("Error: fclose failed for pFile at Process %d\n", USE_PROCESS_COUNT); - testStatus = FAIL; - } - - fprintf(pProcessFile, "%d,%d,%d\n", USE_PROCESS_COUNT, processStats.operationTime, processStats.relationId ); - if(fclose(pProcessFile)) - { - Trace("Error: fclose failed for pProcessFile at Process %d\n", USE_PROCESS_COUNT); - testStatus = FAIL; - } - /* Logging for the test case over, clean up the handles */ - - for( i = 0; i < THREAD_COUNT; i++ ) - { - if(!CloseHandle(hThread[i]) ) - { - Trace("Error:%d: CloseHandle failed for Process [%d] hThread[%d]\n", GetLastError(), USE_PROCESS_COUNT, i); - testStatus = FAIL; - } - } - - if(!CloseHandle(StartTestsEvHandle)) - { - Trace("Error:%d: CloseHandle failed for Process [%d] StartTestsEvHandle\n", GetLastError(), USE_PROCESS_COUNT); - testStatus = FAIL; - } - - if(!CloseHandle(hEventHandle)) - { - Trace("Error:%d: CloseHandle failed for Process [%d] hEventHandle\n", GetLastError(), USE_PROCESS_COUNT); - testStatus = FAIL; - } - - free(wcObjName); - PAL_Terminate(); - return testStatus; -} - -void PALAPI Run_Thread_event_shared (LPVOID lpParam) -{ - unsigned int i = 0; - DWORD dwWaitResult; - - struct statistics stats; - DWORD dwStartTime; - - stats.relationId = RELATION_ID; - stats.processId = USE_PROCESS_COUNT; - stats.operationsFailed = 0; - stats.operationsPassed = 0; - stats.operationsTotal = 0; - stats.operationTime = 0; - - int Id=(int)lpParam; - - dwWaitResult = WaitForSingleObject( - StartTestsEvHandle, // handle to start test handle - TIMEOUT); - - if(dwWaitResult != WAIT_OBJECT_0) - { - Trace("Error:%d: while waiting for StartTest Event@ thread %d\n", GetLastError(), Id); - testStatus = FAIL; - } - - dwStartTime = (DWORD)minipal_lowres_ticks(); - - for( i = 0; i < REPEAT_COUNT; i++ ) - { - dwWaitResult = WaitForSingleObject( - hEventHandle, // handle to Event - TIMEOUT); - - if(dwWaitResult != WAIT_OBJECT_0) - { - stats.operationsFailed += 1; - stats.operationsTotal += 1; - testStatus = FAIL; - continue; - } - - if (! SetEvent(hEventHandle)) - { - // Deal with error. - stats.operationsFailed += 1; - stats.operationsTotal += 1; - // do we need to have while true loop to attempt to set event...? - testStatus = FAIL; - continue; - } - - stats.operationsTotal += 1; - stats.operationsPassed += 1; - } - - stats.operationTime = GetTimeDiff(dwStartTime); - if(resultBuffer->LogResult(Id, (char *)&stats)) - { - Fail("Error:%d: while writing to shared memory, Thread Id is[%d] and Process id is [%d]\n", GetLastError(), Id, USE_PROCESS_COUNT); - } -} diff --git a/src/coreclr/pal/tests/palsuite/composite/object_management/event/shared/main.cpp b/src/coreclr/pal/tests/palsuite/composite/object_management/event/shared/main.cpp deleted file mode 100644 index 32287705cbb91d..00000000000000 --- a/src/coreclr/pal/tests/palsuite/composite/object_management/event/shared/main.cpp +++ /dev/null @@ -1,264 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -/*============================================================ -** -** Source Code: main.c and event.c -** main.c creates process and waits for all processes to get over -** event.c creates a event and then calls threads which will contend for the event -** -** This test is for Object Management Test case for event where Object type is shareable. -** Algorithm -** o Main Process Creates OBJECT_TYPE Object -** o Create PROCESS_COUNT processes aware of the Shared Object -** -** Author: ShamitP -** -** -**============================================================ -*/ -#include -#include "resulttime.h" - -/* Test Input Variables */ -unsigned int PROCESS_COUNT = 2; -unsigned int THREAD_COUNT = 20; -unsigned int REPEAT_COUNT = 200; -unsigned int RELATION_ID = 1001; - - -char objectSuffix[MAX_PATH_FNAME]; - -struct TestStats{ - DWORD operationTime; - unsigned int relationId; - unsigned int processCount; - unsigned int threadCount; - unsigned int repeatCount; - char* buildNumber; - -}; - -int GetParameters( int argc, char **argv) -{ - if( (!((argc == 5) || (argc == 6) ) )|| ((argc == 1) && !strcmp(argv[1],"/?")) - || !strcmp(argv[1],"/h") || !strcmp(argv[1],"/H")) - { - printf("PAL -Composite Object Management event Test\n"); - printf("Usage:\n"); - printf("main\n\t[PROCESS_COUNT (greater than 1)] \n"); - printf("\t[THREAD_COUNT (greater than 1)] \n"); - printf("\t[REPEAT_COUNT (greater than 1)]\n"); - printf("\t[RELATION_ID [greater than or equal to 1]\n"); - printf("\t[Object Name Suffix]\n"); - return -1; - } - - PROCESS_COUNT = atoi(argv[1]); - if( (PROCESS_COUNT < 1) || (PROCESS_COUNT > MAXIMUM_WAIT_OBJECTS) ) - { - printf("\nMain Process:Invalid PROCESS_COUNT number, Pass greater than 1 and less than PROCESS_COUNT %d\n", MAXIMUM_WAIT_OBJECTS); - return -1; - } - - THREAD_COUNT = atoi(argv[2]); - if( (THREAD_COUNT < 1) || (THREAD_COUNT > MAXIMUM_WAIT_OBJECTS) ) - { - printf("\nInvalid THREAD_COUNT number, Pass greater than 1 and less than %d\n", MAXIMUM_WAIT_OBJECTS); - return -1; - } - - REPEAT_COUNT = atoi(argv[3]); - if( REPEAT_COUNT < 1) - { - printf("\nMain Process:Invalid REPEAT_COUNT number, Pass greater than 1\n"); - return -1; - } - - RELATION_ID = atoi(argv[4]); - if( RELATION_ID < 1) - { - printf("\nMain Process:Invalid RELATION_ID number, Pass greater than 1\n"); - return -1; - } - - - if(argc == 6) - { - strncpy(objectSuffix, argv[5], MAX_PATH_FNAME-1); - } - - return 0; -} - -PALTEST(composite_object_management_event_shared_paltest_event_shared, "composite/object_management/event/shared/paltest_event_shared") -{ - unsigned int i = 0; - HANDLE hProcess[MAXIMUM_WAIT_OBJECTS]; - HANDLE hEventHandle; - - STARTUPINFO si[MAXIMUM_WAIT_OBJECTS]; - PROCESS_INFORMATION pi[MAXIMUM_WAIT_OBJECTS]; - - char lpCommandLine[MAX_LONGPATH] = ""; - char ObjName[MAX_PATH_FNAME] = "SHARED_EVENT"; - - int returnCode = 0; - DWORD processReturnCode = 0; - int testReturnCode = PASS; - - char fileName[MAX_PATH_FNAME]; - FILE *pFile = NULL; - DWORD dwStartTime; - struct TestStats testStats; - - if(0 != (PAL_Initialize(argc, argv))) - { - return ( FAIL ); - } - - ZeroMemory( objectSuffix, MAX_PATH_FNAME ); - - if(GetParameters(argc, argv)) - { - Fail("Error in obtaining the parameters\n"); - } - - if(argc == 5) - { - strncat(ObjName, objectSuffix, MAX_PATH_FNAME - (sizeof(ObjName) + 1) ); - } - - /* Register the start time */ - dwStartTime = (DWORD)minipal_lowres_ticks(); - testStats.relationId = RELATION_ID; - testStats.processCount = PROCESS_COUNT; - testStats.threadCount = THREAD_COUNT; - testStats.repeatCount = REPEAT_COUNT; - testStats.buildNumber = getBuildNumber(); - - - _snprintf(fileName, MAX_PATH_FNAME, "main_event_%d_.txt", RELATION_ID); - pFile = fopen(fileName, "w+"); - if(pFile == NULL) - { - Fail("Error in opening main file for write\n"); - } - - hEventHandle = CreateEvent( - NULL, /* lpEventAttributes, inheritable to child processes*/ - TRUE, /* bAutomaticReset */ - TRUE, /* bInitialState */ - ObjName - ); - - if( hEventHandle == NULL) - { - Fail("Unable to create Event handle, returned error [%d]\n", GetLastError()); - } - - for( i = 0; i < PROCESS_COUNT; i++ ) - { - - ZeroMemory( lpCommandLine, MAX_PATH_FNAME ); - if ( _snprintf( lpCommandLine, MAX_PATH_FNAME-1, "event %d %d %d %d %s", i, THREAD_COUNT, REPEAT_COUNT, RELATION_ID, objectSuffix) < 0 ) - { - Fail ("Error: Insufficient Event name string length for %s for iteration [%d]\n", ObjName, i); - } - - /* Zero the data structure space */ - ZeroMemory ( &pi[i], sizeof(pi[i]) ); - ZeroMemory ( &si[i], sizeof(si[i]) ); - - /* Set the process flags and standard io handles */ - si[i].cb = sizeof(si[i]); - - if(!CreateProcess( NULL, /* lpApplicationName*/ - lpCommandLine, /* lpCommandLine */ - NULL, /* lpProcessAttributes */ - NULL, /* lpThreadAttributes */ - TRUE, /* bInheritHandles */ - 0, /* dwCreationFlags, */ - NULL, /* lpEnvironment */ - NULL, /* pCurrentDirectory */ - &si[i], /* lpStartupInfo */ - &pi[i] /* lpProcessInformation */ - )) - { - Fail("Process Not created for [%d], the error code is [%d]\n", i, GetLastError()); - } - else - { - hProcess[i] = pi[i].hProcess; -// Trace("Process created for [%d]\n", i); - - } - - //Create Process - - } - - returnCode = WaitForMultipleObjects( PROCESS_COUNT, hProcess, TRUE, INFINITE); - if( WAIT_OBJECT_0 != returnCode ) - { - Trace("Wait for Object(s) @ Main thread for %d processes returned %d, and GetLastError value is %d\n", PROCESS_COUNT, returnCode, GetLastError()); - testReturnCode = FAIL; - } - -// Trace("Test over\n"); - for( i = 0; i < PROCESS_COUNT; i++ ) - { - /* check the exit code from the process */ - if( ! GetExitCodeProcess( pi[i].hProcess, &processReturnCode ) ) - { - Trace( "GetExitCodeProcess call failed for iteration %d with error code %u\n", - i, GetLastError() ); - - testReturnCode = FAIL; - } - - if(processReturnCode == FAIL) - { - Trace( "Process [%d] failed and returned FAIL\n", i); - testReturnCode = FAIL; - } - - if(!CloseHandle(pi[i].hThread)) - { - Trace("Error:%d: CloseHandle failed for Process [%d] hThread\n", GetLastError(), i); - testReturnCode = FAIL; - } - - if(!CloseHandle(pi[i].hProcess) ) - { - Trace("Error:%d: CloseHandle failed for Process [%d] hProcess\n", GetLastError(), i); - testReturnCode = FAIL; - } - } - - testStats.operationTime = GetTimeDiff(dwStartTime); - fprintf(pFile, "%d,%d,%d,%d,%d,%s\n", testStats.operationTime, testStats.relationId, testStats.processCount, testStats.threadCount, testStats.repeatCount, testStats.buildNumber); - if(fclose(pFile)) - { - Trace("Error: fclose failed for pFile\n"); - testReturnCode = FAIL; - } - - if(!CloseHandle(hEventHandle)) - { - Trace("Error:%d: CloseHandle failed for hEventHandle\n", GetLastError()); - testReturnCode = FAIL; - } - - if( testReturnCode == PASS) - { - Trace("Test Passed\n"); - } - else - { - Trace("Test Failed\n"); - } - - PAL_Terminate(); - return testReturnCode; -} diff --git a/src/coreclr/pal/tests/palsuite/composite/object_management/readme.txt b/src/coreclr/pal/tests/palsuite/composite/object_management/readme.txt deleted file mode 100644 index 669b61f79fe3d7..00000000000000 --- a/src/coreclr/pal/tests/palsuite/composite/object_management/readme.txt +++ /dev/null @@ -1,27 +0,0 @@ -To compile: - -1) create a dat file (say object_management.dat) with contents: - -PAL,Composite,palsuite\composite\object_management\semaphore\nonshared,semaphore=main.c semaphore.c,,, -PAL,Composite,palsuite\composite\object_management\semaphore\shared,semaphore=main.c semaphore.c,,, -PAL,Composite,palsuite\composite\object_management\event\nonshared,event=main.c event.c,,, -PAL,Composite,palsuite\composite\object_management\event\shared,event=main.c event.c,,, - - -2) perl rrunmod.pl -r object_management.dat - - -To execute: -For each of the test cases, -main [PROCESS_COUNT] [THREAD_COUNT] [REPEAT_COUNT] - - -Output: -The performance numbers will be in _[event|semaphore].txt -(will be at palsuite\composite\object_management\[event|semaphore]\[shared|nonshared]\obj[r|c|d] directory if u use rrunmod.pl) - -So if process_count is 3, you will have files 0_event.txt, 1_event.txt and so on� - -For each process txt file created, -each row represents a thread data (process id, number of failures, number of pass, total number of repeated operations and an integer that will be used to identify a run -(currently zero)). diff --git a/src/coreclr/pal/tests/palsuite/composite/object_management/semaphore/nonshared/main.cpp b/src/coreclr/pal/tests/palsuite/composite/object_management/semaphore/nonshared/main.cpp deleted file mode 100644 index 3075b29c2a6669..00000000000000 --- a/src/coreclr/pal/tests/palsuite/composite/object_management/semaphore/nonshared/main.cpp +++ /dev/null @@ -1,227 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -/*============================================================ -** -** Source Code: main.c and semaphore.c -** main.c creates process and waits for all processes to get over -** semaphore.c creates a semaphore and then calls threads which will contend for the semaphore -** -** This test is for Object Management Test case for semaphore where Object type is not shareable. -** Algorithm -** o Create PROCESS_COUNT processes. -** o Main Thread of each process creates OBJECT_TYPE Object -** -** Author: ShamitP -** -** -**============================================================ -*/ - -#include -#include "resulttime.h" - -/* Test Input Variables */ -unsigned int PROCESS_COUNT = 2; -unsigned int THREAD_COUNT = 15; -unsigned int REPEAT_COUNT = 40000; -unsigned int RELATION_ID = 1001; - - - -struct TestStats{ - DWORD operationTime; - unsigned int relationId; - unsigned int processCount; - unsigned int threadCount; - unsigned int repeatCount; - char* buildNumber; -}; - -int GetParameters( int argc, char **argv) -{ - if( (argc != 5) || ((argc == 1) && !strcmp(argv[1],"/?")) - || !strcmp(argv[1],"/h") || !strcmp(argv[1],"/H")) - { - printf("PAL -Composite Object Management Semaphore Test\n"); - printf("Usage:\n"); - printf("main\n\t[PROCESS_COUNT [greater than 1] \n"); - printf("\t[THREAD_COUNT [greater than 1] \n"); - printf("\t[REPEAT_COUNT [greater than 1]\n"); - printf("\t[RELATION_ID [greater than 1]\n"); - return -1; - } - - PROCESS_COUNT = atoi(argv[1]); - if( (PROCESS_COUNT < 1) || (PROCESS_COUNT > MAXIMUM_WAIT_OBJECTS) ) - { - printf("\nMain Process:Invalid PROCESS_COUNT number, Pass greater than 1 and less than PROCESS_COUNT %d\n", MAXIMUM_WAIT_OBJECTS); - return -1; - } - - THREAD_COUNT = atoi(argv[2]); - if( (THREAD_COUNT < 1) || (THREAD_COUNT > MAXIMUM_WAIT_OBJECTS) ) - { - printf("\nInvalid THREAD_COUNT number, Pass greater than 1 and less than %d\n", MAXIMUM_WAIT_OBJECTS); - return -1; - } - - REPEAT_COUNT = atoi(argv[3]); - if( REPEAT_COUNT < 1) - { - printf("\nMain Process:Invalid REPEAT_COUNT number, Pass greater than 1\n"); - return -1; - } - - RELATION_ID = atoi(argv[4]); - if( RELATION_ID < 1) - { - printf("\nMain Process:Invalid RELATION_ID number, Pass greater than or Equal to 1\n"); - return -1; - } - - return 0; -} - -PALTEST(composite_object_management_semaphore_nonshared_paltest_semaphore_nonshared, "composite/object_management/semaphore/nonshared/paltest_semaphore_nonshared") -{ - unsigned int i = 0; - HANDLE hProcess[MAXIMUM_WAIT_OBJECTS]; - HANDLE hSemaphoreHandle[MAXIMUM_WAIT_OBJECTS]; - - STARTUPINFO si[MAXIMUM_WAIT_OBJECTS]; - PROCESS_INFORMATION pi[MAXIMUM_WAIT_OBJECTS]; - - const char *ObjName = "Semaphore"; - char lpCommandLine[MAX_PATH] = ""; - - int returnCode = 0; - DWORD processReturnCode = 0; - int testReturnCode = PASS; - - char fileName[MAX_PATH]; - FILE *pFile = NULL; - DWORD dwStartTime; - struct TestStats testStats; - - if(0 != (PAL_Initialize(argc, argv))) - { - return ( FAIL ); - } - - if(GetParameters(argc, argv)) - { - Fail("Error in obtaining the parameters\n"); - } - - /* Register the start time */ - dwStartTime = (DWORD)minipal_lowres_ticks(); - testStats.relationId = RELATION_ID; - testStats.processCount = PROCESS_COUNT; - testStats.threadCount = THREAD_COUNT; - testStats.repeatCount = REPEAT_COUNT; - testStats.buildNumber = getBuildNumber(); - - - _snprintf(fileName, MAX_PATH, "main_semaphore_%d_.txt", RELATION_ID); - pFile = fopen(fileName, "w+"); - if(pFile == NULL) - { - Fail("Error in opening main file for write\n"); - } - - for( i = 0; i < PROCESS_COUNT; i++ ) - { - ZeroMemory( lpCommandLine, MAX_PATH ); - if ( _snprintf( lpCommandLine, MAX_PATH-1, "semaphore %d %d %d %d", i, THREAD_COUNT, REPEAT_COUNT, RELATION_ID) < 0 ) - { - Fail("Error Insufficient semaphore name string length for %s for iteration [%d]\n", ObjName, i); - } - - /* Zero the data structure space */ - ZeroMemory ( &pi[i], sizeof(pi[i]) ); - ZeroMemory ( &si[i], sizeof(si[i]) ); - - /* Set the process flags and standard io handles */ - si[i].cb = sizeof(si[i]); - - //Create Process - if(!CreateProcess( NULL, /* lpApplicationName*/ - lpCommandLine, /* lpCommandLine */ - NULL, /* lpProcessAttributes */ - NULL, /* lpThreadAttributes */ - TRUE, /* bInheritHandles */ - 0, /* dwCreationFlags, */ - NULL, /* lpEnvironment */ - NULL, /* pCurrentDirectory */ - &si[i], /* lpStartupInfo */ - &pi[i] /* lpProcessInformation */ - )) - { - Fail("Process Not created for [%d], the error code is [%d]\n", i, GetLastError()); - } - else - { - hProcess[i] = pi[i].hProcess; -// Trace("Process created for [%d]\n", i); - - } - } - - returnCode = WaitForMultipleObjects( PROCESS_COUNT, hProcess, TRUE, INFINITE); - if( WAIT_OBJECT_0 != returnCode ) - { - Trace("Wait for Object(s) @ Main thread for %d processes returned %d, and GetLastError value is %d\n", PROCESS_COUNT, returnCode, GetLastError()); - testReturnCode = FAIL; - } - - for( i = 0; i < PROCESS_COUNT; i++ ) - { - /* check the exit code from the process */ - if( ! GetExitCodeProcess( pi[i].hProcess, &processReturnCode ) ) - { - Trace( "GetExitCodeProcess call failed for iteration %d with error code %u\n", - i, GetLastError() ); - - testReturnCode = FAIL; - } - - if(processReturnCode == FAIL) - { - Trace( "Process [%d] failed and returned FAIL\n", i); - testReturnCode = FAIL; - } - - if(!CloseHandle(pi[i].hThread)) - { - Trace("Error:%d: CloseHandle failed for Process [%d] hThread\n", GetLastError(), i); - testReturnCode = FAIL; - } - - if(!CloseHandle(pi[i].hProcess) ) - { - Trace("Error:%d: CloseHandle failed for Process [%d] hProcess\n", GetLastError(), i); - testReturnCode = FAIL; - } - } - - testStats.operationTime = GetTimeDiff(dwStartTime); - fprintf(pFile, "%d,%d,%d,%d,%d,%s\n", testStats.operationTime, testStats.relationId,testStats.processCount, testStats.threadCount, testStats.repeatCount, testStats.buildNumber ); - if(fclose(pFile)) - { - Trace("Error: fclose failed for pFile\n"); - testReturnCode = FAIL; - } - - if( testReturnCode == PASS) - { - Trace("Test Passed\n"); - } - else - { - Trace("Test Failed\n"); - } - - PAL_Terminate(); - return testReturnCode; -} diff --git a/src/coreclr/pal/tests/palsuite/composite/object_management/semaphore/nonshared/semaphore.cpp b/src/coreclr/pal/tests/palsuite/composite/object_management/semaphore/nonshared/semaphore.cpp deleted file mode 100644 index 89616ad01d5a01..00000000000000 --- a/src/coreclr/pal/tests/palsuite/composite/object_management/semaphore/nonshared/semaphore.cpp +++ /dev/null @@ -1,331 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -/*============================================================ -** -** Source Code: main.c and semaphore.c -** main.c creates process and waits for all processes to get over -** semaphore.c creates a semaphore and then calls threads which will contend for the semaphore -** -** This test is for Object Management Test case for semaphore where Object type is not shareable. -** Algorithm -** o Create PROCESS_COUNT processes. -** o Main Thread of each process creates OBJECT_TYPE Object -** -** Author: ShamitP -** -** -**============================================================ -*/ - -#include -#include "resultbuffer.h" -#include "resulttime.h" - -#define TIMEOUT 5000 -/* Test Input Variables */ -unsigned int USE_PROCESS_COUNT = 0; -unsigned int THREAD_COUNT = 0; -unsigned int REPEAT_COUNT = 0; -unsigned int RELATION_ID = 0; - -/* Capture statistics at per thread basis */ -struct statistics{ - unsigned int processId; - unsigned int operationsFailed; - unsigned int operationsPassed; - unsigned int operationsTotal; - DWORD operationTime; - unsigned int relationId; -}; - -struct ProcessStats{ - unsigned int processId; - DWORD operationTime; - unsigned int relationId; -}; - -/* Semaphore variables */ -unsigned long lInitialCount = 1; /* Signaled */ -unsigned long lMaximumCount = 1; /* Maximum value of 1 */ - -HANDLE StartTestsEvHandle = NULL; -HANDLE hSemaphoreHandle = NULL; - -/* Results Buffer */ -ResultBuffer *resultBuffer = NULL; - -int testStatus; - -const char sTmpEventName[MAX_PATH] = "StartTestEvent"; - -void PALAPI Run_Thread_semaphore_nonshared(LPVOID lpParam); - -int GetParameters( int argc, char **argv) -{ - if( (argc != 5) || ((argc == 1) && !strcmp(argv[1],"/?")) - || !strcmp(argv[1],"/h") || !strcmp(argv[1],"/H")) - { - printf("PAL -Composite Object Management Semaphore Test\n"); - printf("Usage:\n"); - printf("semaphore\n\t[USE_PROCESS_COUNT ( greater than 1] \n"); - printf("\t[THREAD_COUNT ( greater than 1] \n"); - printf("\t[REPEAT_COUNT ( greater than 1]\n"); - printf("\t[RELATION_ID [greater than 1]\n"); - return -1; - } - - USE_PROCESS_COUNT = atoi(argv[1]); - if( USE_PROCESS_COUNT < 0) - { - printf("\nInvalid USE_PROCESS_COUNT number, Pass greater than 1\n"); - return -1; - } - - THREAD_COUNT = atoi(argv[2]); - if( (THREAD_COUNT < 1) || (THREAD_COUNT > MAXIMUM_WAIT_OBJECTS) ) - { - printf("\nInvalid THREAD_COUNT number, Pass greater than 1 and less than %d\n", MAXIMUM_WAIT_OBJECTS); - return -1; - } - - REPEAT_COUNT = atoi(argv[3]); - if( REPEAT_COUNT < 1) - { - printf("\nInvalid REPEAT_COUNT number, Pass greater than 1\n"); - return -1; - } - - RELATION_ID = atoi(argv[4]); - if( RELATION_ID < 1) - { - printf("\nMain Process:Invalid RELATION_ID number, Pass greater than or Equal to 1\n"); - return -1; - } - - return 0; -} - -PALTEST(composite_object_management_semaphore_nonshared_paltest_semaphore_nonshared, "composite/object_management/semaphore/nonshared/paltest_semaphore_nonshared") -{ - unsigned int i = 0; - HANDLE hThread[MAXIMUM_WAIT_OBJECTS]; - DWORD threadId[MAXIMUM_WAIT_OBJECTS]; - - const char *ObjName = "Semaphore"; - - DWORD dwParam = 0; - - int returnCode = 0; - - /* Variables to capture the file name and the file pointer at thread level*/ - char fileName[MAX_PATH]; - FILE *pFile = NULL; - struct statistics* buffer = NULL; - int statisticsSize = 0; - - /* Variables to capture the file name and the file pointer at process level*/ - char processFileName[MAX_PATH]; - FILE *pProcessFile = NULL; - struct ProcessStats processStats; - DWORD dwStartTime; - - testStatus = PASS; - - if(0 != (PAL_Initialize(argc, argv))) - { - return ( FAIL ); - } - - if(GetParameters(argc, argv)) - { - Fail("Error in obtaining the parameters\n"); - } - - /* Register the start time */ - dwStartTime = (DWORD)minipal_lowres_ticks(); - processStats.relationId = RELATION_ID; - processStats.processId = USE_PROCESS_COUNT; - - _snprintf(processFileName, MAX_PATH, "%d_process_semaphore_%d_.txt", USE_PROCESS_COUNT, RELATION_ID); - pProcessFile = fopen(processFileName, "w+"); - if(pProcessFile == NULL) - { - Fail("Error in opening process File file for write for process [%d]\n", USE_PROCESS_COUNT); - } - - statisticsSize = sizeof(struct statistics); - - _snprintf(fileName, MAX_PATH, "%d_thread_semaphore_%d_.txt", USE_PROCESS_COUNT, RELATION_ID); - pFile = fopen(fileName, "w+"); - if(pFile == NULL) - { - Fail("Error in opening file for write for process [%d]\n", USE_PROCESS_COUNT); - } - // For each thread we will log operations failed (int), passed (int), total (int) - // and number of ticks (DWORD) for the operations - resultBuffer = new ResultBuffer( THREAD_COUNT, statisticsSize); - - StartTestsEvHandle = CreateEvent( NULL, /* lpEventAttributes*/ - TRUE, /* bManualReset */ - FALSE, /* bInitialState */ - NULL); /* name of Event */ - - if( StartTestsEvHandle == NULL ) - { - Fail("Error:%d: Unexpected failure " - "to create %s Event for process count %d\n", GetLastError(), sTmpEventName, USE_PROCESS_COUNT ); - - } - - /* Create StartTest Event */ - hSemaphoreHandle = CreateSemaphore( - NULL, /* lpSemaphoreAttributes */ - lInitialCount, /*lInitialCount*/ - lMaximumCount, /*lMaximumCount */ - NULL, - 0, - 0 - ); - - if( hSemaphoreHandle == NULL) - { - Fail("Unable to create Semaphore handle for process id [%d], returned error [%d]\n", i, GetLastError()); - } - /* We already assume that the Semaphore was created previously*/ - - for( i = 0; i < THREAD_COUNT; i++ ) - { - dwParam = (int) i; - //Create thread - hThread[i] = CreateThread( - NULL, /* no security attributes */ - 0, /* use default stack size */ - (LPTHREAD_START_ROUTINE)Run_Thread_semaphore_nonshared,/* thread function */ - (LPVOID)dwParam, /* argument to thread function */ - 0, /* use default creation flags */ - &threadId[i] /* returns the thread identifier*/ - ); - - - if(hThread[i] == NULL) - { - Fail("Create Thread failed for %d process, and GetLastError value is %d\n", USE_PROCESS_COUNT, GetLastError()); - } - - } - - if (!SetEvent(StartTestsEvHandle)) - { - Fail("Set Event for Start Tests failed for %d process, and GetLastError value is %d\n", USE_PROCESS_COUNT, GetLastError()); - } - - /* Test running */ - returnCode = WaitForMultipleObjects( THREAD_COUNT, hThread, TRUE, INFINITE); - - if( WAIT_OBJECT_0 != returnCode ) - { - Trace("Wait for Object(s) for %d process returned %d, and GetLastError value is %d\n", USE_PROCESS_COUNT, returnCode, GetLastError()); - testStatus = FAIL; - } - - processStats.operationTime = GetTimeDiff(dwStartTime); - - /* Write to a file*/ - if(pFile!= NULL) - { - for( i = 0; i < THREAD_COUNT; i++ ) - { - buffer = (struct statistics *)resultBuffer->getResultBuffer(i); - returnCode = fprintf(pFile, "%d,%d,%d,%d,%lu,%d\n", buffer->processId, buffer->operationsFailed, buffer->operationsPassed, buffer->operationsTotal, buffer->operationTime, buffer->relationId ); - } - } - fclose(pFile); - /* Logging for the test case over, clean up the handles */ - - for( i = 0; i < THREAD_COUNT; i++ ) - { - if(!CloseHandle(hThread[i]) ) - { - Trace("Error:%d: CloseHandle failed for Process [%d] hThread[%d]\n", GetLastError(), USE_PROCESS_COUNT, i); - testStatus = FAIL; - } - } - - if(!CloseHandle(StartTestsEvHandle)) - { - Trace("Error:%d: CloseHandle failed for Process [%d] StartTestsEvHandle\n", GetLastError(), USE_PROCESS_COUNT); - testStatus = FAIL; - } - - if(!CloseHandle(hSemaphoreHandle)) - { - Trace("Error:%d: CloseHandle failed for Process [%d] hSemaphoreHandle\n", GetLastError(), USE_PROCESS_COUNT); - testStatus = FAIL; - } - - PAL_Terminate(); - return PASS; -} - -void PALAPI Run_Thread_semaphore_nonshared (LPVOID lpParam) -{ - unsigned int i = 0; - DWORD dwWaitResult; - - int Id=(int)lpParam; - - struct statistics stats; - DWORD dwStartTime; - - stats.relationId = RELATION_ID; - stats.processId = USE_PROCESS_COUNT; - stats.operationsFailed = 0; - stats.operationsPassed = 0; - stats.operationsTotal = 0; - stats.operationTime = 0; - - dwWaitResult = WaitForSingleObject( - StartTestsEvHandle, // handle to start test handle - TIMEOUT); - - if(dwWaitResult != WAIT_OBJECT_0) - { - Fail("Error while waiting for StartTest Event@ thread %d, RC is %d, Error is %d\n", Id, dwWaitResult, GetLastError()); - } - - dwStartTime = (DWORD)minipal_lowres_ticks(); - - for( i = 0; i < REPEAT_COUNT; i++ ) - { - dwWaitResult = WaitForSingleObject( - hSemaphoreHandle, // handle to Semaphore - TIMEOUT); - - if(dwWaitResult != WAIT_OBJECT_0) - { - stats.operationsFailed += 1; - stats.operationsTotal += 1; - testStatus = FAIL; - continue; - } - if (! ReleaseSemaphore(hSemaphoreHandle, 1, NULL)) - { - // Deal with error. - stats.operationsFailed += 1; - stats.operationsTotal += 1; - // Probably need to have while true loop to attempt to release semaphore... - testStatus = FAIL; - continue; - } - - stats.operationsTotal += 1; - stats.operationsPassed += 1; - } - - stats.operationTime = GetTimeDiff(dwStartTime); - if(resultBuffer->LogResult(Id, (char *)&stats)) - { - Fail("Error:%d: while writing to shared memory, Thread Id is[%d] and Process id is [%d]\n", GetLastError(), Id, USE_PROCESS_COUNT); - } -} diff --git a/src/coreclr/pal/tests/palsuite/composite/object_management/semaphore/shared/main.cpp b/src/coreclr/pal/tests/palsuite/composite/object_management/semaphore/shared/main.cpp deleted file mode 100644 index e96e77abda1248..00000000000000 --- a/src/coreclr/pal/tests/palsuite/composite/object_management/semaphore/shared/main.cpp +++ /dev/null @@ -1,276 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -/*============================================================ -** -** Source Code: main.c and semaphore.c -** main.c creates process and waits for all processes to get over -** semaphore.c creates a semaphore and then calls threads which will contend for the semaphore -** -** This test is for Object Management Test case for semaphore where Object type is shareable. -** Algorithm -** o Main Process Creates OBJECT_TYPE Object -** o Create PROCESS_COUNT processes aware of the Shared Object -** -** -** -**============================================================ -*/ - -#include -#include "resulttime.h" - -/* Test Input Variables */ -unsigned int PROCESS_COUNT = 1; -unsigned int THREAD_COUNT = 1; -unsigned int REPEAT_COUNT = 4; -unsigned int RELATION_ID = 1001; - - -unsigned long lInitialCount = 1; /* Signaled */ -unsigned long lMaximumCount = 1; /* Maximum value of 1 */ - -char objectSuffix[MAX_PATH]; - -struct TestStats{ - DWORD operationTime; - unsigned int relationId; - unsigned int processCount; - unsigned int threadCount; - unsigned int repeatCount; - char* buildNumber; - -}; - -int GetParameters( int argc, char **argv) -{ - if( (!((argc == 5) || (argc == 6) ) )|| ((argc == 1) && !strcmp(argv[1],"/?")) - || !strcmp(argv[1],"/h") || !strcmp(argv[1],"/H")) - { - printf("PAL -Composite Object Management event Test\n"); - printf("Usage:\n"); - printf("main\n\t[PROCESS_COUNT (greater than 1)] \n"); - printf("\t[THREAD_COUNT (greater than 1)] \n"); - printf("\t[REPEAT_COUNT (greater than 1)]\n"); - printf("\t[RELATION_ID [greater than or equal to 1]\n"); - printf("\t[Object Name Suffix]\n"); - return -1; - } - - PROCESS_COUNT = atoi(argv[1]); - if( (PROCESS_COUNT < 1) || (PROCESS_COUNT > MAXIMUM_WAIT_OBJECTS) ) - { - printf("\nMain Process:Invalid PROCESS_COUNT number, Pass greater than 1 and less than PROCESS_COUNT %d\n", MAXIMUM_WAIT_OBJECTS); - return -1; - } - - THREAD_COUNT = atoi(argv[2]); - if( (THREAD_COUNT < 1) || (THREAD_COUNT > MAXIMUM_WAIT_OBJECTS) ) - { - printf("\nInvalid THREAD_COUNT number, Pass greater than 1 and less than %d\n", MAXIMUM_WAIT_OBJECTS); - return -1; - } - - REPEAT_COUNT = atoi(argv[3]); - if( REPEAT_COUNT < 1) - { - printf("\nMain Process:Invalid REPEAT_COUNT number, Pass greater than 1\n"); - return -1; - } - - RELATION_ID = atoi(argv[4]); - if( RELATION_ID < 1) - { - printf("\nMain Process:Invalid RELATION_ID number, Pass greater than 1\n"); - return -1; - } - - - if(argc == 6) - { - strncpy(objectSuffix, argv[5], MAX_PATH-1); - } - - return 0; -} - -PALTEST(composite_object_management_semaphore_shared_paltest_semaphore_shared, "composite/object_management/semaphore/shared/paltest_semaphore_shared") -{ - unsigned int i = 0; - HANDLE hProcess[MAXIMUM_WAIT_OBJECTS]; - HANDLE hSemaphoreHandle; - - STARTUPINFO si[MAXIMUM_WAIT_OBJECTS]; - PROCESS_INFORMATION pi[MAXIMUM_WAIT_OBJECTS]; - - char lpCommandLine[MAX_PATH] = ""; - char ObjName[MAX_PATH] = "SHARED_SEMAPHORE"; - - int returnCode = 0; - DWORD processReturnCode = 0; - int testReturnCode = PASS; - - char fileName[MAX_PATH]; - FILE *pFile = NULL; - DWORD dwStartTime; - struct TestStats testStats; - - if(0 != (PAL_Initialize(argc, argv))) - { - return ( FAIL ); - } - -/* -"While the new PAL does support named semaphore it's unclear -if we should change the Windows PAL, since we share that w/ Rotor -and they are still using the old PAL. For the time being it may -make the most sense to just skip the named semaphore test on Windows -- from an object management perspective it doesn't really gain -us anything over what we already have." -*/ - ZeroMemory( objectSuffix, MAX_PATH ); - - if(GetParameters(argc, argv)) - { - Fail("Error in obtaining the parameters\n"); - } - - if(argc == 6) - { - strncat(ObjName, objectSuffix, MAX_PATH - (sizeof(ObjName) + 1) ); - } - - /* Register the start time */ - dwStartTime = (DWORD)minipal_lowres_ticks(); - testStats.relationId = RELATION_ID; - testStats.processCount = PROCESS_COUNT; - testStats.threadCount = THREAD_COUNT; - testStats.repeatCount = REPEAT_COUNT; - testStats.buildNumber = getBuildNumber(); - - _snprintf(fileName, MAX_PATH, "main_semaphore_%d_.txt", RELATION_ID); - pFile = fopen(fileName, "w+"); - if(pFile == NULL) - { - Fail("Error in opening main file for write\n"); - } - - hSemaphoreHandle = CreateSemaphore( - NULL, /* lpSemaphoreAttributes */ - lInitialCount, /*lInitialCount*/ - lMaximumCount, /*lMaximumCount */ - ObjName, - 0, - 0 - ); - - if( hSemaphoreHandle == NULL) - { - Fail("Unable to create shared Semaphore handle @ Main returned error [%d]\n", GetLastError()); - } - - for( i = 0; i < PROCESS_COUNT; i++ ) - { - - - ZeroMemory( lpCommandLine, MAX_PATH ); - if ( _snprintf( lpCommandLine, MAX_PATH-1, "semaphore %d %d %d %d %s", i, THREAD_COUNT, REPEAT_COUNT, RELATION_ID, objectSuffix) < 0 ) - { - Fail("Error: Insufficient semaphore name string length for %s for iteration [%d]\n", ObjName, i); - } - - - /* Zero the data structure space */ - ZeroMemory ( &pi[i], sizeof(pi[i]) ); - ZeroMemory ( &si[i], sizeof(si[i]) ); - - /* Set the process flags and standard io handles */ - si[i].cb = sizeof(si[i]); - - if(!CreateProcess( NULL, /* lpApplicationName*/ - lpCommandLine, /* lpCommandLine */ - NULL, /* lpProcessAttributes */ - NULL, /* lpThreadAttributes */ - TRUE, /* bInheritHandles */ - 0, /* dwCreationFlags, */ - NULL, /* lpEnvironment */ - NULL, /* pCurrentDirectory */ - &si[i], /* lpStartupInfo */ - &pi[i] /* lpProcessInformation */ - )) - { - Fail("Process Not created for [%d], the error code is [%d]\n", i, GetLastError()); - } - else - { - hProcess[i] = pi[i].hProcess; -// Trace("Process created for [%d]\n", i); - - } - - } - - returnCode = WaitForMultipleObjects( PROCESS_COUNT, hProcess, TRUE, INFINITE); - if( WAIT_OBJECT_0 != returnCode ) - { - Trace("Wait for Object(s) @ Main thread for %d processes returned %d, and GetLastError value is %d\n", PROCESS_COUNT, returnCode, GetLastError()); - testReturnCode = FAIL; - } - - for( i = 0; i < PROCESS_COUNT; i++ ) - { - /* check the exit code from the process */ - if( ! GetExitCodeProcess( pi[i].hProcess, &processReturnCode ) ) - { - Trace( "GetExitCodeProcess call failed for iteration %d with error code %u\n", - i, GetLastError() ); - - testReturnCode = FAIL; - } - - if(processReturnCode == FAIL) - { - Trace( "Process [%d] failed and returned FAIL\n", i); - testReturnCode = FAIL; - } - - if(!CloseHandle(pi[i].hThread)) - { - Trace("Error:%d: CloseHandle failed for Process [%d] hThread\n", GetLastError(), i); - testReturnCode = FAIL; - } - - if(!CloseHandle(pi[i].hProcess) ) - { - Trace("Error:%d: CloseHandle failed for Process [%d] hProcess\n", GetLastError(), i); - testReturnCode = FAIL; - } - } - - testStats.operationTime = GetTimeDiff(dwStartTime); - fprintf(pFile, "%d,%d,%d,%d,%d,%s\n", testStats.operationTime, testStats.relationId, testStats.processCount, testStats.threadCount, testStats.repeatCount, testStats.buildNumber); - if(fclose(pFile)) - { - Trace("Error: fclose failed for pFile\n"); - testReturnCode = FAIL; - }; - - if(!CloseHandle(hSemaphoreHandle)) - { - Trace("Error:%d: CloseHandle failed for hSemaphoreHandle\n", GetLastError()); - testReturnCode = FAIL; - - } - - if( testReturnCode == PASS) - { - Trace("Test Passed\n"); - } - else - { - Trace("Test Failed\n"); - } - - PAL_Terminate(); - return testReturnCode; -} diff --git a/src/coreclr/pal/tests/palsuite/composite/object_management/semaphore/shared/semaphore.cpp b/src/coreclr/pal/tests/palsuite/composite/object_management/semaphore/shared/semaphore.cpp deleted file mode 100644 index 0fec6fef7e971c..00000000000000 --- a/src/coreclr/pal/tests/palsuite/composite/object_management/semaphore/shared/semaphore.cpp +++ /dev/null @@ -1,343 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -/*============================================================ -** -** Source Code: main.c and semaphore.c -** main.c creates process and waits for all processes to get over -** semaphore.c creates a semaphore and then calls threads which will contend for the semaphore -** -** This test is for Object Management Test case for semaphore where Object type is shareable. -** Algorithm -** o Main Process Creates OBJECT_TYPE Object -** o Create PROCESS_COUNT processes aware of the Shared Object -** -** -** -**============================================================ -*/ - -#include -#include "resultbuffer.h" -#include "resulttime.h" - -#define TIMEOUT 5000 -/* Test Input Variables */ -unsigned int USE_PROCESS_COUNT = 0; -unsigned int THREAD_COUNT = 0; -unsigned int REPEAT_COUNT = 0; -unsigned int RELATION_ID= 0; - -/* Capture statistics at per thread basis */ -struct statistics{ - unsigned int processId; - unsigned int operationsFailed; - unsigned int operationsPassed; - unsigned int operationsTotal; - DWORD operationTime; - unsigned int relationId; -}; - -struct ProcessStats{ - unsigned int processId; - DWORD operationTime; - unsigned int relationId; -}; - -/* Semaphore variables */ -unsigned long lInitialCount = 1; /* Signaled */ -unsigned long lMaximumCount = 1; /* Maximum value of 1 */ - -HANDLE StartTestsEvHandle = NULL; -HANDLE hSemaphoreHandle = NULL; - -/* Results Buffer */ -ResultBuffer *resultBuffer = NULL; - -int testStatus; - -const char sTmpEventName[MAX_PATH] = "StartTestEvent"; -char objectSuffix[MAX_PATH]; - -void PALAPI Run_Thread_semaphore_shared(LPVOID lpParam); - -int GetParameters( int argc, char **argv) -{ - if( (!((argc == 5) || (argc == 6) ) )|| ((argc == 1) && !strcmp(argv[1],"/?")) - || !strcmp(argv[1],"/h") || !strcmp(argv[1],"/H")) - { - printf("PAL -Composite Object Management event Test\n"); - printf("Usage:\n"); - printf("main\n\t[PROCESS_COUNT (greater than 1)] \n"); - printf("\t[THREAD_COUNT (greater than 1)] \n"); - printf("\t[REPEAT_COUNT (greater than 1)]\n"); - printf("\t[RELATION_ID [greater than or equal to 1]\n"); - printf("\t[Object Name Suffix]\n"); - return -1; - } - - USE_PROCESS_COUNT = atoi(argv[1]); - if(USE_PROCESS_COUNT < 0) - { - printf("\nMain Process:Invalid PROCESS_COUNT number, Pass greater than 0 \n"); - return -1; - } - - THREAD_COUNT = atoi(argv[2]); - if( (THREAD_COUNT < 1) || (THREAD_COUNT > MAXIMUM_WAIT_OBJECTS) ) - { - printf("\nInvalid THREAD_COUNT number, Pass greater than 1 and less than %d\n", MAXIMUM_WAIT_OBJECTS); - return -1; - } - - REPEAT_COUNT = atoi(argv[3]); - if( REPEAT_COUNT < 1) - { - printf("\nMain Process:Invalid REPEAT_COUNT number, Pass greater than 1\n"); - return -1; - } - - RELATION_ID = atoi(argv[4]); - if( RELATION_ID < 1) - { - printf("\nMain Process:Invalid RELATION_ID number, Pass greater than 1\n"); - return -1; - } - - if(argc == 6) - { - strncpy(objectSuffix, argv[5], MAX_PATH-1); - } - - return 0; -} - -PALTEST(composite_object_management_semaphore_shared_paltest_semaphore_shared, "composite/object_management/semaphore/shared/paltest_semaphore_shared") -{ - unsigned int i = 0; - HANDLE hThread[MAXIMUM_WAIT_OBJECTS]; - DWORD threadId[MAXIMUM_WAIT_OBJECTS]; - - char ObjName[MAX_PATH] = "SHARED_SEMAPHORE"; - DWORD dwParam = 0; - - int returnCode = 0; - - /* Variables to capture the file name and the file pointer at thread level*/ - char fileName[MAX_PATH]; - FILE *pFile = NULL; - struct statistics* buffer = NULL; - int statisticsSize = 0; - - /* Variables to capture the file name and the file pointer at process level*/ - char processFileName[MAX_PATH]; - FILE *pProcessFile = NULL; - struct ProcessStats processStats; - DWORD dwStartTime; - - testStatus = PASS; - - ZeroMemory( objectSuffix, MAX_PATH ); - - if(0 != (PAL_Initialize(argc, argv))) - { - return ( FAIL ); - } - - if(GetParameters(argc, argv)) - { - Fail("Error in obtaining the parameters\n"); - } - - if(argc == 6) - { - strncat(ObjName , objectSuffix, MAX_PATH - (sizeof(ObjName) + 1) ); - } - - /* Register the start time */ - dwStartTime = (DWORD)minipal_lowres_ticks(); - processStats.relationId = RELATION_ID; - processStats.processId = USE_PROCESS_COUNT; - - _snprintf(processFileName, MAX_PATH, "%d_process_semaphore_%d_.txt", USE_PROCESS_COUNT, RELATION_ID); - pProcessFile = fopen(processFileName, "w+"); - if(pProcessFile == NULL) - { - Fail("Error in opening process File file for write for process [%d]\n", USE_PROCESS_COUNT); - } - - statisticsSize = sizeof(struct statistics); - - _snprintf(fileName, MAX_PATH, "%d_thread_semaphore_%d_.txt", USE_PROCESS_COUNT, RELATION_ID); - pFile = fopen(fileName, "w+"); - if(pFile == NULL) - { - Fail("Error in opening file for write for process [%d]\n", USE_PROCESS_COUNT); - } - // For each thread we will log operations failed (int), passed (int), total (int) - // and number of ticks (DWORD) for the operations - resultBuffer = new ResultBuffer( THREAD_COUNT, statisticsSize); - - /* Create Start Tests event */ - StartTestsEvHandle = CreateEvent( NULL, /* lpEventAttributes*/ - TRUE, /* bManualReset */ - FALSE, /* bInitialState */ - NULL); /* name of Event */ - - if( StartTestsEvHandle == NULL ) - { - Fail("Error:%d: Unexpected failure " - "to create %s Event for process count %d\n", GetLastError(), sTmpEventName, USE_PROCESS_COUNT ); - - } - - hSemaphoreHandle = CreateSemaphore( - NULL, /* lpSemaphoreAttributes */ - lInitialCount, /*lInitialCount*/ - lMaximumCount, /*lMaximumCount */ - ObjName, - 0, - 0 - ); - - - if( (hSemaphoreHandle == NULL) || (GetLastError() != ERROR_ALREADY_EXISTS) ) - { - Fail("Unable to create Semaphore handle for process id [%d], returned error [%d], expected ERROR_ALREADY_EXISTS\n", i, GetLastError()); - } - - /* We already assume that the Semaphore was created previously*/ - - for( i = 0; i < THREAD_COUNT; i++ ) - { - dwParam = (int) i; - //Create thread - hThread[i] = CreateThread( - NULL, /* no security attributes */ - 0, /* use default stack size */ - (LPTHREAD_START_ROUTINE)Run_Thread_semaphore_shared,/* thread function */ - (LPVOID)dwParam, /* argument to thread function */ - 0, /* use default creation flags */ - &threadId[i] /* returns the thread identifier*/ - ); - - if(hThread[i] == NULL) - { - Fail("Create Thread failed for %d process, and GetLastError value is %d\n", USE_PROCESS_COUNT, GetLastError()); - } - } - - if (!SetEvent(StartTestsEvHandle)) - { - Fail("Set Event for Start Tests failed for %d process, and GetLastError value is %d\n", USE_PROCESS_COUNT, GetLastError()); - } - - /* Test running */ - returnCode = WaitForMultipleObjects( THREAD_COUNT, hThread, TRUE, INFINITE); - - if( WAIT_OBJECT_0 != returnCode ) - { - Trace("Wait for Object(s) for %d process returned %d, and GetLastError value is %d\n", USE_PROCESS_COUNT, returnCode, GetLastError()); - testStatus = FAIL; - } - - processStats.operationTime = GetTimeDiff(dwStartTime); - - /* Write to a file*/ - if(pFile!= NULL) - { - for( i = 0; i < THREAD_COUNT; i++ ) - { - buffer = (struct statistics *)resultBuffer->getResultBuffer(i); - returnCode = fprintf(pFile, "%d,%d,%d,%d,%lu,%d\n", buffer->processId, buffer->operationsFailed, buffer->operationsPassed, buffer->operationsTotal, buffer->operationTime, buffer->relationId ); - } - } - fclose(pFile); - /* Logging for the test case over, clean up the handles */ - - for( i = 0; i < THREAD_COUNT; i++ ) - { - if(!CloseHandle(hThread[i]) ) - { - Trace("Error:%d: CloseHandle failed for Process [%d] hThread[%d]\n", GetLastError(), USE_PROCESS_COUNT, i); - testStatus = FAIL; - } - } - - if(!CloseHandle(StartTestsEvHandle)) - { - Trace("Error:%d: CloseHandle failed for Process [%d] StartTestsEvHandle\n", GetLastError(), USE_PROCESS_COUNT); - testStatus = FAIL; - } - - if(!CloseHandle(hSemaphoreHandle)) - { - Trace("Error:%d: CloseHandle failed for Process [%d] hSemaphoreHandle\n", GetLastError(), USE_PROCESS_COUNT); - testStatus = FAIL; - } - - PAL_Terminate(); - return PASS; -} - -void PALAPI Run_Thread_semaphore_shared (LPVOID lpParam) -{ - unsigned int i = 0; - DWORD dwWaitResult; - - int Id=(int)lpParam; - - struct statistics stats; - DWORD dwStartTime; - - stats.relationId = RELATION_ID; - stats.processId = USE_PROCESS_COUNT; - stats.operationsFailed = 0; - stats.operationsPassed = 0; - stats.operationsTotal = 0; - stats.operationTime = 0; - - dwWaitResult = WaitForSingleObject( - StartTestsEvHandle, // handle to start test handle - TIMEOUT); - - if(dwWaitResult != WAIT_OBJECT_0) - { - Fail("Error while waiting for StartTest Event@ thread %d, RC is %d, Error is %d\n", Id, dwWaitResult, GetLastError()); - } - - dwStartTime = (DWORD)minipal_lowres_ticks(); - - for( i = 0; i < REPEAT_COUNT; i++ ) - { - dwWaitResult = WaitForSingleObject( - hSemaphoreHandle, // handle to Semaphore - TIMEOUT); - - if(dwWaitResult != WAIT_OBJECT_0) - { - stats.operationsFailed += 1; - stats.operationsTotal += 1; - testStatus = FAIL; - continue; - } - if (! ReleaseSemaphore(hSemaphoreHandle, 1, NULL)) - { - // Deal with error. - stats.operationsFailed += 1; - stats.operationsTotal += 1; - // Probably need to have while true loop to attempt to release semaphore.. - testStatus = FAIL; - continue; - } - - stats.operationsTotal += 1; - stats.operationsPassed += 1; - } - - stats.operationTime = GetTimeDiff(dwStartTime); - if(resultBuffer->LogResult(Id, (char *)&stats)) - { - Fail("Error:%d: while writing to shared memory, Thread Id is[%d] and Process id is [%d]\n", GetLastError(), Id, USE_PROCESS_COUNT); - } -} diff --git a/src/coreclr/pal/tests/palsuite/debug_api/WriteProcessMemory/test1/commonconsts.h b/src/coreclr/pal/tests/palsuite/debug_api/WriteProcessMemory/test1/commonconsts.h deleted file mode 100644 index f056c478dd8342..00000000000000 --- a/src/coreclr/pal/tests/palsuite/debug_api/WriteProcessMemory/test1/commonconsts.h +++ /dev/null @@ -1,45 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -/*============================================================= -** -** Source: commonconsts.h -** -** -**============================================================*/ - -#ifndef _COMMONCONSTS_H_ -#define _COMMONCONSTS_H_ - -#include - -const int TIMEOUT = 40000; - -const WCHAR szcToHelperEvName[] = { 'T', 'o', '\0' }; -const WCHAR szcFromHelperEvName[] = { 'F', 'r', 'o', 'm', '\0' }; - -const char initialValue = '-'; -const char nextValue = '|'; -const char guardValue = '*'; -const char *commsFileName = "AddrNLen.dat"; - -/* PEDANTIC and PEDANTIC0 is a helper macro that just grumps about any - * zero return codes in a generic way. with little typing */ -#define PEDANTIC(function, parameters) \ -{ \ - if (! (function parameters) ) \ - { \ - Trace("%s: NonFatal failure of %s%s for reasons %u and %u\n", \ - __FILE__, #function, #parameters, GetLastError(), errno); \ - } \ -} -#define PEDANTIC1(function, parameters) \ -{ \ - if ( (function parameters) ) \ - { \ - Trace("%s: NonFatal failure of %s%s for reasons %u and %u\n", \ - __FILE__, #function, #parameters, GetLastError(), errno); \ - } \ -} - -#endif diff --git a/src/coreclr/pal/tests/palsuite/debug_api/WriteProcessMemory/test1/helper.cpp b/src/coreclr/pal/tests/palsuite/debug_api/WriteProcessMemory/test1/helper.cpp deleted file mode 100644 index edf8857b864b47..00000000000000 --- a/src/coreclr/pal/tests/palsuite/debug_api/WriteProcessMemory/test1/helper.cpp +++ /dev/null @@ -1,242 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -/*============================================================= -** -** Source: helper.c -** -** Purpose: This helper process sets up a several blocks of memory, -** then uses a file to tell its parent process where that memory is -** So it can do a WriteProcessMemory on it. When the parent process is done -** we check here that it was written properly. -** -** -**============================================================*/ - -#include "commonconsts.h" - -#include - -struct allhandles_t -{ - HANDLE hEvToHelper; - HANDLE hEvFromHelper; - char *valuesFileName; -}; - - -/* function: wpmDoIt - * - * This is a general WriteProcessMemory testing function that sets up - * the RAM pointed to and tells the companion process on the other end - * of the handles in 'Comms' to attempt to alter 'lenDest' bytes at - * '*pDest'. - * - * '*pBuffer'[0..'lenBuffer'] is expected to be a guard region - * surrounding the '*pDest'[0..'lenDest'] region so that this function - * can verify that only the proper bytes were altered. - */ - -int wpmDoIt(struct allhandles_t Comms, - char * pBuffer, unsigned int lenBuffer, - char * pDest, unsigned int lenDest, - const char* storageDescription) -{ - char *pCurr; - FILE *commsFile; - DWORD dwRet; - - if (pBuffer > pDest || lenDest > lenBuffer) - { - Trace("WriteProcessMemory::DoIt() test implementation: " - "(pBuffer > pDest || lenDest > lenBuffer)\n"); - return FALSE; - } - - /* set up the storage */ - memset(pBuffer, guardValue, lenBuffer); - memset(pDest, initialValue, lenDest); - - /* tell the parent what RAM to adjust */ - if(!(commsFile = fopen(Comms.valuesFileName, "w"))) - { - Trace("WriteProcessMemory: fopen of '%S' failed (%u). \n", - Comms.valuesFileName, GetLastError()); - return FALSE; - } - if (!fprintf(commsFile, "%u %u '%s'\n", - pDest, lenDest, storageDescription)) - { - Trace("WriteProcessMemory: fprintf to '%S' failed (%u). \n", - Comms.valuesFileName, GetLastError()); - return FALSE; - } - PEDANTIC1(fclose, (commsFile)); - - /* Tell the parent the data is ready for it to adjust */ - PEDANTIC(ResetEvent, (Comms.hEvToHelper)); - PEDANTIC(SetEvent, (Comms.hEvFromHelper)); - - dwRet = WaitForSingleObject(Comms.hEvToHelper, TIMEOUT); /* parent is done */ - if (dwRet != WAIT_OBJECT_0) - { - Trace("helper WaitForSingleObjectTest: WaitForSingleObject " - "failed (%u)\n", GetLastError()); - return FALSE; - } - - /* check the stuff that SHOULD have changed */ - for (pCurr = pDest; pCurr < (pDest + lenDest); pCurr++) - { - if ( *pCurr != nextValue) - { - Trace("When testing '%s': alteration test failed " - "at %u offset %u. Found '%c' instead of '%c'\n.", - storageDescription, pDest, pCurr - pDest, *pCurr, nextValue); - Trace(" 'Altered' string: '%.*s'\n",lenBuffer, pBuffer); - return FALSE; - } - } - /* check the stuff that should NOT have changed */ - for (pCurr = pBuffer; pCurr < pDest; pCurr++ ) - { - if ( *pCurr != guardValue) - { - Trace("When testing '%s': leading guard zone test failed " - "at %u offset %u. Found '%c' instead of '%c'\n.", - storageDescription, pDest, pCurr - pBuffer, *pCurr, guardValue); - Trace(" 'Altered' string: '%.*s'\n",lenBuffer, pBuffer); - return FALSE; - } - } - for (pCurr = pDest + lenDest; pCurr < (pBuffer + lenBuffer); pCurr++ ) - { - if ( *pCurr != guardValue) - { - Trace("When testing '%s': trailing guard zone test failed " - "at %u offset %u. Found '%c' instead of '%c'\n.", - storageDescription, pDest + lenDest, pCurr - pBuffer, *pCurr, guardValue); - Trace(" 'Altered' string: '%.*s'\n",lenBuffer, pBuffer); - return FALSE; - } - } - - return TRUE; -} - -PALTEST(debug_api_WriteProcessMemory_test1_paltest_writeprocessmemory_test1_helper, "debug_api/WriteProcessMemory/test1/paltest_writeprocessmemory_test1_helper") -{ - - BOOL success = TRUE; /* assume success */ - struct allhandles_t Comms = {0,0,0} ; - - /* variables to track storage to alter */ - char *pTarget = NULL; - unsigned int sizeTarget; - - if(0 != (PAL_Initialize(argc, argv))) - { - return FAIL; - } - - /* hook up with the events created by the parent */ - Comms.hEvToHelper = OpenEventW(EVENT_ALL_ACCESS, 0, szcToHelperEvName); - if (!Comms.hEvToHelper) - { - Fail("WriteProcessMemory: OpenEvent of '%S' failed (%u). " - "(the event should already exist!)\n", - szcToHelperEvName, GetLastError()); - } - Comms.hEvFromHelper = OpenEventW(EVENT_ALL_ACCESS, 0, szcFromHelperEvName); - if (!Comms.hEvToHelper) - { - Trace("WriteProcessMemory: OpenEvent of '%S' failed (%u). " - "(the event should already exist!)\n", - szcFromHelperEvName, GetLastError()); - success = FALSE; - goto EXIT; - } - Comms.valuesFileName = argv[1]; - - { - char autoAllocatedOnStack[51]; - - /* Get the parent process to write to the local stack */ - success &= wpmDoIt(Comms, autoAllocatedOnStack, - sizeof(autoAllocatedOnStack), - autoAllocatedOnStack + sizeof(int), - sizeof(autoAllocatedOnStack) - 2 * sizeof(int), - "const size array on stack with int sized guards"); - } - - /* Get the parent process to write to stuff on the heap */ - sizeTarget = 2 * sizeof(int) + 23 ; /* 23 is just a random prime > 16 */ - if (!(pTarget = (char*)malloc(sizeTarget))) - { - Trace("WriteProcessMemory helper: unable to allocate '%s'->%d bytes of memory" - "(%u).\n", - argv[3], sizeTarget, GetLastError()); - success = FALSE; - goto EXIT; - - } - success &= wpmDoIt(Comms, pTarget, sizeTarget, - pTarget + sizeof(int), - sizeTarget - 2 * sizeof(int), - "array on heap with int sized guards"); - - /* just to be nice try something 16 - 2 * sizeof(int) bytes long */ - { - char autoAllocatedOnStack[16]; - - /* Get the parent process to write to the local stack */ - success &= wpmDoIt(Comms, autoAllocatedOnStack, - sizeof(autoAllocatedOnStack), - autoAllocatedOnStack + sizeof(int), - sizeof(autoAllocatedOnStack) - 2 * sizeof(int), - "another 16 byte array on stack with int sized guards inside"); - } - - /* NOTE: Don't try 0 bytes long. Win32 WriteProcessMemory claims - * it writes 8 bytes in that case! */ - - /* and 1 byte long... */ - { - char autoAllocatedOnStack[1+ 2 * sizeof(int)]; - - /* Get the parent process to write to the local stack */ - success &= wpmDoIt(Comms, autoAllocatedOnStack, - sizeof(autoAllocatedOnStack), - autoAllocatedOnStack + sizeof(int), - 1, - "no bytes with int sized guards outside on stack"); - } - - -EXIT: - /* Tell the parent that we are done */ - if (!DeleteFile(Comms.valuesFileName)) - { - Trace("helper: DeleteFile failed so parent (test1) is unlikely " - "to exit cleanly\n"); - } - PEDANTIC(ResetEvent, (Comms.hEvToHelper)); - if (!SetEvent(Comms.hEvFromHelper)) - { - Trace("helper: SetEvent failed so parent (test1) is unlikely " - "to exit cleanly\n"); - } - - free(pTarget); - PEDANTIC(CloseHandle, (Comms.hEvToHelper)); - PEDANTIC(CloseHandle, (Comms.hEvFromHelper)); - - if (!success) - { - Fail(""); - } - - PAL_TerminateEx(success ? PASS : FAIL); - - return success ? PASS : FAIL; -} diff --git a/src/coreclr/pal/tests/palsuite/debug_api/WriteProcessMemory/test1/test1.cpp b/src/coreclr/pal/tests/palsuite/debug_api/WriteProcessMemory/test1/test1.cpp deleted file mode 100644 index f64291b7ec8584..00000000000000 --- a/src/coreclr/pal/tests/palsuite/debug_api/WriteProcessMemory/test1/test1.cpp +++ /dev/null @@ -1,188 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -/*============================================================= -** -** Source: test1.c -** -** Purpose: Create a child process and some events for communications with it. -** When the child gets back to us with a memory location and a length, -** Call WriteProcessMemory on this location and check to see that it -** writes successfully. -** -** -**============================================================*/ - -#define UNICODE - -#include "commonconsts.h" - -#include - -PALTEST(debug_api_WriteProcessMemory_test1_paltest_writeprocessmemory_test1, "debug_api/WriteProcessMemory/test1/paltest_writeprocessmemory_test1") -{ - - PROCESS_INFORMATION pi; - STARTUPINFO si; - HANDLE hEvToHelper; - HANDLE hEvFromHelper; - DWORD dwExitCode; - - - DWORD dwRet; - char cmdComposeBuf[MAX_PATH]; - PWCHAR uniString; - - if(0 != (PAL_Initialize(argc, argv))) - { - return FAIL; - } - - /* Create the signals we need for cross process communication */ - hEvToHelper = CreateEvent(NULL, TRUE, FALSE, szcToHelperEvName); - if (!hEvToHelper) - { - Fail("WriteProcessMemory: CreateEvent of '%S' failed. " - "GetLastError() returned %d.\n", szcToHelperEvName, - GetLastError()); - } - if (GetLastError() == ERROR_ALREADY_EXISTS) - { - Fail("WriteProcessMemory: CreateEvent of '%S' failed. " - "(already exists!)\n", szcToHelperEvName); - } - hEvFromHelper = CreateEvent(NULL, TRUE, FALSE, szcFromHelperEvName); - if (!hEvToHelper) - { - Fail("WriteProcessMemory: CreateEvent of '%S' failed. " - "GetLastError() returned %d.\n", szcFromHelperEvName, - GetLastError()); - } - if (GetLastError() == ERROR_ALREADY_EXISTS) - { - Fail("WriteProcessMemory: CreateEvent of '%S' failed. " - "(already exists!)\n", szcFromHelperEvName); - } - ResetEvent(hEvFromHelper); - ResetEvent(hEvToHelper); - - if (!sprintf_s(cmdComposeBuf, ARRAY_SIZE(cmdComposeBuf), "helper %s", commsFileName)) - { - Fail("Could not convert command line\n"); - } - uniString = convert(cmdComposeBuf); - - ZeroMemory( &si, sizeof(si) ); - si.cb = sizeof(si); - ZeroMemory( &pi, sizeof(pi) ); - - /* Create a new process. This is the process that will ask for - * memory munging */ - if(!CreateProcess( NULL, uniString, NULL, NULL, - FALSE, 0, NULL, NULL, &si, &pi)) - { - Trace("ERROR: CreateProcess failed to load executable '%S'. " - "GetLastError() returned %u.\n", - uniString, GetLastError()); - free(uniString); - Fail(""); - } - free(uniString); - - while(1) - { - FILE *commsFile; - char* pSrcMemory; - char* pDestMemory; - int Count; - SIZE_T wpmCount; - char incomingCMDBuffer[MAX_PATH + 1]; - - /* wait until the helper tells us that it has given us - * something to do */ - dwRet = WaitForSingleObject(hEvFromHelper, TIMEOUT); - if (dwRet != WAIT_OBJECT_0) - { - Trace("test1 WaitForSingleObjectTest: WaitForSingleObject " - "failed (%u)\n", GetLastError()); - break; /* no more work incoming */ - } - - /* get the parameters to test WriteProcessMemory with */ - if (!(commsFile = fopen(commsFileName, "r"))) - { - /* no file means there is no more work */ - break; - } - if ( NULL == fgets(incomingCMDBuffer, MAX_PATH, commsFile)) - { - Fail ("unable to read from communication file %s " - "for reasons %u & %u\n", - errno, GetLastError()); - } - PEDANTIC1(fclose,(commsFile)); - sscanf(incomingCMDBuffer, "%u %u", &pDestMemory, &Count); - if (argc > 1) - { - Trace("Preparing to write to %u bytes @ %u ('%s')\n", - Count, pDestMemory, incomingCMDBuffer); - } - - /* compose some data to write to the client process */ - if (!(pSrcMemory = (char*)malloc(Count))) - { - Trace("could not dynamically allocate memory to copy from " - "for reasons %u & %u\n", - errno, GetLastError()); - goto doneIteration; - } - memset(pSrcMemory, nextValue, Count); - - /* do the work */ - dwRet = WriteProcessMemory(pi.hProcess, - pDestMemory, - pSrcMemory, - Count, - &wpmCount); - if (!dwRet) - { - Trace("%s: Problem: on a write to %u bytes @ %u ('%s')\n", - argv[0], Count, pDestMemory, incomingCMDBuffer); - Trace("test1 WriteProcessMemory returned a%u(!=0) (GLE=%u)\n", - GetLastError()); - } - if(Count != wpmCount) - { - Trace("%s: Problem: on a write to %u bytes @ %u ('%s')\n", - argv[0], Count, pDestMemory, incomingCMDBuffer); - Trace("The number of bytes written should have been " - "%u, but was reported as %u.\n", Count, wpmCount); - } - free(pSrcMemory); - - doneIteration: - PEDANTIC(ResetEvent, (hEvFromHelper)); - PEDANTIC(SetEvent, (hEvToHelper)); - } - - /* wait for the child process to complete */ - WaitForSingleObject ( pi.hProcess, TIMEOUT ); - /* this may return a failure code on a success path */ - - /* check the exit code from the process */ - if( ! GetExitCodeProcess( pi.hProcess, &dwExitCode ) ) - { - Trace( "GetExitCodeProcess call failed with error code %u\n", - GetLastError() ); - dwExitCode = FAIL; - } - - - PEDANTIC(CloseHandle, (hEvToHelper)); - PEDANTIC(CloseHandle, (hEvFromHelper)); - PEDANTIC(CloseHandle, (pi.hThread)); - PEDANTIC(CloseHandle, (pi.hProcess)); - - PAL_TerminateEx(dwExitCode); - return dwExitCode; -} diff --git a/src/coreclr/pal/tests/palsuite/debug_api/WriteProcessMemory/test3/commonconsts.h b/src/coreclr/pal/tests/palsuite/debug_api/WriteProcessMemory/test3/commonconsts.h deleted file mode 100644 index b055ddf07ade03..00000000000000 --- a/src/coreclr/pal/tests/palsuite/debug_api/WriteProcessMemory/test3/commonconsts.h +++ /dev/null @@ -1,49 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -/*============================================================= -** -** Header: commonconsts.h -** -** -==============================================================*/ - -#ifndef _COMMONCONSTS_H_ -#define _COMMONCONSTS_H_ - -#include - -const int TIMEOUT = 40000; - -const WCHAR szcToHelperEvName[] = { 'T', 'o', '\0' }; -const WCHAR szcFromHelperEvName[] = { 'F', 'r', 'o', 'm', '\0' }; - -const char initialValue = '-'; -const char nextValue = '|'; -const char guardValue = '*'; -const char *commsFileName = "AddrNLen.dat"; - -/* PEDANTIC and PEDANTIC0 is a helper macro that just grumps about any - * zero return codes in a generic way. with little typing */ -#define PEDANTIC(function, parameters) \ -{ \ - unsigned int retval = (function parameters); \ - if ( !retval ) \ - { \ - Trace("%s: NonFatal failure of %s%s (returned %u) " \ - "for reasons %u and %u.\n", \ - __FILE__, #function, #parameters, retval, GetLastError(), errno); \ - } \ -} -#define PEDANTIC1(function, parameters) \ -{ \ - unsigned int retval = (function parameters); \ - if ( retval ) \ - { \ - Trace("%s: NonFatal failure of %s%s (returned %u) " \ - "for reasons %u and %u\n", \ - __FILE__, #function, #parameters, retval, GetLastError(), errno); \ - } \ -} - -#endif diff --git a/src/coreclr/pal/tests/palsuite/debug_api/WriteProcessMemory/test3/helper.cpp b/src/coreclr/pal/tests/palsuite/debug_api/WriteProcessMemory/test3/helper.cpp deleted file mode 100644 index 3479bc39f5323b..00000000000000 --- a/src/coreclr/pal/tests/palsuite/debug_api/WriteProcessMemory/test3/helper.cpp +++ /dev/null @@ -1,255 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -/*============================================================= -** -** Source: helper.c - -** -==============================================================*/ - - -/* -** -** Purpose: This helper process sets up a several blocks of memory -** that should be unwritable from the parent process, then uses a file -** to tell its parent process where that memory is so it can attempt a -** WriteProcessMemory on it. When the parent process is done we check -** here that it was (properly) unable to change the contents of the -** memory. -*/ - -#include "commonconsts.h" - -#include - -struct allhandles_t -{ - HANDLE hEvToHelper; - HANDLE hEvFromHelper; - char *valuesFileName; -}; - - -/* function: wpmVerifyCant - * - * This is a general WriteProcessMemory testing function that sets up - * the RAM pointed to and tells the companion process on the other end - * of the handles in 'Comms' to attempt to alter 'lenDest' bytes at - * '*pDest'. - * - * However, the memory at pDest[0..lenDest] is expected to be unwritable by - * the companion process. The companion is expects this. This function - * verifies that no bytes were affected - */ - -int wpmVerifyCant(struct allhandles_t Comms, - char * pDest, unsigned int lenDest, - unsigned int lenLegitDest, - DWORD dwExpectedErrorCode, - const char* storageDescription) -{ - char *pCurr; - FILE *commsFile; - DWORD dwRet; - - unsigned int lenSafe = min(lenDest, lenLegitDest); - - PAL_TRY - { - memset(pDest, initialValue, lenSafe); - } - PAL_EXCEPT_EX (setup, EXCEPTION_EXECUTE_HANDLER) - { - Trace("WriteProcessMemory: bug in test values for '%s' (%p, %u, %u), " - "the initial memset threw an exception.\n", - storageDescription, pDest, lenDest, lenSafe); - } - PAL_ENDTRY; - - /* tell the parent what RAM to attempt to adjust */ - if(!(commsFile = fopen(Comms.valuesFileName, "w"))) - { - Trace("WriteProcessMemory: fopen of '%S' failed (%u). \n", - Comms.valuesFileName, GetLastError()); - return FALSE; - } - if (!fprintf(commsFile, "%u %u %u '%s'\n", - pDest, lenDest, dwExpectedErrorCode, storageDescription)) - { - Trace("WriteProcessMemory: fprintf to '%S' failed (%u). \n", - Comms.valuesFileName, GetLastError()); - return FALSE; - } - PEDANTIC1(fclose, (commsFile)); - - /* Tell the parent the data is ready for it to adjust */ - PEDANTIC(ResetEvent, (Comms.hEvToHelper)); - PEDANTIC(SetEvent, (Comms.hEvFromHelper)); - - dwRet = WaitForSingleObject(Comms.hEvToHelper, TIMEOUT); - if (dwRet != WAIT_OBJECT_0) - { - Trace("helper WaitForSingleObjectTest: WaitForSingleObject " - "failed (%u)\n", GetLastError()); - return FALSE; - } - - PAL_TRY - { - /* check the stuff (as much as we can) that should NOT have changed */ - for (pCurr = pDest; pCurr < (pDest + lenSafe); pCurr++ ) - { - if ( *pCurr != initialValue) - { - Trace("When testing '%s': real memory values preservation failed " - "at %u offset %u. Found '%c' instead of '%c'\n.", - storageDescription, pDest, pCurr - pDest, - *pCurr, initialValue); - return FALSE; - } - } - } - PAL_EXCEPT_EX (testing, EXCEPTION_EXECUTE_HANDLER) - { - Trace("WriteProcessMemory: bug in test values for '%s' (%p, %u, %u), " - "the verification pass threw an exception.\n", - storageDescription, pDest, lenDest, lenSafe); - } - PAL_ENDTRY; - - return TRUE; -} - -PALTEST(debug_api_WriteProcessMemory_test3_paltest_writeprocessmemory_test3_helper, "debug_api/WriteProcessMemory/test3/paltest_writeprocessmemory_test3_helper") -{ - BOOL success = TRUE; /* assume success */ - struct allhandles_t Comms = {0,0,0} ; - - SYSTEM_INFO sysinfo; - - char* Memory; - - if(0 != (PAL_Initialize(argc, argv))) - { - return FAIL; - } - - /* hook up with the events created by the parent */ - Comms.hEvToHelper = OpenEventW(EVENT_ALL_ACCESS, 0, szcToHelperEvName); - if (!Comms.hEvToHelper) - { - Fail("WriteProcessMemory: OpenEvent of '%S' failed (%u). " - "(the event should already exist!)\n", - szcToHelperEvName, GetLastError()); - success = FALSE; - goto EXIT; - } - Comms.hEvFromHelper = OpenEventW(EVENT_ALL_ACCESS, 0, szcFromHelperEvName); - if (!Comms.hEvToHelper) - { - Trace("WriteProcessMemory: OpenEvent of '%S' failed (%u). " - "(the event should already exist!)\n", - szcFromHelperEvName, GetLastError()); - success = FALSE; - goto EXIT; - } - Comms.valuesFileName = argv[1]; - - /* test setup */ - GetSystemInfo(&sysinfo); - - { - unsigned int allocSize = sysinfo.dwPageSize * 2; - unsigned int writeLen = allocSize * 2; - - /* First test: overrun the allocated memory */ - Memory = (char*)VirtualAlloc(NULL, allocSize, - MEM_COMMIT, PAGE_READWRITE); - - if(Memory == NULL) - { - Fail("ERROR: Attempted to commit two pages, but the " - " VirtualAlloc call failed. " - "GetLastError() returned %u.\n",GetLastError()); - } - success &= wpmVerifyCant(Comms, Memory, writeLen, allocSize, - ERROR_INVALID_ADDRESS, - "should not write beyond committed allocation"); - - PEDANTIC1(VirtualFree, (Memory, allocSize, - MEM_DECOMMIT | MEM_RELEASE)); - } - - { - /* Allocate the memory as readonly */ - unsigned int allocSize = sysinfo.dwPageSize * 2; - unsigned int writeLen = allocSize; - - Memory = (char*)VirtualAlloc(NULL, allocSize, - MEM_COMMIT, PAGE_READONLY); - - if(Memory == NULL) - { - Fail("ERROR: Attempted to commit two pages readonly, but the " - " VirtualAlloc call failed. " - "GetLastError() returned %u.\n",GetLastError()); - } - success &= wpmVerifyCant(Comms, Memory, writeLen, 0, - ERROR_NOACCESS, - "should not write in READONLY allocation"); - - PEDANTIC1(VirtualFree, (Memory, allocSize, - MEM_DECOMMIT | MEM_RELEASE)); - } - - - { - /* attempt to write to memory that is not committed yet */ - unsigned int allocSize = sysinfo.dwPageSize * 2; - unsigned int writeLen = allocSize; - - Memory = (char*)VirtualAlloc(NULL, allocSize, - MEM_RESERVE, PAGE_NOACCESS); - - if(Memory == NULL) - { - Fail("ERROR: Attempted to reserve two pages, but the " - " VirtualAlloc call failed. " - "GetLastError() returned %u.\n",GetLastError()); - } - success &= wpmVerifyCant(Comms, Memory, writeLen, 0, - ERROR_INVALID_ADDRESS, - "should not write in memory that is" - " RESERVED but not COMMITTED"); - - PEDANTIC1(VirtualFree, (Memory, allocSize, MEM_RELEASE)); - } - - -EXIT: - /* Tell the parent that we are done */ - if (!DeleteFile(Comms.valuesFileName)) - { - Trace("helper: DeleteFile failed so parent (test1) is unlikely " - "to exit cleanly\n"); - } - PEDANTIC(ResetEvent, (Comms.hEvToHelper)); - if (!SetEvent(Comms.hEvFromHelper)) - { - Trace("helper: SetEvent failed so parent (test1) is unlikely " - "to exit cleanly\n"); - } - - PEDANTIC(CloseHandle, (Comms.hEvToHelper)); - PEDANTIC(CloseHandle, (Comms.hEvFromHelper)); - - if (!success) - { - Fail(""); - } - - PAL_TerminateEx(success ? PASS : FAIL); - - return success ? PASS : FAIL; -} diff --git a/src/coreclr/pal/tests/palsuite/debug_api/WriteProcessMemory/test3/test3.cpp b/src/coreclr/pal/tests/palsuite/debug_api/WriteProcessMemory/test3/test3.cpp deleted file mode 100644 index 1d6cb240dfda90..00000000000000 --- a/src/coreclr/pal/tests/palsuite/debug_api/WriteProcessMemory/test3/test3.cpp +++ /dev/null @@ -1,204 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -/*============================================================= -** -** Source: test3.c -** -** Purpose: Create a child process and debug it. When the child -** raises an exception, it sends back a memory location. Call -** WriteProcessMemory on the memory location, but attempt to write -** more than the memory allows. This should cause an error and the -** data should be unchanged. -** -** -==============================================================*/ - -#define UNICODE - -#include "commonconsts.h" - -#include - -PALTEST(debug_api_WriteProcessMemory_test3_paltest_writeprocessmemory_test3, "debug_api/WriteProcessMemory/test3/paltest_writeprocessmemory_test3") -{ - - PROCESS_INFORMATION pi; - STARTUPINFO si; - HANDLE hEvToHelper; - HANDLE hEvFromHelper; - DWORD dwExitCode; - - - DWORD dwRet; - BOOL success = TRUE; /* assume success */ - char cmdComposeBuf[MAX_PATH]; - PWCHAR uniString; - - if(0 != (PAL_Initialize(argc, argv))) - { - return FAIL; - } - - /* Create the signals we need for cross process communication */ - hEvToHelper = CreateEvent(NULL, TRUE, FALSE, szcToHelperEvName); - if (!hEvToHelper) - { - Fail("WriteProcessMemory: CreateEvent of '%S' failed. " - "GetLastError() returned %u.\n", szcToHelperEvName, - GetLastError()); - } - if (GetLastError() == ERROR_ALREADY_EXISTS) - { - Fail("WriteProcessMemory: CreateEvent of '%S' failed. " - "(already exists!)\n", szcToHelperEvName); - } - hEvFromHelper = CreateEvent(NULL, TRUE, FALSE, szcFromHelperEvName); - if (!hEvToHelper) - { - Fail("WriteProcessMemory: CreateEvent of '%S' failed. " - "GetLastError() returned %u.\n", szcFromHelperEvName, - GetLastError()); - } - if (GetLastError() == ERROR_ALREADY_EXISTS) - { - Fail("WriteProcessMemory: CreateEvent of '%S' failed. " - "(already exists!)\n", szcFromHelperEvName); - } - - if (!sprintf_s(cmdComposeBuf, ARRAY_SIZE(cmdComposeBuf), "helper %s", commsFileName)) - { - Fail("Could not convert command line\n"); - } - uniString = convert(cmdComposeBuf); - - ZeroMemory( &si, sizeof(si) ); - si.cb = sizeof(si); - ZeroMemory( &pi, sizeof(pi) ); - - /* Create a new process. This is the process that will ask for - * memory munging */ - if(!CreateProcess( NULL, uniString, NULL, NULL, - FALSE, 0, NULL, NULL, &si, &pi)) - { - Trace("ERROR: CreateProcess failed to load executable '%S'. " - "GetLastError() returned %u.\n", - uniString, GetLastError()); - free(uniString); - Fail(""); - } - free(uniString); - - while(1) - { - FILE *commsFile; - char* pSrcMemory; - char* pDestMemory; - int Count; - SIZE_T wpmCount; - DWORD dwExpectedErrorCode; - - char incomingCMDBuffer[MAX_PATH + 1]; - - /* wait until the helper tells us that it has given us - * something to do */ - dwRet = WaitForSingleObject(hEvFromHelper, TIMEOUT); - if (dwRet != WAIT_OBJECT_0) - { - Trace("test1 WaitForSingleObjectTest: WaitForSingleObject " - "failed (%u)\n", GetLastError()); - break; /* no more work incoming */ - } - - /* get the parameters to test WriteProcessMemory with */ - if (!(commsFile = fopen(commsFileName, "r"))) - { - /* no file means there is no more work */ - break; - } - if ( NULL == fgets(incomingCMDBuffer, MAX_PATH, commsFile)) - { - Trace ("unable to read from communication file %s " - "for reasons %u & %u\n", - errno, GetLastError()); - success = FALSE; - PEDANTIC1(fclose,(commsFile)); - /* it's not worth continuing this trial */ - goto doneIteration; - } - PEDANTIC1(fclose,(commsFile)); - sscanf(incomingCMDBuffer, "%u %u %u", - &pDestMemory, &Count, &dwExpectedErrorCode); - if (argc > 1) - { - Trace("Preparing to write to %u bytes @ %u ('%s')\n", - Count, pDestMemory, incomingCMDBuffer); - } - - /* compose some data to write to the client process */ - if (!(pSrcMemory = (char*)malloc(Count))) - { - Trace("could not dynamically allocate memory to copy from " - "for reasons %u & %u\n", - errno, GetLastError()); - success = FALSE; - goto doneIteration; - } - memset(pSrcMemory, nextValue, Count); - - /* do the work */ - dwRet = WriteProcessMemory(pi.hProcess, - pDestMemory, - pSrcMemory, - Count, - &wpmCount); - - if(dwRet != 0) - { - Trace("ERROR: Situation: '%s', return code: %u, bytes 'written': %u\n", - incomingCMDBuffer, dwRet, wpmCount); - Trace("ERROR: WriteProcessMemory did not fail as it should, as " - "it attempted to write to a range of memory which was " - "not completely accessible.\n"); - success = FALSE; - } - - if(GetLastError() != dwExpectedErrorCode) - { - Trace("ERROR: GetLastError() should have returned " - "%u , but instead it returned %u.\n", - dwExpectedErrorCode, GetLastError()); - success = FALSE; - } - free(pSrcMemory); - - doneIteration: - PEDANTIC(ResetEvent, (hEvFromHelper)); - PEDANTIC(SetEvent, (hEvToHelper)); - } - - - /* wait for the child process to complete */ - WaitForSingleObject ( pi.hProcess, TIMEOUT ); - /* this may return a failure code on a success path */ - - /* check the exit code from the process */ - if( ! GetExitCodeProcess( pi.hProcess, &dwExitCode ) ) - { - Trace( "GetExitCodeProcess call failed with error code %u\n", - GetLastError() ); - dwExitCode = FAIL; - } - if(!success) - { - dwExitCode = FAIL; - } - - PEDANTIC(CloseHandle, (hEvToHelper)); - PEDANTIC(CloseHandle, (hEvFromHelper)); - PEDANTIC(CloseHandle, (pi.hThread)); - PEDANTIC(CloseHandle, (pi.hProcess)); - - PAL_TerminateEx(dwExitCode); - return dwExitCode; -} diff --git a/src/coreclr/pal/tests/palsuite/debug_api/WriteProcessMemory/test4/helper.cpp b/src/coreclr/pal/tests/palsuite/debug_api/WriteProcessMemory/test4/helper.cpp deleted file mode 100644 index 42ee9125bc79b2..00000000000000 --- a/src/coreclr/pal/tests/palsuite/debug_api/WriteProcessMemory/test4/helper.cpp +++ /dev/null @@ -1,66 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -/*============================================================= -** -** Source: helper.c -** -** Purpose: This helper process sets up a block of memory, then -** raises an exception to pass that memory location back to the -** parent process. When the parent process is done calling WriteProcessMemory -** we check here that it was written properly. -** -** -**============================================================*/ - -#include -const int MY_EXCEPTION=999; - -PALTEST(debug_api_WriteProcessMemory_test4_paltest_writeprocessmemory_test4_helper, "debug_api/WriteProcessMemory/test4/paltest_writeprocessmemory_test4_helper") -{ - - char* Memory; - char* TheArray[1]; - int i; - - if(0 != (PAL_Initialize(argc, argv))) - { - return FAIL; - } - - Memory = (char*)VirtualAlloc(NULL, 4096, MEM_COMMIT, PAGE_READONLY); - - if(Memory == NULL) - { - Fail("ERROR: Attempted to allocate two pages, but the VirtualAlloc " - "call failed. GetLastError() returned %d.\n",GetLastError()); - } - - - TheArray[0] = Memory; - - - /* Need to sleep for a couple seconds. Otherwise this process - won't be being debugged when the first exception is raised. - */ - Sleep(4000); - - RaiseException(MY_EXCEPTION, 0, 1, (ULONG_PTR*)TheArray); - - for(i=0; i<4096; ++i) - { - if(Memory[i] != '\0') - { - Fail("ERROR: The memory should be unchanged after the " - "invalid call to WriteProcessMemory, but the char " - "at index %d has changed.\n",i); - } - } - - - - - - PAL_Terminate(); - return PASS; -} diff --git a/src/coreclr/pal/tests/palsuite/debug_api/WriteProcessMemory/test4/test4.cpp b/src/coreclr/pal/tests/palsuite/debug_api/WriteProcessMemory/test4/test4.cpp deleted file mode 100644 index 255d96c832bfec..00000000000000 --- a/src/coreclr/pal/tests/palsuite/debug_api/WriteProcessMemory/test4/test4.cpp +++ /dev/null @@ -1,123 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -/*============================================================= -** -** Source: test4.c -** -** Purpose: Create a child process and debug it. When the child -** raises an exception, it sends back a memory location. Call -** WriteProcessMemory on a restricted memory location and ensure that -** it fails. -** -** -**============================================================*/ - -#include -const int MY_EXCEPTION=999; - -PALTEST(debug_api_WriteProcessMemory_test4_paltest_writeprocessmemory_test4, "debug_api/WriteProcessMemory/test4/paltest_writeprocessmemory_test4") -{ - - PROCESS_INFORMATION pi; - STARTUPINFO si; - DEBUG_EVENT DebugEv; - DWORD dwContinueStatus = DBG_CONTINUE; - int Count, ret; - char* DataBuffer[4096]; - char* Memory; - - if(0 != (PAL_Initialize(argc, argv))) - { - return FAIL; - } - - ZeroMemory( &si, sizeof(si) ); - si.cb = sizeof(si); - ZeroMemory( &pi, sizeof(pi) ); - - memset(DataBuffer, 'z', 4096); - - /* Create a new process. This is the process to be Debugged */ - if(!CreateProcess( NULL, "helper", NULL, NULL, - FALSE, 0, NULL, NULL, &si, &pi)) - { - Fail("ERROR: CreateProcess failed to load executable 'helper'. " - "GetLastError() returned %d.\n",GetLastError()); - } - - /* Call DebugActiveProcess, because the process wasn't created as a - debug process. - */ - if(DebugActiveProcess(pi.dwProcessId) == 0) - { - Fail("ERROR: Failed calling DebugActiveProcess on the process " - "which was created to debug. GetLastError() returned %d.\n", - GetLastError()); - } - - - /* Call WaitForDebugEvent, which will wait until the helper process - raises an exception. - */ - - while(1) - { - if(WaitForDebugEvent(&DebugEv, INFINITE) == 0) - { - Fail("ERROR: WaitForDebugEvent returned 0, indicating failure. " - "GetLastError() returned %d.\n",GetLastError()); - } - - /* We're waiting for the helper process to send this exception. - When it does, we call WriteProcess. If it gets called more than - once, it is ignored. - */ - - if(DebugEv.u.Exception.ExceptionRecord.ExceptionCode == MY_EXCEPTION) - { - - Memory = (LPVOID) - DebugEv.u.Exception.ExceptionRecord.ExceptionInformation[0]; - - /* Write to this memory which we have no access to. */ - - ret = WriteProcessMemory(pi.hProcess, - Memory, - DataBuffer, - 4096, - &Count); - - if(ret != 0) - { - Fail("ERROR: WriteProcessMemory should have failed, as " - "it attempted to write to a range of memory which was " - "not accessible.\n"); - } - - if(GetLastError() != ERROR_NOACCESS) - { - Fail("ERROR: GetLastError() should have returned " - "ERROR_NOACCESS , but instead it returned " - "%d.\n",GetLastError()); - } - } - - if(DebugEv.dwDebugEventCode == EXIT_PROCESS_DEBUG_EVENT) - { - break; - } - - if(ContinueDebugEvent(DebugEv.dwProcessId, - DebugEv.dwThreadId, dwContinueStatus) == 0) - { - Fail("ERROR: ContinueDebugEvent failed to continue the thread " - "which had a debug event. GetLastError() returned %d.\n", - GetLastError()); - } - } - - - PAL_Terminate(); - return PASS; -} diff --git a/src/coreclr/pal/tests/palsuite/paltestlist.txt b/src/coreclr/pal/tests/palsuite/paltestlist.txt index 650e28f0e2d00f..e6d11faf5b0244 100644 --- a/src/coreclr/pal/tests/palsuite/paltestlist.txt +++ b/src/coreclr/pal/tests/palsuite/paltestlist.txt @@ -267,7 +267,6 @@ threading/SetEvent/test3/paltest_setevent_test3 threading/SetEvent/test4/paltest_setevent_test4 threading/SwitchToThread/test1/paltest_switchtothread_test1 threading/ThreadPriority/test1/paltest_threadpriority_test1 -threading/WaitForMultipleObjects/test1/paltest_waitformultipleobjects_test1 threading/WaitForMultipleObjectsEx/test1/paltest_waitformultipleobjectsex_test1 threading/WaitForSingleObject/test1/paltest_waitforsingleobject_test1 threading/WaitForSingleObject/WFSOSemaphoreTest/paltest_waitforsingleobject_wfsosemaphoretest diff --git a/src/coreclr/pal/tests/palsuite/paltestlist_to_be_reviewed.txt b/src/coreclr/pal/tests/palsuite/paltestlist_to_be_reviewed.txt index e890e3cd5ee083..9a4bd36028a636 100644 --- a/src/coreclr/pal/tests/palsuite/paltestlist_to_be_reviewed.txt +++ b/src/coreclr/pal/tests/palsuite/paltestlist_to_be_reviewed.txt @@ -4,9 +4,6 @@ They should either be fixed or deleted if they are no longer applicable. c_runtime/iswprint/test1/paltest_iswprint_test1 debug_api/DebugBreak/test1/paltest_debugbreak_test1 debug_api/OutputDebugStringA/test1/paltest_outputdebugstringa_test1 -debug_api/WriteProcessMemory/test1/paltest_writeprocessmemory_test1 -debug_api/WriteProcessMemory/test3/paltest_writeprocessmemory_test3 -debug_api/WriteProcessMemory/test4/paltest_writeprocessmemory_test4 exception_handling/pal_except/test1/paltest_pal_except_test1 exception_handling/pal_except/test2/paltest_pal_except_test2 exception_handling/pal_except/test3/paltest_pal_except_test3 @@ -78,12 +75,10 @@ threading/DuplicateHandle/test9/paltest_duplicatehandle_test9 threading/ExitThread/test2/paltest_exitthread_test2 threading/GetCurrentProcess/test1/paltest_getcurrentprocess_test1 threading/GetCurrentThreadId/test1/paltest_getcurrentthreadid_test1 -threading/GetExitCodeProcess/test1/paltest_getexitcodeprocess_test1 threading/OpenEventW/test1/paltest_openeventw_test1 threading/OpenEventW/test2/paltest_openeventw_test2 threading/OpenEventW/test3/paltest_openeventw_test3 threading/OpenEventW/test5/paltest_openeventw_test5 -threading/OpenProcess/test1/paltest_openprocess_test1 threading/Sleep/test1/paltest_sleep_test1 threading/SleepEx/test1/paltest_sleepex_test1 threading/TerminateProcess/test1/paltest_terminateprocess_test1 diff --git a/src/coreclr/pal/tests/palsuite/threading/SwitchToThread/test1/test1.cpp b/src/coreclr/pal/tests/palsuite/threading/SwitchToThread/test1/test1.cpp index eb268aad2f8274..4bfb886ebf48ca 100644 --- a/src/coreclr/pal/tests/palsuite/threading/SwitchToThread/test1/test1.cpp +++ b/src/coreclr/pal/tests/palsuite/threading/SwitchToThread/test1/test1.cpp @@ -68,7 +68,7 @@ PALTEST(threading_SwitchToThread_test1_paltest_switchtothread_test1, "threading/ } - returnCode = WaitForMultipleObjects(THREAD_COUNT, hThread, TRUE, TIMEOUT); + returnCode = WaitForMultipleObjectsEx(THREAD_COUNT, hThread, TRUE, TIMEOUT, FALSE); if( WAIT_OBJECT_0 != returnCode ) { Trace("Wait for Object(s) returned %d, expected value is %d, and GetLastError value is %d\n", returnCode, WAIT_OBJECT_0, GetLastError()); diff --git a/src/coreclr/pal/tests/palsuite/threading/WaitForMultipleObjects/test1/test1.cpp b/src/coreclr/pal/tests/palsuite/threading/WaitForMultipleObjects/test1/test1.cpp deleted file mode 100644 index ae9c972d3e0b0e..00000000000000 --- a/src/coreclr/pal/tests/palsuite/threading/WaitForMultipleObjects/test1/test1.cpp +++ /dev/null @@ -1,223 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -/*============================================================ -** -** Source: test1.c -** -** Purpose: Test for WaitForMultipleObjects. Call the function -** on an array of 4 events, and ensure that it returns correct -** results when we do so. -** -** -**=========================================================*/ - -#include - -/* Number of events in array */ -#define MAX_EVENTS 4 - -BOOL WaitForMultipleObjectsTest() -{ - BOOL bRet = TRUE; - DWORD dwRet = 0; - - DWORD i = 0, j = 0; - - LPSECURITY_ATTRIBUTES lpEventAttributes = NULL; - BOOL bManualReset = TRUE; - BOOL bInitialState = TRUE; - - HANDLE hEvent[MAX_EVENTS]; - - /* Run through this for loop and create 4 events */ - for (i = 0; i < MAX_EVENTS; i++) - { - hEvent[i] = CreateEvent( lpEventAttributes, - bManualReset, bInitialState, NULL); - - if (hEvent[i] == INVALID_HANDLE_VALUE) - { - Trace("WaitForMultipleObjectsTest:CreateEvent %u failed (%x)\n", i, GetLastError()); - bRet = FALSE; - break; - } - - /* Set the current event */ - bRet = SetEvent(hEvent[i]); - - if (!bRet) - { - Trace("WaitForMultipleObjectsTest:SetEvent %u failed (%x)\n", i, GetLastError()); - bRet = FALSE; - break; - } - - /* Ensure that this returns the correct value */ - dwRet = WaitForSingleObject(hEvent[i],0); - - if (dwRet != WAIT_OBJECT_0) - { - Trace("WaitForMultipleObjectsTest:WaitForSingleObject %u failed (%x)\n", i, GetLastError()); - bRet = FALSE; - break; - } - - /* Reset the event, and again ensure that the return value of - WaitForSingle is correct. - */ - bRet = ResetEvent(hEvent[i]); - - if (!bRet) - { - Trace("WaitForMultipleObjectsTest:ResetEvent %u failed (%x)\n", i, GetLastError()); - bRet = FALSE; - break; - } - - dwRet = WaitForSingleObject(hEvent[i],0); - - if (dwRet != WAIT_TIMEOUT) - { - Trace("WaitForMultipleObjectsTest:WaitForSingleObject %u failed (%x)\n", i, GetLastError()); - bRet = FALSE; - break; - } - } - - /* - * If the first section of the test passed, move on to the - * second. - */ - - if (bRet) - { - BOOL bWaitAll = TRUE; - DWORD nCount = MAX_EVENTS; - CONST HANDLE *lpHandles = &hEvent[0]; - - /* Call WaitForMultipleObjects on all the events, the return - should be WAIT_TIMEOUT - */ - dwRet = WaitForMultipleObjects( nCount, - lpHandles, - bWaitAll, - 0); - - if (dwRet != WAIT_TIMEOUT) - { - Trace("WaitForMultipleObjectsTest:WaitForMultipleObjects failed (%x)\n", GetLastError()); - } - else - { - /* Step through each event and one at a time, set the - current test, while resetting all the other tests - */ - - for (i = 0; i < MAX_EVENTS; i++) - { - for (j = 0; j < MAX_EVENTS; j++) - { - if (j == i) - { - - bRet = SetEvent(hEvent[j]); - - if (!bRet) - { - Trace("WaitForMultipleObjectsTest:SetEvent %u failed (%x)\n", j, GetLastError()); - break; - } - } - else - { - bRet = ResetEvent(hEvent[j]); - - if (!bRet) - { - Trace("WaitForMultipleObjectsTest:ResetEvent %u failed (%x)\n", j, GetLastError()); - } - } - } - - bWaitAll = FALSE; - - /* Check that WaitFor returns WAIT_OBJECT + i */ - dwRet = WaitForMultipleObjects( nCount, - lpHandles, bWaitAll, 0); - - if (dwRet != WAIT_OBJECT_0+i) - { - Trace("WaitForMultipleObjectsTest:WaitForMultipleObjects failed (%x)\n", GetLastError()); - bRet = FALSE; - break; - } - } - } - - for (i = 0; i < MAX_EVENTS; i++) - { - bRet = CloseHandle(hEvent[i]); - - if (!bRet) - { - Trace("WaitForMultipleObjectsTest:CloseHandle %u failed (%x)\n", i, GetLastError()); - } - } - } - - return bRet; -} - -BOOL WaitMultipleDuplicateHandleTest_WFMO_test1() -{ - BOOL testResult = TRUE; - const HANDLE eventHandle = CreateEvent(NULL, TRUE, TRUE, NULL); - HANDLE eventHandles[] = {eventHandle, eventHandle}; - - // WaitAny - Wait for any of the events (no error expected) - DWORD result = WaitForMultipleObjects(sizeof(eventHandles) / sizeof(eventHandles[0]), eventHandles, FALSE, 0); - if (result != WAIT_OBJECT_0) - { - Trace("WaitMultipleDuplicateHandleTest:WaitAny failed (%x)\n", GetLastError()); - testResult = FALSE; - } - - // WaitAll - Wait for all of the events (error expected) - result = WaitForMultipleObjects(sizeof(eventHandles) / sizeof(eventHandles[0]), eventHandles, TRUE, 0); - if (result != WAIT_FAILED) - { - Trace("WaitMultipleDuplicateHandleTest:WaitAll failed: call unexpectedly succeeded\n"); - testResult = FALSE; - } - else if (GetLastError() != ERROR_INVALID_PARAMETER) - { - Trace("WaitMultipleDuplicateHandleTest:WaitAll failed: unexpected last error (%x)\n"); - testResult = FALSE; - } - - return testResult; -} - -PALTEST(threading_WaitForMultipleObjects_test1_paltest_waitformultipleobjects_test1, "threading/WaitForMultipleObjects/test1/paltest_waitformultipleobjects_test1") -{ - - if(0 != (PAL_Initialize(argc, argv))) - { - return ( FAIL ); - } - - if(!WaitForMultipleObjectsTest()) - { - Fail ("Test failed\n"); - } - - if (!WaitMultipleDuplicateHandleTest_WFMO_test1()) - { - Fail("Test failed\n"); - } - - PAL_Terminate(); - return ( PASS ); - -} diff --git a/src/coreclr/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test1/test1.cpp b/src/coreclr/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test1/test1.cpp index a1b2cbb1d11efa..b962dc306bba40 100644 --- a/src/coreclr/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test1/test1.cpp +++ b/src/coreclr/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test1/test1.cpp @@ -179,7 +179,7 @@ BOOL WaitMultipleDuplicateHandleTest_WFMOEx_test1() HANDLE eventHandles[] = {eventHandle, eventHandle}; // WaitAny - Wait for any of the events (no error expected) - DWORD result = WaitForMultipleObjects(sizeof(eventHandles) / sizeof(eventHandles[0]), eventHandles, FALSE, 0); + DWORD result = WaitForMultipleObjectsEx(sizeof(eventHandles) / sizeof(eventHandles[0]), eventHandles, FALSE, 0, FALSE); if (result != WAIT_OBJECT_0) { Trace("WaitMultipleDuplicateHandleTest:WaitAny failed (%x)\n", GetLastError()); @@ -187,7 +187,7 @@ BOOL WaitMultipleDuplicateHandleTest_WFMOEx_test1() } // WaitAll - Wait for all of the events (error expected) - result = WaitForMultipleObjects(sizeof(eventHandles) / sizeof(eventHandles[0]), eventHandles, TRUE, 0); + result = WaitForMultipleObjectsEx(sizeof(eventHandles) / sizeof(eventHandles[0]), eventHandles, TRUE, 0, FALSE); if (result != WAIT_FAILED) { Trace("WaitMultipleDuplicateHandleTest:WaitAll failed: call unexpectedly succeeded\n"); diff --git a/src/coreclr/pal/tests/palsuite/threading/WaitForSingleObject/WFSOSemaphoreTest/WFSOSemaphoreTest.cpp b/src/coreclr/pal/tests/palsuite/threading/WaitForSingleObject/WFSOSemaphoreTest/WFSOSemaphoreTest.cpp index 14a22309755793..d0103a4fd089dd 100644 --- a/src/coreclr/pal/tests/palsuite/threading/WaitForSingleObject/WFSOSemaphoreTest/WFSOSemaphoreTest.cpp +++ b/src/coreclr/pal/tests/palsuite/threading/WaitForSingleObject/WFSOSemaphoreTest/WFSOSemaphoreTest.cpp @@ -92,7 +92,7 @@ PALTEST(threading_WaitForSingleObject_WFSOSemaphoreTest_paltest_waitforsingleobj /* Test running */ - returnCode = WaitForMultipleObjects( NUMBER_OF_WORKER_THREADS, hThread, TRUE, 5000); + returnCode = WaitForMultipleObjectsEx( NUMBER_OF_WORKER_THREADS, hThread, TRUE, 5000, FALSE); if( WAIT_OBJECT_0 != returnCode ) { Trace("Wait for Object(s) returned %d, and GetLastError value is %d\n", returnCode, GetLastError()); diff --git a/src/coreclr/pal/tests/palsuite/threading/YieldProcessor/test1/test1.cpp b/src/coreclr/pal/tests/palsuite/threading/YieldProcessor/test1/test1.cpp index ca0a9cbf685879..dd80015e05f733 100644 --- a/src/coreclr/pal/tests/palsuite/threading/YieldProcessor/test1/test1.cpp +++ b/src/coreclr/pal/tests/palsuite/threading/YieldProcessor/test1/test1.cpp @@ -68,7 +68,7 @@ PALTEST(threading_YieldProcessor_test1_paltest_yieldprocessor_test1, "threading/ } - returnCode = WaitForMultipleObjects(THREAD_COUNT, hThread, TRUE, TIMEOUT); + returnCode = WaitForMultipleObjectsEx(THREAD_COUNT, hThread, TRUE, TIMEOUT, FALSE); if( WAIT_OBJECT_0 != returnCode ) { Trace("Wait for Object(s) returned %d, expected value is %d, and GetLastError value is %d\n", returnCode, WAIT_OBJECT_0, GetLastError()); From 5dd24c0265d6682025aa4a2678776b7dc1200b15 Mon Sep 17 00:00:00 2001 From: Pavel Savara Date: Thu, 7 May 2026 08:15:08 +0200 Subject: [PATCH 032/109] [browser][coreclr] WASM-specific GC OS layer; no mmap/decommit (#127328) --- src/coreclr/gc/CMakeLists.txt | 6 +- src/coreclr/gc/env/gcenv.unix.inl | 7 +- src/coreclr/gc/env/gcenv.windows.inl | 3 +- src/coreclr/gc/gc.cpp | 1 + src/coreclr/gc/gcpriv.h | 8 + src/coreclr/gc/init.cpp | 9 + src/coreclr/gc/memory.cpp | 37 ++- src/coreclr/gc/regions_segments.cpp | 22 +- src/coreclr/gc/sweep.cpp | 2 +- src/coreclr/gc/unix/gcenv.unix.cpp | 27 +- src/coreclr/gc/wasm/CMakeLists.txt | 14 + src/coreclr/gc/wasm/gcenv.cpp | 450 +++++++++++++++++++++++++++ src/coreclr/pal/src/map/virtual.cpp | 76 +++-- src/coreclr/pal/src/misc/sysinfo.cpp | 4 +- src/native/minipal/CMakeLists.txt | 8 + src/native/minipal/ospagesize.c | 24 ++ src/native/minipal/ospagesize.h | 43 +++ 17 files changed, 668 insertions(+), 73 deletions(-) create mode 100644 src/coreclr/gc/wasm/CMakeLists.txt create mode 100644 src/coreclr/gc/wasm/gcenv.cpp create mode 100644 src/native/minipal/ospagesize.c create mode 100644 src/native/minipal/ospagesize.h diff --git a/src/coreclr/gc/CMakeLists.txt b/src/coreclr/gc/CMakeLists.txt index e28391221f66ca..9b48e6ddd4ded6 100644 --- a/src/coreclr/gc/CMakeLists.txt +++ b/src/coreclr/gc/CMakeLists.txt @@ -25,7 +25,9 @@ set(GC_SOURCES gcbridge.cpp handletablecache.cpp) -if(CLR_CMAKE_HOST_UNIX) +if(CLR_CMAKE_TARGET_ARCH_WASM) + add_subdirectory(wasm) +elseif(CLR_CMAKE_HOST_UNIX) add_subdirectory(unix) include(unix/configure.cmake) else() @@ -33,7 +35,7 @@ else() set (GC_SOURCES ${GC_SOURCES} windows/Native.rc) -endif(CLR_CMAKE_HOST_UNIX) +endif() if (CLR_CMAKE_TARGET_ARCH_ARM64 OR CLR_CMAKE_TARGET_ARCH_AMD64) add_subdirectory(vxsort) diff --git a/src/coreclr/gc/env/gcenv.unix.inl b/src/coreclr/gc/env/gcenv.unix.inl index 0e221e8a0a9596..76c676f60d3bee 100644 --- a/src/coreclr/gc/env/gcenv.unix.inl +++ b/src/coreclr/gc/env/gcenv.unix.inl @@ -6,14 +6,19 @@ #include "gcenv.os.h" -extern uint32_t g_pageSizeUnixInl; +#include #define OS_PAGE_SIZE GCToOSInterface::GetPageSize() #ifndef DACCESS_COMPILE FORCEINLINE size_t GCToOSInterface::GetPageSize() { +#if defined(__wasm__) + return minipal_getpagesize(); +#else + extern uint32_t g_pageSizeUnixInl; return g_pageSizeUnixInl; +#endif // defined(__wasm__) } #endif // DACCESS_COMPILE diff --git a/src/coreclr/gc/env/gcenv.windows.inl b/src/coreclr/gc/env/gcenv.windows.inl index 8ac51a19775076..84bcedb3c500b3 100644 --- a/src/coreclr/gc/env/gcenv.windows.inl +++ b/src/coreclr/gc/env/gcenv.windows.inl @@ -6,12 +6,13 @@ #include "gcenv.os.h" +#include #define OS_PAGE_SIZE GCToOSInterface::GetPageSize() FORCEINLINE size_t GCToOSInterface::GetPageSize() { - return 0x1000; + return minipal_getpagesize(); } #endif // __GCENV_WINDOWS_INL__ diff --git a/src/coreclr/gc/gc.cpp b/src/coreclr/gc/gc.cpp index 7f715cf7daf57e..13c2e30c8f0002 100644 --- a/src/coreclr/gc/gc.cpp +++ b/src/coreclr/gc/gc.cpp @@ -2620,6 +2620,7 @@ heap_segment* gc_heap::segment_standby_list; #endif //USE_REGIONS bool gc_heap::use_large_pages_p = 0; bool gc_heap::large_pages_emulation_mode_p = 0; +bool gc_heap::never_decommit_p = 0; #ifdef HEAP_BALANCE_INSTRUMENTATION size_t gc_heap::last_gc_end_time_us = 0; #endif //HEAP_BALANCE_INSTRUMENTATION diff --git a/src/coreclr/gc/gcpriv.h b/src/coreclr/gc/gcpriv.h index d520934fce408f..c2c6b429719135 100644 --- a/src/coreclr/gc/gcpriv.h +++ b/src/coreclr/gc/gcpriv.h @@ -5375,6 +5375,14 @@ class gc_heap PER_HEAP_ISOLATED_FIELD_INIT_ONLY bool use_large_pages_p; PER_HEAP_ISOLATED_FIELD_INIT_ONLY bool large_pages_emulation_mode_p; + // Indicates that the underlying OS does not support decommitting memory. + // Implies that VirtualCommit/VirtualDecommit are no-ops on heap memory and + // that GC code paths that rely on returning memory to the OS must be skipped. + // Set unconditionally on WASM and whenever use_large_pages_p is set (large pages + // are pre-committed and cannot be decommitted). Code that wants to skip a + // decommit-related path should test this flag rather than use_large_pages_p. + PER_HEAP_ISOLATED_FIELD_INIT_ONLY bool never_decommit_p; + #ifdef MULTIPLE_HEAPS // Init-ed in gc_heap::initialize_gc PER_HEAP_ISOLATED_FIELD_INIT_ONLY gc_heap** g_heaps; diff --git a/src/coreclr/gc/init.cpp b/src/coreclr/gc/init.cpp index f242e12c7aa22f..113415c2e48636 100644 --- a/src/coreclr/gc/init.cpp +++ b/src/coreclr/gc/init.cpp @@ -1295,6 +1295,15 @@ bool gc_heap::compute_hard_limit() large_pages_emulation_mode_p = (large_pages_config == 2); #endif //HOST_64BIT + // Large pages are pre-committed and cannot be decommitted, so they imply + // never_decommit_p. On WASM, reserve == commit (posix_memalign allocates real + // memory) and there is no way to give memory back to the engine. +#if defined(HOST_WASM) || defined(__wasm__) + never_decommit_p = true; +#else + never_decommit_p = use_large_pages_p; +#endif // defined(HOST_WASM) || defined(__wasm__) + if (heap_hard_limit_oh[soh] || heap_hard_limit_oh[loh] || heap_hard_limit_oh[poh]) { if (!heap_hard_limit_oh[soh]) diff --git a/src/coreclr/gc/memory.cpp b/src/coreclr/gc/memory.cpp index 79f2f489fadf40..5c073c8f2dcf03 100644 --- a/src/coreclr/gc/memory.cpp +++ b/src/coreclr/gc/memory.cpp @@ -98,8 +98,10 @@ bool gc_heap::virtual_commit (void* address, size_t size, int bucket, int h_numb } // If it's a valid heap number it means it's commiting for memory on the GC heap. - // In addition if large pages is enabled, we set commit_succeeded_p to true because memory is already committed. - bool commit_succeeded_p = ((h_number >= 0) ? (use_large_pages_p ? true : + // In addition if never-decommit is enabled (which is implied by large pages), we + // set commit_succeeded_p to true because memory is already committed (and + // VirtualCommit would be a no-op). + bool commit_succeeded_p = ((h_number >= 0) ? (never_decommit_p ? true : virtual_alloc_commit_for_heap (address, size, h_number)) : GCToOSInterface::VirtualCommit(address, size)); @@ -171,10 +173,11 @@ bool gc_heap::virtual_decommit (void* address, size_t size, int bucket, int h_nu * Case 3: This is for free - the bucket will be recorded_committed_free_bucket, and the h_number will be -1 */ - // With large pages, VirtualDecommit on heap memory is a no-op. All such callers - // should either skip the decommit or handle stale data themselves (decommit_region - // does the latter by calling reduce_committed_bytes directly and clearing memory). - assert (!use_large_pages_p || bucket == recorded_committed_bookkeeping_bucket); + // With never-decommit (implied by large pages), VirtualDecommit on heap memory is + // a no-op. All such callers should either skip the decommit or handle stale data + // themselves (decommit_region does the latter by calling reduce_committed_bytes + // directly and clearing memory). + assert (!never_decommit_p || bucket == recorded_committed_bookkeeping_bucket); bool decommit_succeeded_p = GCToOSInterface::VirtualDecommit (address, size); @@ -202,7 +205,7 @@ void gc_heap::virtual_free (void* add, size_t allocated_size, heap_segment* sg) // distribute_free_regions where we are calling estimate_gen_growth. void gc_heap::decommit_ephemeral_segment_pages() { - if (settings.concurrent || use_large_pages_p || (settings.pause_mode == pause_no_gc)) + if (settings.concurrent || never_decommit_p || (settings.pause_mode == pause_no_gc)) { return; } @@ -315,15 +318,15 @@ bool gc_heap::decommit_step (uint64_t step_milliseconds) } } } - if (use_large_pages_p) + if (never_decommit_p) { return (decommit_size != 0); } #endif //USE_REGIONS #ifdef MULTIPLE_HEAPS - // should never get here for large pages because decommit_ephemeral_segment_pages - // will not do anything if use_large_pages_p is true - assert(!use_large_pages_p); + // should never get here for never-decommit because decommit_ephemeral_segment_pages + // will not do anything if never_decommit_p is true + assert(!never_decommit_p); for (int i = 0; i < n_heaps; i++) { @@ -345,10 +348,10 @@ size_t gc_heap::decommit_region (heap_segment* region, int bucket, int h_number) uint8_t* decommit_end = heap_segment_committed (region); size_t decommit_size = decommit_end - page_start; bool decommit_succeeded_p; - if (use_large_pages_p) + if (never_decommit_p) { - // VirtualDecommit is a no-op for large pages so skip it and update - // committed bookkeeping directly. Memory clearing is handled below. + // VirtualDecommit is a no-op when never_decommit_p is set, so skip it and + // update committed bookkeeping directly. Memory clearing is handled below. decommit_succeeded_p = true; reduce_committed_bytes (page_start, decommit_size, bucket, h_number, true); } @@ -356,7 +359,7 @@ size_t gc_heap::decommit_region (heap_segment* region, int bucket, int h_number) { decommit_succeeded_p = virtual_decommit (page_start, decommit_size, bucket, h_number); } - bool require_clearing_memory_p = !decommit_succeeded_p || use_large_pages_p; + bool require_clearing_memory_p = !decommit_succeeded_p || never_decommit_p; dprintf (REGIONS_LOG, ("decommitted region %p(%p-%p) (%zu bytes) - success: %d", region, page_start, @@ -365,7 +368,7 @@ size_t gc_heap::decommit_region (heap_segment* region, int bucket, int h_number) decommit_succeeded_p)); if (require_clearing_memory_p) { - uint8_t* clear_end = use_large_pages_p ? heap_segment_used (region) : heap_segment_committed (region); + uint8_t* clear_end = never_decommit_p ? heap_segment_used (region) : heap_segment_committed (region); size_t clear_size = clear_end - page_start; memclr (page_start, clear_size); heap_segment_used (region) = heap_segment_mem (region); @@ -397,7 +400,7 @@ size_t gc_heap::decommit_region (heap_segment* region, int bucket, int h_number) } #endif //BACKGROUND_GC - if (use_large_pages_p) + if (never_decommit_p) { assert (heap_segment_used (region) == heap_segment_mem (region)); } diff --git a/src/coreclr/gc/regions_segments.cpp b/src/coreclr/gc/regions_segments.cpp index e9275063f10d09..c1e4984e38d69c 100644 --- a/src/coreclr/gc/regions_segments.cpp +++ b/src/coreclr/gc/regions_segments.cpp @@ -1305,7 +1305,7 @@ size_t gc_heap::get_soh_start_obj_len (uint8_t* start_obj) heap_segment* gc_heap::make_heap_segment (uint8_t* new_pages, size_t size, gc_heap* hp, int gen_num) { gc_oh_num oh = gen_to_oh (gen_num); - size_t initial_commit = use_large_pages_p ? size : SEGMENT_INITIAL_COMMIT; + size_t initial_commit = never_decommit_p ? size : SEGMENT_INITIAL_COMMIT; int h_number = #ifdef MULTIPLE_HEAPS hp->heap_number; @@ -1475,7 +1475,7 @@ void gc_heap::reset_heap_segment_pages (heap_segment* seg) void gc_heap::decommit_heap_segment_pages (heap_segment* seg, size_t extra_space) { - if (use_large_pages_p) + if (never_decommit_p) return; uint8_t* page_start = align_on_page (heap_segment_allocated(seg)); @@ -1493,7 +1493,7 @@ void gc_heap::decommit_heap_segment_pages (heap_segment* seg, size_t gc_heap::decommit_heap_segment_pages_worker (heap_segment* seg, uint8_t* new_committed) { - assert (!use_large_pages_p); + assert (!never_decommit_p); uint8_t* page_start = align_on_page (new_committed); ptrdiff_t size = heap_segment_committed (seg) - page_start; if (size > 0) @@ -1522,9 +1522,10 @@ size_t gc_heap::decommit_heap_segment_pages_worker (heap_segment* seg, //decommit all pages except one or 2 void gc_heap::decommit_heap_segment (heap_segment* seg) { - // For large pages, VirtualDecommit is a no-op so skip the decommit entirely - // to avoid lowering committed/used bookkeeping while memory retains stale data. - if (use_large_pages_p) + // For never-decommit (implied by large pages), VirtualDecommit is a no-op so + // skip the decommit entirely to avoid lowering committed/used bookkeeping while + // memory retains stale data. + if (never_decommit_p) { return; } @@ -1820,10 +1821,11 @@ void gc_heap::distribute_free_regions() while (decommit_step(DECOMMIT_TIME_STEP_MILLISECONDS)) { } - // For large pages, VirtualDecommit on in-use regions is a no-op so the - // memory is never actually returned to the OS. Skip the tail decommit - // entirely to avoid misleading bookkeeping and unnecessary memclr overhead. - if (!use_large_pages_p) + // For never-decommit (implied by large pages), VirtualDecommit on in-use + // regions is a no-op so the memory is never actually returned to the OS. + // Skip the tail decommit entirely to avoid misleading bookkeeping and + // unnecessary memclr overhead. + if (!never_decommit_p) { #ifdef MULTIPLE_HEAPS for (int i = 0; i < n_heaps; i++) diff --git a/src/coreclr/gc/sweep.cpp b/src/coreclr/gc/sweep.cpp index 25a1825639eb2d..85f804318af8b5 100644 --- a/src/coreclr/gc/sweep.cpp +++ b/src/coreclr/gc/sweep.cpp @@ -442,7 +442,7 @@ void gc_heap::clear_unused_array (uint8_t* x, size_t size) void gc_heap::reset_memory (uint8_t* o, size_t sizeo) { - if (gc_heap::use_large_pages_p) + if (gc_heap::never_decommit_p) return; if (sizeo > 128 * 1024) diff --git a/src/coreclr/gc/unix/gcenv.unix.cpp b/src/coreclr/gc/unix/gcenv.unix.cpp index 42b73e0611241a..126483bde3ec96 100644 --- a/src/coreclr/gc/unix/gcenv.unix.cpp +++ b/src/coreclr/gc/unix/gcenv.unix.cpp @@ -108,11 +108,6 @@ typedef cpuset_t cpu_set_t; #define SYSCONF_GET_NUMPROCS _SC_NPROCESSORS_ONLN #endif -#ifdef __EMSCRIPTEN__ -#include -#endif // __EMSCRIPTEN__ - - // The cached total number of CPUs that can be used in the OS. uint32_t g_totalCpuCount = 0; @@ -347,7 +342,7 @@ void GCToOSInterface::Sleep(uint32_t sleepMSec) requested.tv_nsec = (sleepMSec - requested.tv_sec * tccSecondsToMilliSeconds) * tccMilliSecondsToNanoSeconds; timespec remaining; - while (nanosleep(&requested, &remaining) == EINTR) + while (nanosleep(&requested, &remaining) == -1 && errno == EINTR) { requested = remaining; } @@ -405,7 +400,7 @@ static void* VirtualReserveInner(size_t size, size_t alignment, uint32_t flags, } pRetVal = pAlignedRetVal; -#if defined(MADV_DONTDUMP) && !defined(TARGET_WASM) +#if defined(MADV_DONTDUMP) // Do not include reserved uncommitted memory in coredump. if (!committing) { @@ -453,13 +448,9 @@ bool GCToOSInterface::VirtualRelease(void* address, size_t size) // true if it has succeeded, false if it has failed static bool VirtualCommitInner(void* address, size_t size, uint16_t node, bool newMemory) { -#ifndef TARGET_WASM bool success = mprotect(address, size, PROT_WRITE | PROT_READ) == 0; -#else - bool success = true; -#endif // !TARGET_WASM -#if defined(MADV_DONTDUMP) && !defined(TARGET_WASM) +#if defined(MADV_DONTDUMP) if (success && !newMemory) { // Include committed memory in coredump. New memory is included by default. @@ -544,13 +535,13 @@ bool GCToOSInterface::VirtualDecommit(void* address, size_t size) #endif bool bRetVal = mmap(address, size, PROT_NONE, mmapFlags, -1, 0) != MAP_FAILED; -#if defined(MADV_DONTDUMP) && !defined(TARGET_WASM) +#if defined(MADV_DONTDUMP) if (bRetVal) { // Do not include freed memory in coredump. madvise(address, size, MADV_DONTDUMP); } -#endif // defined(MADV_DONTDUMP) && !defined(TARGET_WASM) +#endif // defined(MADV_DONTDUMP) return bRetVal; } @@ -565,9 +556,6 @@ bool GCToOSInterface::VirtualDecommit(void* address, size_t size) // true if it has succeeded, false if it has failed bool GCToOSInterface::VirtualReset(void * address, size_t size, bool unlock) { -#ifdef TARGET_WASM - return true; -#else // !TARGET_WASM int st = EINVAL; #ifdef MADV_DONTDUMP @@ -586,7 +574,6 @@ bool GCToOSInterface::VirtualReset(void * address, size_t size, bool unlock) #endif // MADV_FREE return (st == 0); -#endif // !TARGET_WASM } // Check if the OS supports write watching @@ -836,7 +823,7 @@ static uint64_t GetMemorySizeMultiplier(char units) return 1; } -#if !defined(__APPLE__) && !defined(__HAIKU__) && !defined(__EMSCRIPTEN__) +#if !defined(__APPLE__) && !defined(__HAIKU__) // Try to read the MemAvailable entry from /proc/meminfo. // Return true if the /proc/meminfo existed, the entry was present and we were able to parse it. static bool ReadMemAvailable(uint64_t* memAvailable) @@ -1104,8 +1091,6 @@ uint64_t GetAvailablePhysicalMemory() { available = info.free_memory; } -#elif defined(__EMSCRIPTEN__) - available = emscripten_get_heap_max() - emscripten_get_heap_size(); #else // Linux static volatile bool tryReadMemInfo = true; diff --git a/src/coreclr/gc/wasm/CMakeLists.txt b/src/coreclr/gc/wasm/CMakeLists.txt new file mode 100644 index 00000000000000..0173a8e81fdf33 --- /dev/null +++ b/src/coreclr/gc/wasm/CMakeLists.txt @@ -0,0 +1,14 @@ +set(CMAKE_INCLUDE_CURRENT_DIR ON) +include_directories("../env") +include_directories("..") +include_directories("../unix") + +# Generates config.gc.h in this subdirectory's binary dir (picked up via +# CMAKE_INCLUDE_CURRENT_DIR). Mirrors how gc/unix/CMakeLists.txt does it. +include(../unix/configure.cmake) + +set(GC_PAL_SOURCES + gcenv.cpp + ../unix/events.cpp) + +add_library(gc_pal OBJECT ${GC_PAL_SOURCES} ${VERSION_FILE_PATH}) diff --git a/src/coreclr/gc/wasm/gcenv.cpp b/src/coreclr/gc/wasm/gcenv.cpp new file mode 100644 index 00000000000000..2b64b614354082 --- /dev/null +++ b/src/coreclr/gc/wasm/gcenv.cpp @@ -0,0 +1,450 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +// WASM-specific GC OS interface implementation. +// Replaces gcenv.unix.cpp when targeting WebAssembly (browser or WASI). + +#include +#include +#include +#include +#include +#include + +#include "config.gc.h" +#include "common.h" + +#include "gcenv.structs.h" +#include "gcenv.base.h" +#include "gcenv.os.h" +#include "gcenv.ee.h" +#include "gcenv.unix.inl" +#include "gcconfig.h" + +#include + +#ifdef FEATURE_MULTITHREADING +#include +#include +#include +#endif + +#include +#include +#include + +#include "globals.h" + +#ifdef TARGET_BROWSER +#include +#endif + +// WASM memory.grow operates in 64KB pages. This is distinct from OS_PAGE_SIZE +// (the GC's page granularity), which is 16KB on WASM (via minipal_getpagesize). +static const size_t WasmPageSize = 64 * 1024; + +uint32_t g_totalCpuCount = 1; + +static int64_t g_totalPhysicalMemSize = 0; + +// Forward declarations +static bool GetPhysicalMemoryUsed(size_t* val); +static uint64_t GetAvailablePhysicalMemory(); + +// ============================================================================ +// Initialization / Shutdown +// ============================================================================ + +bool GCToOSInterface::Initialize() +{ + // Get the physical memory size +#ifdef TARGET_BROWSER + g_totalPhysicalMemSize = (int64_t)emscripten_get_heap_max(); +#else // TARGET_WASI + // WASI doesn't have an API to query max memory. + g_totalPhysicalMemSize = 2LL * 1024 * 1024 * 1024; // 2GB +#endif + + assert(g_totalPhysicalMemSize != 0); + + return true; +} + +void GCToOSInterface::Shutdown() +{ +} + +// ============================================================================ +// Thread / Process identification +// ============================================================================ + +uint64_t GCToOSInterface::GetCurrentThreadIdForLogging() +{ + return (uint64_t)minipal_get_current_thread_id(); +} + +uint32_t GCToOSInterface::GetCurrentProcessId() +{ + return getpid(); +} + +bool GCToOSInterface::SetCurrentThreadIdealAffinity(uint16_t srcProcNo, uint16_t dstProcNo) +{ + (void)srcProcNo; + (void)dstProcNo; + return true; +} + +uint32_t GCToOSInterface::GetCurrentProcessorNumber() +{ + return 0; +} + +bool GCToOSInterface::CanGetCurrentProcessorNumber() +{ + return true; +} + +// ============================================================================ +// Debugging / Sleeping / Yielding +// ============================================================================ + +void GCToOSInterface::DebugBreak() +{ +#if __has_builtin(__builtin_debugtrap) + __builtin_debugtrap(); +#else + abort(); +#endif +} + +void GCToOSInterface::Sleep(uint32_t sleepMSec) +{ +#ifdef FEATURE_MULTITHREADING + timespec requested = + { + static_cast(sleepMSec / 1000), + static_cast((sleepMSec % 1000) * 1000000) + }; + timespec remaining; + + while (nanosleep(&requested, &remaining) != 0 && errno == EINTR) + { + requested = remaining; + } +#else + // On single-threaded WASM, nanosleep is either a no-op or stalls the + // event loop. There are no other threads to wait for, and no signals + // to deliver EINTR. +#endif + (void)sleepMSec; +} + +void GCToOSInterface::YieldThread(uint32_t switchCount) +{ +#ifdef FEATURE_MULTITHREADING + sched_yield(); +#else + // No-op on single-threaded WASM - there are no other threads to yield to. +#endif + (void)switchCount; +} + +// ============================================================================ +// Virtual Memory - WASM-specific (posix_memalign / free) +// ============================================================================ + +// Emscripten does not provide a complete implementation of mmap and munmap: +// munmap cannot unmap partial allocations, mmap(PROT_NONE) still consumes +// linear memory, and MAP_FIXED is broken. +// Emscripten does provide an implementation of posix_memalign which is used here. +// +// posix_memalign returns either freshly grown linear memory (zero by the WASM +// spec) or a recycled block from the allocator's free list (which may contain +// stale data from a previous VirtualDecommit -> free cycle). Since we cannot +// portably distinguish the two without relying on dlmalloc implementation +// details, we always zero the returned memory to match VirtualReserve's +// "memory starts zeroed" contract. + +static void* VirtualReserveInner(size_t size, size_t alignment, uint32_t flags) +{ + assert(!(flags & VirtualReserveFlags::WriteWatch) && "WriteWatch not supported on WASM"); + if (alignment < OS_PAGE_SIZE) + { + alignment = OS_PAGE_SIZE; + } + + void* pRetVal; + int result = posix_memalign(&pRetVal, alignment, size); + if (result != 0) + { + return nullptr; + } + + memset(pRetVal, 0, size); + + return pRetVal; +} + +void* GCToOSInterface::VirtualReserve(size_t size, size_t alignment, uint32_t flags, uint16_t node) +{ + (void)node; + return VirtualReserveInner(size, alignment, flags); +} + +bool GCToOSInterface::VirtualRelease(void* address, size_t size) +{ + (void)size; + free(address); + return true; +} + +void* GCToOSInterface::VirtualReserveAndCommitLargePages(size_t size, uint16_t node) +{ + (void)node; + // WASM has no large pages - just reserve+commit normally. + return VirtualReserveInner(size, OS_PAGE_SIZE, 0); +} + +bool GCToOSInterface::VirtualCommit(void* address, size_t size, uint16_t node) +{ + // The GC skips this for heap memory when never_decommit_p is true (which + // it always is on WASM). This is still called for bookkeeping memory. + // Memory is always zero here: either from VirtualReserveInner (initial + // allocation) or from VirtualDecommit (which zeroes on decommit). + (void)address; + (void)size; + (void)node; + return true; +} + +bool GCToOSInterface::VirtualDecommit(void* address, size_t size) +{ + // The GC skips this for heap memory when never_decommit_p is true (which + // it always is on WASM). This is still called for bookkeeping memory. + // On WASM, we cannot return memory to the OS or change page protection. + // Zero the range so it is clean for any future VirtualCommit (which is a no-op). + memset(address, 0, size); + return true; +} + +bool GCToOSInterface::VirtualReset(void* address, size_t size, bool unlock) +{ + // Return false to indicate reset is not supported. + // This forces the GC to use the decommit+commit fallback path instead. + // On WASM, madvise is a no-op so reset cannot discard pages. + (void)address; + (void)size; + (void)unlock; + return false; +} + +// ============================================================================ +// Write Watch (not supported on WASM) +// ============================================================================ + +bool GCToOSInterface::SupportsWriteWatch() +{ + return false; +} + +void GCToOSInterface::ResetWriteWatch(void* address, size_t size) +{ + assert(!"should never call ResetWriteWatch on WASM"); +} + +bool GCToOSInterface::GetWriteWatch(bool resetState, void* address, size_t size, void** pageAddresses, uintptr_t* pageAddressesCount) +{ + assert(!"should never call GetWriteWatch on WASM"); + return false; +} + +// ============================================================================ +// Processor cache +// ============================================================================ + +size_t GCToOSInterface::GetCacheSizePerLogicalCpu(bool trueSize) +{ + (void)trueSize; + // WASM doesn't expose cache topology. + // Return a reasonable default (256 KB). + return 256 * 1024; +} + +// ============================================================================ +// Thread affinity / priority +// ============================================================================ + +bool GCToOSInterface::SetThreadAffinity(uint16_t procNo) +{ + (void)procNo; + // No thread affinity on WASM + return false; +} + +bool GCToOSInterface::BoostThreadPriority() +{ + // No thread priority on WASM + return false; +} + +const AffinitySet* GCToOSInterface::SetGCThreadsAffinitySet(uintptr_t configAffinityMask, const AffinitySet* configAffinitySet) +{ + (void)configAffinityMask; + (void)configAffinitySet; + return nullptr; // only for multiple heaps +} + +// ============================================================================ +// Virtual / Physical Memory Limits +// ============================================================================ + +size_t GCToOSInterface::GetVirtualMemoryLimit() +{ + return GetVirtualMemoryMaxAddress(); +} + +size_t GCToOSInterface::GetVirtualMemoryMaxAddress() +{ + // On WASM, linear-memory ceiling = max addressable. Both APIs return the + // same value because there is no separate per-process virtual address space + // limit beyond what the engine permits the linear memory to grow to. + return g_totalPhysicalMemSize; +} + +static bool GetPhysicalMemoryUsed(size_t* val) +{ +#ifdef TARGET_BROWSER + uint64_t bytesUsed = static_cast(emscripten_get_heap_size()); +#else // TARGET_WASI + uint64_t bytesUsed = static_cast(__builtin_wasm_memory_size(0)) * WasmPageSize; +#endif + + *val = (bytesUsed > SIZE_MAX) ? SIZE_MAX : static_cast(bytesUsed); + return true; +} + +uint64_t GCToOSInterface::GetPhysicalMemoryLimit(bool* is_restricted) +{ + // No restricted-memory mode on WASM. The linear memory ceiling enforced by the + // engine is the only hard cap; we don't auto-derive a GC heap_hard_limit from it. + if (is_restricted) + *is_restricted = false; + + return g_totalPhysicalMemSize; +} + +static uint64_t GetAvailablePhysicalMemory() +{ +#ifdef TARGET_BROWSER + uint64_t bytesUsed = static_cast(emscripten_get_heap_size()); +#else // TARGET_WASI + uint64_t bytesUsed = static_cast(__builtin_wasm_memory_size(0)) * WasmPageSize; +#endif + uint64_t total = g_totalPhysicalMemSize; + return (total > bytesUsed) ? (total - bytesUsed) : 0; +} + +void GCToOSInterface::GetMemoryStatus(uint64_t restricted_limit, uint32_t* memory_load, uint64_t* available_physical, uint64_t* available_page_file) +{ + uint64_t available = 0; + uint32_t load = 0; + + size_t used; + if (restricted_limit != 0) + { + if (GetPhysicalMemoryUsed(&used)) + { + available = restricted_limit > used ? restricted_limit - used : 0; + load = (uint32_t)(((float)used * 100) / (float)restricted_limit); + } + else + { + available = GetAvailablePhysicalMemory(); + } + } + else + { + available = GetAvailablePhysicalMemory(); + + if (memory_load != nullptr) + { + uint64_t total = g_totalPhysicalMemSize; + + if (total > available) + { + used = total - available; + load = (uint32_t)(((float)used * 100) / (float)total); + } + } + } + + if (available_physical != nullptr) + *available_physical = available; + + if (memory_load != nullptr) + *memory_load = load; + + if (available_page_file != nullptr) + *available_page_file = 0; // No page file on wasm +} + +// ============================================================================ +// Time +// ============================================================================ + +int64_t GCToOSInterface::QueryPerformanceCounter() +{ + return minipal_hires_ticks(); +} + +int64_t GCToOSInterface::QueryPerformanceFrequency() +{ + return minipal_hires_tick_frequency(); +} + +uint64_t GCToOSInterface::GetLowPrecisionTimeStamp() +{ + return (uint64_t)minipal_lowres_ticks(); +} + +// ============================================================================ +// Processor count / NUMA / CPU Groups +// ============================================================================ + +uint32_t GCToOSInterface::GetTotalProcessorCount() +{ + return 1; +} + +uint32_t GCToOSInterface::GetMaxProcessorCount() +{ + return 1; +} + +bool GCToOSInterface::CanEnableGCNumaAware() +{ + return false; +} + +bool GCToOSInterface::CanEnableGCCPUGroups() +{ + return false; +} + +bool GCToOSInterface::GetProcessorForHeap(uint16_t heap_number, uint16_t* proc_no, uint16_t* node_no) +{ + if (heap_number == 0) + { + *proc_no = 0; + *node_no = NUMA_NODE_UNDEFINED; + return true; + } + + return false; +} + +bool GCToOSInterface::ParseGCHeapAffinitizeRangesEntry(const char** config_string, size_t* start_index, size_t* end_index) +{ + return ParseIndexOrRange(config_string, start_index, end_index); +} diff --git a/src/coreclr/pal/src/map/virtual.cpp b/src/coreclr/pal/src/map/virtual.cpp index 043502e916acd1..f7e9b0c764613b 100644 --- a/src/coreclr/pal/src/map/virtual.cpp +++ b/src/coreclr/pal/src/map/virtual.cpp @@ -39,6 +39,8 @@ SET_DEFAULT_DEBUG_CHANNEL(VIRTUAL); // some headers have code with asserts, so d #include #include #include +#include +#include #if HAVE_VM_ALLOCATE #include @@ -165,7 +167,7 @@ extern "C" BOOL VIRTUALInitialize(bool initializeExecutableMemoryAllocator) { - s_virtualPageSize = getpagesize(); + s_virtualPageSize = minipal_getpagesize(); TRACE("Initializing the Virtual Critical Sections. \n"); @@ -531,7 +533,11 @@ static LPVOID VIRTUALReserveMemory( { ASSERT( "Unable to store the structure in the list.\n"); pthrCurrent->SetLastError( ERROR_INTERNAL_ERROR ); +#ifdef TARGET_WASM + free( pRetVal ); +#else munmap( pRetVal, MemSize ); +#endif pRetVal = NULL; } } @@ -565,6 +571,32 @@ static LPVOID ReserveVirtualMemory( TRACE( "Reserving the memory now.\n"); +#ifdef TARGET_WASM + // WASM cannot honor address hints - ignore lpAddress and allocate + // at whatever address posix_memalign returns. Callers must handle + // getting a different address than requested (same as Linux with + // some SELinux settings). + (void)StartBoundary; + (void)fAllocationType; // Large pages / executable flags are N/A on WASM. + + // WASM has no virtual memory - mmap(PROT_NONE) still consumes linear memory, + // munmap of partial ranges doesn't return memory, and MAP_FIXED is broken. + // Use posix_memalign/free instead. + + LPVOID pRetVal = nullptr; + if (posix_memalign(&pRetVal, GetVirtualPageSize(), MemSize) != 0 || pRetVal == nullptr) + { + ERROR( "Failed due to insufficient memory.\n" ); + pthrCurrent->SetLastError(ERROR_NOT_ENOUGH_MEMORY); + return nullptr; + } + + // posix_memalign may return either freshly grown linear memory (zeroed by the + // WASM spec) or a recycled block from the allocator's free list (which may + // contain stale data from a previous free()). Always zero to match the + // "reserved memory starts zeroed" contract of this function. + memset(pRetVal, 0, MemSize); +#else // !TARGET_WASM // Most platforms will only commit memory if it is dirtied, // so this should not consume too much swap space. int mmapFlags = MAP_ANON | MAP_PRIVATE; @@ -627,13 +659,14 @@ static LPVOID ReserveVirtualMemory( } #endif // MMAP_ANON_IGNORES_PROTECTION -#if defined(MADV_DONTDUMP) && !defined(TARGET_WASM) +#if defined(MADV_DONTDUMP) // Do not include reserved uncommitted memory in coredump. if (!(fAllocationType & MEM_COMMIT)) { madvise(pRetVal, MemSize, MADV_DONTDUMP); } #endif +#endif // !TARGET_WASM return pRetVal; } @@ -714,16 +747,21 @@ VIRTUALCommitMemory( TRACE( "Committing the memory now..\n"); - nProtect = W32toUnixAccessControl(flProtect); pRetVal = (void *) StartBoundary; #ifndef TARGET_WASM + nProtect = W32toUnixAccessControl(flProtect); // Commit the pages if (mprotect((void *) StartBoundary, MemSize, nProtect) != 0) { ERROR("mprotect() failed! Error(%d)=%s\n", errno, strerror(errno)); goto error; } +#else + // On WASM, reserve == commit — memory is accessible after posix_memalign. + // Memory is always zero here: either from ReserveVirtualMemory (initial + // allocation) or from the MEM_DECOMMIT path (which zeroes on decommit). + (void)MemSize; #endif #if defined(MADV_DONTDUMP) && !defined(TARGET_WASM) @@ -738,7 +776,6 @@ VIRTUALCommitMemory( #ifndef TARGET_WASM error: -#endif if ( flAllocationType & MEM_RESERVE || IsLocallyReserved ) { munmap( pRetVal, MemSize ); @@ -753,6 +790,7 @@ VIRTUALCommitMemory( pInformation = NULL; pRetVal = NULL; +#endif // !TARGET_WASM done: LogVaOperation( @@ -1077,10 +1115,9 @@ VirtualFree( goto VirtualFreeExit; } #else // TARGET_WASM - // We can't decommit the mapping (MAP_FIXED doesn't work in emscripten), and we can't - // MADV_DONTNEED it (madvise doesn't work in emscripten), but we can at least zero - // the memory so that if an attempt is made to reuse it later, the memory will be - // empty as PAL tests expect it to be. + // On WASM, we cannot decommit (MAP_FIXED and madvise don't work in + // emscripten). Zero the range so it is clean for any future commit + // (which is a no-op). ZeroMemory((LPVOID) StartBoundary, MemSize); #endif // TARGET_WASM } @@ -1108,25 +1145,26 @@ VirtualFree( TRACE( "Releasing the following memory %d to %d.\n", pMemoryToBeReleased->startBoundary, pMemoryToBeReleased->memSize ); +#ifdef TARGET_WASM + free( (LPVOID)pMemoryToBeReleased->startBoundary ); +#else // !TARGET_WASM if ( munmap( (LPVOID)pMemoryToBeReleased->startBoundary, - pMemoryToBeReleased->memSize ) == 0 ) + pMemoryToBeReleased->memSize ) != 0 ) { - if ( VIRTUALReleaseMemory( pMemoryToBeReleased ) == FALSE ) - { - ASSERT( "Unable to remove the PCMI entry from the list.\n" ); - pthrCurrent->SetLastError( ERROR_INTERNAL_ERROR ); - bRetVal = FALSE; - goto VirtualFreeExit; - } - pMemoryToBeReleased = NULL; + ASSERT( "Unable to unmap the memory, munmap() returned an abnormal value.\n" ); + pthrCurrent->SetLastError( ERROR_INTERNAL_ERROR ); + bRetVal = FALSE; + goto VirtualFreeExit; } - else +#endif // !TARGET_WASM + if ( VIRTUALReleaseMemory( pMemoryToBeReleased ) == FALSE ) { - ASSERT( "Unable to unmap the memory, munmap() returned an abnormal value.\n" ); + ASSERT( "Unable to remove the PCMI entry from the list.\n" ); pthrCurrent->SetLastError( ERROR_INTERNAL_ERROR ); bRetVal = FALSE; goto VirtualFreeExit; } + pMemoryToBeReleased = NULL; } VirtualFreeExit: diff --git a/src/coreclr/pal/src/misc/sysinfo.cpp b/src/coreclr/pal/src/misc/sysinfo.cpp index df2a319b365488..63b02d00be88d1 100644 --- a/src/coreclr/pal/src/misc/sysinfo.cpp +++ b/src/coreclr/pal/src/misc/sysinfo.cpp @@ -24,6 +24,8 @@ Revision History: #include #include #include +#include +#include #define __STDC_FORMAT_MACROS #include #include @@ -233,7 +235,7 @@ GetSystemInfo( PERF_ENTRY(GetSystemInfo); ENTRY("GetSystemInfo (lpSystemInfo=%p)\n", lpSystemInfo); - pagesize = getpagesize(); + pagesize = minipal_getpagesize(); lpSystemInfo->wProcessorArchitecture_PAL_Undefined = 0; lpSystemInfo->wReserved_PAL_Undefined = 0; diff --git a/src/native/minipal/CMakeLists.txt b/src/native/minipal/CMakeLists.txt index d7f9ad5e2ab78a..af1990a9909fc4 100644 --- a/src/native/minipal/CMakeLists.txt +++ b/src/native/minipal/CMakeLists.txt @@ -16,6 +16,14 @@ set(SOURCES log.c ) +# ospagesize is provided inline in the header on Windows and WASM; the .c file +# only contains the POSIX implementation. Including it on those platforms would +# produce a redefinition error (mono builds for wasi/browser set HOST_WASM but +# not CLR_CMAKE_TARGET_ARCH_WASM, so check both). +if(NOT WIN32 AND NOT CLR_CMAKE_TARGET_ARCH_WASM AND NOT HOST_WASM) + list(APPEND SOURCES ospagesize.c) +endif() + # Provide an object library for scenarios where we ship static libraries include_directories(${CLR_SRC_NATIVE_DIR} ${CMAKE_CURRENT_BINARY_DIR}) diff --git a/src/native/minipal/ospagesize.c b/src/native/minipal/ospagesize.c new file mode 100644 index 00000000000000..0d171149e25a1c --- /dev/null +++ b/src/native/minipal/ospagesize.c @@ -0,0 +1,24 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +// POSIX implementation of minipal_getpagesize. On WASM and Windows the page size +// is a compile-time constant and minipal_getpagesize is defined inline in the +// header; this file is excluded from the build on those platforms by +// src/native/minipal/CMakeLists.txt to avoid an empty translation unit. + +#include +#include "ospagesize.h" + +size_t minipal_getpagesize(void) +{ + // Process-wide constant. Any thread that races to initialize the cache writes + // the same value, so no synchronization is required. + static size_t cached_page_size = 0; + size_t page_size = cached_page_size; + if (page_size == 0) + { + page_size = (size_t)getpagesize(); + cached_page_size = page_size; + } + return page_size; +} diff --git a/src/native/minipal/ospagesize.h b/src/native/minipal/ospagesize.h new file mode 100644 index 00000000000000..4657625402a448 --- /dev/null +++ b/src/native/minipal/ospagesize.h @@ -0,0 +1,43 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +#ifndef HAVE_MINIPAL_OSPAGESIZE_H +#define HAVE_MINIPAL_OSPAGESIZE_H + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +// Returns the OS page size in bytes. +// +// On platforms where the page size is fixed (Windows: 4KB, WASM: 16KB) this is +// defined inline so callers see a compile-time constant. This matters for the GC, +// which expects GetPageSize to fold into a constant for alignment math. +// +// On other platforms the value is queried from the OS once and cached; the +// definition lives in ospagesize.c so there is exactly one cache per process. +#if defined(HOST_WASM) +static inline size_t minipal_getpagesize(void) +{ + // WASM has no hardware pages; getpagesize() returns the 64KB memory.grow granularity, + // which is too coarse for GC alignment and thresholds. Reduce the OS page size used + // by the runtime on WASM to 16KB. + return 16 * 1024; +} +#elif defined(HOST_WINDOWS) +static inline size_t minipal_getpagesize(void) +{ + // The page size on Windows is 4KB and is not going to change. + return 4 * 1024; +} +#else +size_t minipal_getpagesize(void); +#endif + +#ifdef __cplusplus +} +#endif + +#endif // HAVE_MINIPAL_OSPAGESIZE_H From 5566dcc3aef9192af567a2c8cda8cbc9758cfb62 Mon Sep 17 00:00:00 2001 From: Milos Kotlar Date: Thu, 7 May 2026 11:53:52 +0200 Subject: [PATCH 033/109] Fix iOS arm64 CoreCLR crash from shared MethodDesc::CalliCookie slot (#127876) ## Problem PR #127016 updated `MethodDescCodeData::CallStub` added a new writer in `CInterpreterJitInfo::GetCookieForInterpreterCalliSig` that caches a calli signature `CallStubHeader*` on the P/Invoke target `MethodDesc`. PR #127016 added a small "calli cookie" cache. Each managed method has one slot where this cookie is stored. The problem is that two different parts of the runtime now write to that one slot: - The interpreter-to-native call path stores a helper that's set up for the method's own signature - The new code in #127016 stores a helper that's set up for the signature of a `calli` instruction inside an IL stub. On iOS, when an app tries to execute address 0 the kernel does not give us a normal crash. It assumes the page is unsigned/tampered and kills the process with `SIGKILL` and a `CODESIGNING / Invalid Page` reason. ## Proposed fix Drop the new `pContextMD->{Set,Get}CalliCookie` cache reads/writes in `CInterpreterJitInfo::GetCookieForInterpreterCalliSig`. The function now always computes the cookie via `GetCookieForCalliSig(sig, pContextMD)`, matching pre-#127016 behavior. Fixes #127869 #127863 #127867 --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/coreclr/vm/jitinterface.cpp | 31 ++++++++++++------------------- 1 file changed, 12 insertions(+), 19 deletions(-) diff --git a/src/coreclr/vm/jitinterface.cpp b/src/coreclr/vm/jitinterface.cpp index cb30fa87c3aaec..aaf24318c47019 100644 --- a/src/coreclr/vm/jitinterface.cpp +++ b/src/coreclr/vm/jitinterface.cpp @@ -11500,6 +11500,9 @@ LPVOID CInterpreterJitInfo::GetCookieForInterpreterCalliSig(CORINFO_SIG_INFO* sz // When compiling a calli inside an IL stub for a P/Invoke, pass the target // P/Invoke MethodDesc so ComputeCallStub can detect the Swift calling convention. + // Do not cache the cookie on pContextMD: MethodDesc::CalliCookie is for + // calling the target via managed calling convention. The stub we are about + // to generate calls the target via unmanaged calling convention. MethodDesc* pContextMD = nullptr; if (m_pMethodBeingCompiled != nullptr && m_pMethodBeingCompiled->IsILStub()) { @@ -11507,32 +11510,22 @@ LPVOID CInterpreterJitInfo::GetCookieForInterpreterCalliSig(CORINFO_SIG_INFO* sz if (pTargetMD != nullptr) { pContextMD = pTargetMD; - result = pTargetMD->GetCalliCookie(); } } - if (result == NULL) - { - Instantiation classInst = Instantiation((TypeHandle*) szMetaSig->sigInst.classInst, szMetaSig->sigInst.classInstCount); - Instantiation methodInst = Instantiation((TypeHandle*) szMetaSig->sigInst.methInst, szMetaSig->sigInst.methInstCount); - SigTypeContext typeContext = SigTypeContext(classInst, methodInst); - Module* mod = GetModule(szMetaSig->scope); - - MetaSig sig(szMetaSig->pSig, szMetaSig->cbSig, mod, &typeContext); + Instantiation classInst = Instantiation((TypeHandle*) szMetaSig->sigInst.classInst, szMetaSig->sigInst.classInstCount); + Instantiation methodInst = Instantiation((TypeHandle*) szMetaSig->sigInst.methInst, szMetaSig->sigInst.methInstCount); + SigTypeContext typeContext = SigTypeContext(classInst, methodInst); + Module* mod = GetModule(szMetaSig->scope); - if (szMetaSig->isAsyncCall()) - sig.SetIsAsyncCall(); + MetaSig sig(szMetaSig->pSig, szMetaSig->cbSig, mod, &typeContext); - _ASSERTE(szMetaSig->isAsyncCall() == sig.IsAsyncCall()); + if (szMetaSig->isAsyncCall()) + sig.SetIsAsyncCall(); - result = GetCookieForCalliSig(sig, pContextMD); + _ASSERTE(szMetaSig->isAsyncCall() == sig.IsAsyncCall()); - if (pContextMD != nullptr) - { - pContextMD->SetCalliCookie(result); - result = pContextMD->GetCalliCookie(); - } - } + result = GetCookieForCalliSig(sig, pContextMD); EE_TO_JIT_TRANSITION(); return (void*)result; From 0c9b431cdd57be94539ffac13bbe8fd31c9f146f Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 7 May 2026 12:16:07 +0200 Subject: [PATCH 034/109] [mobile] Skip localhost subdomain with trailing dot test on Android (#127862) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Reasoning The test `DnsGetHostEntry_LocalhostSubdomainWithTrailingDot_ReturnsLoopback` expects DNS queries for `*.localhost.` (with trailing dot) to resolve to loopback addresses, following RFC 6761. However, on Android devices, these queries resolve to actual network addresses (both IPv4 and IPv6) instead of loopback. This is the same root cause as `DnsGetHostEntry_LocalhostSubdomain_ReturnsLoopback` (without trailing dot), which is already disabled on Android via ActiveIssue #126456. Android's DNS resolver does not treat `.localhost` subdomains as reserved names that must resolve to loopback, regardless of whether a trailing dot is present. Adding the same `[ActiveIssue]` attribute to this test variant ensures consistent behavior across all localhost subdomain test cases on Android. ## Impact on platforms Failing on Android in build [1406427](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1406427) (2026-05-03): - **android-arm64** / Windows.11.Amd64.Android.Open / exit code 1 - **android-arm** / Windows.11.Amd64.Android.Open / exit code 1 - **android-x64** / Windows.11.Amd64.Android.Open / exit code 1 - **android-x86** / Windows.11.Amd64.Android.Open / exit code 1 ## Errors log From android-arm64 Helix work item `System.Net.NameResolution.Functional.Tests` ([console log](https://helixr1107v0xdeko0k025g8.blob.core.windows.net/dotnet-runtime-refs-heads-main-ae2d5fa7b6734cedad/System.Net.NameResolution.Functional.Tests/3/console.0d73d2d2.log?helixlogtype=result)): ```` [FAIL] System.Net.NameResolution.Tests.GetHostEntryTest.DnsGetHostEntry_LocalhostSubdomainWithTrailingDot_ReturnsLoopback(hostName: "foo.localhost.") Assert.All() Failure: 11 out of 12 items in the collection did not pass. [1]: Item: fe80::e0ef:4bff:feb4:bb16%47 Error: Expected loopback address but got: fe80::e0ef:4bff:feb4:bb16%47 [2]: Item: 2001:4898:502:3:e0ef:4bff:feb4:bb16 Error: Expected loopback address but got: 2001:4898:502:3:e0ef:4bff:feb4:bb16 [11]: Item: 10.64.36.83 Error: Expected loopback address but got: 10.64.36.83 ```` ## First build it occurred First observed (within the scanned window) in build [1406427](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1406427), finished on 2026-05-03T09:02:27Z. **Note:** This test failure has the same root cause as existing issue #126456, which has been present since April 2026. The "first occurrence" reflects only the scanned window, not the true origin. > [!NOTE] > This change was generated by the [Mobile Platform Failure Scanner](https://github.com/dotnet/runtime/actions/runs/25432280266) workflow. > Generated by [Mobile Platform Failure Scanner](https://github.com/dotnet/runtime/actions/runs/25432280266/agentic_workflow) · ● 6.8M · [◷](https://github.com/search?q=repo%3Adotnet%2Fruntime+%22gh-aw-workflow-id%3A+mobile-scan%22&type=pullrequests) --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: github-actions[bot] --- .../tests/FunctionalTests/GetHostEntryTest.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/libraries/System.Net.NameResolution/tests/FunctionalTests/GetHostEntryTest.cs b/src/libraries/System.Net.NameResolution/tests/FunctionalTests/GetHostEntryTest.cs index 616c2c6f4bd9a4..eba2b5c8b79ec9 100644 --- a/src/libraries/System.Net.NameResolution/tests/FunctionalTests/GetHostEntryTest.cs +++ b/src/libraries/System.Net.NameResolution/tests/FunctionalTests/GetHostEntryTest.cs @@ -477,6 +477,7 @@ public async Task DnsGetHostEntry_LocalhostAndSubdomain_BothReturnLoopback() [Theory] [InlineData("foo.localhost.")] [InlineData("bar.test.localhost.")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/126456", TestPlatforms.Android)] public async Task DnsGetHostEntry_LocalhostSubdomainWithTrailingDot_ReturnsLoopback(string hostName) { IPHostEntry entry = Dns.GetHostEntry(hostName); From dd14dfdd9ed326d73ee9b2cc22bc9ec547b871bb Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Thu, 7 May 2026 13:20:08 +0200 Subject: [PATCH 035/109] JIT: Restore EH-region check in if-conversion flow validation (#127450) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A Fuzzlyn-generated repro hits `assert(!block->HasFlag(BBF_DONT_REMOVE))` during the JIT's *If conversion* phase when the Then block is the start of a try region. Bisected to dea4756 (#125347), which simplified `IfConvertCheckFlow` and inadvertently dropped the `BasicBlock::sameEHRegion` check previously performed by `IfConvertCheckInnerBlockFlow`. Without it, if-conversion proceeds on a Then/Else block that begins an EH region, then trips the assert when later removing it. ## Changes - **`src/coreclr/jit/ifconversion.cpp`** — In `OptIfConversionDsc::IfConvertCheckFlow`, bail when `falseBb` (Then) or `trueBb` (Else, when present) is not in the same EH region as `m_startBlock`. After merging `origin/main`, the Else guard uses the new `HasElseBlock()` helper (which replaced the removed `m_doElseConversion` member). - **`src/tests/JIT/Regression/JitBlue/Runtime_127446/Runtime_127446.cs`** — Regression test using the original repro. The test source is added to the shared merged `src/tests/JIT/Regression/Regression_ro_2.csproj` (alongside other JitBlue regression tests); no per-test csproj or environment variables are needed. ```cpp if (falseBb->GetUniquePred(m_compiler) == nullptr) { return false; } // The Then/Else blocks will be removed by if-conversion, so they must be in the same // EH region as m_startBlock. Otherwise they may be the start of a try/handler region // (and thus marked BBF_DONT_REMOVE), or removing them could leave dangling EH state. if (!BasicBlock::sameEHRegion(falseBb, m_startBlock)) { return false; } m_finalBlock = HasElseBlock() ? trueBb->GetUniqueSucc() : trueBb; if (HasElseBlock() && !BasicBlock::sameEHRegion(trueBb, m_startBlock)) { return false; } ``` Verified the assert reproduces on the unfixed JIT and is gone with the fix; the new test passes through the merged test runner (`global::Runtime_127446.Runtime_127446.TestEntryPoint()` → Passed) after merging the latest `origin/main`. --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: EgorBo <523221+EgorBo@users.noreply.github.com> Co-authored-by: jakobbotsch <7887810+jakobbotsch@users.noreply.github.com> Co-authored-by: Egor Bogatov --- src/coreclr/jit/ifconversion.cpp | 13 +++++ .../JitBlue/Runtime_127446/Runtime_127446.cs | 53 +++++++++++++++++++ .../JIT/Regression/Regression_ro_2.csproj | 1 + 3 files changed, 67 insertions(+) create mode 100644 src/tests/JIT/Regression/JitBlue/Runtime_127446/Runtime_127446.cs diff --git a/src/coreclr/jit/ifconversion.cpp b/src/coreclr/jit/ifconversion.cpp index d14473d12f551a..d5f42aecde353a 100644 --- a/src/coreclr/jit/ifconversion.cpp +++ b/src/coreclr/jit/ifconversion.cpp @@ -148,8 +148,21 @@ bool OptIfConversionDsc::IfConvertCheckFlow() return false; } + // The Then/Else blocks will be removed by if-conversion, so they must be in the same + // EH region as m_startBlock. Otherwise they may be the start of a try/handler region + // (and thus marked BBF_DONT_REMOVE), or removing them could leave dangling EH state. + if (!BasicBlock::sameEHRegion(falseBb, m_startBlock)) + { + return false; + } + m_finalBlock = HasElseBlock() ? trueBb->GetUniqueSucc() : trueBb; + if (HasElseBlock() && !BasicBlock::sameEHRegion(trueBb, m_startBlock)) + { + return false; + } + // m_finalBlock is only allowed to be null if both return. // E.g: Then block exits by throwing an exception => we bail here. if (m_finalBlock == nullptr && (!falseBb->KindIs(BBJ_RETURN) || !trueBb->KindIs(BBJ_RETURN))) diff --git a/src/tests/JIT/Regression/JitBlue/Runtime_127446/Runtime_127446.cs b/src/tests/JIT/Regression/JitBlue/Runtime_127446/Runtime_127446.cs new file mode 100644 index 00000000000000..91104c1842847e --- /dev/null +++ b/src/tests/JIT/Regression/JitBlue/Runtime_127446/Runtime_127446.cs @@ -0,0 +1,53 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +namespace Runtime_127446; + +using System; +using Xunit; + +public class Runtime_127446 +{ + // Regression test: the JIT's if-conversion phase used to assert when the + // "Then" block was the start of an EH region (and therefore marked + // BBF_DONT_REMOVE). Compilation should succeed without hitting the assert. + [Fact] + public static void TestEntryPoint() + { + try + { + M0(); + } + catch (NullReferenceException) + { + } + catch (DivideByZeroException) + { + } + } + + private static void M0() + { + int var1 = default(int); + bool[,] var4 = default(bool[,]); + if (var4[0, 0]) + { + try + { + var1 = 0; + } + catch (System.Exception) + { + try + { + var4[0, 0] = var4[0, 0]; + } + catch (System.Exception) + { + } + } + } + + var1 = (0 / var1); + } +} diff --git a/src/tests/JIT/Regression/Regression_ro_2.csproj b/src/tests/JIT/Regression/Regression_ro_2.csproj index 04778781d23124..edf1a6f91d385b 100644 --- a/src/tests/JIT/Regression/Regression_ro_2.csproj +++ b/src/tests/JIT/Regression/Regression_ro_2.csproj @@ -96,6 +96,7 @@ + From 4586cd5c0b7c48fa08821daa076f53024d5d3d31 Mon Sep 17 00:00:00 2001 From: Egor Bogatov Date: Thu, 7 May 2026 13:56:55 +0200 Subject: [PATCH 036/109] JIT: Remove redundant null checks for non-null PHIs (#127810) Teach non-null assertion propagation to inspect edge assertions reaching PHI VNs, removing redundant explicit null checks after `??=` merges. ```csharp class Inner { int _value; public int Do(int n) { if (n > 0) return _value + n; return _value - n; } } class Program { Inner? _inner; [MethodImpl(MethodImplOptions.NoInlining)] public int Invoke(int n) => (_inner ??= new Inner()).Do(n); } ``` ```diff G_M*_IG04: - cmp byte ptr [rax], al test ebx, ebx jg SHORT G_M*_IG06 ``` Fixes #127796 [Diffs](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1409111&view=ms.vss-build-web.run-extensions-tab) --- src/coreclr/jit/assertionprop.cpp | 80 +++++++++++++++++-------------- src/coreclr/jit/compiler.h | 2 +- 2 files changed, 45 insertions(+), 37 deletions(-) diff --git a/src/coreclr/jit/assertionprop.cpp b/src/coreclr/jit/assertionprop.cpp index 9d4731ac02f6ab..2d4a84a3e41da4 100644 --- a/src/coreclr/jit/assertionprop.cpp +++ b/src/coreclr/jit/assertionprop.cpp @@ -4940,33 +4940,8 @@ bool Compiler::optAssertionIsNonNull(GenTree* op, ASSERT_VALARG_TP assertions) // If local assertion prop use lcl comparison, else use VN comparison. if (!optLocalAssertionProp) { - // Look at both the top-level vn, and - // the vn we get by stripping off any constant adds. - // ValueNum vn = vnStore->VNConservativeNormalValue(op->gtVNPair); - if (vn == ValueNumStore::NoVN) - { - return false; - } - - ValueNum vnBase = vn; - target_ssize_t offset = 0; - vnStore->PeelOffsets(&vnBase, &offset); - - // Check each assertion to find if we have a vn != null assertion. - // - BitVecOps::Iter iter(apTraits, assertions); - unsigned index = 0; - while (iter.NextElem(&index)) - { - AssertionIndex assertionIndex = GetAssertionIndex(index); - const AssertionDsc& curAssertion = optGetAssertion(assertionIndex); - if (curAssertion.CanPropNonNull() && - ((curAssertion.GetOp1().GetVN() == vn) || (curAssertion.GetOp1().GetVN() == vnBase))) - { - return true; - } - } + return optAssertionVNIsNonNull(vn, assertions); } else { @@ -5003,31 +4978,64 @@ bool Compiler::optAssertionIsNonNull(GenTree* op, ASSERT_VALARG_TP assertions) // Arguments: // vn - VN to check // assertions - set of live assertions +// budget - limits the depth of recursion when chasing assertions across VNs. // // Return Value: // True if the VN could be proven non-null. // -bool Compiler::optAssertionVNIsNonNull(ValueNum vn, ASSERT_VALARG_TP assertions) +bool Compiler::optAssertionVNIsNonNull(ValueNum vn, ASSERT_VALARG_TP assertions, int budget) { + if (vn == ValueNumStore::NoVN) + { + return false; + } + if (vnStore->IsKnownNonNull(vn)) { return true; } - if (!BitVecOps::MayBeUninit(assertions) && optAssertionHasAssertionsForVN(vn)) + ValueNum vnBase = vn; + target_ssize_t offset = 0; + vnStore->PeelOffsets(&vnBase, &offset); + + // Check each assertion to find if we have a vn != null assertion. + // + BitVecOps::Iter iter(apTraits, assertions); + unsigned index = 0; + while (iter.NextElem(&index)) { - BitVecOps::Iter iter(apTraits, assertions); - unsigned index = 0; - while (iter.NextElem(&index)) + AssertionIndex assertionIndex = GetAssertionIndex(index); + const AssertionDsc& curAssertion = optGetAssertion(assertionIndex); + if (curAssertion.CanPropNonNull() && + ((curAssertion.GetOp1().GetVN() == vn) || (curAssertion.GetOp1().GetVN() == vnBase))) { - const AssertionDsc& curAssertion = optGetAssertion(GetAssertionIndex(index)); - if (curAssertion.CanPropNonNull() && curAssertion.GetOp1().GetVN() == vn) - { - return true; - } + return true; } } + if (budget <= 0) + { + return false; + } + + // Inspect the reaching assertions for the vn and vnBase. + // + auto visitor = [this, budget](ValueNum reachingVN, ASSERT_TP reachingAssertions) { + return optAssertionVNIsNonNull(reachingVN, reachingAssertions, budget - 1) ? AssertVisit::Continue + : AssertVisit::Abort; + }; + + if (optVisitReachingAssertions(vn, visitor) == AssertVisit::Continue) + { + return true; + } + + if ((vnBase != vn) && (optVisitReachingAssertions(vnBase, visitor) == AssertVisit::Continue)) + { + return true; + } + return false; } diff --git a/src/coreclr/jit/compiler.h b/src/coreclr/jit/compiler.h index 7f6426b6b7bf31..f964828161fac9 100644 --- a/src/coreclr/jit/compiler.h +++ b/src/coreclr/jit/compiler.h @@ -8825,7 +8825,7 @@ class Compiler // Used for respective assertion propagations. AssertionIndex optAssertionIsSubrange(GenTree* tree, IntegralRange range, ASSERT_VALARG_TP assertions); AssertionIndex optAssertionIsSubtype(GenTree* tree, GenTree* methodTableArg, ASSERT_VALARG_TP assertions); - bool optAssertionVNIsNonNull(ValueNum vn, ASSERT_VALARG_TP assertions); + bool optAssertionVNIsNonNull(ValueNum vn, ASSERT_VALARG_TP assertions, int budget = 10); bool optAssertionIsNonNull(GenTree* op, ASSERT_VALARG_TP assertions); AssertionIndex optGlobalAssertionIsEqualOrNotEqual(ASSERT_VALARG_TP assertions, GenTree* op1, GenTree* op2); From 9f657f018a1d31bf7c76f021693492c9d3b967a9 Mon Sep 17 00:00:00 2001 From: Egor Bogatov Date: Thu, 7 May 2026 13:58:29 +0200 Subject: [PATCH 037/109] Remove unsafe code from System.Linq.MaxMin (#127845) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit > [!NOTE] > This PR is AI-generated. This PR does several things: 1) Replace unsafe code with safe in `MinMaxInteger` 2) Replace scalar loops over Vector512 and Vector256 with a reduction to Vector128 so we only run scalar loop over the smallest vector - this improves perf. 3) Adds a bunch of [AI] to satisfy inliner (3) is needed because we run out of inliner budget in the safe version: https://gist.github.com/EgorBo/278e4bc6795cc829b9e129d7c5932f14 ## Benchmark ```cs public class Bench { private int[] _ints = default!; private long[] _longs = default!; private byte[] _bytes = default!; [Params(2, 4, 16, 32, 200, 1000)] public int Length { get; set; } [GlobalSetup] public void Setup() { var rng = new Random(42); _ints = new int[Length]; _longs = new long[Length]; _bytes = new byte[Length]; for (int i = 0; i < Length; i++) { _ints[i] = rng.Next(); _longs[i] = ((long)rng.Next() << 32) | (uint)rng.Next(); _bytes[i] = (byte)rng.Next(256); } } [Benchmark] public int IntMax() => _ints.Max(); [Benchmark] public int IntMin() => _ints.Min(); [Benchmark] public long LongMax() => _longs.Max(); [Benchmark] public byte ByteMax() => _bytes.Max(); } ``` **Summary** — speedup of PR vs `main` (>1 = PR faster, <1 = PR slower). Full results: EgorBot/Benchmarks#187. **x64 (AMD EPYC, AVX-512)** — significant wins from inliner-budget fixes + more efficient Vector256/512 → scalar reduction: | Method | 2 | 4 | 16 | 32 | 200 | 1000 | |---------|-----:|-----:|-------:|------:|-------:|------:| | IntMax | 1.03 | 1.07 | **9.41** | **2.79** | **5.42** | **1.89** | | IntMin | 1.02 | 1.07 | **3.10** | **2.61** | **3.03** | **1.22** | | LongMax | 1.15 | **1.92** | **9.19** | **2.41** | 1.06 | 1.06 | | ByteMax | **2.42** | **3.37** | **1.26** | **3.03** | **6.52** | **7.76** | **arm64 (Apple M2, Vector128)** — mostly flat; minor regressions at small/medium lengths | Method | 2 | 4 | 16 | 32 | 200 | 1000 | |---------|-----:|-----:|-----:|-----:|-----:|-----:| | IntMax | 0.92 | 0.95 | 0.83 | 0.99 | 1.08 | 1.01 | | IntMin | 0.96 | 0.99 | 0.83 | 0.98 | 1.05 | 1.02 | | LongMax | 1.03 | 0.91 | 0.99 | 0.99 | 1.00 | 1.00 | | ByteMax | 0.99 | 1.00 | 0.98 | 1.00 | 0.92 | 1.03 | --- src/coreclr/jit/importercalls.cpp | 4 + src/coreclr/jit/inline.cpp | 41 ++++++++ src/coreclr/jit/inline.h | 23 ++++- .../System.Linq/src/System/Linq/MaxMin.cs | 96 +++++++++---------- 4 files changed, 110 insertions(+), 54 deletions(-) diff --git a/src/coreclr/jit/importercalls.cpp b/src/coreclr/jit/importercalls.cpp index a7e7473ac475dc..65243e7ca9e636 100644 --- a/src/coreclr/jit/importercalls.cpp +++ b/src/coreclr/jit/importercalls.cpp @@ -3144,6 +3144,7 @@ GenTree* Compiler::impIntrinsic(CORINFO_CLASS_HANDLE clsHnd, case NI_IsSupported_True: { assert(sig->numArgs == 0); + impInlineRoot()->m_inlineStrategy->NoteHardwareIntrinsicCheckObserved(); return gtNewIconNode(true); } @@ -3155,6 +3156,7 @@ GenTree* Compiler::impIntrinsic(CORINFO_CLASS_HANDLE clsHnd, case NI_IsSupported_Dynamic: { + impInlineRoot()->m_inlineStrategy->NoteHardwareIntrinsicCheckObserved(); break; } @@ -3163,6 +3165,8 @@ GenTree* Compiler::impIntrinsic(CORINFO_CLASS_HANDLE clsHnd, CORINFO_CLASS_HANDLE typeArgHnd; CorInfoType simdBaseJitType; + impInlineRoot()->m_inlineStrategy->NoteHardwareIntrinsicCheckObserved(); + typeArgHnd = info.compCompHnd->getTypeInstantiationArgument(clsHnd, 0); simdBaseJitType = info.compCompHnd->getTypeForPrimitiveNumericClass(typeArgHnd); diff --git a/src/coreclr/jit/inline.cpp b/src/coreclr/jit/inline.cpp index 3a6cc6b0b4d33a..cf04918ec07ab9 100644 --- a/src/coreclr/jit/inline.cpp +++ b/src/coreclr/jit/inline.cpp @@ -848,6 +848,7 @@ InlineStrategy::InlineStrategy(Compiler* compiler) , m_InitialSizeEstimate(0) , m_CurrentSizeEstimate(0) , m_HasForceViaDiscretionary(false) + , m_HasHardwareIntrinsicCheck(false) #if defined(DEBUG) , m_MethodXmlFilePosition(0) , m_Random(nullptr) @@ -1255,6 +1256,46 @@ bool InlineStrategy::BudgetCheck(unsigned ilSize) return result; } +//------------------------------------------------------------------------ +// NoteHardwareIntrinsicCheckObserved: record that the root method or an +// already-imported inlinee references a HW-intrinsic IsSupported / +// IsHardwareAccelerated capability check, and grow the inline time +// budget on the first such observation per root method. +// +// Notes: +// Methods with SIMD paths typically carry several ISA-specific fallbacks +// (e.g. Vector512/Vector256/Vector128/scalar variants), making them +// IL-heavy. Inlining one such callee can otherwise consume nearly the +// entire inline time budget for the root method, blocking subsequent +// inlines of trivial helpers (Span.Slice, property getters, etc.). +// +// The boost is one-shot per root method and monotonic: it never lowers +// the current budget (preserving any prior growth from force inlines). +// +void InlineStrategy::NoteHardwareIntrinsicCheckObserved() +{ + if (m_HasHardwareIntrinsicCheck) + { + return; + } + + m_HasHardwareIntrinsicCheck = true; + + // Compute the boosted budget in 64-bit to avoid signed overflow when + // an unusually large JitInlineBudget is configured. + const int64_t boosted64 = + static_cast(m_InitialTimeBudget) * static_cast(SIMD_BUDGET_BOOST_MULTIPLIER); + const int boosted = (boosted64 > INT_MAX) ? INT_MAX : static_cast(boosted64); + + if (m_CurrentTimeBudget < boosted) + { + JITDUMP("\nBudget: HW intrinsic IsSupported/IsHardwareAccelerated check observed; " + "boosting inline time budget from %d to %d (initial=%d, multiplier=%d)\n", + m_CurrentTimeBudget, boosted, m_InitialTimeBudget, (int)SIMD_BUDGET_BOOST_MULTIPLIER); + m_CurrentTimeBudget = boosted; + } +} + //------------------------------------------------------------------------ // NewRoot: construct an InlineContext for the root method // diff --git a/src/coreclr/jit/inline.h b/src/coreclr/jit/inline.h index 83d74587789366..4ae4670f800c96 100644 --- a/src/coreclr/jit/inline.h +++ b/src/coreclr/jit/inline.h @@ -989,7 +989,15 @@ class InlineStrategy // Maximum number of over-budget [Intrinsic]-type inlines allowed per root method. enum { - MAX_OVER_BUDGET_INTRINSIC_INLINES = 50 + MAX_OVER_BUDGET_INTRINSIC_INLINES = 50, + + // When the root method or an already-imported inlinee references a + // Vector*/HW-intrinsic IsSupported / IsHardwareAccelerated property, + // multiply the initial inline time budget by this factor (one-shot). + // Methods with SIMD ISA fallbacks tend to be IL-heavy, and inlining one + // such callee can otherwise consume the budget for trivial helpers + // (e.g., Span.Slice, property getters) that follow. + SIMD_BUDGET_BOOST_MULTIPLIER = 5 }; // Number of over-budget inlines admitted because the callee was on an [Intrinsic] type. @@ -1004,6 +1012,18 @@ class InlineStrategy m_OverBudgetIntrinsicInlineCount++; } + // Note that the root method or an already-imported inlinee uses a HW + // intrinsic IsSupported / IsHardwareAccelerated capability check (e.g., + // Vector128.IsHardwareAccelerated, Vector.IsSupported, Sse41.IsSupported). + // On the first such observation per root method this dramatically increases + // the inline time budget so that subsequent small inlinees are not starved. + void NoteHardwareIntrinsicCheckObserved(); + + bool HasObservedHardwareIntrinsicCheck() const + { + return m_HasHardwareIntrinsicCheck; + } + // Number of successful inlines into the root unsigned GetInlineCount() const { @@ -1165,6 +1185,7 @@ class InlineStrategy int m_InitialSizeEstimate; int m_CurrentSizeEstimate; bool m_HasForceViaDiscretionary; + bool m_HasHardwareIntrinsicCheck; #if defined(DEBUG) long m_MethodXmlFilePosition; diff --git a/src/libraries/System.Linq/src/System/Linq/MaxMin.cs b/src/libraries/System.Linq/src/System/Linq/MaxMin.cs index 7adf15a83dcd3e..26e1d6eec512e4 100644 --- a/src/libraries/System.Linq/src/System/Linq/MaxMin.cs +++ b/src/libraries/System.Linq/src/System/Linq/MaxMin.cs @@ -3,9 +3,8 @@ using System.Collections.Generic; using System.Numerics; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; using System.Runtime.Intrinsics; +using System.Runtime.CompilerServices; namespace System.Linq { @@ -47,77 +46,68 @@ private static T MinMaxInteger(this IEnumerable source) value = span[i]; } } + return value; } - else if (!Vector256.IsHardwareAccelerated || !Vector256.IsSupported || span.Length < Vector256.Count) - { - ref T current = ref MemoryMarshal.GetReference(span); - ref T lastVectorStart = ref Unsafe.Add(ref current, span.Length - Vector128.Count); - Vector128 best = Vector128.LoadUnsafe(ref current); - current = ref Unsafe.Add(ref current, Vector128.Count); + // All vectorized paths reduce to 128-bit, so we can use that as our accumulator + // regardless of the maximum supported vector size. + Vector128 best128; - while (Unsafe.IsAddressLessThan(ref current, ref lastVectorStart)) - { - best = TMinMax.Compare(best, Vector128.LoadUnsafe(ref current)); - current = ref Unsafe.Add(ref current, Vector128.Count); - } - best = TMinMax.Compare(best, Vector128.LoadUnsafe(ref lastVectorStart)); + if (!Vector256.IsHardwareAccelerated || span.Length < Vector256.Count) + { + ReadOnlySpan data = span; + Vector128 best = Vector128.Create(data); + data = data.Slice(Vector128.Count); - value = best[0]; - for (int i = 1; i < Vector128.Count; i++) + while (data.Length > Vector128.Count) { - if (TMinMax.Compare(best[i], value)) - { - value = best[i]; - } + best = TMinMax.Compare(best, Vector128.Create(data)); + data = data.Slice(Vector128.Count); } + best128 = TMinMax.Compare(best, Vector128.Create(span.Slice(span.Length - Vector128.Count))); } - else if (!Vector512.IsHardwareAccelerated || !Vector512.IsSupported || span.Length < Vector512.Count) + else if (!Vector512.IsHardwareAccelerated || span.Length < Vector512.Count) { - ref T current = ref MemoryMarshal.GetReference(span); - ref T lastVectorStart = ref Unsafe.Add(ref current, span.Length - Vector256.Count); + ReadOnlySpan data = span; + Vector256 best = Vector256.Create(data); + data = data.Slice(Vector256.Count); - Vector256 best = Vector256.LoadUnsafe(ref current); - current = ref Unsafe.Add(ref current, Vector256.Count); - - while (Unsafe.IsAddressLessThan(ref current, ref lastVectorStart)) + while (data.Length > Vector256.Count) { - best = TMinMax.Compare(best, Vector256.LoadUnsafe(ref current)); - current = ref Unsafe.Add(ref current, Vector256.Count); + best = TMinMax.Compare(best, Vector256.Create(data)); + data = data.Slice(Vector256.Count); } - best = TMinMax.Compare(best, Vector256.LoadUnsafe(ref lastVectorStart)); + best = TMinMax.Compare(best, Vector256.Create(span.Slice(span.Length - Vector256.Count))); - value = best[0]; - for (int i = 1; i < Vector256.Count; i++) - { - if (TMinMax.Compare(best[i], value)) - { - value = best[i]; - } - } + // Reduce to 128-bit + best128 = TMinMax.Compare(best.GetLower(), best.GetUpper()); } else { - ref T current = ref MemoryMarshal.GetReference(span); - ref T lastVectorStart = ref Unsafe.Add(ref current, span.Length - Vector512.Count); + ReadOnlySpan data = span; + Vector512 best = Vector512.Create(data); + data = data.Slice(Vector512.Count); - Vector512 best = Vector512.LoadUnsafe(ref current); - current = ref Unsafe.Add(ref current, Vector512.Count); - - while (Unsafe.IsAddressLessThan(ref current, ref lastVectorStart)) + while (data.Length > Vector512.Count) { - best = TMinMax.Compare(best, Vector512.LoadUnsafe(ref current)); - current = ref Unsafe.Add(ref current, Vector512.Count); + best = TMinMax.Compare(best, Vector512.Create(data)); + data = data.Slice(Vector512.Count); } - best = TMinMax.Compare(best, Vector512.LoadUnsafe(ref lastVectorStart)); + best = TMinMax.Compare(best, Vector512.Create(span.Slice(span.Length - Vector512.Count))); - value = best[0]; - for (int i = 1; i < Vector512.Count; i++) + // Reduce to 128-bit + Vector256 best256 = TMinMax.Compare(best.GetLower(), best.GetUpper()); + best128 = TMinMax.Compare(best256.GetLower(), best256.GetUpper()); + } + + // Reduce to single value + // NOTE: this can be optimized further with shuffles. + value = best128[0]; + for (int i = 1; i < Vector128.Count; i++) + { + if (TMinMax.Compare(best128[i], value)) { - if (TMinMax.Compare(best[i], value)) - { - value = best[i]; - } + value = best128[i]; } } } From 58c6d30b9b87bdadafae1930af30c85286b543cb Mon Sep 17 00:00:00 2001 From: Pavel Savara Date: Thu, 7 May 2026 14:45:15 +0200 Subject: [PATCH 038/109] [browser][coreCLR] Enable download retry by default and improve retry sequencing (#127559) --- .../Wasm.Build.Tests/ModuleConfigTests.cs | 30 +++++++++++++++++-- .../libs/Common/JavaScript/loader/assets.ts | 27 +++++++++++++++-- .../libs/Common/JavaScript/loader/config.ts | 1 + .../JavaScript/loader/lib-initializers.ts | 9 +++--- .../libs/Common/JavaScript/loader/run.ts | 7 ++++- 5 files changed, 64 insertions(+), 10 deletions(-) diff --git a/src/mono/wasm/Wasm.Build.Tests/ModuleConfigTests.cs b/src/mono/wasm/Wasm.Build.Tests/ModuleConfigTests.cs index 717920233be1de..6fcbe04e121fd7 100644 --- a/src/mono/wasm/Wasm.Build.Tests/ModuleConfigTests.cs +++ b/src/mono/wasm/Wasm.Build.Tests/ModuleConfigTests.cs @@ -23,7 +23,7 @@ public ModuleConfigTests(ITestOutputHelper output, SharedBuildPerTestClassFixtur [Theory] [InlineData(false)] - // [InlineData(true)] // ActiveIssue: https://github.com/dotnet/runtime/issues/124946 + [InlineData(true)] public async Task DownloadProgressFinishes(bool failAssemblyDownload) { Configuration config = Configuration.Debug; @@ -50,13 +50,39 @@ public async Task DownloadProgressFinishes(bool failAssemblyDownload) "The download progress test did emit unexpected message about second download retry" ); Assert.True( - result.TestOutput.Any(m => m.Contains("Throw error instead of downloading resource") == failAssemblyDownload), + result.TestOutput.Any(m => m.Contains("Throw error instead of downloading resource")) == failAssemblyDownload, failAssemblyDownload ? "The download progress test didn't emit expected message about failing download" : "The download progress test did emit unexpected message about failing download" ); } + [Fact] + public async Task DownloadRetryRecoversFromFailure() + { + Configuration config = Configuration.Release; + ProjectInfo info = CopyTestAsset(config, false, TestAsset.WasmBasicTestApp, "ModuleConfigTests_DownloadRetryRecoversFromFailure"); + PublishProject(info, config); + + var result = await RunForPublishWithWebServer(new BrowserRunOptions( + Configuration: config, + TestScenario: "DownloadResourceProgressTest", + BrowserQueryString: new NameValueCollection { {"failAssemblyDownload", "true" } } + )); + Assert.True( + result.TestOutput.Any(m => m.Contains("DownloadResourceProgress: Finished")), + "Download progress didn't finish after retries" + ); + Assert.True( + result.ConsoleOutput.Any(m => m.Contains("Retrying download")), + "Expected retry log message was not emitted" + ); + Assert.False( + result.ConsoleOutput.Any(m => m.Contains("Retrying download (2)")), + "Second retry should not be needed since first retry succeeds" + ); + } + [Fact, TestCategory("bundler-friendly")] public async Task OutErrOverrideWorks() { diff --git a/src/native/libs/Common/JavaScript/loader/assets.ts b/src/native/libs/Common/JavaScript/loader/assets.ts index 35e57c750359b0..fad4da6d33b1c0 100644 --- a/src/native/libs/Common/JavaScript/loader/assets.ts +++ b/src/native/libs/Common/JavaScript/loader/assets.ts @@ -17,6 +17,11 @@ let totalAssetsToDownload = 0; let loadBootResourceCallback: LoadBootResourceCallback | undefined = undefined; const loadedLazyAssemblies = new Set(); let mainWasmAsset: WasmAsset | null = null; +const allDownloadsQueuedPCS = createPromiseCompletionSource(); + +export function resolveAllDownloadsQueued(): void { + allDownloadsQueuedPCS.resolve(); +} export function setLoadBootResourceCallback(callback: LoadBootResourceCallback | undefined): void { loadBootResourceCallback = callback; @@ -332,7 +337,14 @@ export async function fetchNativeSymbols(asset: SymbolsAsset): Promise { async function fetchBytes(asset: AssetEntryInternal): Promise { dotnetAssert.check(asset && asset.resolvedUrl, "Bad asset.resolvedUrl"); - const response = await loadResource(asset); + let response: Response; + try { + response = await loadResource(asset); + } catch (err: any) { + // Strip .silent flag from download errors so they are properly reported via exit listeners + const message = err instanceof Error ? err.message : String(err); + throw new Error(`Failed to load resource '${asset.name}' from '${asset.resolvedUrl}': ${message}`, { cause: err }); + } if (!response.ok) { if (asset.isOptional) { dotnetLogger.warn(`Optional resource '${asset.name}' failed to load from '${asset.resolvedUrl}'. HTTP status: ${response.status} ${response.statusText}`); @@ -346,7 +358,14 @@ async function fetchBytes(asset: AssetEntryInternal): Promise async function fetchText(asset: AssetEntryInternal): Promise { dotnetAssert.check(asset && asset.resolvedUrl, "Bad asset.resolvedUrl"); - const response = await loadResource(asset); + let response: Response; + try { + response = await loadResource(asset); + } catch (err: any) { + // Strip .silent flag from download errors so they are properly reported via exit listeners + const message = err instanceof Error ? err.message : String(err); + throw new Error(`Failed to load resource '${asset.name}' from '${asset.resolvedUrl}': ${message}`, { cause: err }); + } if (!response.ok) { if (asset.isOptional) { dotnetLogger.warn(`Optional resource '${asset.name}' failed to load from '${asset.resolvedUrl}'. HTTP status: ${response.status} ${response.statusText}`); @@ -377,15 +396,19 @@ async function loadResourceRetry(asset: AssetEntryInternal): Promise { if (response.ok || asset.isOptional || noRetryStatusCodes.has(response.status)) { return response; } + // second attempt only after all first attempts are queued + await allDownloadsQueuedPCS.promise; if (response.status === 429) { // Too Many Requests await delay(100); } + dotnetLogger.debug(`Retrying download '${asset.name}'`); response = await loadResourceAttempt(); if (response.ok || noRetryStatusCodes.has(response.status)) { return response; } await delay(100); // wait 100ms before the last retry + dotnetLogger.debug(`Retrying download (2) '${asset.name}' after delay`); response = await loadResourceAttempt(); if (response.ok) { return response; diff --git a/src/native/libs/Common/JavaScript/loader/config.ts b/src/native/libs/Common/JavaScript/loader/config.ts index 061c6ea9102759..659cdb6b3acfde 100644 --- a/src/native/libs/Common/JavaScript/loader/config.ts +++ b/src/native/libs/Common/JavaScript/loader/config.ts @@ -92,6 +92,7 @@ function defaultConfig(target: LoaderConfigInternal) { if (target.diagnosticTracing === undefined) target.diagnosticTracing = false; if (target.virtualWorkingDirectory === undefined) target.virtualWorkingDirectory = browserVirtualAppBase; if (target.maxParallelDownloads === undefined) target.maxParallelDownloads = 16; + if (target.enableDownloadRetry === undefined) target.enableDownloadRetry = true; normalizeConfig(target); } diff --git a/src/native/libs/Common/JavaScript/loader/lib-initializers.ts b/src/native/libs/Common/JavaScript/loader/lib-initializers.ts index 48e21f3b494e70..fb9697734673c8 100644 --- a/src/native/libs/Common/JavaScript/loader/lib-initializers.ts +++ b/src/native/libs/Common/JavaScript/loader/lib-initializers.ts @@ -33,10 +33,9 @@ async function invokeWithErrorHandling( } catch (err) { const name = asset.name || asset.resolvedUrl || "unknown"; const message = err instanceof Error ? err.message : String(err); - dotnetLogger.warn( - `Failed to invoke '${functionName}' on library initializer '${name}': ${message}` - ); - exit(1, err); - throw err; + const wrappedError = new Error(`Failed to invoke '${functionName}' on library initializer '${name}': ${message}`, { cause: err }); + dotnetLogger.warn(wrappedError.message); + exit(1, wrappedError); + throw wrappedError; } } diff --git a/src/native/libs/Common/JavaScript/loader/run.ts b/src/native/libs/Common/JavaScript/loader/run.ts index 230f54fca8e150..00e223e3cd994c 100644 --- a/src/native/libs/Common/JavaScript/loader/run.ts +++ b/src/native/libs/Common/JavaScript/loader/run.ts @@ -8,7 +8,7 @@ import { exit, runtimeState } from "./exit"; import { createPromiseCompletionSource } from "./promise-completion-source"; import { getIcuResourceName } from "./icu"; import { loaderConfig, validateLoaderConfig } from "./config"; -import { fetchAssembly, fetchIcu, fetchNativeSymbols, fetchPdb, fetchSatelliteAssemblies, fetchVfs, fetchMainWasm, loadDotnetModule, loadJSModule, nativeModulePromiseController, verifyAllAssetsDownloaded, callLibraryInitializerOnRuntimeReady, callLibraryInitializerOnRuntimeConfigLoaded, prefetchAllResources, prefetchJSModuleLinks } from "./assets"; +import { fetchAssembly, fetchIcu, fetchNativeSymbols, fetchPdb, fetchSatelliteAssemblies, fetchVfs, fetchMainWasm, loadDotnetModule, loadJSModule, nativeModulePromiseController, verifyAllAssetsDownloaded, callLibraryInitializerOnRuntimeReady, callLibraryInitializerOnRuntimeConfigLoaded, prefetchAllResources, prefetchJSModuleLinks, resolveAllDownloadsQueued } from "./assets"; import { initPolyfills } from "./polyfills"; import { validateEngineFeatures } from "./bootstrap"; @@ -131,6 +131,11 @@ export async function createRuntime(downloadOnly: boolean, httpCacheOnly: boolea const isDebuggingSupported = loaderConfig.debugLevel != 0; const corePDBsPromise = forEachResource(resources.corePdb, fetchPdb, () => isDebuggingSupported); const pdbsPromise = forEachResource(resources.pdb, fetchPdb, () => isDebuggingSupported); + + // Signal that all first-attempt asset fetches queued above via forEachResource/fetch* have been queued. + // Retry logic waits on this before attempting second downloads for those asset fetches. + resolveAllDownloadsQueued(); + // In download-only mode, just add prefetch hints for runtime-ready modules so create() loads them from cache. // In create mode, load them now so onRuntimeReady can be called later. let modulesAfterRuntimeReadyPromises: [JsAsset, Promise][] = []; From ee4f930cc2ad1591e9ccbc77f079c6d915ef27ad Mon Sep 17 00:00:00 2001 From: Tommaso Cittadino <115944088+cittaz@users.noreply.github.com> Date: Thu, 7 May 2026 14:59:06 +0200 Subject: [PATCH 039/109] Fix WebSocket close single-consumer violation (#127183) --- .../tests/CloseTest.cs | 10 ++- .../System/Net/WebSockets/ManagedWebSocket.cs | 89 ++++++++++++------- 2 files changed, 63 insertions(+), 36 deletions(-) diff --git a/src/libraries/System.Net.WebSockets.Client/tests/CloseTest.cs b/src/libraries/System.Net.WebSockets.Client/tests/CloseTest.cs index 9a8f33299de93e..dbcc997e932e36 100644 --- a/src/libraries/System.Net.WebSockets.Client/tests/CloseTest.cs +++ b/src/libraries/System.Net.WebSockets.Client/tests/CloseTest.cs @@ -422,9 +422,13 @@ protected async Task RunClient_CloseAsync_DuringConcurrentReceiveAsync_ExpectedS await cws.CloseAsync(WebSocketCloseStatus.NormalClosure, "", CancellationToken.None); - // There is a race condition in the above. If the ReceiveAsync receives the sent close message from the server, - // then it will complete successfully and the socket will close successfully. If the CloseAsync receive the sent - // close message from the server, then the receive async will end up getting aborted along with the socket. + // The outcome depends on timing. Two outcomes are acceptable: + // 1. The pending ReceiveAsync picks up the server's close frame cleanly: it completes with a Close + // message and the socket transitions to Closed. + // 2. The close handshake triggers an internal Abort (e.g. WaitForServerToCloseConnectionAsync + // times out because the server doesn't close TCP within its 1s window): state becomes Aborted, + // the parked receive's stream read fails, and ReceiveAsyncPrivate translates the exception to + // OperationCanceledException because of the Aborted state. try { await t; diff --git a/src/libraries/System.Net.WebSockets/src/System/Net/WebSockets/ManagedWebSocket.cs b/src/libraries/System.Net.WebSockets/src/System/Net/WebSockets/ManagedWebSocket.cs index 88abc5e56d0c0e..388c660cd01d39 100644 --- a/src/libraries/System.Net.WebSockets/src/System/Net/WebSockets/ManagedWebSocket.cs +++ b/src/libraries/System.Net.WebSockets/src/System/Net/WebSockets/ManagedWebSocket.cs @@ -408,10 +408,10 @@ public override Task CloseOutputAsync(WebSocketCloseStatus closeStatus, string? if (NetEventSource.Log.IsEnabled()) NetEventSource.Trace(this); WebSocketValidate.ValidateCloseStatus(closeStatus, statusDescription); - return CloseOutputAsyncCore(closeStatus, statusDescription, cancellationToken); + return CloseOutputAsyncCore(closeStatus, statusDescription, enterReceiveMutex: true, cancellationToken: cancellationToken); } - private async Task CloseOutputAsyncCore(WebSocketCloseStatus closeStatus, string? statusDescription, CancellationToken cancellationToken) + private async Task CloseOutputAsyncCore(WebSocketCloseStatus closeStatus, string? statusDescription, bool enterReceiveMutex, CancellationToken cancellationToken) { if (NetEventSource.Log.IsEnabled()) NetEventSource.Trace(this); @@ -419,6 +419,12 @@ private async Task CloseOutputAsyncCore(WebSocketCloseStatus closeStatus, string await SendCloseFrameAsync(closeStatus, statusDescription, cancellationToken).ConfigureAwait(false); + // Polite EOF wait under the receive mutex; avoids racing the receive loop on the stream. + if (!_isServer && _receivedCloseFrame) + { + await WaitForServerToCloseConnectionAsync(enterReceiveMutex, cancellationToken).ConfigureAwait(false); + } + // If we already received a close frame, since we've now also sent one, we're now closed. lock (StateUpdateLock) { @@ -1119,41 +1125,55 @@ private async ValueTask HandleReceivedCloseAsync(MessageHeader header, Cancellat if (!_isServer && _sentCloseFrame) { - await WaitForServerToCloseConnectionAsync(cancellationToken).ConfigureAwait(false); + await WaitForServerToCloseConnectionAsync(enterMutex: false, cancellationToken).ConfigureAwait(false); } } - /// Issues a read on the stream to wait for EOF. - private async ValueTask WaitForServerToCloseConnectionAsync(CancellationToken cancellationToken) + /// Issues a read on the stream to wait for EOF, optionally acquiring first. + private async ValueTask WaitForServerToCloseConnectionAsync(bool enterMutex, CancellationToken cancellationToken) { - if (NetEventSource.Log.IsEnabled()) NetEventSource.Trace(this); + bool mutexEntered = false; + Task? task = null; + try + { + if (enterMutex) + { + await _receiveMutex.EnterAsync(cancellationToken).ConfigureAwait(false); + mutexEntered = true; + if (NetEventSource.Log.IsEnabled()) NetEventSource.MutexEntered(_receiveMutex); + } - // Per RFC 6455 7.1.1, try to let the server close the connection. We give it up to a second. - // We simply issue a read and don't care what we get back; we could validate that we don't get - // additional data, but at this point we're about to close the connection and we're just stalling - // to try to get the server to close first. - ValueTask finalReadTask = _stream.ReadAsync(_receiveBuffer, cancellationToken); + Debug.Assert(_receiveMutex.IsHeld, $"Expected {nameof(_receiveMutex)} to be held"); - if (finalReadTask.IsCompletedSuccessfully) - { - finalReadTask.GetAwaiter().GetResult(); - } - else - { - const int WaitForCloseTimeoutMs = 1_000; // arbitrary amount of time to give the server (same duration as .NET Framework) - Task task = finalReadTask.AsTask(); + if (NetEventSource.Log.IsEnabled()) NetEventSource.Trace(this); + + // Per RFC 6455 7.1.1, try to let the server close the connection. We give it up to a second. + // We simply issue a read and don't care what we get back; we could validate that we don't get + // additional data, but at this point we're about to close the connection and we're just stalling + // to try to get the server to close first. + ValueTask finalReadTask = _stream.ReadAsync(_receiveBuffer, cancellationToken); + + const int WaitForCloseTimeoutMs = 1_000; // arbitrary amount of time to give the server + task = finalReadTask.AsTask(); - try - { #pragma warning disable CA2016 // Token was already provided to the ReadAsync - await task.WaitAsync(TimeSpan.FromMilliseconds(WaitForCloseTimeoutMs)).ConfigureAwait(false); + await task.WaitAsync(TimeSpan.FromMilliseconds(WaitForCloseTimeoutMs)).ConfigureAwait(false); #pragma warning restore CA2016 - } - catch + } + catch + { + if (task is not null) { - // Eat any resulting exceptions. We were going to close the connection, anyway. LogExceptions(task); - Abort(); + } + Abort(); + } + finally + { + if (mutexEntered) + { + _receiveMutex.Exit(); + if (NetEventSource.Log.IsEnabled()) NetEventSource.MutexExited(_receiveMutex); } } } @@ -1267,12 +1287,14 @@ private static bool IsValidCloseStatus(WebSocketCloseStatus closeStatus) private async ValueTask CloseWithReceiveErrorAndThrowAsync( WebSocketCloseStatus closeStatus, WebSocketError error, string? errorMessage = null, Exception? innerException = null) { + Debug.Assert(_receiveMutex.IsHeld, $"Caller should hold the {nameof(_receiveMutex)}"); + if (NetEventSource.Log.IsEnabled()) NetEventSource.Trace(this, errorMessage); - // Close the connection if it hasn't already been closed + // Caller holds _receiveMutex; don't re-enter it for the EOF wait. if (!_sentCloseFrame) { - await CloseOutputAsync(closeStatus, string.Empty, default).ConfigureAwait(false); + await CloseOutputAsyncCore(closeStatus, string.Empty, enterReceiveMutex: false, cancellationToken: default).ConfigureAwait(false); } // Dump our receive buffer; we're in a bad state to do any further processing @@ -1491,6 +1513,12 @@ private async Task CloseAsyncPrivate(WebSocketCloseStatus closeStatus, string? s } } + // Polite EOF wait under the receive mutex; avoids racing the receive loop on the stream. + if (!_isServer && _receivedCloseFrame) + { + await WaitForServerToCloseConnectionAsync(enterMutex: true, cancellationToken).ConfigureAwait(false); + } + // We're closed. Close the connection and update the status. lock (StateUpdateLock) { @@ -1560,11 +1588,6 @@ private async ValueTask SendCloseFrameAsync(WebSocketCloseStatus closeStatus, st if (NetEventSource.Log.IsEnabled()) NetEventSource.Trace(this, $"State transition from {state} to {_state}"); } - - if (!_isServer && _receivedCloseFrame) - { - await WaitForServerToCloseConnectionAsync(cancellationToken).ConfigureAwait(false); - } } private void ConsumeFromBuffer(int count) From 270715bbb734d4ada17c3371726150a097c667e6 Mon Sep 17 00:00:00 2001 From: snickolls-arm <151848422+snickolls-arm@users.noreply.github.com> Date: Thu, 7 May 2026 14:15:06 +0100 Subject: [PATCH 040/109] JIT: Implement UnknownSizeFrame for locals with unknown size (#125491) Implements a simple bump allocator for `TYP_SIMD` and `TYP_MASK`. Locals are allocated to this space when `lvaIsUnknownSizeLocal` is true for the variable. The frame is implemented on ARM64 as two homogenenous blocks containing either `TYP_SIMD` or `TYP_MASK` locals. The x19 register is reserved for addressing locals in the block. Updates codegen for SVE memory transfer instructions to accept indices in multiples of the vector length (or VL / 8 for masks) instead of deriving them from the size of the local. --- src/coreclr/jit/codegen.h | 4 + src/coreclr/jit/codegenarmarch.cpp | 41 ++++ src/coreclr/jit/codegencommon.cpp | 28 +++ src/coreclr/jit/compiler.cpp | 6 + src/coreclr/jit/compiler.h | 215 ++++++++++++++++++ src/coreclr/jit/compiler.hpp | 2 + src/coreclr/jit/emit.cpp | 5 + src/coreclr/jit/emitarm64.cpp | 335 +++++++++++++++-------------- src/coreclr/jit/lclvars.cpp | 119 +++++++++- src/coreclr/jit/lsra.cpp | 10 + src/coreclr/jit/regset.cpp | 4 +- src/coreclr/jit/scopeinfo.cpp | 4 +- src/coreclr/jit/targetarm64.h | 2 + 13 files changed, 596 insertions(+), 179 deletions(-) diff --git a/src/coreclr/jit/codegen.h b/src/coreclr/jit/codegen.h index e0450d9ba3b9ab..bd15513f199d71 100644 --- a/src/coreclr/jit/codegen.h +++ b/src/coreclr/jit/codegen.h @@ -436,6 +436,10 @@ class CodeGen final : public CodeGenInterface void genSaveCalleeSavedRegistersHelp(regMaskTP regsToSaveMask, int lowestCalleeSavedOffset, int spDelta); void genRestoreCalleeSavedRegistersHelp(regMaskTP regsToRestoreMask, int lowestCalleeSavedOffset, int spDelta); +#if defined(TARGET_ARM64) + void genUnknownSizeFrame(); +#endif + #elif defined(TARGET_LOONGARCH64) || defined(TARGET_RISCV64) bool genInstrWithConstant(instruction ins, emitAttr attr, diff --git a/src/coreclr/jit/codegenarmarch.cpp b/src/coreclr/jit/codegenarmarch.cpp index 74d8148f720653..2b23d8b3f7b0af 100644 --- a/src/coreclr/jit/codegenarmarch.cpp +++ b/src/coreclr/jit/codegenarmarch.cpp @@ -4868,9 +4868,50 @@ void CodeGen::genPushCalleeSavedRegisters(regNumber initReg, bool* pInitRegZeroe m_compiler->compFrameInfo.calleeSaveSpOffset = calleeSaveSpOffset; m_compiler->compFrameInfo.calleeSaveSpDelta = calleeSaveSpDelta; m_compiler->compFrameInfo.offsetSpToSavedFp = offsetSpToSavedFp; + #endif // TARGET_ARM64 } +#if defined(TARGET_ARM64) +/***************************************************************************** + * + * Generates code for creating the UnknownSizeFrame stack space. + * + * See Compiler::UnknownSizeFrame for implementation details. The space contains + * stack allocations for Vector. + */ + +void CodeGen::genUnknownSizeFrame() +{ + assert(m_compiler->compLocallocUsed && m_compiler->compUsesUnknownSizeFrame); + assert(m_compiler->unkSizeFrame.isFinalized); + unsigned totalVectorCount = m_compiler->unkSizeFrame.FrameSizeInVectors(); + + // We reserve REG_UNKBASE for addressing SVE locals. This will always point at the top of + // of the UnknownSizeFrame and we index into it. + // TODO-SVE: We may want this to point into the middle of the frame to reduce address + // computations (we have a signed 9-bit indexing immediate). + inst_Mov(TYP_I_IMPL, REG_UNKBASE, REG_SP, false); + + if (0 < totalVectorCount && totalVectorCount <= 32) + { + GetEmitter()->emitIns_R_R_I(INS_sve_addvl, EA_8BYTE, REG_SP, REG_SP, -(ssize_t)totalVectorCount); + } + else + { + // Generate `sp = sp - totalVectorCount * VL` + assert(totalVectorCount != 0); + regNumber rsvd = rsGetRsvdReg(); + // mov rsvd, #totalVectorCount + // rdvl scratch, #1 + // msub sp, rsvd, scratch, sp + instGen_Set_Reg_To_Imm(EA_8BYTE, rsvd, totalVectorCount); + GetEmitter()->emitIns_R_I(INS_sve_rdvl, EA_8BYTE, REG_SCRATCH, 1); + GetEmitter()->emitIns_R_R_R_R(INS_msub, EA_8BYTE, REG_SP, rsvd, REG_SCRATCH, REG_SP); + } +} +#endif + /***************************************************************************** * * Generates code for a function epilog. diff --git a/src/coreclr/jit/codegencommon.cpp b/src/coreclr/jit/codegencommon.cpp index ad6cef5840900b..790bf2b96a9d8e 100644 --- a/src/coreclr/jit/codegencommon.cpp +++ b/src/coreclr/jit/codegencommon.cpp @@ -3720,6 +3720,11 @@ void CodeGen::genCheckUseBlockInit() continue; } + if (m_compiler->lvaIsUnknownSizeLocal(varNum)) + { + continue; + } + if (m_compiler->fgVarIsNeverZeroInitializedInProlog(varNum)) { varDsc->lvMustInit = 0; @@ -4077,6 +4082,12 @@ void CodeGen::genZeroInitFrame(int untrLclHi, int untrLclLo, regNumber initReg, noway_assert(varDsc->lvOnFrame); + if (m_compiler->lvaIsUnknownSizeLocal(varNum)) + { + // This local will belong on the UnknownSizeFrame, which will handle zeroing instead. + continue; + } + // lvMustInit can only be set for GC types or TYP_STRUCT types // or when compInitMem is true // or when in debug code @@ -4815,6 +4826,11 @@ void CodeGen::genFinalizeFrame() regSet.rsSetRegsModified(maskPairRegs); } } + + if (m_compiler->compUsesUnknownSizeFrame) + { + regSet.rsSetRegsModified(RBM_UNKBASE); + } #endif #ifdef DEBUG @@ -5122,6 +5138,11 @@ void CodeGen::genFnProlog() continue; } + if (m_compiler->lvaIsUnknownSizeLocal(varNum)) + { + continue; + } + signed int loOffs = varDsc->GetStackOffset(); signed int hiOffs = varDsc->GetStackOffset() + m_compiler->lvaLclStackHomeSize(varNum); @@ -5547,6 +5568,13 @@ void CodeGen::genFnProlog() // //------------------------------------------------------------------------- +#ifdef TARGET_ARM64 + if (m_compiler->compUsesUnknownSizeFrame) + { + genUnknownSizeFrame(); + } +#endif + #ifdef TARGET_ARM if (needToEstablishFP) { diff --git a/src/coreclr/jit/compiler.cpp b/src/coreclr/jit/compiler.cpp index 24634a2fc4d823..24b980ccc8f755 100644 --- a/src/coreclr/jit/compiler.cpp +++ b/src/coreclr/jit/compiler.cpp @@ -5654,6 +5654,12 @@ void Compiler::generatePatchpointInfo() // unsigned varNum = lclNum; + // Variable-sized locals reside in a different part of the stack frame. + if (lvaIsUnknownSizeLocal(varNum)) + { + continue; + } + if (gsShadowVarInfo != nullptr) { unsigned const shadowNum = gsShadowVarInfo[lclNum].shadowCopy; diff --git a/src/coreclr/jit/compiler.h b/src/coreclr/jit/compiler.h index f964828161fac9..875106b746944b 100644 --- a/src/coreclr/jit/compiler.h +++ b/src/coreclr/jit/compiler.h @@ -982,17 +982,49 @@ class LclVarDsc public: int GetStackOffset() const { + assert(lvValueSize().IsExact()); return lvStkOffs; } void SetStackOffset(int offset) { + assert(lvValueSize().IsExact()); lvStkOffs = offset; } unsigned lvExactSize() const; ValueSize lvValueSize() const; + // SetUnknownSizeFrameIndex: Set the index that has been assigned to this + // local on the UnknownSizeFrame. + // + // This is only used for locals that have an unknown size, such as TYP_SIMD/TYP_MASK. + // These locals do not have an absolute stack offset. + // + // Arguments: + // index -- The index on the UnknownSizeFrame to assign to this local. + // + void SetUnknownSizeFrameIndex(int index) + { + assert(!lvValueSize().IsExact()); + lvStkOffs = index; + } + + // GetUnknownSizeFrameIndex: Get the index that has been assigned to this + // local on the UnknownSizeFrame. + // + // This is only used for locals that have an unknown size, such as TYP_SIMD/TYP_MASK. + // These locals do not have an absolute stack offset. + // + // Returns: + // The index of this local on the UnknownSizeFrame. + // + int GetUnknownSizeFrameIndex() const + { + assert(!lvValueSize().IsExact()); + return lvStkOffs; + } + unsigned lvSlotNum; // original slot # (if remapped) // class handle for the local or null if not known or not a class @@ -4322,6 +4354,185 @@ class Compiler int lvaOSRLocalTier0FrameOffset(unsigned varNum); + //------------------------- UnknownSizeFrame --------------------------------- + + void lvaInitUnknownSizeFrame(); + void lvaAllocUnknownSizeLocal(unsigned varNum); + + bool compUsesUnknownSizeFrame; + +#if defined(FEATURE_SIMD) && defined(TARGET_ARM64) + // For ARM64, the UnknownSizeFrame lives at the end of the statically + // allocated stack space. This means it belongs to the 'alloca' space on the + // frame, and it is essentially the first dynamically allocated stack + // variable. + // + // Currently, the only locals with unknown size are SIMD types supporting + // Vector, TYP_SIMD and TYP_MASK. We do not know the size of these types + // at compile time, so we need to execute the rdvl/addvl instruction to + // learn this size and allocate the UnknownSizeFrame. + // + // We reserve the x19 register to point to the top of the UnknownSizeFrame + // and use this as the base address for local variables with unknown size. + // Reserving a register is simpler than using fp/sp, as fp may point + // to different locations depending on various properties of the frame, and + // the value of sp may change at runtime. + // + // Typically, a vector is loaded using a base address and some index which + // the instruction will scale by VL, for example: `ldr z0, [x19, #3 MUL VL]`. + // A mask is loaded with `ldr p0, [x19, #3 MUL VL]`, but in this case the + // `MUL VL` indicates we are scaling with the length of the predicate + // register rather than the vector. A predicate register is defined to have + // 1/8th the length of a vector register. + // + // We know that sizeof(TYP_SIMD) and sizeof(TYP_MASK) are invariant despite + // being unknown at compile time, so we allocate them in single homogeneous + // blocks per type. An individual local can be referenced from the start of + // its block by an index into the block. + // + // The difference in addressing-mode index scaling means we have to be + // careful where we place the mask locals block with respect to the vector + // locals block. If we place the mask locals after the vector locals, we'll + // need to offset the load index by (8 * nVector) to account for the vector + // locals. + // + // Instead, we choose to pad the mask locals block to VL and place it at the + // beginning of the frame (closest to fp). This way we'll need to offset + // vector load indices by `roundUp(nMask, 8) / 8`. This is less likely to + // put pressure on the immediate encoding range and result in requiring an + // address computation. + // + // The maximum wasted space from the padding is 7/8ths VL (224 bytes with + // the architectural maximum 256 byte vectors), which occurs when 1 mask + // local is spilled to the frame. Alternatively this is 28 bytes for 32 byte + // vectors, for an example closer to today's implementations. + // + // The padding also makes it simple to allocate the UnknownSizeFrame since + // the UnknownSizeFrame will be aligned to VL. The total number of vectors + // to allocate is `(roundUp(nMask, 8) / 8) + nVector`. The stack pointer + // can be adjusted with a single instruction `addvl sp, sp, #totalVectors`. + // + // See the diagram below for a visual representation of this scheme. + // + // ... + // | static space | + // | (totalFrameSize) | + // +----------------------------------+ x19, begin UnknownSizeFrame + // | mask locals block | ^ + // | (nMask * VL/8) | | + // +----------------------------------+ | + // | padding to VL alignment | | + // +----------------------------------+ (roundUp(nMask, 8)/8 + nVector)*VL + // | | | + // | vector locals block | | + // | (nVector * VL) | | + // | | v + // +----------------------------------+ end UnknownSizeFrame + // | | + // | rest of alloca space | + // ... sp + struct UnknownSizeFrame + { + // Number of allocated vectors/masks. These also represent the end of + // the allocation space for each block. The allocator for each block is + // a simple bump allocator. + unsigned nVector = 0; + unsigned nMask = 0; + +#ifdef DEBUG + bool isFinalized = false; +#endif + + // Returns the size of the mask block in number of vector lengths. + unsigned MaskBlockSizeInVectors() + { + assert(roundUp(0U, 8U) == 0); + return roundUp(nMask, 8) / 8; + } + + // Returns the size of the vector block in number of vector lengths. + unsigned VectorBlockSize() + { + return nVector; + } + + // Returns the size of the total UnknownSizeFrame in number of vector + // lengths. + unsigned FrameSizeInVectors() + { + return MaskBlockSizeInVectors() + VectorBlockSize(); + } + + // Allocate a mask, returning an index of the mask in the mask block. + unsigned AllocMask() + { + assert(!isFinalized); + unsigned idx = nMask; + nMask++; + return idx; + } + + // Allocate a vector, returning an index of the vector in the vector + // block. + unsigned AllocVector() + { + assert(!isFinalized); + unsigned idx = nVector; + nVector++; + return idx; + } + + // Returns a negative offset relative to the base of the UnknownSizeFrame + // for addressing an allocated vector or mask local. + // If `isMask == true`, given an index that was assigned to mask local, + // the returned offset is an index measured in units of VL/8. + // Otherwise given an index that was assigned to a vector local, the + // returned offset is measured in units of VL. + // The index parameter should have been obtained through AllocMask() or + // AllocVector(). + int GetOffset(unsigned index, bool isMask = false) + { + // We can't compute addresses if we haven't finished allocating. + assert(isFinalized); + + unsigned offset = UINT32_MAX; + if (isMask) + { + assert(index < nMask); + offset = index; + } + else + { + assert(index < nVector); + offset = MaskBlockSizeInVectors() + index; + } + assert(offset != UINT32_MAX); + // The index is always offset by 1 as we are writing from below fp + // upwards. + return -(int)(offset + 1); + } + + // Given a local on the UnknownSizeFrame, compute the offset used for addressing + // this local relative to the base address of the UnknownSizeFrame. This offset + // can be used with addvl/addpl for TYP_SIMD/TYP_MASK respectively. The offset + // needs to be scaled by VL/PL to produce an absolute address value. + int GetAddressingOffset(LclVarDsc* varDsc) + { + return GetOffset(varDsc->GetUnknownSizeFrameIndex(), varDsc->TypeIs(TYP_MASK)); + } + + // This system ensures we don't try and generate an address on the frame + // without finishing all allocations. + void Finalize() + { +#ifdef DEBUG + isFinalized = true; +#endif + } + + } unkSizeFrame; +#endif + //------------------------ For splitting types ---------------------------- void lvaInitTypeRef(); @@ -4418,7 +4629,11 @@ class Compiler // bool lvaIsUnknownSizeLocal(unsigned varNum) { +#ifdef TARGET_ARM64 return !lvaLclValueSize(varNum).IsExact(); +#else + return false; +#endif } bool lvaHaveManyLocals(float percent = 1.0f) const; diff --git a/src/coreclr/jit/compiler.hpp b/src/coreclr/jit/compiler.hpp index 166e4a1097e8f0..cf012b39d2e855 100644 --- a/src/coreclr/jit/compiler.hpp +++ b/src/coreclr/jit/compiler.hpp @@ -2721,6 +2721,7 @@ inline bool fConservative = false; if (varNum >= 0) { + assert(!lvaIsUnknownSizeLocal(varNum)); LclVarDsc* varDsc = lvaGetDesc(varNum); bool isPrespilledArg = false; #if defined(TARGET_ARM) && defined(PROFILING_SUPPORTED) @@ -2779,6 +2780,7 @@ inline tmpDsc = codeGen->regSet.tmpFindNum(varNum, RegSet::TEMP_USAGE_USED); } assert(tmpDsc != nullptr); + assert(!varTypeHasUnknownSize(tmpDsc->tdTempType())); varOffset = tmpDsc->tdTempOffs(); } else diff --git a/src/coreclr/jit/emit.cpp b/src/coreclr/jit/emit.cpp index ea343f496cce66..d3e723b5df1d18 100644 --- a/src/coreclr/jit/emit.cpp +++ b/src/coreclr/jit/emit.cpp @@ -7131,6 +7131,11 @@ unsigned emitter::emitEndCodeGen(Compiler* comp, continue; } + if (m_compiler->lvaIsUnknownSizeLocal(num)) + { + continue; + } + #if FEATURE_FIXED_OUT_ARGS if (num == m_compiler->lvaOutgoingArgSpaceVar) { diff --git a/src/coreclr/jit/emitarm64.cpp b/src/coreclr/jit/emitarm64.cpp index 250af9a94d9213..a0711a07f3cd7d 100644 --- a/src/coreclr/jit/emitarm64.cpp +++ b/src/coreclr/jit/emitarm64.cpp @@ -8199,134 +8199,143 @@ void emitter::emitIns_R_S(instruction ins, emitAttr attr, regNumber reg1, int va emitAttr size = EA_SIZE(attr); insFormat fmt = IF_NONE; insOpts opt = INS_OPTS_NONE; + regNumber reg2 = REG_NA; regNumber reg3 = REG_NA; unsigned scale = 0; bool isLdrStr = false; bool isSimple = true; bool useRegForImm = false; + ssize_t imm = 0; assert(offs >= 0); - /* Figure out the variable's frame position */ - bool FPbased; - int base = m_compiler->lvaFrameAddress(varx, &FPbased); - int disp = base + offs; - ssize_t imm = disp; + if (varx >= 0 && m_compiler->lvaIsUnknownSizeLocal(varx)) + { + // SVE locals are TYP_SIMD or TYP_MASK, both should be placed on the UnknownSizeFrame. + // The base address of these locals should be REG_UNKBASE (x19). + assert(offs == 0); + isSimple = false; + reg2 = REG_UNKBASE; + imm = m_compiler->unkSizeFrame.GetAddressingOffset(m_compiler->lvaGetDesc(varx)); - regNumber reg2 = encodingSPtoZR(FPbased ? REG_FPBASE : REG_SPBASE); + switch (ins) + { + case INS_lea: + // We shouldn't be materializing the address of a mask. + assert(m_compiler->lvaGetActualType(varx) != TYP_MASK); + // addvl reg1, x19, #imm + emitIns_R_R_I(INS_sve_addvl, EA_8BYTE, reg1, REG_UNKBASE, imm); + return; - // TODO-ARM64-CQ: use unscaled loads? - /* Figure out the encoding format of the instruction */ - switch (ins) + case INS_sve_ldr: + // TODO-SVE: Handle generation of base address for large immediate scaled by VL/PL. + assert(isValidSimm<9>(imm)); + fmt = isPredicateRegister(reg1) ? IF_SVE_ID_2A : IF_SVE_IE_2A; + break; + + default: + NYI("emitIns_R_S"); + return; + } + } + else { - case INS_strb: - case INS_ldrb: - case INS_ldrsb: - scale = 0; - break; + /* Figure out the variable's frame position */ + bool FPbased; + int base = m_compiler->lvaFrameAddress(varx, &FPbased); + int disp = base + offs; + imm = disp; + reg2 = encodingSPtoZR(FPbased ? REG_FPBASE : REG_SPBASE); - case INS_strh: - case INS_ldrh: - case INS_ldrsh: - scale = 1; - break; + // TODO-ARM64-CQ: use unscaled loads? + /* Figure out the encoding format of the instruction */ + switch (ins) + { + case INS_strb: + case INS_ldrb: + case INS_ldrsb: + scale = 0; + break; - case INS_ldrsw: - scale = 2; - break; + case INS_strh: + case INS_ldrh: + case INS_ldrsh: + scale = 1; + break; - case INS_str: - case INS_ldr: - assert(isValidGeneralDatasize(size) || isValidVectorDatasize(size)); - scale = genLog2(EA_SIZE_IN_BYTES(size)); - isLdrStr = true; - break; + case INS_ldrsw: + scale = 2; + break; - case INS_lea: - assert(size == EA_8BYTE); - isSimple = false; - scale = 0; + case INS_str: + case INS_ldr: + assert(isValidGeneralDatasize(size) || isValidVectorDatasize(size)); + scale = genLog2(EA_SIZE_IN_BYTES(size)); + isLdrStr = true; + break; - if (disp >= 0) - { - ins = INS_add; - } - else - { - ins = INS_sub; - imm = -disp; - } + case INS_lea: + assert(size == EA_8BYTE); + isSimple = false; + scale = 0; - if (imm <= 0x0fff) - { - fmt = IF_DI_2A; // add reg1,reg2,#disp - } - else - { - regNumber rsvdReg = codeGen->rsGetRsvdReg(); - codeGen->instGen_Set_Reg_To_Imm(EA_PTRSIZE, rsvdReg, imm); - imm = 0; - if (encodingZRtoSP(reg2) == REG_SP) + if (disp >= 0) { - fmt = IF_DR_3C; // add reg1,sp,rsvdReg - opt = INS_OPTS_LSL; - reg3 = rsvdReg; + ins = INS_add; } else { - fmt = IF_DR_3A; // add reg1,reg2,rsvdReg + ins = INS_sub; + imm = -disp; } - } - break; - - case INS_sve_ldr: - { - isSimple = false; - size = EA_SCALABLE; - attr = size; - if (isPredicateRegister(reg1)) - { - assert(offs == 0); - // For predicate, generate based off rsGetRsvdReg() - regNumber rsvdReg = codeGen->rsGetRsvdReg(); - // add rsvd, fp, #imm - emitIns_R_R_Imm(INS_add, EA_8BYTE, rsvdReg, encodingZRtoSP(reg2), imm); - // str p0, [rsvd, #0, mul vl] - emitIns_R_R_I(ins, attr, reg1, rsvdReg, 0); - - return; - } + if (imm <= 0x0fff) + { + fmt = IF_DI_2A; // add reg1,reg2,#disp + } + else + { + regNumber rsvdReg = codeGen->rsGetRsvdReg(); + codeGen->instGen_Set_Reg_To_Imm(EA_PTRSIZE, rsvdReg, imm); + imm = 0; + if (encodingZRtoSP(reg2) == REG_SP) + { + fmt = IF_DR_3C; // add reg1,sp,rsvdReg + opt = INS_OPTS_LSL; + reg3 = rsvdReg; + } + else + { + fmt = IF_DR_3A; // add reg1,reg2,rsvdReg + } + } + break; - assert(isVectorRegister(reg1)); - fmt = IF_SVE_IE_2A; + case INS_sve_ldr: + { + assert(isPredicateRegister(reg1) || isVectorRegister(reg1)); + assert(FPbased); - // TODO-SVE: Don't assume 128bit vectors - // Predicate size is vector length / 8 - scale = NaturalScale_helper(isVectorRegister(reg1) ? EA_16BYTE : EA_2BYTE); - ssize_t mask = (1 << scale) - 1; // the mask of low bits that must be zero to encode the immediate + isSimple = false; + size = EA_SCALABLE; + attr = size; + fmt = isPredicateRegister(reg1) ? IF_SVE_ID_2A : IF_SVE_IE_2A; - if (((imm & mask) == 0) && (isValidSimm<9>(imm >> scale))) - { - imm >>= scale; // The immediate is scaled by the size of the ld/st - } - else - { useRegForImm = true; regNumber rsvdReg = codeGen->rsGetRsvdReg(); - // For larger imm values (> 9 bits), calculate base + imm in a reserved register first. - codeGen->instGen_Set_Reg_To_Base_Plus_Imm(EA_PTRSIZE, rsvdReg, reg2, imm); + codeGen->instGen_Set_Reg_To_Base_Plus_Imm(EA_PTRSIZE, rsvdReg, REG_FP, imm); + reg2 = rsvdReg; imm = 0; } - } - break; + break; - default: - NYI("emitIns_R_S"); // FP locals? - return; + default: + NYI("emitIns_R_S"); // FP locals? + return; - } // end switch (ins) + } // end switch (ins) + } assert((scale >= 0) && (scale <= 4)); @@ -8510,96 +8519,90 @@ void emitter::emitIns_S_R(instruction ins, emitAttr attr, regNumber reg1, int va bool isStr = false; bool isSimple = true; bool useRegForImm = false; + regNumber reg2 = REG_NA; + ssize_t imm = 0; - /* Figure out the variable's frame position */ - bool FPbased; - int base = m_compiler->lvaFrameAddress(varx, &FPbased); - int disp = base + offs; - ssize_t imm = disp; + if (varx >= 0 && m_compiler->lvaIsUnknownSizeLocal(varx)) + { + // SVE locals are TYP_SIMD or TYP_MASK, both should be placed on the UnknownSizeFrame. + // The base address of these locals should be REG_UNKBASE (x19). + assert(ins == INS_sve_str); + assert(offs == 0); + assert(attr == EA_SCALABLE); - // TODO-ARM64-CQ: with compLocallocUsed, should we use REG_SAVED_LOCALLOC_SP instead? - regNumber reg2 = encodingSPtoZR(FPbased ? REG_FPBASE : REG_SPBASE); + reg2 = REG_UNKBASE; + imm = m_compiler->unkSizeFrame.GetAddressingOffset(m_compiler->lvaGetDesc(varx)); + fmt = isPredicateRegister(reg1) ? IF_SVE_JG_2A : IF_SVE_JH_2A; + isSimple = false; - // TODO-ARM64-CQ: use unscaled loads? - /* Figure out the encoding format of the instruction */ - switch (ins) + // TODO-SVE: Handle generation of base address for large immediate scaled by VL/PL. + assert(isValidSimm<9>(imm)); + } + else { - case INS_strb: - scale = 0; - assert(isGeneralRegisterOrZR(reg1)); - break; + /* Figure out the variable's frame position */ + bool FPbased; + int base = m_compiler->lvaFrameAddress(varx, &FPbased); + int disp = base + offs; - case INS_strh: - scale = 1; - assert(isGeneralRegisterOrZR(reg1)); - break; + imm = disp; - case INS_str: - if (isGeneralRegisterOrZR(reg1)) - { - assert(isValidGeneralDatasize(size)); - scale = (size == EA_8BYTE) ? 3 : 2; - } - else - { - assert(isVectorRegister(reg1)); - assert(isValidVectorLSDatasize(size)); - scale = NaturalScale_helper(size); - isVectorStore = true; - } - isStr = true; - break; + // TODO-ARM64-CQ: with compLocallocUsed, should we use REG_SAVED_LOCALLOC_SP instead? + reg2 = encodingSPtoZR(FPbased ? REG_FPBASE : REG_SPBASE); - case INS_sve_str: + // TODO-ARM64-CQ: use unscaled loads? + /* Figure out the encoding format of the instruction */ + switch (ins) { - isSimple = false; - size = EA_SCALABLE; - attr = size; - - if (isPredicateRegister(reg1)) - { - assert(offs == 0); - - // For predicate, generate based off rsGetRsvdReg() - regNumber rsvdReg = codeGen->rsGetRsvdReg(); - - // add rsvd, fp, #imm - emitIns_R_R_Imm(INS_add, EA_8BYTE, rsvdReg, encodingZRtoSP(reg2), imm); - // str p0, [rsvd, #0, mul vl] - emitIns_R_R_I(ins, attr, reg1, rsvdReg, 0); - - return; - } + case INS_strb: + scale = 0; + assert(isGeneralRegisterOrZR(reg1)); + break; - assert(isVectorRegister(reg1)); - fmt = IF_SVE_JH_2A; + case INS_strh: + scale = 1; + assert(isGeneralRegisterOrZR(reg1)); + break; - // TODO-SVE: Don't assume 128bit vectors - // Predicate size is vector length / 8 - scale = NaturalScale_helper(isVectorRegister(reg1) ? EA_16BYTE : EA_2BYTE); - ssize_t mask = (1 << scale) - 1; // the mask of low bits that must be zero to encode the immediate + case INS_str: + if (isGeneralRegisterOrZR(reg1)) + { + assert(isValidGeneralDatasize(size)); + scale = (size == EA_8BYTE) ? 3 : 2; + } + else + { + assert(isVectorRegister(reg1)); + assert(isValidVectorLSDatasize(size)); + scale = NaturalScale_helper(size); + isVectorStore = true; + } + isStr = true; + break; - if (((imm & mask) == 0) && (isValidSimm<9>(imm >> scale))) - { - imm >>= scale; // The immediate is scaled by the size of the ld/st - } - else + case INS_sve_str: { + assert(isVectorRegister(reg1) || isPredicateRegister(reg1)); + assert(FPbased); + isSimple = false; + size = EA_SCALABLE; + attr = size; + fmt = isPredicateRegister(reg1) ? IF_SVE_JG_2A : IF_SVE_JH_2A; + useRegForImm = true; regNumber rsvdReg = codeGen->rsGetRsvdReg(); - // For larger imm values (> 9 bits), calculate base + imm in a reserved register first. - codeGen->instGen_Set_Reg_To_Base_Plus_Imm(EA_PTRSIZE, rsvdReg, reg2, imm); + codeGen->instGen_Set_Reg_To_Base_Plus_Imm(EA_PTRSIZE, rsvdReg, REG_FP, imm); reg2 = rsvdReg; imm = 0; } - } - break; + break; - default: - NYI("emitIns_S_R"); // FP locals? - return; + default: + NYI("emitIns_S_R"); // FP locals? + return; - } // end switch (ins) + } // end switch (ins) + } if (isVectorStore || !isSimple) { diff --git a/src/coreclr/jit/lclvars.cpp b/src/coreclr/jit/lclvars.cpp index 34ad714fc1d2c0..33cb583fcfb3a5 100644 --- a/src/coreclr/jit/lclvars.cpp +++ b/src/coreclr/jit/lclvars.cpp @@ -897,7 +897,14 @@ void Compiler::lvaInitVarDsc(LclVarDsc* varDsc, } #ifdef DEBUG - varDsc->SetStackOffset(BAD_STK_OFFS); + if (varDsc->lvValueSize().IsExact()) + { + varDsc->SetStackOffset(BAD_STK_OFFS); + } + else + { + varDsc->SetUnknownSizeFrameIndex(BAD_STK_OFFS); + } #endif } @@ -4311,6 +4318,15 @@ void Compiler::lvaAssignFrameOffsets(FrameLayoutState curState) assert(lvaOutgoingArgSpaceVar != BAD_VAR_NUM); #endif // FEATURE_FIXED_OUT_ARGS + /*------------------------------------------------------------------------- + * + * Initialize tracking information for locals with unknown size. + * + *------------------------------------------------------------------------- + */ + + lvaInitUnknownSizeFrame(); + /*------------------------------------------------------------------------- * * First process the arguments. @@ -4357,6 +4373,13 @@ void Compiler::lvaAssignFrameOffsets(FrameLayoutState curState) { codeGen->resetFramePointerUsedWritePhase(); } +#if defined(FEATURE_SIMD) && defined(TARGET_ARM64) + else + { + assert(curState == FINAL_FRAME_LAYOUT); + unkSizeFrame.Finalize(); + } +#endif } /***************************************************************************** @@ -4468,6 +4491,11 @@ void Compiler::lvaFixVirtualFrameOffsets() // Can't be relative to EBP unless we have an EBP noway_assert(!varDsc->lvFramePointerBased || codeGen->doubleAlignOrFramePointerUsed()); + if (lvaIsUnknownSizeLocal(lclNum)) + { + continue; + } + // Is this a non-param promoted struct field? // if so then set doAssignStkOffs to false. // @@ -4663,6 +4691,8 @@ void Compiler::lvaAssignVirtualFrameOffsetsToArgs() int startOffset; if (lvaGetRelativeOffsetToCallerAllocatedSpaceForParameter(lclNum, &startOffset)) { + assert(!lvaIsUnknownSizeLocal(lclNum)); + dsc->SetStackOffset(startOffset + relativeZero); JITDUMP("Set V%02u to offset %d\n", lclNum, startOffset); @@ -5281,6 +5311,12 @@ void Compiler::lvaAssignVirtualFrameOffsetsToLocals() continue; } + else if (lvaIsUnknownSizeLocal(lclNum)) + { + // Reserve dynamic stack space for this variable. + lvaAllocUnknownSizeLocal(lclNum); + continue; + } // These need to be located as the very first variables (highest memory address) // and so they have already been assigned an offset @@ -5608,6 +5644,58 @@ void Compiler::lvaAssignVirtualFrameOffsetsToLocals() #endif // TARGET_ARM64 } +void Compiler::lvaInitUnknownSizeFrame() +{ +#if defined(FEATURE_SIMD) && defined(TARGET_ARM64) + compUsesUnknownSizeFrame = false; +#ifdef DEBUG + unkSizeFrame.isFinalized = false; +#endif + unkSizeFrame.nMask = 0; + unkSizeFrame.nVector = 0; +#endif +} + +//------------------------------------------------------------------------------- +// lvaAllocUnknownSizeLocal: Allocate stack space for a local with unknown size +// +// A local with unknown size has a size that is not precisely known at compile time, +// but may be derived dynamically through code. These locals are allocated into +// their own stack space categorized by JIT type. +// +// Ideally, locals are primitive types that can fit into a homogeneous space containing +// objects with the same unknown size. In this case, we can identify them by a simple +// index into the space. +void Compiler::lvaAllocUnknownSizeLocal(unsigned varNum) +{ + LclVarDsc* const varDsc = lvaGetDesc(varNum); + assert(varTypeHasUnknownSize(varDsc)); + +#if defined(FEATURE_SIMD) && defined(TARGET_ARM64) + if (varDsc->TypeIs(TYP_SIMD)) + { + varDsc->SetUnknownSizeFrameIndex((int)unkSizeFrame.AllocVector()); + } + else if (varDsc->TypeIs(TYP_MASK)) + { + varDsc->SetUnknownSizeFrameIndex((int)unkSizeFrame.AllocMask()); + } + else +#endif + { + // The only types with unknown size should be SIMD at the moment. + unreached(); + } + + compUsesUnknownSizeFrame = true; + + // Technically we're not using localalloc, but the space these locals use + // will be at the beginning of the alloca space on the stack frame. So we + // should set this and inherit all of its behaviour, e.g. guarantee we get + // a frame pointer. + compLocallocUsed = true; +} + //------------------------------------------------------------------------ // lvaParamHasLocalStackSpace: Check if a local that represents a parameter has // space allocated for it in the local stack frame. @@ -6131,19 +6219,30 @@ void Compiler::lvaDumpFrameLocation(unsigned lclNum, int minLength) { int offset; regNumber baseReg; + int printed = 0; +#ifdef TARGET_ARM64 + if (lvaIsUnknownSizeLocal(lclNum)) + { + LclVarDsc* varDsc = lvaGetDesc(lclNum); + offset = unkSizeFrame.GetAddressingOffset(varDsc); + printed = printf("[%2s%1s0x%02X*%s] ", getRegName(REG_UNKBASE), (offset < 0 ? "-" : "+"), + (offset < 0 ? -offset : offset), varDsc->TypeIs(TYP_MASK) ? "PL" : "VL"); + } + else +#endif + { #ifdef TARGET_ARM - offset = lvaFrameAddress(lclNum, compLocallocUsed, &baseReg, 0, /* isFloatUsage */ false); + offset = lvaFrameAddress(lclNum, compLocallocUsed, &baseReg, 0, /* isFloatUsage */ false); #else - bool EBPbased; - offset = lvaFrameAddress(lclNum, &EBPbased); - - // Use the sp/fp from the function region - baseReg = EBPbased ? codeGen->GetFramePointerReg(ROOT_FUNC_IDX) : codeGen->GetStackPointerReg(ROOT_FUNC_IDX); -#endif // TARGET_ARM + bool EBPbased; + offset = lvaFrameAddress(lclNum, &EBPbased); + baseReg = EBPbased ? codeGen->GetFramePointerReg(ROOT_FUNC_IDX) : codeGen->GetStackPointerReg(ROOT_FUNC_IDX); +#endif + printed = + printf("[%2s%1s0x%02X] ", getRegName(baseReg), (offset < 0 ? "-" : "+"), (offset < 0 ? -offset : offset)); + } - int printed = - printf("[%2s%1s0x%02X] ", getRegName(baseReg), (offset < 0 ? "-" : "+"), (offset < 0 ? -offset : offset)); if ((printed >= 0) && (printed < minLength)) { printf("%*s", minLength - printed, ""); diff --git a/src/coreclr/jit/lsra.cpp b/src/coreclr/jit/lsra.cpp index f4ea5bf6ec76b9..1ea129c15d2ca6 100644 --- a/src/coreclr/jit/lsra.cpp +++ b/src/coreclr/jit/lsra.cpp @@ -2601,6 +2601,16 @@ void LinearScan::setFrameType() } #endif // TARGET_ARM +#if defined(TARGET_ARM64) + if (m_compiler->compUsesUnknownSizeFrame) + { + // We reserve x19 for addressing vector and mask locals on the UnknownSizeFrame. + m_compiler->codeGen->regSet.rsMaskResvd |= RBM_UNKBASE; + JITDUMP(" Reserved REG_UNKBASE (%s) due to presence of UnknownSizeFrame\n", getRegName(REG_UNKBASE)); + removeMask |= RBM_UNKBASE.GetIntRegSet(); + } +#endif + if ((removeMask != RBM_NONE) && ((availableIntRegs & removeMask) != 0)) { // We know that we're already in "read mode" for availableIntRegs. However, diff --git a/src/coreclr/jit/regset.cpp b/src/coreclr/jit/regset.cpp index 61933141334969..58434e6a7912f5 100644 --- a/src/coreclr/jit/regset.cpp +++ b/src/coreclr/jit/regset.cpp @@ -626,7 +626,7 @@ TempDsc* RegSet::tmpGetTemp(var_types type) unsigned size = genTypeSize(type); // If TYP_STRUCT ever gets in here we do bad things (tmpSlot returns -1) - noway_assert(size >= sizeof(int)); + noway_assert(size >= sizeof(int) && size != SIZE_UNKNOWN); /* Find the slot to search for a free temp of the right size */ @@ -688,7 +688,7 @@ void RegSet::tmpPreAllocateTemps(var_types type, unsigned count) unsigned size = genTypeSize(type); // If TYP_STRUCT ever gets in here we do bad things (tmpSlot returns -1) - noway_assert(size >= sizeof(int)); + noway_assert(size >= sizeof(int) && size != SIZE_UNKNOWN); // Find the slot to search for a free temp of the right size. // Note that slots are shared by types of the identical size (e.g., TYP_REF and TYP_LONG on AMD64), diff --git a/src/coreclr/jit/scopeinfo.cpp b/src/coreclr/jit/scopeinfo.cpp index 8d173971d84849..9fc32e0fb48798 100644 --- a/src/coreclr/jit/scopeinfo.cpp +++ b/src/coreclr/jit/scopeinfo.cpp @@ -1074,7 +1074,9 @@ void CodeGenInterface::VariableLiveKeeper::siStartVariableLiveRange(const LclVar // Only the variables that exists in the IL, "this", and special arguments are reported, as long as they were // allocated. - if (m_compiler->opts.compDbgInfo && (varNum < m_LiveDscCount) && (varDsc->lvIsInReg() || varDsc->lvOnFrame)) + // TODO-SVE: Do we need to support this for scalable vectors? + if (m_compiler->opts.compDbgInfo && (varNum < m_LiveDscCount) && (varDsc->lvIsInReg() || varDsc->lvOnFrame) && + varDsc->lvValueSize().IsExact()) { // Build siVarLoc for this born "varDsc" CodeGenInterface::siVarLoc varLocation = diff --git a/src/coreclr/jit/targetarm64.h b/src/coreclr/jit/targetarm64.h index f4edfbf7723b20..34ebcf5afebcce 100644 --- a/src/coreclr/jit/targetarm64.h +++ b/src/coreclr/jit/targetarm64.h @@ -389,4 +389,6 @@ #define REG_SWIFT_INTRET_ORDER REG_R0,REG_R1,REG_R2,REG_R3 #define REG_SWIFT_FLOATRET_ORDER REG_V0,REG_V1,REG_V2,REG_V3 +#define REG_UNKBASE REG_R19 +#define RBM_UNKBASE RBM_R19 // clang-format on From feeb7b95a88aa87d59084f455c91c5c8df6fe4ef Mon Sep 17 00:00:00 2001 From: BoyBaykiller <88141582+BoyBaykiller@users.noreply.github.com> Date: Thu, 7 May 2026 15:21:42 +0200 Subject: [PATCH 041/109] JIT: Clean up and unify SELECT opts (#127621) The idea here is to make it easier to add SELECT transformations in the future and also call them from elsewhere in HIR if needed. --- src/coreclr/jit/ifconversion.cpp | 308 +++++++++++++++++-------------- src/coreclr/jit/lower.cpp | 28 --- 2 files changed, 172 insertions(+), 164 deletions(-) diff --git a/src/coreclr/jit/ifconversion.cpp b/src/coreclr/jit/ifconversion.cpp index d5f42aecde353a..5e00b2648cae43 100644 --- a/src/coreclr/jit/ifconversion.cpp +++ b/src/coreclr/jit/ifconversion.cpp @@ -52,9 +52,11 @@ class OptIfConversionDsc bool IfConvertCheckStmts(BasicBlock* block, IfConvertOperation* foundOperation); bool IfConvertTryGetElseFromJtrueBlock(GenTreeLclVar* thenStore, IfConvertOperation* foundOperation); - GenTree* TryTransformSelectOperOrLocal(GenTree* oper, GenTree* lcl); - GenTree* TryTransformSelectOperOrZero(GenTree* oper, GenTree* lcl); - GenTree* TryTransformSelectToOrdinaryOps(GenTree* trueInput, GenTree* falseInput); + GenTree* TryOptimizeSelect(GenTreeConditional* select); + GenTree* TrySelectToCnsOpCond(GenTreeConditional* select); + GenTree* TrySelectToLclOpCond(GenTreeConditional* select); + GenTree* TrySelectToCondOpLcl(GenTreeConditional* select); + #ifdef DEBUG void IfConvertDump(); #endif @@ -580,17 +582,22 @@ bool OptIfConversionDsc::optIfConvert(int* pReachabilityBudget) } } - // Get the select node inputs. - var_types selectType; - GenTree* selectTrueInput; - GenTree* selectFalseInput; + // Get the SELECT inputs. + GenTree* selectTrueInput; + GenTree* selectFalseInput; if (m_mainOper == GT_STORE_LCL_VAR) { selectFalseInput = m_thenOperation.node->AsLclVar()->Data(); - selectTrueInput = (m_elseOperation.block != nullptr) ? m_elseOperation.node->AsLclVar()->Data() : nullptr; - - // Pick the type as the type of the local, which should always be compatible even for implicit coercions. - selectType = genActualType(m_thenOperation.node); + if (m_elseOperation.block == nullptr) + { + // The code doesn't explicitly express an Else operation, use the unmodified local. + GenTreeLclVar* store = m_thenOperation.node->AsLclVar(); + selectTrueInput = m_compiler->gtNewLclVarNode(store->GetLclNum(), store->TypeGet()); + } + else + { + selectTrueInput = m_elseOperation.node->AsLclVar()->Data(); + } } else { @@ -600,27 +607,43 @@ bool OptIfConversionDsc::optIfConvert(int* pReachabilityBudget) selectTrueInput = m_elseOperation.node->AsOp()->GetReturnValue(); selectFalseInput = m_thenOperation.node->AsOp()->GetReturnValue(); - selectType = genActualType(m_thenOperation.node); } - GenTree* select = TryTransformSelectToOrdinaryOps(selectTrueInput, selectFalseInput); - if (select == nullptr) + GenTree* select = m_compiler->gtNewConditionalNode(GT_SELECT, m_cond, selectTrueInput, selectFalseInput, + genActualType(m_thenOperation.node)); + +#ifdef DEBUG + JITDUMP("\nSELECT created:\n"); + if (m_compiler->verbose) { -#ifdef TARGET_RISCV64 - JITDUMP("Skipping if-conversion that cannot be transformed to ordinary operations\n"); - return false; + m_compiler->gtDispTree(select); + } #endif - if (selectTrueInput == nullptr) + + { + GenTree* optSelect = TryOptimizeSelect(select->AsConditional()); + if (optSelect != nullptr) { - // Duplicate the destination of the Then store. - assert(m_mainOper == GT_STORE_LCL_VAR && (m_elseOperation.block == nullptr)); - GenTreeLclVar* store = m_thenOperation.node->AsLclVar(); - selectTrueInput = m_compiler->gtNewLclVarNode(store->GetLclNum(), store->TypeGet()); + select = optSelect; + +#ifdef DEBUG + JITDUMP("\nSELECT after optimizations:\n"); + if (m_compiler->verbose) + { + m_compiler->gtDispTree(select); + } +#endif } - // Create a select node - select = m_compiler->gtNewConditionalNode(GT_SELECT, m_cond, selectTrueInput, selectFalseInput, selectType); } +#ifdef TARGET_RISCV64 + if (select->OperIs(GT_SELECT)) + { + JITDUMP("Skipping if-conversion that could not be optimized to ordinary operations\n"); + return true; + } +#endif + // Use the SELECT as the source of the Then STORE/RETURN. m_thenOperation.node->AddAllEffectsFlags(select); if (m_mainOper == GT_STORE_LCL_VAR) @@ -687,6 +710,38 @@ bool OptIfConversionDsc::optIfConvert(int* pReachabilityBudget) return true; } +//----------------------------------------------------------------------------- +// TryOptimizeSelect: Try to optimize SELECT +// +// Arguments: +// select - The SELECT node +// +// Return Value: +// Optimized node, otherwise nullptr. +// +GenTree* OptIfConversionDsc::TryOptimizeSelect(GenTreeConditional* select) +{ + GenTree* opt = TrySelectToCnsOpCond(select); + if (opt != nullptr) + { + return opt; + } + + opt = TrySelectToLclOpCond(select); + if (opt != nullptr) + { + return opt; + } + + opt = TrySelectToCondOpLcl(select); + if (opt != nullptr) + { + return opt; + } + + return nullptr; +} + struct IntConstSelectOper { genTreeOps oper; @@ -698,17 +753,6 @@ struct IntConstSelectOper return oper != GT_NONE; } }; - -//----------------------------------------------------------------------------- -// MatchIntConstSelectValues: Matches an operation so that `trueVal` can be calculated as: -// oper(type, falseVal, condition) -// -// Notes: -// A non-zero bitIndex (log2(trueVal)) differentiates (condition << bitIndex) from (falseVal << condition). -// -// Return Value: -// The matched operation (if any). -// static IntConstSelectOper MatchIntConstSelectValues(int64_t trueVal, int64_t falseVal) { if (trueVal == falseVal + 1) @@ -752,19 +796,90 @@ static IntConstSelectOper MatchIntConstSelectValues(int64_t trueVal, int64_t fal } //----------------------------------------------------------------------------- -// TryTransformSelectOperOrLocal: Try to trasform "cond ? oper(lcl, (-)1) : lcl" into "oper(')(lcl, cond)" +// TrySelectToCnsOpCond: Try to optimize: +// SELECT(cond, 0, 1) -> cond +// SELECT(cond, 3, 3) -> 3 +// SELECT(cond, 6, 5) -> 5 + cond +// SELECT(cond, -25, -13) -> -25 >> cond +// +// Arguments: +// select - The SELECT node +// +// Return Value: +// Optimized node, otherwise nullptr. +// +GenTree* OptIfConversionDsc::TrySelectToCnsOpCond(GenTreeConditional* select) +{ + GenTree* cond = select->gtCond; + GenTree* trueInput = select->gtOp1; + GenTree* falseInput = select->gtOp2; + + if (!trueInput->IsIntegralConst() || !falseInput->IsIntegralConst()) + { + return nullptr; + } + + int64_t trueVal = trueInput->AsIntConCommon()->IntegralValue(); + int64_t falseVal = falseInput->AsIntConCommon()->IntegralValue(); + + if (trueVal == 1 && falseVal == 0) + { + return cond; + } + else if (trueVal == 0 && falseVal == 1) + { + return m_compiler->gtReverseCond(cond); + } + +#ifdef TARGET_RISCV64 + bool isCondReversed = false; + IntConstSelectOper selectOper = MatchIntConstSelectValues(trueVal, falseVal); + if (!selectOper.isMatched()) + { + isCondReversed = true; + selectOper = MatchIntConstSelectValues(falseVal, trueVal); + } + if (selectOper.isMatched()) + { + GenTree* left = isCondReversed ? trueInput : falseInput; + GenTree* right = isCondReversed ? m_compiler->gtReverseCond(cond) : cond; + if (selectOper.bitIndex > 0) + { + assert(selectOper.oper == GT_LSH); + left->AsIntConCommon()->SetIntegralValue(selectOper.bitIndex); + std::swap(left, right); + } + return m_compiler->gtNewOperNode(selectOper.oper, selectOper.type, left, right); + } +#endif // TARGET_RISCV64 + + return nullptr; +} + +//----------------------------------------------------------------------------- +// TrySelectToLclOpCond: Try to optimize: +// SELECT(cond, x + 1, x) -> x + cond +// SELECT(cond, x | 1, x) -> x | cond +// SELECT(cond, x ^ 1, x) -> x ^ cond +// SELECT(cond, x << 1, x) -> x << cond // // Arguments: -// trueInput - expression to be evaluated when m_cond is true -// falseInput - expression to be evaluated when m_cond is false +// select - The SELECT node // // Return Value: -// The transformed expression, or null if no transformation took place +// Optimized node, otherwise nullptr. // -GenTree* OptIfConversionDsc::TryTransformSelectOperOrLocal(GenTree* trueInput, GenTree* falseInput) +GenTree* OptIfConversionDsc::TrySelectToLclOpCond(GenTreeConditional* select) { - GenTree* oper = trueInput; - GenTree* lcl = falseInput; +#ifdef TARGET_RISCV64 + GenTree* cond = select->gtCond; + GenTree* oper = select->gtOp1; + GenTree* lcl = select->gtOp2; + + if (!cond->OperIsCompare()) + { + return nullptr; + } bool isCondReversed = !lcl->OperIsAnyLocal(); if (isCondReversed) @@ -784,32 +899,36 @@ GenTree* OptIfConversionDsc::TryTransformSelectOperOrLocal(GenTree* trueInput, G if (lcl2->OperIs(GT_LCL_VAR) && (lcl2->AsLclVar()->GetLclNum() == lclNum)) { oper->AsOp()->gtOp1 = lcl2; - oper->AsOp()->gtOp2 = isCondReversed ? m_compiler->gtReverseCond(m_cond) : m_cond; + oper->AsOp()->gtOp2 = isCondReversed ? m_compiler->gtReverseCond(cond) : cond; if (isDecrement) oper->ChangeOper(GT_SUB); - oper->gtFlags |= m_cond->gtFlags & GTF_ALL_EFFECT; + oper->gtFlags |= cond->gtFlags & GTF_ALL_EFFECT; return oper; } } } +#endif // TARGET_RISCV64 return nullptr; } //----------------------------------------------------------------------------- -// TryTransformSelectOperOrZero: Try to trasform "cond ? oper(1, expr) : 0" into "oper(cond, expr)" +// TrySelectToCondOpLcl: Try to optimize: +// SELECT(cond, 1 << x, 0) -> cond << x +// SELECT(cond, 1 & x, 0) -> cond & x // // Arguments: -// trueInput - expression to be evaluated when m_cond is true -// falseInput - expression to be evaluated when m_cond is false +// select - The SELECT node // // Return Value: -// The transformed expression, or null if no transformation took place +// Optimized node, otherwise nullptr. // -GenTree* OptIfConversionDsc::TryTransformSelectOperOrZero(GenTree* trueInput, GenTree* falseInput) +GenTree* OptIfConversionDsc::TrySelectToCondOpLcl(GenTreeConditional* select) { - GenTree* oper = trueInput; - GenTree* zero = falseInput; +#ifdef TARGET_RISCV64 + GenTree* cond = select->gtCond; + GenTree* oper = select->gtOp1; + GenTree* zero = select->gtOp2; bool isCondReversed = !zero->IsIntegralConst(); if (isCondReversed) @@ -824,96 +943,13 @@ GenTree* OptIfConversionDsc::TryTransformSelectOperOrZero(GenTree* trueInput, Ge if (one->IsIntegralConst(1)) { - oper->AsOp()->gtOp1 = isCondReversed ? m_compiler->gtReverseCond(m_cond) : m_cond; + oper->AsOp()->gtOp1 = isCondReversed ? m_compiler->gtReverseCond(cond) : cond; oper->AsOp()->gtOp2 = expr; - oper->gtFlags |= m_cond->gtFlags & GTF_ALL_EFFECT; + oper->gtFlags |= cond->gtFlags & GTF_ALL_EFFECT; return oper; } } - return nullptr; -} - -//----------------------------------------------------------------------------- -// TryTransformSelectToOrdinaryOps: Try transforming the identified if-else expressions to a single expression -// -// This is meant mostly for RISC-V where the condition (1 or 0) is stored in a regular general-purpose register -// which can be fed as an argument to standard operations, e.g. -// * (cond ? 6 : 5) becomes (5 + cond) -// * (cond ? -25 : -13) becomes (-25 >> cond) -// * if (cond) a++; becomes (a + cond) -// * (cond ? 1 << a : 0) becomes (cond << a) -// -// Arguments: -// trueInput - expression to be evaluated when m_cond is true, or null if there is no else expression -// falseInput - expression to be evaluated when m_cond is false -// -// Return Value: -// The transformed single expression equivalent to the if-else expressions, or null if no transformation took place -// -GenTree* OptIfConversionDsc::TryTransformSelectToOrdinaryOps(GenTree* trueInput, GenTree* falseInput) -{ - assert(falseInput != nullptr); - - if ((trueInput != nullptr && trueInput->IsIntegralConst()) && falseInput->IsIntegralConst()) - { - int64_t trueVal = trueInput->AsIntConCommon()->IntegralValue(); - int64_t falseVal = falseInput->AsIntConCommon()->IntegralValue(); - if (trueInput->TypeIs(TYP_INT) && falseInput->TypeIs(TYP_INT)) - { - if (trueVal == 1 && falseVal == 0) - { - // compare ? true : false --> compare - return m_cond; - } - else if (trueVal == 0 && falseVal == 1) - { - // compare ? false : true --> reversed_compare - return m_compiler->gtReverseCond(m_cond); - } - } -#ifdef TARGET_RISCV64 - if (varTypeIsIntegral(trueInput) && varTypeIsIntegral(falseInput) && (trueVal != falseVal)) - { - bool isCondReversed = false; - IntConstSelectOper selectOper = MatchIntConstSelectValues(trueVal, falseVal); - if (!selectOper.isMatched()) - { - isCondReversed = true; - selectOper = MatchIntConstSelectValues(falseVal, trueVal); - } - if (selectOper.isMatched()) - { - GenTree* left = isCondReversed ? trueInput : falseInput; - GenTree* right = isCondReversed ? m_compiler->gtReverseCond(m_cond) : m_cond; - if (selectOper.bitIndex > 0) - { - assert(selectOper.oper == GT_LSH); - left->AsIntConCommon()->SetIntegralValue(selectOper.bitIndex); - std::swap(left, right); - } - return m_compiler->gtNewOperNode(selectOper.oper, selectOper.type, left, right); - } - } -#endif // TARGET_RISCV64 - } -#ifdef TARGET_RISCV64 - else - { - if (trueInput == nullptr) - { - assert(m_mainOper == GT_STORE_LCL_VAR && (m_elseOperation.block == nullptr)); - trueInput = m_thenOperation.node; - } - - GenTree* transformed = TryTransformSelectOperOrLocal(trueInput, falseInput); - if (transformed != nullptr) - return transformed; - - transformed = TryTransformSelectOperOrZero(trueInput, falseInput); - if (transformed != nullptr) - return transformed; - } #endif // TARGET_RISCV64 return nullptr; } diff --git a/src/coreclr/jit/lower.cpp b/src/coreclr/jit/lower.cpp index 5f8f8166f57fa9..73bba8ae8a1914 100644 --- a/src/coreclr/jit/lower.cpp +++ b/src/coreclr/jit/lower.cpp @@ -4862,34 +4862,6 @@ GenTree* Lowering::LowerSelect(GenTreeConditional* select) GenTree* trueVal = select->gtOp1; GenTree* falseVal = select->gtOp2; - // Replace SELECT cond 1/0 0/1 with (perhaps reversed) cond - if (cond->OperIsCompare() && ((trueVal->IsIntegralConst(0) && falseVal->IsIntegralConst(1)) || - (trueVal->IsIntegralConst(1) && falseVal->IsIntegralConst(0)))) - { - assert(select->TypeIs(TYP_INT, TYP_LONG)); - - LIR::Use use; - if (BlockRange().TryGetUse(select, &use)) - { - if (trueVal->IsIntegralConst(0)) - { - GenTree* reversed = m_compiler->gtReverseCond(cond); - assert(reversed == cond); - } - - // Codegen supports also TYP_LONG typed compares so we can just - // retype the compare instead of inserting a cast. - cond->gtType = select->TypeGet(); - - BlockRange().Remove(trueVal); - BlockRange().Remove(falseVal); - BlockRange().Remove(select); - use.ReplaceWith(cond); - - return cond->gtNext; - } - } - JITDUMP("Lowering select:\n"); DISPTREERANGE(BlockRange(), select); JITDUMP("\n"); From 4081ee1b4c3aade7bd2455cb3bd2d16a6a62dc22 Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Thu, 7 May 2026 06:36:44 -0700 Subject: [PATCH 042/109] Fix static analysis findings in GC bridge and NativeAOT runtime (#127893) - Fixed allocator mismatch in `src/coreclr/gc/gcbridge.cpp` by replacing `free` with `delete[]` for memory allocated via `new[]`. - Fixed potential null-dereference path in NativeAOT stress log by replacing heap-allocated `CrstStatic` with inline `minipal_mutex`, and asserting that `minipal_mutex_init` succeeds (`bool success; success = minipal_mutex_init(&theLog.lock); _ASSERTE(success);`). - Fixed invalid handle cleanup in `src/coreclr/nativeaot/Runtime/windows/PalMinWin.cpp` by guarding `CloseHandle` calls for `hMap` and `hFile`. --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: jkotas <6668460+jkotas@users.noreply.github.com> Co-authored-by: Jan Kotas --- src/coreclr/gc/gcbridge.cpp | 4 ++-- src/coreclr/nativeaot/Runtime/inc/stressLog.h | 3 +-- src/coreclr/nativeaot/Runtime/stressLog.cpp | 11 ++++------- src/coreclr/nativeaot/Runtime/windows/PalMinWin.cpp | 11 +++++++++-- 4 files changed, 16 insertions(+), 13 deletions(-) diff --git a/src/coreclr/gc/gcbridge.cpp b/src/coreclr/gc/gcbridge.cpp index dccf45cf761443..ea8801cba9eda5 100644 --- a/src/coreclr/gc/gcbridge.cpp +++ b/src/coreclr/gc/gcbridge.cpp @@ -44,7 +44,7 @@ static void DynPtrArrayUninit(DynPtrArray* da) if (da->capacity == 0) return; - free(da->data); + delete[] reinterpret_cast(da->data); da->data = NULL; } @@ -72,7 +72,7 @@ static void DynPtrArrayEnsureCapacity(DynPtrArray* da, int capacity) assert(newData); memcpy(newData, da->data, sizeof(void*) * da->size); if (oldCapacity > 0) - free(da->data); + delete[] reinterpret_cast(da->data); da->data = newData; } diff --git a/src/coreclr/nativeaot/Runtime/inc/stressLog.h b/src/coreclr/nativeaot/Runtime/inc/stressLog.h index 888edc33961057..91c72b0fac58d8 100644 --- a/src/coreclr/nativeaot/Runtime/inc/stressLog.h +++ b/src/coreclr/nativeaot/Runtime/inc/stressLog.h @@ -208,7 +208,6 @@ enum LogFacilitiesEnum: unsigned int { // // forward declarations: // -class CrstStatic; class Thread; typedef DPTR(Thread) PTR_Thread; class StressLog; @@ -235,7 +234,7 @@ class StressLog { int32_t totalChunk; // current number of total chunks allocated PTR_ThreadStressLog logs; // the list of logs for every thread. int32_t deadCount; // count of dead threads in the log - CrstStatic *pLock; // lock + minipal_mutex lock; // lock uint64_t tickFrequency; // number of ticks per second uint64_t startTimeStamp; // start time from when tick counter started uint64_t startTime; // time the application started in Windows FILETIME precision (100ns since 01 Jan 1601) diff --git a/src/coreclr/nativeaot/Runtime/stressLog.cpp b/src/coreclr/nativeaot/Runtime/stressLog.cpp index e3a5f8d8efe6f6..be3d69b30d1e56 100644 --- a/src/coreclr/nativeaot/Runtime/stressLog.cpp +++ b/src/coreclr/nativeaot/Runtime/stressLog.cpp @@ -18,7 +18,6 @@ #include "daccess.h" #include "stressLog.h" #include "holder.h" -#include "Crst.h" #include "rhassert.h" #include "slist.h" #include "regdisplay.h" @@ -96,10 +95,10 @@ void StressLog::Initialize(unsigned facilities, unsigned level, unsigned maxByt return; } - g_pStressLog = &theLog; + bool success = minipal_mutex_init(&theLog.lock); + _ASSERTE(success); - theLog.pLock = new (nothrow) CrstStatic(); - theLog.pLock->Init(CrstStressLog); + g_pStressLog = &theLog; if (maxBytesPerThread < STRESSLOG_CHUNK_SIZE) { maxBytesPerThread = STRESSLOG_CHUNK_SIZE; @@ -146,8 +145,7 @@ ThreadStressLog* StressLog::CreateThreadStressLog(Thread * pThread) { return NULL; } - CrstHolder holder(theLog.pLock); - + minipal::MutexHolder holder(theLog.lock); msgs = CreateThreadStressLogHelper(pThread); return msgs; @@ -578,4 +576,3 @@ void StressLog::EnumStressLogMemRanges(/*STRESSLOGMEMRANGECALLBACK*/void* slmrcb #endif // !DACCESS_COMPILE #endif // STRESS_LOG - diff --git a/src/coreclr/nativeaot/Runtime/windows/PalMinWin.cpp b/src/coreclr/nativeaot/Runtime/windows/PalMinWin.cpp index 316ad02c9e7d56..7e3a5a0715725c 100644 --- a/src/coreclr/nativeaot/Runtime/windows/PalMinWin.cpp +++ b/src/coreclr/nativeaot/Runtime/windows/PalMinWin.cpp @@ -220,8 +220,15 @@ UInt32_BOOL PalAllocateThunksFromTemplate(_In_ HANDLE hTemplateModule, uint32_t success = ((*newThunksOut) != NULL); cleanup: - CloseHandle(hMap); - CloseHandle(hFile); + if (hMap != NULL) + { + CloseHandle(hMap); + } + + if (hFile != INVALID_HANDLE_VALUE) + { + CloseHandle(hFile); + } return success; #endif From 0909efb51117221c9fab46fd24d15eee74dc7d92 Mon Sep 17 00:00:00 2001 From: Milos Kotlar Date: Thu, 7 May 2026 16:17:34 +0200 Subject: [PATCH 043/109] [clr-ios] Propagate XSLT ActiveIssue from base to derived test classes (#127788) ## Description The `[ActiveIssue(IsAppleMobile, IsCoreCLR)]` added by #127464 was on the `XsltApiTestCaseBase2` base class, but xUnit `[ActiveIssue]` does not propagate to derived classes, so all 469 XSLT tests still ran and threw `TypeInitializationException` from the base static ctor writing into the read-only iOS/tvOS bundle (build [1406826](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1406826)). --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- .../Xslt/XslCompiledTransformApi/Errata4.cs | 1 + .../XslCompiledTransformApi/OutputSettings.cs | 1 + .../Xslt/XslCompiledTransformApi/TempFiles.cs | 1 + .../XslCompiledTransform.cs | 16 ++++++++++++++++ .../XslTransformMultith.cs | 2 ++ .../Xslt/XslCompiledTransformApi/XsltApiV2.cs | 1 - .../XslCompiledTransformApi/XsltArgumentList.cs | 10 ++++++++++ .../XsltArgumentListMultith.cs | 3 +++ .../Xslt/XslCompiledTransformApi/XsltSettings.cs | 1 + 9 files changed, 35 insertions(+), 1 deletion(-) diff --git a/src/libraries/System.Private.Xml/tests/Xslt/XslCompiledTransformApi/Errata4.cs b/src/libraries/System.Private.Xml/tests/Xslt/XslCompiledTransformApi/Errata4.cs index 0b5c13f8d95c0a..d5dd4082a8888b 100644 --- a/src/libraries/System.Private.Xml/tests/Xslt/XslCompiledTransformApi/Errata4.cs +++ b/src/libraries/System.Private.Xml/tests/Xslt/XslCompiledTransformApi/Errata4.cs @@ -14,6 +14,7 @@ namespace System.Xml.XslCompiledTransformApiTests { //[TestCase(Name = "Xml 4th Errata tests for XslCompiledTransform", Params = new object[] { 300 })] [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/124344", typeof(PlatformDetection), nameof(PlatformDetection.IsAppleMobile), nameof(PlatformDetection.IsCoreCLR))] public class Errata4 : XsltApiTestCaseBase2 { private ITestOutputHelper _output; diff --git a/src/libraries/System.Private.Xml/tests/Xslt/XslCompiledTransformApi/OutputSettings.cs b/src/libraries/System.Private.Xml/tests/Xslt/XslCompiledTransformApi/OutputSettings.cs index 5bf09df20ede9c..cf3a01b7a807c7 100644 --- a/src/libraries/System.Private.Xml/tests/Xslt/XslCompiledTransformApi/OutputSettings.cs +++ b/src/libraries/System.Private.Xml/tests/Xslt/XslCompiledTransformApi/OutputSettings.cs @@ -11,6 +11,7 @@ namespace System.Xml.XslCompiledTransformApiTests { //[TestCase(Name = "OutputSettings", Desc = "This testcase tests the OutputSettings on XslCompiledTransform", Param = "Debug")] [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/124344", typeof(PlatformDetection), nameof(PlatformDetection.IsAppleMobile), nameof(PlatformDetection.IsCoreCLR))] public class COutputSettings : XsltApiTestCaseBase2 { private XslCompiledTransform _xsl = null; diff --git a/src/libraries/System.Private.Xml/tests/Xslt/XslCompiledTransformApi/TempFiles.cs b/src/libraries/System.Private.Xml/tests/Xslt/XslCompiledTransformApi/TempFiles.cs index aa5020f24f6da5..816ec3315cbbec 100644 --- a/src/libraries/System.Private.Xml/tests/Xslt/XslCompiledTransformApi/TempFiles.cs +++ b/src/libraries/System.Private.Xml/tests/Xslt/XslCompiledTransformApi/TempFiles.cs @@ -10,6 +10,7 @@ namespace System.Xml.XslCompiledTransformApiTests { //[TestCase(Name = "TemporaryFiles", Desc = "This testcase tests the Temporary Files property on XslCompiledTransform")] [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/124344", typeof(PlatformDetection), nameof(PlatformDetection.IsAppleMobile), nameof(PlatformDetection.IsCoreCLR))] public class TempFiles : XsltApiTestCaseBase2 { private XslCompiledTransform _xsl = null; diff --git a/src/libraries/System.Private.Xml/tests/Xslt/XslCompiledTransformApi/XslCompiledTransform.cs b/src/libraries/System.Private.Xml/tests/Xslt/XslCompiledTransformApi/XslCompiledTransform.cs index 7f9707004c9bdf..675b8e87d2ab96 100644 --- a/src/libraries/System.Private.Xml/tests/Xslt/XslCompiledTransformApi/XslCompiledTransform.cs +++ b/src/libraries/System.Private.Xml/tests/Xslt/XslCompiledTransformApi/XslCompiledTransform.cs @@ -82,6 +82,7 @@ protected void WLoad(XslCompiledTransform instance, MethodInfo meth, byte[] byte //[TestCase(Name = "Load(MethodInfo, ByteArray, TypeArray) tests", Desc = "This testcase tests private Load method via Reflection. This method is used by sharepoint")] [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/124344", typeof(PlatformDetection), nameof(PlatformDetection.IsAppleMobile), nameof(PlatformDetection.IsCoreCLR))] public class CLoadMethInfoTest : ReflectionTestCaseBase { private ITestOutputHelper _output; @@ -134,6 +135,7 @@ public void Var2() } //[TestCase(Name = "Null argument tests", Desc = "This testcase passes NULL arguments to all XslCompiledTransform methods")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/124344", typeof(PlatformDetection), nameof(PlatformDetection.IsAppleMobile), nameof(PlatformDetection.IsCoreCLR))] public class CNullArgumentTest : XsltApiTestCaseBase2 { private ITestOutputHelper _output; @@ -478,6 +480,7 @@ public void Var14() //[TestCase(Name = "XslCompiledTransform.XmlResolver : Navigator, Writer", Desc = "NAVIGATOR,WRITER")] //[TestCase(Name = "XslCompiledTransform.XmlResolver : Navigator, TextWriter", Desc = "NAVIGATOR,TEXTWRITER")] [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/124344", typeof(PlatformDetection), nameof(PlatformDetection.IsAppleMobile), nameof(PlatformDetection.IsCoreCLR))] public class CXmlResolverTest : XsltApiTestCaseBase2, IDisposable { private ITestOutputHelper _output; @@ -670,6 +673,7 @@ public void XmlResolver7(XslInputType xslInputType, ReaderType readerType, Outpu //[TestCase(Name = "XslCompiledTransform.Load() - Integrity : Navigator, Writer", Desc = "NAVIGATOR,WRITER")] //[TestCase(Name = "XslCompiledTransform.Load() - Integrity : Navigator, TextWriter", Desc = "NAVIGATOR,TEXTWRITER")] [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/124344", typeof(PlatformDetection), nameof(PlatformDetection.IsAppleMobile), nameof(PlatformDetection.IsCoreCLR))] public class CLoadTest : XsltApiTestCaseBase2 { private ITestOutputHelper _output; @@ -1009,6 +1013,7 @@ public void LoadGeneric12(XslInputType xslInputType, ReaderType readerType) //[TestCase(Name = "XslCompiledTransform.Load(XmlResolver) - Integrity : URI, Writer", Desc = "URI,WRITER")] //[TestCase(Name = "XslCompiledTransform.Load(XmlResolver) - Integrity : URI, TextWriter", Desc = "URI,TEXTWRITER")] [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/124344", typeof(PlatformDetection), nameof(PlatformDetection.IsAppleMobile), nameof(PlatformDetection.IsCoreCLR))] public class CLoadXmlResolverTest : XsltApiTestCaseBase2 { private ITestOutputHelper _output; @@ -1441,6 +1446,7 @@ public void LoadGeneric11(XslInputType xslInputType, ReaderType readerType) //[TestCase(Name = "XslCompiledTransform.Load(Url, Resolver) : URI, Writer", Desc = "URI,WRITER")] //[TestCase(Name = "XslCompiledTransform.Load(Url, Resolver) : URI, TextWriter", Desc = "URI,TEXTWRITER")] [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/124344", typeof(PlatformDetection), nameof(PlatformDetection.IsAppleMobile), nameof(PlatformDetection.IsCoreCLR))] public class CLoadUrlResolverTest : XsltApiTestCaseBase2 { private ITestOutputHelper _output; @@ -1541,6 +1547,7 @@ private sealed class XmlAuditingUrlResolver : XmlUrlResolver //[TestCase(Name = "XslCompiledTransform.Load(Url) Integrity : URI, Stream", Desc = "URI,STREAM")] [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/124344", typeof(PlatformDetection), nameof(PlatformDetection.IsAppleMobile), nameof(PlatformDetection.IsCoreCLR))] public class CLoadStringTest : XsltApiTestCaseBase2 { private ITestOutputHelper _output; @@ -1660,6 +1667,7 @@ public void LoadUrl5(ReaderType readerType) //[TestCase(Name = "XslCompiledTransform .Load(IXPathNavigable) : Navigator, TextWriter", Desc = "NAVIGATOR,TEXTWRITER")] [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/124344", typeof(PlatformDetection), nameof(PlatformDetection.IsAppleMobile), nameof(PlatformDetection.IsCoreCLR))] public class CLoadXPathNavigableTest : XsltApiTestCaseBase2 { private ITestOutputHelper _output; @@ -1769,6 +1777,7 @@ public void LoadNavigator4() //[TestCase(Name = "XslCompiledTransform.Load(Reader) : Reader, Stream", Desc = "READER,STREAM")] [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/124344", typeof(PlatformDetection), nameof(PlatformDetection.IsAppleMobile), nameof(PlatformDetection.IsCoreCLR))] public class CLoadReaderTest : XsltApiTestCaseBase2 { private ITestOutputHelper _output; @@ -2159,6 +2168,7 @@ public override string Value //[TestCase(Name = "XslCompiledTransform.Transform() Integrity : Navigator, Writer", Desc = "NAVIGATOR,WRITER")] //[TestCase(Name = "XslCompiledTransform.Transform() Integrity : Navigator, TextWriter", Desc = "NAVIGATOR,TEXTWRITER")] [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/124344", typeof(PlatformDetection), nameof(PlatformDetection.IsAppleMobile), nameof(PlatformDetection.IsCoreCLR))] public class CTransformTestGeneric : XsltApiTestCaseBase2 { private ITestOutputHelper _output; @@ -2415,6 +2425,7 @@ public void TransformGeneric11(XslInputType xslInputType, ReaderType readerType, //[TestCase(Name = "XslCompiledTransform.Transform(XmlResolver) : Navigator, Writer", Desc = "NAVIGATOR,WRITER")] //[TestCase(Name = "XslCompiledTransform.Transform(XmlResolver) : Navigator, TextWriter", Desc = "NAVIGATOR,TEXTWRITER")] [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/124344", typeof(PlatformDetection), nameof(PlatformDetection.IsAppleMobile), nameof(PlatformDetection.IsCoreCLR))] public class CTransformResolverTest : XsltApiTestCaseBase2, IDisposable { private ITestOutputHelper _output; @@ -2628,6 +2639,7 @@ public void XmlResolver7(XslInputType xslInputType, ReaderType readerType, Outpu //[TestCase(Name = "XslCompiledTransform.Transform(String, String) : URI, String", Desc = "URI,STREAM")] //[TestCase(Name = "XslCompiledTransform.Transform(String, String) : Navigator, String", Desc = "NAVIGATOR,STREAM")] [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/124344", typeof(PlatformDetection), nameof(PlatformDetection.IsAppleMobile), nameof(PlatformDetection.IsCoreCLR))] public class CTransformStrStrTest : XsltApiTestCaseBase2 { private ITestOutputHelper _output; @@ -3001,6 +3013,7 @@ public void TransformStrStr13(XslInputType xslInputType, ReaderType readerType) //[TestCase(Name = "XslCompiledTransform.Transform(String, String, Resolver) : URI, String", Desc = "URI,STREAM")] //[TestCase(Name = "XslCompiledTransform.Transform(String, String, Resolver) : Navigator, String", Desc = "NAVIGATOR,STREAM")] [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/124344", typeof(PlatformDetection), nameof(PlatformDetection.IsAppleMobile), nameof(PlatformDetection.IsCoreCLR))] public class CTransformStrStrResolverTest : XsltApiTestCaseBase2, IDisposable { private ITestOutputHelper _output; @@ -3106,6 +3119,7 @@ public void TransformStrStrResolver3(object param, XslInputType xslInputType, Re //[TestCase(Name = "XslCompiledTransform.Transform(IXPathNavigable, XsltArgumentList, XmlWriter, XmlResolver)", Desc = "Constructor Tests", Param = "IXPathNavigable")] //[TestCase(Name = "XslCompiledTransform.Transform(XmlReader, XsltArgumentList, XmlWriter, XmlResolver)", Desc = "Constructor Tests", Param = "XmlReader")] [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/124344", typeof(PlatformDetection), nameof(PlatformDetection.IsAppleMobile), nameof(PlatformDetection.IsCoreCLR))] public class CTransformConstructorWithFourParametersTest : XsltApiTestCaseBase2 { private ITestOutputHelper _output; @@ -3313,6 +3327,7 @@ public void InValidCases(object param0, object param1, object param2) //[TestCase(Name = "NDP1_1SP1 Bugs (URI,STREAM)", Desc = "URI,STREAM")] //[TestCase(Name = "NDP1_1SP1 Bugs (NAVIGATOR,TEXTWRITER)", Desc = "NAVIGATOR,TEXTWRITER")] [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/124344", typeof(PlatformDetection), nameof(PlatformDetection.IsAppleMobile), nameof(PlatformDetection.IsCoreCLR))] public class CNDP1_1SP1Test : XsltApiTestCaseBase2 { private ITestOutputHelper _output; @@ -3405,6 +3420,7 @@ public void var4(XslInputType xslInputType, ReaderType readerType, OutputType ou //[TestCase(Name = "XslCompiledTransform Regression Tests for API", Desc = "XslCompiledTransform Regression Tests")] [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/124344", typeof(PlatformDetection), nameof(PlatformDetection.IsAppleMobile), nameof(PlatformDetection.IsCoreCLR))] public class CTransformRegressionTest : XsltApiTestCaseBase2, IDisposable { private ITestOutputHelper _output; diff --git a/src/libraries/System.Private.Xml/tests/Xslt/XslCompiledTransformApi/XslTransformMultith.cs b/src/libraries/System.Private.Xml/tests/Xslt/XslCompiledTransformApi/XslTransformMultith.cs index 29f58152ba8687..29c08cd065b42e 100644 --- a/src/libraries/System.Private.Xml/tests/Xslt/XslCompiledTransformApi/XslTransformMultith.cs +++ b/src/libraries/System.Private.Xml/tests/Xslt/XslCompiledTransformApi/XslTransformMultith.cs @@ -36,6 +36,7 @@ public SameInstanceXslTransformTestCase(ITestOutputHelper output) : base(output) //[TestCase(Name = "Same instance testing: Transform() - READER")] [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/124344", typeof(PlatformDetection), nameof(PlatformDetection.IsAppleMobile), nameof(PlatformDetection.IsCoreCLR))] public class SameInstanceXslTransformReader : SameInstanceXslTransformTestCase { private XPathDocument _xd; // Loads XML file @@ -320,6 +321,7 @@ public void proc12() //[TestCase(Name = "Same instance testing: Transform() - TEXTWRITER")] [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/124344", typeof(PlatformDetection), nameof(PlatformDetection.IsAppleMobile), nameof(PlatformDetection.IsCoreCLR))] public class SameInstanceXslTransformWriter : SameInstanceXslTransformTestCase { private XPathDocument _xd; // Loads XML file diff --git a/src/libraries/System.Private.Xml/tests/Xslt/XslCompiledTransformApi/XsltApiV2.cs b/src/libraries/System.Private.Xml/tests/Xslt/XslCompiledTransformApi/XsltApiV2.cs index 7dc7693a689ead..a4cee46f961fe2 100644 --- a/src/libraries/System.Private.Xml/tests/Xslt/XslCompiledTransformApi/XsltApiV2.cs +++ b/src/libraries/System.Private.Xml/tests/Xslt/XslCompiledTransformApi/XsltApiV2.cs @@ -38,7 +38,6 @@ public enum NavType // //////////////////////////////////////////////////////////////// [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/124344", typeof(PlatformDetection), nameof(PlatformDetection.IsAppleMobile), nameof(PlatformDetection.IsCoreCLR))] public class XsltApiTestCaseBase2 { // Generic data for all derived test cases diff --git a/src/libraries/System.Private.Xml/tests/Xslt/XslCompiledTransformApi/XsltArgumentList.cs b/src/libraries/System.Private.Xml/tests/Xslt/XslCompiledTransformApi/XsltArgumentList.cs index 71de03fbcabc9e..aaa6d171936e14 100644 --- a/src/libraries/System.Private.Xml/tests/Xslt/XslCompiledTransformApi/XsltArgumentList.cs +++ b/src/libraries/System.Private.Xml/tests/Xslt/XslCompiledTransformApi/XsltArgumentList.cs @@ -18,6 +18,7 @@ namespace System.Xml.XslCompiledTransformApiTests //[TestCase(Name = "XsltArgumentList - GetParam", Desc = "Get Param Test Cases")] [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/124344", typeof(PlatformDetection), nameof(PlatformDetection.IsAppleMobile), nameof(PlatformDetection.IsCoreCLR))] public class CArgIntegrity : XsltApiTestCaseBase2 { private ITestOutputHelper _output; @@ -601,6 +602,7 @@ public void GetParam20() /***********************************************************/ //[TestCase(Name = "XsltArgumentList - GetExtensionObject", Desc = "XsltArgumentList.GetExtensionObject")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/124344", typeof(PlatformDetection), nameof(PlatformDetection.IsAppleMobile), nameof(PlatformDetection.IsCoreCLR))] public class CArgGetExtObj : XsltApiTestCaseBase2 { private ITestOutputHelper _output; @@ -984,6 +986,7 @@ public void GetExtObject12() //[TestCase(Name = "XsltArgumentList - AddParam : Navigator, Stream", Desc = "NAVIGATOR,STREAM")] //[TestCase(Name = "XsltArgumentList - AddParam : Navigator, Writer", Desc = "NAVIGATOR,WRITER")] //[TestCase(Name = "XsltArgumentList - AddParam : Navigator, TextWriter", Desc = "NAVIGATOR,TEXTWRITER")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/124344", typeof(PlatformDetection), nameof(PlatformDetection.IsAppleMobile), nameof(PlatformDetection.IsCoreCLR))] public class CArgAddParam : XsltApiTestCaseBase2 { private ITestOutputHelper _output; @@ -1688,6 +1691,7 @@ public void AddExtObject32(XslInputType xslInputType, ReaderType readerType, Out //[TestCase(Name = "XsltArgumentList - AddParam Misc : Navigator, Stream", Desc = "NAVIGATOR,STREAM")] //[TestCase(Name = "XsltArgumentList - AddParam Misc : Navigator, Writer", Desc = "NAVIGATOR,WRITER")] //[TestCase(Name = "XsltArgumentList - AddParam Misc : Navigator, TextWriter", Desc = "NAVIGATOR,TEXTWRITER")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/124344", typeof(PlatformDetection), nameof(PlatformDetection.IsAppleMobile), nameof(PlatformDetection.IsCoreCLR))] public class CArgAddParamMisc : XsltApiTestCaseBase2 { private ITestOutputHelper _output; @@ -2415,6 +2419,7 @@ public void AddParam3(object param0, object param1, XslInputType xslInputType, R //[TestCase(Name = "XsltArgumentList - AddExtensionObject : Navigator, Stream", Desc = "NAVIGATOR,STREAM")] //[TestCase(Name = "XsltArgumentList - AddExtensionObject : Navigator, Writer", Desc = "NAVIGATOR,WRITER")] //[TestCase(Name = "XsltArgumentList - AddExtensionObject : Navigator, TextWriter", Desc = "NAVIGATOR,TEXTWRITER")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/124344", typeof(PlatformDetection), nameof(PlatformDetection.IsAppleMobile), nameof(PlatformDetection.IsCoreCLR))] public class CArgAddExtObj : XsltApiTestCaseBase2 { private ITestOutputHelper _output; @@ -3391,6 +3396,7 @@ public int Increment() //[TestCase(Name = "XsltArgumentList - RemoveParam : URI, Stream", Desc = "URI,STREAM")] //[TestCase(Name = "XsltArgumentList - RemoveParam : Navigator, Writer", Desc = "NAVIGATOR,WRITER")] //[TestCase(Name = "XsltArgumentList - RemoveParam : Navigator, TextWriter", Desc = "NAVIGATOR,TEXTWRITER")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/124344", typeof(PlatformDetection), nameof(PlatformDetection.IsAppleMobile), nameof(PlatformDetection.IsCoreCLR))] public class CArgRemoveParam : XsltApiTestCaseBase2 { private string _baseline = string.Empty; @@ -3950,6 +3956,7 @@ public void RemoveParam15() //[TestCase(Name = "XsltArgumentList - RemoveExtensionObject : Reader, TextWriter", Desc = "READER,TEXTWRITER")] //[TestCase(Name = "XsltArgumentList - RemoveExtensionObject : URI, Reader", Desc = "URI,READER")] //[TestCase(Name = "XsltArgumentList - RemoveExtensionObject : Navigator, Stream", Desc = "NAVIGATOR,STREAM")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/124344", typeof(PlatformDetection), nameof(PlatformDetection.IsAppleMobile), nameof(PlatformDetection.IsCoreCLR))] public class CArgRemoveExtObj : XsltApiTestCaseBase2 { private ITestOutputHelper _output; @@ -4216,6 +4223,7 @@ public void RemoveExtObj9(object param, XslInputType xslInputType, ReaderType re /***********************************************************/ //[TestCase(Name = "XsltArgumentList - Clear", Desc = "XsltArgumentList.Clear")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/124344", typeof(PlatformDetection), nameof(PlatformDetection.IsAppleMobile), nameof(PlatformDetection.IsCoreCLR))] public class CArgClear : XsltApiTestCaseBase2 { private ITestOutputHelper _output; @@ -4469,6 +4477,7 @@ public void Clear8(object param, XslInputType xslInputType, ReaderType readerTyp } //[TestCase(Name = "XsltArgumentList - Events", Desc = "Events raised by xsl:message")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/124344", typeof(PlatformDetection), nameof(PlatformDetection.IsAppleMobile), nameof(PlatformDetection.IsCoreCLR))] public class XsltEvents : XsltApiTestCaseBase2 { public bool EventRaised; @@ -4593,6 +4602,7 @@ public void EventsTests(object param0, object param1, object param2, object para } //[TestCase(Name = "XPathNodeIterator Tests", Desc = "XPathNodeIterator Tests using XsltArgumentList")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/124344", typeof(PlatformDetection), nameof(PlatformDetection.IsAppleMobile), nameof(PlatformDetection.IsCoreCLR))] public class XPathNodeIteratorTests : XsltApiTestCaseBase2 { private ITestOutputHelper _output; diff --git a/src/libraries/System.Private.Xml/tests/Xslt/XslCompiledTransformApi/XsltArgumentListMultith.cs b/src/libraries/System.Private.Xml/tests/Xslt/XslCompiledTransformApi/XsltArgumentListMultith.cs index ef1e1b19c69a5d..cd3fc86f17324b 100644 --- a/src/libraries/System.Private.Xml/tests/Xslt/XslCompiledTransformApi/XsltArgumentListMultith.cs +++ b/src/libraries/System.Private.Xml/tests/Xslt/XslCompiledTransformApi/XsltArgumentListMultith.cs @@ -56,6 +56,7 @@ public CSameInstanceXsltArgTestCase2(ITestOutputHelper output) : base(output) //[TestCase(Name = "Same instance testing: XsltArgList - GetParam", Desc = "GetParam test cases")] [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/124344", typeof(PlatformDetection), nameof(PlatformDetection.IsAppleMobile), nameof(PlatformDetection.IsCoreCLR))] public class CSameInstanceXsltArgumentListGetParam : CSameInstanceXsltArgTestCase2 { private ITestOutputHelper _output; @@ -142,6 +143,7 @@ public void proc2() //[TestCase(Name = "Same instance testing: XsltArgList - GetExtensionObject", Desc = "GetExtensionObject test cases")] [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/124344", typeof(PlatformDetection), nameof(PlatformDetection.IsAppleMobile), nameof(PlatformDetection.IsCoreCLR))] public class CSameInstanceXsltArgumentListGetExtnObject : CSameInstanceXsltArgTestCase2 { private ITestOutputHelper _output; @@ -227,6 +229,7 @@ public void proc2() //[TestCase(Name = "Same instance testing: XsltArgList - Transform", Desc = "Multiple transforms")] [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/124344", typeof(PlatformDetection), nameof(PlatformDetection.IsAppleMobile), nameof(PlatformDetection.IsCoreCLR))] public class CSameInstanceXsltArgumentListTransform : CSameInstanceXsltArgTestCase2 { private ITestOutputHelper _output; diff --git a/src/libraries/System.Private.Xml/tests/Xslt/XslCompiledTransformApi/XsltSettings.cs b/src/libraries/System.Private.Xml/tests/Xslt/XslCompiledTransformApi/XsltSettings.cs index a14896236f8cd1..fb730ce8345b45 100644 --- a/src/libraries/System.Private.Xml/tests/Xslt/XslCompiledTransformApi/XsltSettings.cs +++ b/src/libraries/System.Private.Xml/tests/Xslt/XslCompiledTransformApi/XsltSettings.cs @@ -14,6 +14,7 @@ namespace System.Xml.XslCompiledTransformApiTests //[TestCase(Name = "XsltSettings-Retail", Desc = "This testcase tests the different settings on XsltSettings and the corresponding behavior in retail mode", Param = "Retail")] //[TestCase(Name = "XsltSettings-Debug", Desc = "This testcase tests the different settings on XsltSettings and the corresponding behavior in debug mode", Param = "Debug")] [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/124344", typeof(PlatformDetection), nameof(PlatformDetection.IsAppleMobile), nameof(PlatformDetection.IsCoreCLR))] public class CXsltSettings : XsltApiTestCaseBase2 { private ITestOutputHelper _output; From 896380daa91fba2b89069ab78d8406ae5422f6b8 Mon Sep 17 00:00:00 2001 From: Katelyn Gadd Date: Thu, 7 May 2026 08:45:51 -0700 Subject: [PATCH 044/109] [Wasm RyuJIT] Codegen for reverse pinvoke/unmanagedcallersonly (#127751) Sufficient to compile basic UnmanagedCallersOnly scenarios --- src/coreclr/jit/codegenwasm.cpp | 18 ++++++++++++------ src/coreclr/jit/compiler.hpp | 2 +- src/coreclr/jit/lclvars.cpp | 2 +- 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/src/coreclr/jit/codegenwasm.cpp b/src/coreclr/jit/codegenwasm.cpp index db056b21ab704b..0d89746cf97da6 100644 --- a/src/coreclr/jit/codegenwasm.cpp +++ b/src/coreclr/jit/codegenwasm.cpp @@ -13,6 +13,8 @@ #include "gcinfoencoder.h" static const int LINEAR_MEMORY_INDEX = 0; +// stackPointer is the 0th global in our generated Wasm modules +static const int STACK_POINTER_GLOBAL = 0; #ifdef TARGET_64BIT static const instruction INS_I_load = INS_i64_load; @@ -146,16 +148,20 @@ void CodeGen::genAllocLclFrame(unsigned frameSize, regNumber initReg, bool* pIni m_compiler->unwindAllocStack(frameSize); - // TODO-WASM: reverse pinvoke frame allocation - // + unsigned initialSPLclIndex; + unsigned spLclIndex = WasmRegToIndex(spReg); if (!m_compiler->lvaGetDesc(m_compiler->lvaWasmSpArg)->lvIsParam) { - NYI_WASM("alloc local frame for reverse pinvoke"); + initialSPLclIndex = spLclIndex; + GetEmitter()->emitIns_I(INS_global_get, EA_PTRSIZE, STACK_POINTER_GLOBAL); + GetEmitter()->emitIns_I(INS_local_set, EA_PTRSIZE, initialSPLclIndex); + } + else + { + initialSPLclIndex = + WasmRegToIndex(m_compiler->lvaGetParameterABIInfo(m_compiler->lvaWasmSpArg).Segment(0).GetRegister()); } - unsigned initialSPLclIndex = - WasmRegToIndex(m_compiler->lvaGetParameterABIInfo(m_compiler->lvaWasmSpArg).Segment(0).GetRegister()); - unsigned spLclIndex = WasmRegToIndex(spReg); assert(initialSPLclIndex == spLclIndex); if (frameSize != 0) { diff --git a/src/coreclr/jit/compiler.hpp b/src/coreclr/jit/compiler.hpp index cf012b39d2e855..27add33c734fa6 100644 --- a/src/coreclr/jit/compiler.hpp +++ b/src/coreclr/jit/compiler.hpp @@ -2974,7 +2974,7 @@ inline unsigned Compiler::compMapILargNum(unsigned ILargNum) assert(ILargNum < info.compILargsCount); #if defined(TARGET_WASM) - if (ILargNum >= lvaWasmSpArg) + if ((ILargNum >= lvaWasmSpArg) && (lvaWasmSpArg != BAD_VAR_NUM) && lvaGetDesc(lvaWasmSpArg)->lvIsParam) { ILargNum++; assert(ILargNum < info.compLocalsCount); // compLocals count already adjusted. diff --git a/src/coreclr/jit/lclvars.cpp b/src/coreclr/jit/lclvars.cpp index 33cb583fcfb3a5..2e8e756dee0eeb 100644 --- a/src/coreclr/jit/lclvars.cpp +++ b/src/coreclr/jit/lclvars.cpp @@ -1287,7 +1287,7 @@ unsigned Compiler::compMap2ILvarNum(unsigned varNum) const } #if defined(TARGET_WASM) - if (lvaWasmSpArg != BAD_VAR_NUM && originalVarNum > lvaWasmSpArg) + if (lvaWasmSpArg != BAD_VAR_NUM && originalVarNum > lvaWasmSpArg && lvaGetDesc(lvaWasmSpArg)->lvIsParam) { varNum--; } From 41fad311c8c3d2ae2c5582e16150856313f2bbfe Mon Sep 17 00:00:00 2001 From: Egor Bogatov Date: Thu, 7 May 2026 17:57:15 +0200 Subject: [PATCH 045/109] Remove unsafe code from System.Collections.BitArray (#127846) > [!NOTE] > This PR is AI-generated. [No diffs](https://github.com/MihuBot/runtime-utils/issues/1878) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../src/System/Collections/BitArray.cs | 22 ++++++++++++------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/src/libraries/System.Private.CoreLib/src/System/Collections/BitArray.cs b/src/libraries/System.Private.CoreLib/src/System/Collections/BitArray.cs index a325147a8f0bc5..39797ba0bb7f75 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Collections/BitArray.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Collections/BitArray.cs @@ -170,44 +170,50 @@ public BitArray(bool[] values) // Instead, We compare with zeroes (== false) then negate the result to ensure compatibility. ref byte arrayRef = ref MemoryMarshal.GetArrayDataReference(_array); - ref byte value = ref Unsafe.As(ref MemoryMarshal.GetArrayDataReference(values)); + ReadOnlySpan valuesAsBytes = MemoryMarshal.AsBytes(values.AsSpan()); if (Vector512.IsHardwareAccelerated) { - for (; i <= (uint)values.Length - Vector512.Count; i += (uint)Vector512.Count) + while (valuesAsBytes.Length >= Vector512.Count) { - Vector512 vector = Vector512.LoadUnsafe(ref value, i); + Vector512 vector = Vector512.Create(valuesAsBytes); Vector512 isFalse = Vector512.Equals(vector, Vector512.Zero); ulong result = isFalse.ExtractMostSignificantBits(); Unsafe.WriteUnaligned(ref Unsafe.Add(ref arrayRef, sizeof(ulong) * (i / 64u)), ~result); + i += (uint)Vector512.Count; + valuesAsBytes = valuesAsBytes.Slice(Vector512.Count); } } else if (Vector256.IsHardwareAccelerated) { - for (; i <= (uint)values.Length - Vector256.Count; i += (uint)Vector256.Count) + while (valuesAsBytes.Length >= Vector256.Count) { - Vector256 vector = Vector256.LoadUnsafe(ref value, i); + Vector256 vector = Vector256.Create(valuesAsBytes); Vector256 isFalse = Vector256.Equals(vector, Vector256.Zero); uint result = isFalse.ExtractMostSignificantBits(); Unsafe.WriteUnaligned(ref Unsafe.Add(ref arrayRef, sizeof(uint) * (i / 32u)), ~result); + i += (uint)Vector256.Count; + valuesAsBytes = valuesAsBytes.Slice(Vector256.Count); } } else if (Vector128.IsHardwareAccelerated) { - for (; i <= (uint)values.Length - Vector128.Count * 2u; i += (uint)Vector128.Count * 2u) + while (valuesAsBytes.Length >= Vector128.Count * 2) { - Vector128 lowerVector = Vector128.LoadUnsafe(ref value, i); + Vector128 lowerVector = Vector128.Create(valuesAsBytes); Vector128 lowerIsFalse = Vector128.Equals(lowerVector, Vector128.Zero); uint lowerResult = lowerIsFalse.ExtractMostSignificantBits(); - Vector128 upperVector = Vector128.LoadUnsafe(ref value, i + (uint)Vector128.Count); + Vector128 upperVector = Vector128.Create(valuesAsBytes.Slice(Vector128.Count)); Vector128 upperIsFalse = Vector128.Equals(upperVector, Vector128.Zero); uint upperResult = upperIsFalse.ExtractMostSignificantBits(); Unsafe.WriteUnaligned( ref Unsafe.Add(ref arrayRef, sizeof(uint) * (i / 32u)), ~((upperResult << 16) | lowerResult)); + i += (uint)Vector128.Count * 2u; + valuesAsBytes = valuesAsBytes.Slice(Vector128.Count * 2); } } From 0057b1a0900bc031ca0db9d1c027d1c44a1a6ce2 Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Thu, 7 May 2026 10:05:35 -0700 Subject: [PATCH 046/109] Add test: MaxResponseContentBufferSize enforced against decompressed content (Brotli) (#127864) Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: MihaZupan <25307628+MihaZupan@users.noreply.github.com> --- .../HttpClientHandlerTest.Decompression.cs | 93 +++++++++++++++++++ ...ttp.WinHttpHandler.Functional.Tests.csproj | 3 + 2 files changed, 96 insertions(+) diff --git a/src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.Decompression.cs b/src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.Decompression.cs index 02724599c120ee..8cdac9246bc1fe 100644 --- a/src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.Decompression.cs +++ b/src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.Decompression.cs @@ -7,6 +7,7 @@ using System.Linq; using System.Net.Test.Common; using System.Text.RegularExpressions; +using System.Threading; using System.Threading.Tasks; using Xunit; @@ -287,6 +288,98 @@ await LoopbackServer.CreateServerAsync(async (server, url) => }); } +#if !NETFRAMEWORK + [Fact] + [SkipOnPlatform(TestPlatforms.Browser, "AutomaticDecompression not supported on Browser")] + public async Task GetAsync_AutomaticBrotliDecompression_MaxResponseContentBufferSizeEnforced() + { + if (IsWinHttpHandler) + { + // Brotli not supported on WinHttpHandler + return; + } + + const int ChunkSize = 1024 * 1024; // 1 MB of zeros per write + const long BufferLimit = 10 * 1024 * 1024; // 10 MB buffer limit + + long serverBytesWritten = 0; + + await LoopbackServer.CreateClientAndServerAsync(async uri => + { + using HttpClientHandler handler = CreateHttpClientHandler(); + handler.AutomaticDecompression = DecompressionMethods.Brotli; + using HttpClient client = CreateHttpClient(handler); + client.MaxResponseContentBufferSize = BufferLimit; + + HttpRequestException ex = await Assert.ThrowsAsync( + () => client.GetByteArrayAsync(uri)); + Assert.Equal(HttpRequestError.ConfigurationLimitExceeded, ex.HttpRequestError); + }, async server => + { + await server.AcceptConnectionAsync(async connection => + { + await connection.ReadRequestHeaderAsync(); + await connection.WriteStringAsync("HTTP/1.1 200 OK\r\nContent-Encoding: br\r\n\r\n"); + + var chunk = new byte[ChunkSize]; // zeros — highly compressible + var countingStream = new ByteCountingStream(connection.Stream); + try + { + using var brotliStream = new BrotliStream(countingStream, CompressionLevel.Optimal, leaveOpen: true); + while (true) + { + await brotliStream.WriteAsync(chunk); + await brotliStream.FlushAsync(); + } + } + catch (IOException) { } + catch (OperationCanceledException) { } + finally + { + serverBytesWritten = countingStream.BytesWritten; + } + }); + }); + + // The server should have sent far fewer compressed bytes than the decompressed buffer limit, + // demonstrating that a highly compressed payload can trigger the limit without the server + // needing to transmit anywhere near the full decompressed amount. + Assert.True(serverBytesWritten < BufferLimit, + $"Server sent {serverBytesWritten} compressed bytes, expected fewer than the {BufferLimit}-byte buffer limit"); + } + + private sealed class ByteCountingStream : DelegatingStream + { + public ByteCountingStream(Stream inner) : base(inner) { } + + public long BytesWritten { get; private set; } + + public override void Write(byte[] buffer, int offset, int count) + { + base.Write(buffer, offset, count); + BytesWritten += count; + } + + public override void Write(ReadOnlySpan buffer) + { + base.Write(buffer); + BytesWritten += buffer.Length; + } + + public override async Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) + { + await base.WriteAsync(buffer, offset, count, cancellationToken); + BytesWritten += count; + } + + public override async ValueTask WriteAsync(ReadOnlyMemory buffer, CancellationToken cancellationToken = default) + { + await base.WriteAsync(buffer, cancellationToken); + BytesWritten += buffer.Length; + } + } +#endif + [Theory] #if NET [InlineData(DecompressionMethods.GZip | DecompressionMethods.Deflate | DecompressionMethods.Brotli, "gzip; q=1.0, deflate; q=1.0, br; q=1.0", "")] diff --git a/src/libraries/System.Net.Http.WinHttpHandler/tests/FunctionalTests/System.Net.Http.WinHttpHandler.Functional.Tests.csproj b/src/libraries/System.Net.Http.WinHttpHandler/tests/FunctionalTests/System.Net.Http.WinHttpHandler.Functional.Tests.csproj index ea0f791b559bbd..78ee886b7af9f1 100644 --- a/src/libraries/System.Net.Http.WinHttpHandler/tests/FunctionalTests/System.Net.Http.WinHttpHandler.Functional.Tests.csproj +++ b/src/libraries/System.Net.Http.WinHttpHandler/tests/FunctionalTests/System.Net.Http.WinHttpHandler.Functional.Tests.csproj @@ -21,6 +21,9 @@ Link="Common\System\Net\Http\HttpHandlerDefaults.cs" /> + Date: Thu, 7 May 2026 19:16:16 +0200 Subject: [PATCH 047/109] Reduce Unsafe usage in primitive IBinaryInteger TryRead/TryWrite (#127913) > [!NOTE] > This PR was authored by an AI agent (Copilot CLI) on my behalf. Replaces `MemoryMarshal.GetReference` / `Unsafe.ReadUnaligned` / `Unsafe.Add` with the span indexer and `BinaryPrimitives` helpers in the `IBinaryInteger` `TryRead{Big,Little}Endian` / `TryWrite{Big,Little}Endian` implementations of the primitive numeric types. [Diffs (improvements)](https://github.com/MihuBot/runtime-utils/issues/1884) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../System.Private.CoreLib/src/System/Byte.cs | 8 +++----- .../System.Private.CoreLib/src/System/Char.cs | 11 ++--------- .../System.Private.CoreLib/src/System/Int128.cs | 11 ++--------- .../System.Private.CoreLib/src/System/Int16.cs | 13 +++---------- .../System.Private.CoreLib/src/System/Int32.cs | 11 ++--------- .../System.Private.CoreLib/src/System/Int64.cs | 11 ++--------- .../System.Private.CoreLib/src/System/IntPtr.cs | 11 ++--------- .../System.Private.CoreLib/src/System/SByte.cs | 2 +- .../System.Private.CoreLib/src/System/UInt128.cs | 11 ++--------- .../System.Private.CoreLib/src/System/UInt16.cs | 11 ++--------- .../System.Private.CoreLib/src/System/UInt32.cs | 11 ++--------- .../System.Private.CoreLib/src/System/UInt64.cs | 11 ++--------- .../System.Private.CoreLib/src/System/UIntPtr.cs | 11 ++--------- 13 files changed, 27 insertions(+), 106 deletions(-) diff --git a/src/libraries/System.Private.CoreLib/src/System/Byte.cs b/src/libraries/System.Private.CoreLib/src/System/Byte.cs index 1506b303ccb818..e6a38afe6152b4 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Byte.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Byte.cs @@ -355,7 +355,7 @@ static bool IBinaryInteger.TryReadLittleEndian(ReadOnlySpan source, } // We only have 1-byte so read it directly - result = MemoryMarshal.GetReference(source); + result = source[0]; } value = result; @@ -373,8 +373,7 @@ bool IBinaryInteger.TryWriteBigEndian(Span destination, out int byte { if (destination.Length >= sizeof(byte)) { - byte value = m_value; - MemoryMarshal.GetReference(destination) = value; + destination[0] = m_value; bytesWritten = sizeof(byte); return true; @@ -391,8 +390,7 @@ bool IBinaryInteger.TryWriteLittleEndian(Span destination, out int b { if (destination.Length >= sizeof(byte)) { - byte value = m_value; - MemoryMarshal.GetReference(destination) = value; + destination[0] = m_value; bytesWritten = sizeof(byte); return true; diff --git a/src/libraries/System.Private.CoreLib/src/System/Char.cs b/src/libraries/System.Private.CoreLib/src/System/Char.cs index 5d2c003ba3e66f..e0018e74006088 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Char.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Char.cs @@ -1295,22 +1295,15 @@ static bool IBinaryInteger.TryReadLittleEndian(ReadOnlySpan source, return false; } - ref byte sourceRef = ref MemoryMarshal.GetReference(source); - if (source.Length >= sizeof(char)) { // We have at least 2 bytes, so just read the ones we need directly - result = Unsafe.ReadUnaligned(ref sourceRef); - - if (!BitConverter.IsLittleEndian) - { - result = BinaryPrimitives.ReverseEndianness(result); - } + result = (char)BinaryPrimitives.ReadUInt16LittleEndian(source); } else { // We only have 1-byte so read it directly - result = (char)sourceRef; + result = (char)source[0]; } } diff --git a/src/libraries/System.Private.CoreLib/src/System/Int128.cs b/src/libraries/System.Private.CoreLib/src/System/Int128.cs index bd701587102b13..5a829fbc7300e5 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Int128.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Int128.cs @@ -876,17 +876,10 @@ static bool IBinaryInteger.TryReadLittleEndian(ReadOnlySpan source } } - ref byte sourceRef = ref MemoryMarshal.GetReference(source); - if (source.Length >= Size) { // We have at least 16 bytes, so just read the ones we need directly - result = Unsafe.ReadUnaligned(ref sourceRef); - - if (!BitConverter.IsLittleEndian) - { - result = BinaryPrimitives.ReverseEndianness(result); - } + result = BinaryPrimitives.ReadInt128LittleEndian(source); } else { @@ -899,7 +892,7 @@ static bool IBinaryInteger.TryReadLittleEndian(ReadOnlySpan source for (int i = 0; i < source.Length; i++) { result <<= 8; - result |= Unsafe.Add(ref sourceRef, i); + result |= source[i]; } result <<= ((Size - source.Length) * 8); diff --git a/src/libraries/System.Private.CoreLib/src/System/Int16.cs b/src/libraries/System.Private.CoreLib/src/System/Int16.cs index 5c30e0c071f256..d7eb5b70c85789 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Int16.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Int16.cs @@ -417,27 +417,20 @@ static bool IBinaryInteger.TryReadLittleEndian(ReadOnlySpan source, } } - ref byte sourceRef = ref MemoryMarshal.GetReference(source); - if (source.Length >= sizeof(short)) { // We have at least 2 bytes, so just read the ones we need directly - result = Unsafe.ReadUnaligned(ref sourceRef); - - if (!BitConverter.IsLittleEndian) - { - result = BinaryPrimitives.ReverseEndianness(result); - } + result = BinaryPrimitives.ReadInt16LittleEndian(source); } else if (isUnsigned) { // We only have 1-byte so read it directly - result = sourceRef; + result = source[0]; } else { // We only have 1-byte so read it directly with sign extension - result = (sbyte)sourceRef; + result = (sbyte)source[0]; } } diff --git a/src/libraries/System.Private.CoreLib/src/System/Int32.cs b/src/libraries/System.Private.CoreLib/src/System/Int32.cs index 17856d445c48f7..b6285e071a2e32 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Int32.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Int32.cs @@ -445,17 +445,10 @@ static bool IBinaryInteger.TryReadLittleEndian(ReadOnlySpan source, b } } - ref byte sourceRef = ref MemoryMarshal.GetReference(source); - if (source.Length >= sizeof(int)) { // We have at least 4 bytes, so just read the ones we need directly - result = Unsafe.ReadUnaligned(ref sourceRef); - - if (!BitConverter.IsLittleEndian) - { - result = BinaryPrimitives.ReverseEndianness(result); - } + result = BinaryPrimitives.ReadInt32LittleEndian(source); } else { @@ -468,7 +461,7 @@ static bool IBinaryInteger.TryReadLittleEndian(ReadOnlySpan source, b for (int i = 0; i < source.Length; i++) { result <<= 8; - result |= Unsafe.Add(ref sourceRef, i); + result |= source[i]; } result <<= ((sizeof(int) - source.Length) * 8); diff --git a/src/libraries/System.Private.CoreLib/src/System/Int64.cs b/src/libraries/System.Private.CoreLib/src/System/Int64.cs index ad2b5baa1f3a5a..e5dbace947d36f 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Int64.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Int64.cs @@ -442,17 +442,10 @@ static bool IBinaryInteger.TryReadLittleEndian(ReadOnlySpan source, } } - ref byte sourceRef = ref MemoryMarshal.GetReference(source); - if (source.Length >= sizeof(long)) { // We have at least 8 bytes, so just read the ones we need directly - result = Unsafe.ReadUnaligned(ref sourceRef); - - if (!BitConverter.IsLittleEndian) - { - result = BinaryPrimitives.ReverseEndianness(result); - } + result = BinaryPrimitives.ReadInt64LittleEndian(source); } else { @@ -465,7 +458,7 @@ static bool IBinaryInteger.TryReadLittleEndian(ReadOnlySpan source, for (int i = 0; i < source.Length; i++) { result <<= 8; - result |= Unsafe.Add(ref sourceRef, i); + result |= source[i]; } result <<= ((sizeof(long) - source.Length) * 8); diff --git a/src/libraries/System.Private.CoreLib/src/System/IntPtr.cs b/src/libraries/System.Private.CoreLib/src/System/IntPtr.cs index 86dce7a2210d2d..4a2b949814b413 100644 --- a/src/libraries/System.Private.CoreLib/src/System/IntPtr.cs +++ b/src/libraries/System.Private.CoreLib/src/System/IntPtr.cs @@ -465,17 +465,10 @@ static bool IBinaryInteger.TryReadLittleEndian(ReadOnlySpan source, } } - ref byte sourceRef = ref MemoryMarshal.GetReference(source); - if (source.Length >= sizeof(nint_t)) { // We have at least 4/8 bytes, so just read the ones we need directly - result = Unsafe.ReadUnaligned(ref sourceRef); - - if (!BitConverter.IsLittleEndian) - { - result = BinaryPrimitives.ReverseEndianness(result); - } + result = BinaryPrimitives.ReadIntPtrLittleEndian(source); } else { @@ -488,7 +481,7 @@ static bool IBinaryInteger.TryReadLittleEndian(ReadOnlySpan source, for (int i = 0; i < source.Length; i++) { result <<= 8; - result |= Unsafe.Add(ref sourceRef, i); + result |= source[i]; } result <<= ((sizeof(nint_t) - source.Length) * 8); diff --git a/src/libraries/System.Private.CoreLib/src/System/SByte.cs b/src/libraries/System.Private.CoreLib/src/System/SByte.cs index b39aae69c21a35..48411fe9e54f94 100644 --- a/src/libraries/System.Private.CoreLib/src/System/SByte.cs +++ b/src/libraries/System.Private.CoreLib/src/System/SByte.cs @@ -408,7 +408,7 @@ static bool IBinaryInteger.TryReadLittleEndian(ReadOnlySpan source, } // We only have 1-byte so read it directly - result = (sbyte)MemoryMarshal.GetReference(source); + result = (sbyte)source[0]; } value = result; diff --git a/src/libraries/System.Private.CoreLib/src/System/UInt128.cs b/src/libraries/System.Private.CoreLib/src/System/UInt128.cs index 6d176fee895b65..4b82bb0f61e5e2 100644 --- a/src/libraries/System.Private.CoreLib/src/System/UInt128.cs +++ b/src/libraries/System.Private.CoreLib/src/System/UInt128.cs @@ -1177,17 +1177,10 @@ static bool IBinaryInteger.TryReadLittleEndian(ReadOnlySpan sourc return false; } - ref byte sourceRef = ref MemoryMarshal.GetReference(source); - if (source.Length >= Size) { // We have at least 16 bytes, so just read the ones we need directly - result = Unsafe.ReadUnaligned(ref sourceRef); - - if (!BitConverter.IsLittleEndian) - { - result = BinaryPrimitives.ReverseEndianness(result); - } + result = BinaryPrimitives.ReadUInt128LittleEndian(source); } else { @@ -1199,7 +1192,7 @@ static bool IBinaryInteger.TryReadLittleEndian(ReadOnlySpan sourc for (int i = 0; i < source.Length; i++) { - UInt128 part = Unsafe.Add(ref sourceRef, i); + UInt128 part = source[i]; part <<= (i * 8); result |= part; } diff --git a/src/libraries/System.Private.CoreLib/src/System/UInt16.cs b/src/libraries/System.Private.CoreLib/src/System/UInt16.cs index 103616960bebd6..e6cf2e20b51427 100644 --- a/src/libraries/System.Private.CoreLib/src/System/UInt16.cs +++ b/src/libraries/System.Private.CoreLib/src/System/UInt16.cs @@ -359,22 +359,15 @@ static bool IBinaryInteger.TryReadLittleEndian(ReadOnlySpan source return false; } - ref byte sourceRef = ref MemoryMarshal.GetReference(source); - if (source.Length >= sizeof(ushort)) { // We have at least 2 bytes, so just read the ones we need directly - result = Unsafe.ReadUnaligned(ref sourceRef); - - if (!BitConverter.IsLittleEndian) - { - result = BinaryPrimitives.ReverseEndianness(result); - } + result = BinaryPrimitives.ReadUInt16LittleEndian(source); } else { // We only have 1-byte so read it directly - result = sourceRef; + result = source[0]; } } diff --git a/src/libraries/System.Private.CoreLib/src/System/UInt32.cs b/src/libraries/System.Private.CoreLib/src/System/UInt32.cs index 64257211699f67..f8df052f77ebb0 100644 --- a/src/libraries/System.Private.CoreLib/src/System/UInt32.cs +++ b/src/libraries/System.Private.CoreLib/src/System/UInt32.cs @@ -413,17 +413,10 @@ static bool IBinaryInteger.TryReadLittleEndian(ReadOnlySpan source, return false; } - ref byte sourceRef = ref MemoryMarshal.GetReference(source); - if (source.Length >= sizeof(uint)) { // We have at least 4 bytes, so just read the ones we need directly - result = Unsafe.ReadUnaligned(ref sourceRef); - - if (!BitConverter.IsLittleEndian) - { - result = BinaryPrimitives.ReverseEndianness(result); - } + result = BinaryPrimitives.ReadUInt32LittleEndian(source); } else { @@ -435,7 +428,7 @@ static bool IBinaryInteger.TryReadLittleEndian(ReadOnlySpan source, for (int i = 0; i < source.Length; i++) { - uint part = Unsafe.Add(ref sourceRef, i); + uint part = source[i]; part <<= (i * 8); result |= part; } diff --git a/src/libraries/System.Private.CoreLib/src/System/UInt64.cs b/src/libraries/System.Private.CoreLib/src/System/UInt64.cs index 40331540c63fdd..b19deea580a6ea 100644 --- a/src/libraries/System.Private.CoreLib/src/System/UInt64.cs +++ b/src/libraries/System.Private.CoreLib/src/System/UInt64.cs @@ -420,17 +420,10 @@ static bool IBinaryInteger.TryReadLittleEndian(ReadOnlySpan source, return false; } - ref byte sourceRef = ref MemoryMarshal.GetReference(source); - if (source.Length >= sizeof(ulong)) { // We have at least 8 bytes, so just read the ones we need directly - result = Unsafe.ReadUnaligned(ref sourceRef); - - if (!BitConverter.IsLittleEndian) - { - result = BinaryPrimitives.ReverseEndianness(result); - } + result = BinaryPrimitives.ReadUInt64LittleEndian(source); } else { @@ -442,7 +435,7 @@ static bool IBinaryInteger.TryReadLittleEndian(ReadOnlySpan source, for (int i = 0; i < source.Length; i++) { - ulong part = Unsafe.Add(ref sourceRef, i); + ulong part = source[i]; part <<= (i * 8); result |= part; } diff --git a/src/libraries/System.Private.CoreLib/src/System/UIntPtr.cs b/src/libraries/System.Private.CoreLib/src/System/UIntPtr.cs index e9cf4ab7950807..59de7b1f346dcc 100644 --- a/src/libraries/System.Private.CoreLib/src/System/UIntPtr.cs +++ b/src/libraries/System.Private.CoreLib/src/System/UIntPtr.cs @@ -415,17 +415,10 @@ static bool IBinaryInteger.TryReadLittleEndian(ReadOnlySpan source, return false; } - ref byte sourceRef = ref MemoryMarshal.GetReference(source); - if (source.Length >= sizeof(nuint_t)) { // We have at least 4/8 bytes, so just read the ones we need directly - result = Unsafe.ReadUnaligned(ref sourceRef); - - if (!BitConverter.IsLittleEndian) - { - result = BinaryPrimitives.ReverseEndianness(result); - } + result = BinaryPrimitives.ReadUIntPtrLittleEndian(source); } else { @@ -437,7 +430,7 @@ static bool IBinaryInteger.TryReadLittleEndian(ReadOnlySpan source, for (int i = 0; i < source.Length; i++) { - nuint part = Unsafe.Add(ref sourceRef, i); + nuint part = source[i]; part <<= (i * 8); result |= part; } From 11b3325b5685cd640991a6ff04c7b05593d54491 Mon Sep 17 00:00:00 2001 From: Vlad Brezae Date: Thu, 7 May 2026 20:37:53 +0300 Subject: [PATCH 048/109] Fix arg iteration for reverse pinvokes (#127758) Fixes Interop/StructMarshalling/ReversePInvoke/MarshalSeqStruct/ReversePInvoke test We were generating call stub for `ILStubClass.IL_STUB_ReversePInvoke(ComplexStruct)`. Arg iteration was done using ArgIterator instead of PInvokeArgIterator, ending up with crash in ArgIteratorBase::IsRegPassedStruct. As a fix, we consider these reverse pinvoke il stubs to have unmanaged call convention. --- src/coreclr/vm/callstubgenerator.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/coreclr/vm/callstubgenerator.cpp b/src/coreclr/vm/callstubgenerator.cpp index 1dba38a4b6ac81..7af42216dc7948 100644 --- a/src/coreclr/vm/callstubgenerator.cpp +++ b/src/coreclr/vm/callstubgenerator.cpp @@ -1904,7 +1904,7 @@ void CallStubGenerator::ComputeCallStub(MetaSig &sig, PCODE *pRoutines, MethodDe PInvoke::GetCallingConvention_IgnoreErrors(pMD, &unmanagedCallConv, NULL); hasUnmanagedCallConv = true; } - else if (pMD != NULL && pMD->IsILStub()) + else if (pMD != NULL && pMD->IsILStub() && !pMD->AsDynamicMethodDesc()->IsReversePInvokeStub()) { MethodDesc* pTargetMD = pMD->AsDynamicMethodDesc()->GetILStubResolver()->GetStubTargetMethodDesc(); if (pTargetMD != NULL && pTargetMD->IsPInvoke()) @@ -1919,7 +1919,7 @@ void CallStubGenerator::ComputeCallStub(MetaSig &sig, PCODE *pRoutines, MethodDe #endif } } - else if (pMD != NULL && pMD->HasUnmanagedCallersOnlyAttribute()) + else if (pMD != NULL && !pMD->IsILStub() && pMD->HasUnmanagedCallersOnlyAttribute()) { if (CallConv::TryGetCallingConventionFromUnmanagedCallersOnly(pMD, &unmanagedCallConv)) { From a6bc864020d4cf2209d383ea77048799972c1c74 Mon Sep 17 00:00:00 2001 From: Andy Gocke Date: Thu, 7 May 2026 11:00:01 -0700 Subject: [PATCH 049/109] Enable sccache for linux-x64 coreclr PR builds (#127882) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit > [!NOTE] > This PR was created with assistance from GitHub Copilot. Wire up sccache as a compiler cache for linux-x64 coreclr native builds in PR pipelines using the Azure Pipeline Cache task. This can likely be expanded to more runs/platforms in the future, but this is a good place to start. ## Changes - **`src/coreclr/runtime-prereqs.proj`**: Add `PackageDownload` for `sccache` 0.15.0 (Linux CI only), piggybacking on the existing restore - **`eng/pipelines/coreclr/templates/setup-sccache.yml`**: Pre-build template that configures the Pipeline Cache for sccache storage, sets `USE_SCCACHE`/`SCCACHE_DIR` env vars, and prepends sccache to `PATH` - **`eng/pipelines/coreclr/templates/sccache-stats.yml`**: Post-build template that prints `sccache --show-stats` - **`eng/pipelines/runtime.yml`**: Wires both templates into the `CoreCLR_Libraries` and `Libraries_CheckedCoreCLR` jobs - **`src/coreclr/build-runtime.sh`**: `chmod +x` the sccache binary before use (NuGet strips execute permissions) ## How it works 1. **Pre-build**: Pipeline Cache restores the sccache storage dir → env vars configured (`PATH`, `SCCACHE_DIR`, `USE_SCCACHE`) 2. **Build**: `build.sh` restores `runtime-prereqs.proj` (downloads sccache binary) → native build uses sccache as cmake compiler launcher 3. **Post-build**: Stats printed for observability; Pipeline Cache saves storage dir for next run Templates use compile-time `${{ if }}` conditions so they are no-ops for non-linux-x64 platforms in multi-platform matrix jobs. --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../coreclr/templates/sccache-stats.yml | 18 +++++++++ .../coreclr/templates/setup-sccache.yml | 40 +++++++++++++++++++ eng/pipelines/runtime.yml | 6 +++ src/coreclr/build-runtime.sh | 7 ++++ src/coreclr/runtime-prereqs.proj | 4 ++ 5 files changed, 75 insertions(+) create mode 100644 eng/pipelines/coreclr/templates/sccache-stats.yml create mode 100644 eng/pipelines/coreclr/templates/setup-sccache.yml diff --git a/eng/pipelines/coreclr/templates/sccache-stats.yml b/eng/pipelines/coreclr/templates/sccache-stats.yml new file mode 100644 index 00000000000000..69bd1f9646167d --- /dev/null +++ b/eng/pipelines/coreclr/templates/sccache-stats.yml @@ -0,0 +1,18 @@ +parameters: + archType: 'x64' + osGroup: 'linux' + buildConfig: '' + runtimeFlavor: '' + runtimeVariant: '' + helixQueues: '' + targetRid: '' + nameSuffix: '' + platform: '' + shouldContinueOnError: false + osSubgroup: '' + +steps: + - ${{ if and(eq(parameters.osGroup, 'linux'), eq(parameters.osSubgroup, ''), eq(parameters.archType, 'x64')) }}: + - script: sccache --show-stats || true + displayName: Sccache stats + condition: always() diff --git a/eng/pipelines/coreclr/templates/setup-sccache.yml b/eng/pipelines/coreclr/templates/setup-sccache.yml new file mode 100644 index 00000000000000..8956dd833099ea --- /dev/null +++ b/eng/pipelines/coreclr/templates/setup-sccache.yml @@ -0,0 +1,40 @@ +parameters: + archType: 'x64' + osGroup: 'linux' + buildConfig: '' + runtimeFlavor: '' + runtimeVariant: '' + helixQueues: '' + targetRid: '' + nameSuffix: '' + platform: '' + shouldContinueOnError: false + osSubgroup: '' + + # sccache NuGet package version — keep in sync with runtime-prereqs.proj + sccacheVersion: '0.15.0' + +steps: + - ${{ if and(eq(parameters.osGroup, 'linux'), eq(parameters.osSubgroup, ''), eq(parameters.archType, 'x64')) }}: + # Set up the Azure Pipeline Cache for sccache's local cache directory. + # Use a rolling key so each build can update the cache; restoreKeys + # falls back to the most recent saved entry. + - task: Cache@2 + displayName: Sccache cache + inputs: + key: sccache | ${{ parameters.osGroup }} | ${{ parameters.archType }} | ${{ parameters.nameSuffix }} | ${{ parameters.buildConfig }} | "$(Build.BuildId)" + path: $(Pipeline.Workspace)/.sccache + restoreKeys: | + sccache | ${{ parameters.osGroup }} | ${{ parameters.archType }} | ${{ parameters.nameSuffix }} | ${{ parameters.buildConfig }} + + # Configure sccache environment and add binary to PATH. + # The sccache package is restored by runtime-prereqs.proj during the build. + - script: | + sccacheVersion="${{ parameters.sccacheVersion }}" + sccacheDir="$(Build.SourcesDirectory)/.packages/sccache/${sccacheVersion}/tools" + mkdir -p "$sccacheDir" + echo "##vso[task.prependpath]$sccacheDir" + echo "##vso[task.setvariable variable=SCCACHE_DIR]$(Pipeline.Workspace)/.sccache" + echo "##vso[task.setvariable variable=SCCACHE_IDLE_TIMEOUT]0" + echo "##vso[task.setvariable variable=USE_SCCACHE]true" + displayName: Configure sccache diff --git a/eng/pipelines/runtime.yml b/eng/pipelines/runtime.yml index a1eb3eec103e5d..58f08f5f183f3c 100644 --- a/eng/pipelines/runtime.yml +++ b/eng/pipelines/runtime.yml @@ -254,7 +254,10 @@ extends: nameSuffix: CoreCLR_Libraries buildArgs: -s clr+libs+libs.tests -rc Release -c $(_BuildConfig) /p:ArchiveTests=true timeoutInMinutes: 120 + preBuildSteps: + - template: /eng/pipelines/coreclr/templates/setup-sccache.yml postBuildSteps: + - template: /eng/pipelines/coreclr/templates/sccache-stats.yml - template: /eng/pipelines/common/upload-artifact-step.yml parameters: rootFolder: $(Build.SourcesDirectory)/artifacts/bin @@ -399,7 +402,10 @@ extends: nameSuffix: Libraries_CheckedCoreCLR buildArgs: -s clr+clr.wasmjit+libs -c $(_BuildConfig) -rc Checked timeoutInMinutes: 120 + preBuildSteps: + - template: /eng/pipelines/coreclr/templates/setup-sccache.yml postBuildSteps: + - template: /eng/pipelines/coreclr/templates/sccache-stats.yml - template: /eng/pipelines/coreclr/templates/build-native-test-assets-step.yml - template: /eng/pipelines/common/upload-artifact-step.yml parameters: diff --git a/src/coreclr/build-runtime.sh b/src/coreclr/build-runtime.sh index 6147564b20c11b..3a19060fe71126 100755 --- a/src/coreclr/build-runtime.sh +++ b/src/coreclr/build-runtime.sh @@ -174,6 +174,13 @@ if [[ "$__TargetArch" != "$__HostArch" ]]; then fi if [[ "$USE_SCCACHE" == "true" ]]; then + # NuGet strips execute permissions; restore them using the known package path. + # Try the CI-local packages dir first, then fall back to the global NuGet cache. + for sccacheBin in "$__RepoRootDir/.packages/sccache"/*/tools/sccache "$HOME/.nuget/packages/sccache"/*/tools/sccache; do + if [[ -f "$sccacheBin" ]]; then + chmod +x "$sccacheBin" + fi + done __CMakeArgs="-DCMAKE_C_COMPILER_LAUNCHER=sccache -DCMAKE_CXX_COMPILER_LAUNCHER=sccache $__CMakeArgs" fi diff --git a/src/coreclr/runtime-prereqs.proj b/src/coreclr/runtime-prereqs.proj index 6eb71f172ad4bb..abbe3d81b833b0 100644 --- a/src/coreclr/runtime-prereqs.proj +++ b/src/coreclr/runtime-prereqs.proj @@ -10,6 +10,10 @@ .NET Runtime + + + + From ee0b034dde60ca22254479721e2f87a486db62e6 Mon Sep 17 00:00:00 2001 From: dhartglassMSFT Date: Thu, 7 May 2026 11:49:57 -0700 Subject: [PATCH 050/109] Fix for 126457 (#127050) For a bool-typed inlinee that contains a tail call, where the return is in a seperate block from the tailcall (for a single-return method, for example), the inliner inserts an int->ubyte->int normalizing cast ``` * RETURN int \--* CAST int <- ubyte <- int \--* LCL_VAR int V04 tmp3 ``` The tail-call validation in morph doesn't expect a cast there. However, a normalizing cast here may be safely ignored for tailcalls because 1 - If the calling function was not inlined, the normalizing cast is intead inserted later in morph after the tailcall transformation, and 2 - Callees are responsible for this adjustment anyway so the tailcall return value would have already been normalized fixes #126457 --- src/coreclr/jit/morph.cpp | 14 +++ .../JitBlue/Runtime_126457/Runtime_126457.il | 98 +++++++++++++++++++ .../Runtime_126457/Runtime_126457.ilproj | 14 +++ 3 files changed, 126 insertions(+) create mode 100644 src/tests/JIT/Regression/JitBlue/Runtime_126457/Runtime_126457.il create mode 100644 src/tests/JIT/Regression/JitBlue/Runtime_126457/Runtime_126457.ilproj diff --git a/src/coreclr/jit/morph.cpp b/src/coreclr/jit/morph.cpp index 8ffff718ad2af3..7a62c78684b03d 100644 --- a/src/coreclr/jit/morph.cpp +++ b/src/coreclr/jit/morph.cpp @@ -5040,6 +5040,15 @@ void Compiler::fgValidateIRForTailCall(GenTreeCall* call) { assert(ValidateUse(tree) && "Expected use of local to be tailcall value"); } + else if (tree->OperIs(GT_CAST)) + { + // The inliner can insert small-type-normalizing casts before the return + // (int -> ubyte -> int for bool-return-calls, for example) + // In the jit the callee is responsible for normalizing, so a tailcall + // can freely bypass this extra cast + assert(!m_compiler->fgCastNeeded(m_tailcall, tree->AsCast()->CastToType()) && + ValidateUse(tree->AsCast()->CastOp()) && "Expected normalizing cast of tailcall result"); + } else if (IsCommaNop(tree)) { // COMMA(NOP,NOP) @@ -5065,6 +5074,11 @@ void Compiler::fgValidateIRForTailCall(GenTreeCall* call) bool ValidateUse(GenTree* node) { + if (node->OperIs(GT_CAST)) + { + node = node->AsCast()->CastOp(); + } + if (m_lclNum != BAD_VAR_NUM) { return node->OperIs(GT_LCL_VAR) && (node->AsLclVar()->GetLclNum() == m_lclNum); diff --git a/src/tests/JIT/Regression/JitBlue/Runtime_126457/Runtime_126457.il b/src/tests/JIT/Regression/JitBlue/Runtime_126457/Runtime_126457.il new file mode 100644 index 00000000000000..17932ccca0900c --- /dev/null +++ b/src/tests/JIT/Regression/JitBlue/Runtime_126457/Runtime_126457.il @@ -0,0 +1,98 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +// In some cases the Inliner can insert a CAST node between +// a tail call and the return + +.assembly extern System.Runtime +{ + .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A) +} + +.assembly Runtime_126457 { } +.module Runtime_126457.dll + +.class interface public abstract auto ansi ISite +{ + .method public hidebysig newslot abstract virtual + instance bool tailcall() cil managed + { + } +} + +.class public auto ansi beforefieldinit Component + extends [System.Runtime]System.Object +{ + .field family class ISite _site + + .method family hidebysig newslot virtual + instance bool callee() cil managed + { + .maxstack 8 + ldarg.0 + ldfld class ISite Component::_site + dup + brtrue.s CALL + pop + ldc.i4.0 + br.s DONE + CALL: + callvirt instance bool ISite::tailcall() + DONE: + ret + } + + .method public hidebysig specialname rtspecialname + instance void .ctor() cil managed + { + ldarg.0 + call instance void [System.Runtime]System.Object::.ctor() + ret + } +} + +.class public auto ansi beforefieldinit DerivedComponent + extends Component +{ + .method public hidebysig virtual + instance bool caller() cil managed + { + .maxstack 8 + ldarg.0 + call instance bool Component::callee() + ret + } + + .method public hidebysig specialname rtspecialname + instance void .ctor() cil managed + { + ldarg.0 + call instance void Component::.ctor() + ret + } +} + +.class private auto ansi beforefieldinit Program + extends [System.Runtime]System.Object +{ + .method private hidebysig static int32 + Main() cil managed + { + .entrypoint + .maxstack 1 + newobj instance void DerivedComponent::.ctor() + call bool Program::Test(class DerivedComponent) + pop + ldc.i4.s 100 + ret + } + + .method private hidebysig static bool + Test(class DerivedComponent c) cil managed noinlining + { + .maxstack 8 + ldarg.0 + callvirt instance bool DerivedComponent::caller() + ret + } +} diff --git a/src/tests/JIT/Regression/JitBlue/Runtime_126457/Runtime_126457.ilproj b/src/tests/JIT/Regression/JitBlue/Runtime_126457/Runtime_126457.ilproj new file mode 100644 index 00000000000000..35c76de2c3b163 --- /dev/null +++ b/src/tests/JIT/Regression/JitBlue/Runtime_126457/Runtime_126457.ilproj @@ -0,0 +1,14 @@ + + + true + + + None + True + + + + + + + From c3caf4d3163c429efbdefe7756a71702e9e6c982 Mon Sep 17 00:00:00 2001 From: Jakob Botsch Nielsen Date: Thu, 7 May 2026 21:03:47 +0200 Subject: [PATCH 051/109] JIT: Fix untracked uses of `lvLiveInOutOfHndlr` (#127910) Things that depend on this property for correctness reasons need to check `lvTracked` and properly handle untracked cases conservatively. Some small number of regressions expected. --- src/coreclr/jit/earlyprop.cpp | 7 ++++++- src/coreclr/jit/gentree.cpp | 2 +- src/coreclr/jit/lclvars.cpp | 2 +- src/coreclr/jit/sideeffects.h | 9 +++++++-- 4 files changed, 15 insertions(+), 5 deletions(-) diff --git a/src/coreclr/jit/earlyprop.cpp b/src/coreclr/jit/earlyprop.cpp index 0c6efd0985ee70..2ec9c5cc5ed284 100644 --- a/src/coreclr/jit/earlyprop.cpp +++ b/src/coreclr/jit/earlyprop.cpp @@ -633,7 +633,12 @@ bool Compiler::optCanMoveNullCheckPastTree(GenTree* tree, bool isInsideTry, bool else if (isInsideTry) { // Inside try we allow only stores to locals not live in handlers. - result = tree->OperIs(GT_STORE_LCL_VAR) && !lvaTable[tree->AsLclVar()->GetLclNum()].lvLiveInOutOfHndlr; + result = false; + if (tree->OperIs(GT_STORE_LCL_VAR)) + { + LclVarDsc* varDsc = lvaGetDesc(tree->AsLclVar()); + result = varDsc->lvTracked && !varDsc->lvLiveInOutOfHndlr; + } } else { diff --git a/src/coreclr/jit/gentree.cpp b/src/coreclr/jit/gentree.cpp index dc8d9915954807..d91d1961bc2ba4 100644 --- a/src/coreclr/jit/gentree.cpp +++ b/src/coreclr/jit/gentree.cpp @@ -5000,7 +5000,7 @@ bool Compiler::gtIsLikelyRegVar(GenTree* tree) // If this is an EH-live var, return false if it is a def, // as it will have to go to memory. - if (varDsc->lvLiveInOutOfHndlr && ((tree->gtFlags & GTF_VAR_DEF) != 0)) + if (varDsc->lvTracked && varDsc->lvLiveInOutOfHndlr && ((tree->gtFlags & GTF_VAR_DEF) != 0)) { return false; } diff --git a/src/coreclr/jit/lclvars.cpp b/src/coreclr/jit/lclvars.cpp index 2e8e756dee0eeb..5178394885930b 100644 --- a/src/coreclr/jit/lclvars.cpp +++ b/src/coreclr/jit/lclvars.cpp @@ -3639,7 +3639,7 @@ void Compiler::lvaComputePreciseRefCounts(bool isRecompute, bool setSlotNumbers) // count those in our heuristic for register allocation, since they always // must be stored, so there's no value in enregistering them at defs; only // if there are enough uses to justify it. - if (varDsc->lvLiveInOutOfHndlr && !varDsc->lvDoNotEnregister && + if (varDsc->lvTracked && varDsc->lvLiveInOutOfHndlr && !varDsc->lvDoNotEnregister && ((node->gtFlags & GTF_VAR_DEF) != 0)) { varDsc->incRefCnts(0, this); diff --git a/src/coreclr/jit/sideeffects.h b/src/coreclr/jit/sideeffects.h index 2c7639a44d51f5..2fba2ae73cd832 100644 --- a/src/coreclr/jit/sideeffects.h +++ b/src/coreclr/jit/sideeffects.h @@ -129,12 +129,17 @@ class AliasSet final if ((m_flags & ALIAS_WRITES_LCL_VAR) != 0) { - // Stores to 'lvLiveInOutOfHndlr' locals cannot be reordered with + // Stores to locals live into handlers cannot be reordered with // exception-throwing nodes so we conservatively consider them // globally visible. LclVarDsc* const varDsc = m_compiler->lvaGetDesc(LclNum()); - return varDsc->lvLiveInOutOfHndlr != 0; + if (varDsc->lvTracked) + { + return varDsc->lvLiveInOutOfHndlr != 0; + } + + return m_compiler->compHndBBtabCount > 0; } return false; From 040a010ed3767223101ffc37de5396fcc4a3feb3 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 7 May 2026 20:51:58 +0000 Subject: [PATCH 052/109] [mobile] Skip ConcurrentDictionary reflection test on mobile platforms (#127861) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Reasoning The test `ConcurrentDictionary_Generic_Tests_string_string.NonRandomizedToRandomizedUpgrade_FunctionsCorrectly` uses reflection via `Type.GetType("System.Collections.Concurrent.ConcurrentDictionary`2+Tables, System.Collections.Concurrent", throwOnError: true)` to load a nested private type from ConcurrentDictionary's implementation. This reflection call fails on iOS, tvOS, macCatalyst, and Android with `TypeLoadException: Could not load type 'System.Collections.Concurrent.ConcurrentDictionary\`2' from assembly 'System.Collections.Concurrent'`. The test is attempting to inspect internal implementation details (the private `_tables` field and the nested `Tables` type) to extract the hash code function from the comparer. This level of reflection into nested types and private members is not supported on mobile platforms where assemblies are trimmed and/or AOT-compiled. Since the test is verifying internal implementation behavior rather than public API contracts, and the failure is specific to reflection limitations on mobile platforms (not a product bug affecting end users), the appropriate fix is to skip the test on these platforms using `[SkipOnPlatform]`. ## Impact on platforms Failing on all tested mobile platforms in build [1406427](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1406427) (2026-05-03): - **tvos-arm64** / osx.15.amd64.appletv.open / exit code 1 - **iossimulator-x64** / (inferred from platform pattern) - **iossimulator-arm64** / (inferred from platform pattern) - **maccatalyst-x64** / (inferred from platform pattern) - **maccatalyst-arm64** / (inferred from platform pattern) - **android-arm64** / (inferred from platform pattern) - **android-arm** / (inferred from platform pattern) - **android-x64** / (inferred from platform pattern) - **android-x86** / (inferred from platform pattern) ## Errors log From tvos-arm64 Helix work item `System.Collections.Concurrent.Tests` ([console log](https://helixr1107v0xdeko0k025g8.blob.core.windows.net/dotnet-runtime-refs-heads-main-1a028d92a44d460093/System.Collections.Concurrent.Tests/1/console.fbe72697.log?helixlogtype=result)): ```` [FAIL] System.Collections.Concurrent.Tests.ConcurrentDictionary_Generic_Tests_string_string.NonRandomizedToRandomizedUpgrade_FunctionsCorrectly(ignoreCase: False) System.TypeLoadException : Could not load type 'System.Collections.Concurrent.ConcurrentDictionary`2' from assembly 'System.Collections.Concurrent'. at System.RuntimeTypeHandle.GetTypeByName(String typeName, Boolean throwOnError, Boolean ignoreCase, StackCrawlMark& stackMark) at System.RuntimeType.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase, StackCrawlMark& stackMark) at System.Type.GetType(String typeName, Boolean throwOnError) at System.Collections.Concurrent.Tests.ConcurrentDictionary_Generic_Tests_string_string.g__GetHashCodeFunc|4_0(ConcurrentDictionary`2 cd) at System.Collections.Concurrent.Tests.ConcurrentDictionary_Generic_Tests_string_string.GenerateCollidingStrings(Int32 count) at System.Collections.Concurrent.Tests.ConcurrentDictionary_Generic_Tests_string_string.NonRandomizedToRandomizedUpgrade_FunctionsCorrectly(Boolean ignoreCase) ```` ## First build it occurred First observed (within the scanned window) in build [1406427](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1406427), which finished on 2026-05-03T09:02:27Z. **Note:** This is computed within the last ~20 builds scanned and may not be the true origin. The test may have been failing on mobile platforms since its introduction, as it relies on reflection capabilities not available in trimmed/AOT mobile builds. > [!NOTE] > This change was generated by the [Mobile Platform Failure Scanner](https://github.com/dotnet/runtime/actions/runs/25432280266) workflow. > Generated by [Mobile Platform Failure Scanner](https://github.com/dotnet/runtime/actions/runs/25432280266/agentic_workflow) · ● 6.8M · [◷](https://github.com/search?q=repo%3Adotnet%2Fruntime+%22gh-aw-workflow-id%3A+mobile-scan%22&type=pullrequests) --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: github-actions[bot] Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: kotlarmilos <11523312+kotlarmilos@users.noreply.github.com> Co-authored-by: Milos Kotlar --- .../ConcurrentDictionary/ConcurrentDictionary.Generic.Tests.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/libraries/System.Collections.Concurrent/tests/ConcurrentDictionary/ConcurrentDictionary.Generic.Tests.cs b/src/libraries/System.Collections.Concurrent/tests/ConcurrentDictionary/ConcurrentDictionary.Generic.Tests.cs index 98f79b5aaf848b..e5b7d4b6f6bc82 100644 --- a/src/libraries/System.Collections.Concurrent/tests/ConcurrentDictionary/ConcurrentDictionary.Generic.Tests.cs +++ b/src/libraries/System.Collections.Concurrent/tests/ConcurrentDictionary/ConcurrentDictionary.Generic.Tests.cs @@ -48,6 +48,7 @@ protected override string CreateTKey(int seed) [InlineData(false)] [InlineData(true)] [ActiveIssue("https://github.com/dotnet/runtime/issues/81945", typeof(PlatformDetection), nameof(PlatformDetection.IsBuiltWithAggressiveTrimming))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/81945", TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst | TestPlatforms.Android)] public void NonRandomizedToRandomizedUpgrade_FunctionsCorrectly(bool ignoreCase) { List strings = GenerateCollidingStrings(110); // higher than the collisions threshold From 499f5c6919d6ef3e82877c65abcecb0c580e3404 Mon Sep 17 00:00:00 2001 From: Radek Doulik Date: Fri, 8 May 2026 00:05:56 +0200 Subject: [PATCH 053/109] Fix DispatchProxy TypeLoadException for generic type arguments (#127925) EnsureTypeIsVisible did not recursively check generic type arguments, so when proxying an interface like IFoo where TInternal is internal to another assembly, the dynamic proxy assembly lacked the required IgnoresAccessChecksToAttribute for that assembly. This caused TypeLoadException (attempting to implement an inaccessible interface) when the proxy was the first to reference that type. The bug was masked on desktop by test execution order: other tests happened to add the attribute as a side effect first. The fix recursively calls EnsureTypeIsVisible on all generic type arguments, matching the VM own recursive accessibility check in ClassLoader::CanAccessClass. Also enables System.Reflection.DispatchProxy.Tests on browser/CoreCLR since all 89 tests now pass. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../src/System/Reflection/DispatchProxyGenerator.cs | 11 +++++++++++ src/libraries/tests.proj | 1 - 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/libraries/System.Reflection.DispatchProxy/src/System/Reflection/DispatchProxyGenerator.cs b/src/libraries/System.Reflection.DispatchProxy/src/System/Reflection/DispatchProxyGenerator.cs index ac765e8be34ffd..4639eff6248848 100644 --- a/src/libraries/System.Reflection.DispatchProxy/src/System/Reflection/DispatchProxyGenerator.cs +++ b/src/libraries/System.Reflection.DispatchProxy/src/System/Reflection/DispatchProxyGenerator.cs @@ -246,6 +246,17 @@ internal void EnsureTypeIsVisible(Type type) GenerateInstanceOfIgnoresAccessChecksToAttribute(assemblyName); } } + + if (type.IsGenericType) + { + foreach (Type genericArg in type.GetGenericArguments()) + { + if (!genericArg.IsGenericParameter) + { + EnsureTypeIsVisible(genericArg); + } + } + } } } diff --git a/src/libraries/tests.proj b/src/libraries/tests.proj index c3a6d07d77d383..bff3061df6e50c 100644 --- a/src/libraries/tests.proj +++ b/src/libraries/tests.proj @@ -188,7 +188,6 @@ - From 63e05106dbdc82dbecc9b4524ac029d4361a816b Mon Sep 17 00:00:00 2001 From: dhartglassMSFT Date: Thu, 7 May 2026 17:27:05 -0700 Subject: [PATCH 054/109] Add hw intrinsics pipeline for linux_arm64 (#127482) Current hw-intrinsics pipeline runs ARM64 codegen tests on OSX, which doesn't exercise SVE. So we tend to manually kick off jitstress for every change that touches `hwintrinsiccodegenarm64.cpp` I don't want to just add "linux_arm64" to the existing hw intrinsics pipeline because those machines are at a premium. So instead, I'm adding a new pipeline that triggers only off arm64 jit source files, to reduce machine pool usage --- .../coreclr/hardware-intrinsics-arm64.yml | 27 +++++ eng/pipelines/coreclr/hardware-intrinsics.yml | 113 +----------------- .../jit-hardware-intrinsics-common.yml | 61 ++++++++++ 3 files changed, 92 insertions(+), 109 deletions(-) create mode 100644 eng/pipelines/coreclr/hardware-intrinsics-arm64.yml create mode 100644 eng/pipelines/coreclr/templates/jit-hardware-intrinsics-common.yml diff --git a/eng/pipelines/coreclr/hardware-intrinsics-arm64.yml b/eng/pipelines/coreclr/hardware-intrinsics-arm64.yml new file mode 100644 index 00000000000000..220ac28a24583d --- /dev/null +++ b/eng/pipelines/coreclr/hardware-intrinsics-arm64.yml @@ -0,0 +1,27 @@ +trigger: none +pr: + branches: + include: + - main + paths: + include: + - eng/pipelines/coreclr/hardware-intrinsics-arm64.yml + - eng/pipelines/coreclr/templates/jit-hardware-intrinsics-common.yml + - src/coreclr/jit/*arm64* + +variables: + - template: /eng/pipelines/common/variables.yml + - template: /eng/pipelines/helix-platforms.yml + +extends: + template: /eng/pipelines/common/templates/pipeline-with-resources.yml + parameters: + isOfficialBuild: false + stages: + - stage: Build + jobs: + - template: /eng/pipelines/coreclr/templates/jit-hardware-intrinsics-common.yml + parameters: + platforms: + - linux_arm64 + testBuildArgs: '-tree:JIT/HardwareIntrinsics' diff --git a/eng/pipelines/coreclr/hardware-intrinsics.yml b/eng/pipelines/coreclr/hardware-intrinsics.yml index b54f33da29e830..459fe4d77d3245 100644 --- a/eng/pipelines/coreclr/hardware-intrinsics.yml +++ b/eng/pipelines/coreclr/hardware-intrinsics.yml @@ -21,122 +21,17 @@ extends: stages: - stage: Build jobs: - - template: /eng/pipelines/common/platform-matrix.yml + - template: /eng/pipelines/coreclr/templates/jit-hardware-intrinsics-common.yml parameters: - jobTemplate: /eng/pipelines/common/global-build-job.yml - helixQueuesTemplate: /eng/pipelines/coreclr/templates/helix-queues-setup.yml - buildConfig: Release platforms: - windows_x86 - windows_x64 - variables: - - name: timeoutPerTestInMinutes - value: 60 - - name: timeoutPerTestCollectionInMinutes - value: 180 - jobParameters: - testGroup: outerloop - nameSuffix: CoreCLR - buildArgs: -s clr+libs -c $(_BuildConfig) - timeoutInMinutes: 360 - postBuildSteps: - - template: /eng/pipelines/common/templates/runtimes/build-runtime-tests-and-send-to-helix.yml - parameters: - creator: dotnet-bot - testBuildArgs: 'tree JIT/HardwareIntrinsics' - testRunNamePrefixSuffix: CoreCLR - extraVariablesTemplates: - - template: /eng/pipelines/common/templates/runtimes/test-variables.yml - parameters: - testGroup: outerloop + testBuildArgs: 'tree JIT/HardwareIntrinsics' - - template: /eng/pipelines/common/platform-matrix.yml + - template: /eng/pipelines/coreclr/templates/jit-hardware-intrinsics-common.yml parameters: - jobTemplate: /eng/pipelines/common/global-build-job.yml - helixQueuesTemplate: /eng/pipelines/coreclr/templates/helix-queues-setup.yml - buildConfig: Release platforms: - linux_arm - linux_x64 - osx_arm64 - variables: - - name: timeoutPerTestInMinutes - value: 60 - - name: timeoutPerTestCollectionInMinutes - value: 180 - jobParameters: - testGroup: outerloop - nameSuffix: CoreCLR - buildArgs: -s clr+libs -c $(_BuildConfig) - timeoutInMinutes: 360 - postBuildSteps: - - template: /eng/pipelines/common/templates/runtimes/build-runtime-tests-and-send-to-helix.yml - parameters: - creator: dotnet-bot - testBuildArgs: '-tree:JIT/HardwareIntrinsics' - testRunNamePrefixSuffix: CoreCLR - extraVariablesTemplates: - - template: /eng/pipelines/common/templates/runtimes/test-variables.yml - parameters: - testGroup: outerloop - - - template: /eng/pipelines/common/platform-matrix.yml - parameters: - jobTemplate: /eng/pipelines/common/global-build-job.yml - helixQueuesTemplate: /eng/pipelines/coreclr/templates/helix-queues-setup.yml - buildConfig: Release - platforms: - - windows_x86 - - windows_x64 - variables: - - name: timeoutPerTestInMinutes - value: 60 - - name: timeoutPerTestCollectionInMinutes - value: 180 - jobParameters: - testGroup: outerloop - nameSuffix: NativeAOT - buildArgs: -s clr.aot+libs.native+libs.sfx -c $(_BuildConfig) - timeoutInMinutes: 360 - postBuildSteps: - - template: /eng/pipelines/common/templates/runtimes/build-runtime-tests-and-send-to-helix.yml - parameters: - creator: dotnet-bot - testBuildArgs: 'nativeaot tree JIT/HardwareIntrinsics' - testRunNamePrefixSuffix: NativeAOT - nativeAotTest: true - extraVariablesTemplates: - - template: /eng/pipelines/common/templates/runtimes/test-variables.yml - parameters: - testGroup: outerloop - - - template: /eng/pipelines/common/platform-matrix.yml - parameters: - jobTemplate: /eng/pipelines/common/global-build-job.yml - helixQueuesTemplate: /eng/pipelines/coreclr/templates/helix-queues-setup.yml - buildConfig: Release - platforms: - - linux_arm - - linux_x64 - - osx_arm64 - variables: - - name: timeoutPerTestInMinutes - value: 60 - - name: timeoutPerTestCollectionInMinutes - value: 180 - jobParameters: - testGroup: outerloop - nameSuffix: NativeAOT - buildArgs: -s clr.aot+libs.native+libs.sfx -c $(_BuildConfig) - timeoutInMinutes: 360 - postBuildSteps: - - template: /eng/pipelines/common/templates/runtimes/build-runtime-tests-and-send-to-helix.yml - parameters: - creator: dotnet-bot - testBuildArgs: 'nativeaot -tree:JIT/HardwareIntrinsics' - testRunNamePrefixSuffix: NativeAOT - nativeAotTest: true - extraVariablesTemplates: - - template: /eng/pipelines/common/templates/runtimes/test-variables.yml - parameters: - testGroup: outerloop + testBuildArgs: '-tree:JIT/HardwareIntrinsics' diff --git a/eng/pipelines/coreclr/templates/jit-hardware-intrinsics-common.yml b/eng/pipelines/coreclr/templates/jit-hardware-intrinsics-common.yml new file mode 100644 index 00000000000000..64b273543d065d --- /dev/null +++ b/eng/pipelines/coreclr/templates/jit-hardware-intrinsics-common.yml @@ -0,0 +1,61 @@ +parameters: + - name: platforms + type: object + - name: testBuildArgs + type: string + +jobs: +- template: /eng/pipelines/common/platform-matrix.yml + parameters: + jobTemplate: /eng/pipelines/common/global-build-job.yml + helixQueuesTemplate: /eng/pipelines/coreclr/templates/helix-queues-setup.yml + buildConfig: Release + platforms: ${{ parameters.platforms }} + variables: + - name: timeoutPerTestInMinutes + value: 60 + - name: timeoutPerTestCollectionInMinutes + value: 180 + jobParameters: + testGroup: outerloop + nameSuffix: CoreCLR + buildArgs: -s clr+libs -c $(_BuildConfig) + timeoutInMinutes: 360 + postBuildSteps: + - template: /eng/pipelines/common/templates/runtimes/build-runtime-tests-and-send-to-helix.yml + parameters: + creator: dotnet-bot + testBuildArgs: ${{ parameters.testBuildArgs }} + testRunNamePrefixSuffix: CoreCLR + extraVariablesTemplates: + - template: /eng/pipelines/common/templates/runtimes/test-variables.yml + parameters: + testGroup: outerloop + +- template: /eng/pipelines/common/platform-matrix.yml + parameters: + jobTemplate: /eng/pipelines/common/global-build-job.yml + helixQueuesTemplate: /eng/pipelines/coreclr/templates/helix-queues-setup.yml + buildConfig: Release + platforms: ${{ parameters.platforms }} + variables: + - name: timeoutPerTestInMinutes + value: 60 + - name: timeoutPerTestCollectionInMinutes + value: 180 + jobParameters: + testGroup: outerloop + nameSuffix: NativeAOT + buildArgs: -s clr.aot+libs.native+libs.sfx -c $(_BuildConfig) + timeoutInMinutes: 360 + postBuildSteps: + - template: /eng/pipelines/common/templates/runtimes/build-runtime-tests-and-send-to-helix.yml + parameters: + creator: dotnet-bot + testBuildArgs: nativeaot ${{ parameters.testBuildArgs }} + testRunNamePrefixSuffix: NativeAOT + nativeAotTest: true + extraVariablesTemplates: + - template: /eng/pipelines/common/templates/runtimes/test-variables.yml + parameters: + testGroup: outerloop From 10c9a33d6d86ad5ac2169e1017af7cb235ddd8b3 Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Fri, 8 May 2026 00:43:37 +0000 Subject: [PATCH 055/109] Update and create documentation in build.cmd and build.sh for CoreCLR test builds (#126951) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Summary Updates the help text/documentation in `src/tests/build.cmd` and `src/tests/build.sh` for the CoreCLR test build scripts. ## Changes ### `src/tests/build.cmd` - Added `wasm` to the list of valid build architectures in the usage section - Added an **OS targeting** section documenting `os `, `browser` (shorthand for `os browser`), and `wasi` (shorthand for `os wasi`) options - Added `-CoreCLR` to the usage section (the option was implemented in the code but missing from the help text) ### `src/tests/build.sh` - Added an **OS targeting** section to `usage_list` documenting the `-os ` option (handled by the common build framework), listing common OS values, and noting that native test components are automatically skipped for mobile/device targets (`android`, `ios`, `iossimulator`, `tvos`, `tvossimulator`) - Added `-coreclr` to `usage_list` (the option was implemented in the code but missing from the help text) - Fixed escaped characters (`^(`, `^)`) and Windows-style backslashes in path examples that were incorrectly copied from the Windows batch script ## Command sync check | Option | build.cmd | build.sh | |---|---|---| | OS targeting | `os `, `browser`, `wasi` | `-os ` (via common framework) | | Architecture | `x64`, `x86`, `arm64`, `wasm` | Same (via common framework) | | `-CoreCLR` / `-coreclr` | ✅ (now documented) | ✅ (now documented) | | `-Mono` / `-ExcludeMonoFailures` | ✅ | ✅ | | `-mono_aot`, `-mono_fullaot` | ❌ (Linux/macOS only) | ✅ | | `-runtests` | ❌ (Windows: run manually via `run.cmd`) | ✅ | | `-MSBuild` | ✅ | Use `-ninja false` via common framework | | `-PDB` | ✅ (Windows-only PDB format) | ❌ (not applicable) | > [!NOTE] > This PR was generated by GitHub Copilot. --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: davidwrighton <10779849+davidwrighton@users.noreply.github.com> Co-authored-by: David Wrighton Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- src/tests/build.cmd | 9 ++++++++- src/tests/build.sh | 13 ++++++++++--- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/src/tests/build.cmd b/src/tests/build.cmd index b2d7e5d102a61c..1f90861cde5a17 100644 --- a/src/tests/build.cmd +++ b/src/tests/build.cmd @@ -355,9 +355,15 @@ echo All arguments are optional and case-insensitive, and the '-' prefix is opti echo. echo.-? -h --help: View this message. echo. -echo Build architecture: one of "x64", "x86", "arm64" ^(default: x64^). +echo Build architecture: one of "x64", "x86", "arm64", "wasm" ^(default: x64^). echo Build type: one of "Debug", "Checked", "Release" ^(default: Debug^). echo. +echo Build target OS options: +echo os ^: Set the target OS. Common values: windows ^(default^), linux, osx, android, +echo ios, iossimulator, tvos, tvossimulator, maccatalyst, browser, wasi. +echo browser: Shorthand for "os browser" ^(typically combine with "wasm", for example "wasm browser"^). +echo wasi: Shorthand for "os wasi" ^(typically combine with "wasm", for example "wasm wasi"^). +echo. echo -Rebuild: Clean up all test artifacts prior to building tests. echo -SkipRestorePackages: Skip package restore. echo -SkipManaged: Skip the managed tests build. @@ -374,6 +380,7 @@ echo -NativeAOT: Builds the tests for Native AOT compilation. echo -Perfmap: Emit perfmap symbol files when compiling the framework assemblies using Crossgen2. echo -AllTargets: Build managed tests for all target platforms (including test projects in which CLRTestTargetUnsupported resolves to true). echo -ExcludeMonoFailures, Mono: Build the tests for the Mono runtime honoring mono-specific issues. +echo -CoreCLR: Build tests targeting the CoreCLR runtime (default; opposite of -Mono/-ExcludeMonoFailures). echo. echo Set to "" to disable default exclusion file. echo -Priority ^ : specify a set of tests that will be built and run, with priority N. diff --git a/src/tests/build.sh b/src/tests/build.sh index a0709d7386517c..f18f28ee740369 100755 --- a/src/tests/build.sh +++ b/src/tests/build.sh @@ -136,6 +136,12 @@ build_Tests() usage_list=() usage_list+=("All arguments are optional and the '-' prefix is optional. The options are:") usage_list+=("") +usage_list+=("Build target OS: Use '-os ' (handled by the common build framework) to specify the") +usage_list+=(" target OS. Common values: linux (default on Linux), osx (default on macOS), android,") +usage_list+=(" ios, iossimulator, tvos, tvossimulator, maccatalyst, browser, wasi.") +usage_list+=(" For mobile/device targets (android, ios, iossimulator, tvos, tvossimulator), this script") +usage_list+=(" automatically skips building native test components.") +usage_list+=("") usage_list+=("-rebuild - Clean up all test artifacts prior to building tests.") usage_list+=("-skiprestorepackages - Skip package restore.") usage_list+=("-skipmanaged - Skip the managed tests build.") @@ -154,12 +160,13 @@ usage_list+=("-allTargets - Build managed tests for all target platforms (includ usage_list+=("") usage_list+=("-runtests - Run tests after building them.") usage_list+=("-mono, -excludemonofailures - Build the tests for the Mono runtime honoring mono-specific issues.") +usage_list+=("-coreclr - Build tests targeting the CoreCLR runtime (default; opposite of -mono/-excludemonofailures).") usage_list+=("-mono_aot - Use Mono AOT mode.") usage_list+=("-mono_fullaot - Use Mono Full AOT mode.") usage_list+=("") -usage_list+=("-test:xxx - Only build the specified test project ^(relative or absolute project path under src\tests^)."); -usage_list+=("-dir:xxx - Build all test projects in the given directory ^(relative or absolute directory under src\tests^)."); -usage_list+=("-tree:xxx - Build all test projects in the given subtree ^(relative or absolute directory under src\tests^)."); +usage_list+=("-test:xxx - Only build the specified test project (relative or absolute project path under src/tests).") +usage_list+=("-dir:xxx - Build all test projects in the given directory (relative or absolute directory under src/tests).") +usage_list+=("-tree:xxx - Build all test projects in the given subtree (relative or absolute directory under src/tests).") usage_list+=("-log:xxx - Base file name to use for log files (used in lab pipelines that build tests in multiple steps to retain logs for each step).") usage_list+=("") usage_list+=("Any unrecognized arguments will be passed directly to MSBuild.") From fd9ddfa558190fb46fba3bd9b86b061f25dc57fe Mon Sep 17 00:00:00 2001 From: Barbara Rosiak <76071368+barosiak@users.noreply.github.com> Date: Thu, 7 May 2026 19:32:44 -0700 Subject: [PATCH 056/109] [cDAC] Implement GetPartialUserState for cDAC (#127848) ## Summary Replaces the legacy-delegation stub in DacDbiImpl.GetPartialUserState with a managed implementation using the IThread contract, mirroring the native C++ logic in dacdbiimpl.cpp that maps thread state flags to CorDebugUserState. ## Changes - Rename TS_Interruptible to TS_WaitSleepJoin and remove TSNC_DebuggerSleepWaitJoin from ThreadStateNC across all VM consumers - Add WaitSleepJoin to ThreadState enum (from m_State) - Implement GetPartialUserState in DacDbiImpl with DEBUG cross-validation - Add CorDebugUserState typed enum to IDacDbiInterface - Update data descriptor, contract docs, and VM annotations - Add unit and dump tests --------- Co-authored-by: Jan Kotas Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- docs/design/datacontracts/Thread.md | 1 + src/coreclr/debug/daccess/dacdbiimpl.cpp | 8 +--- src/coreclr/vm/comsynchronizable.cpp | 8 ++-- src/coreclr/vm/eedbginterfaceimpl.cpp | 2 +- src/coreclr/vm/threads.cpp | 4 +- src/coreclr/vm/threads.h | 6 +-- src/coreclr/vm/threadsuspend.cpp | 6 +-- .../Contracts/IThread.cs | 1 + .../Contracts/Thread_1.cs | 3 ++ .../Dbi/DacDbiImpl.cs | 47 ++++++++++++++++++- .../Dbi/IDacDbiInterface.cs | 13 ++++- .../DumpTests/DacDbi/DacDbiThreadDumpTests.cs | 29 ++++++++++++ .../MockDescriptors/MockDescriptors.Thread.cs | 6 +++ src/native/managed/cdac/tests/ThreadTests.cs | 24 ++++++++++ 14 files changed, 133 insertions(+), 25 deletions(-) diff --git a/docs/design/datacontracts/Thread.md b/docs/design/datacontracts/Thread.md index 8d9761703567db..2dcc404e7f885a 100644 --- a/docs/design/datacontracts/Thread.md +++ b/docs/design/datacontracts/Thread.md @@ -32,6 +32,7 @@ enum ThreadState Unstarted = 0x00000400, // Thread has never been started Stopped = 0x00010000, // Thread has started to shut down ThreadPoolWorker = 0x01000000, // is this a threadpool worker thread? + WaitSleepJoin = 0x02000000, // Thread is in a Sleep(), Wait(), Join() Detached = unchecked((int)0x80000000), // Thread was detached } diff --git a/src/coreclr/debug/daccess/dacdbiimpl.cpp b/src/coreclr/debug/daccess/dacdbiimpl.cpp index 2785108723ebba..693852eb063b94 100644 --- a/src/coreclr/debug/daccess/dacdbiimpl.cpp +++ b/src/coreclr/debug/daccess/dacdbiimpl.cpp @@ -5691,13 +5691,7 @@ HRESULT STDMETHODCALLTYPE DacDbiInterfaceImpl::GetPartialUserState(VMPTR_Thread result |= USER_STOPPED; } - // Don't report Thread::TS_AbortRequested - - // The interruptible flag is unreliable (see issue 699245) - // The Debugger_SleepWaitJoin is always accurate when it is present, but it is still - // just a band-aid fix to cover some of the race conditions interruptible has. - - if (ts & Thread::TS_Interruptible || pThread->HasThreadStateNC(Thread::TSNC_DebuggerSleepWaitJoin)) + if (ts & Thread::TS_WaitSleepJoin) { result |= USER_WAIT_SLEEP_JOIN; } diff --git a/src/coreclr/vm/comsynchronizable.cpp b/src/coreclr/vm/comsynchronizable.cpp index c98cbc492656fc..09a611e7e3a2cf 100644 --- a/src/coreclr/vm/comsynchronizable.cpp +++ b/src/coreclr/vm/comsynchronizable.cpp @@ -420,7 +420,7 @@ extern "C" INT32 QCALLTYPE ThreadNative_GetThreadState(QCall::ThreadHandle threa if (state & Thread::TS_AbortRequested) res |= ThreadNative::ThreadAbortRequested; - if (state & Thread::TS_Interruptible) + if (state & Thread::TS_WaitSleepJoin) res |= ThreadNative::ThreadWaitSleepJoin; return res; @@ -436,8 +436,7 @@ extern "C" void QCALLTYPE ThreadNative_SetWaitSleepJoinState(QCall::ThreadHandle CONTRACTL_END; // Set the state bits. - thread->SetThreadState(Thread::TS_Interruptible); - thread->SetThreadStateNC(Thread::TSNC_DebuggerSleepWaitJoin); + thread->SetThreadState(Thread::TS_WaitSleepJoin); } extern "C" void QCALLTYPE ThreadNative_ClearWaitSleepJoinState(QCall::ThreadHandle thread) @@ -450,8 +449,7 @@ extern "C" void QCALLTYPE ThreadNative_ClearWaitSleepJoinState(QCall::ThreadHand CONTRACTL_END; // Clear the state bits. - thread->ResetThreadState(Thread::TS_Interruptible); - thread->ResetThreadStateNC(Thread::TSNC_DebuggerSleepWaitJoin); + thread->ResetThreadState(Thread::TS_WaitSleepJoin); } #ifdef FEATURE_COMINTEROP_APARTMENT_SUPPORT diff --git a/src/coreclr/vm/eedbginterfaceimpl.cpp b/src/coreclr/vm/eedbginterfaceimpl.cpp index 2c33b9c94a7fc7..cba424243229c3 100644 --- a/src/coreclr/vm/eedbginterfaceimpl.cpp +++ b/src/coreclr/vm/eedbginterfaceimpl.cpp @@ -1437,7 +1437,7 @@ CorDebugUserState EEDbgInterfaceImpl::GetPartialUserState(Thread *pThread) ret |= (unsigned)USER_STOPPED; } - if (ts & Thread::TS_Interruptible) + if (ts & Thread::TS_WaitSleepJoin) { ret |= (unsigned)USER_WAIT_SLEEP_JOIN; } diff --git a/src/coreclr/vm/threads.cpp b/src/coreclr/vm/threads.cpp index 54d954bd02ef3d..4d18424e8b0a82 100644 --- a/src/coreclr/vm/threads.cpp +++ b/src/coreclr/vm/threads.cpp @@ -2990,7 +2990,7 @@ void Thread::UserInterrupt(ThreadInterruptMode mode) InterlockedOr(&m_UserInterrupt, mode); if (HasValidThreadHandle() && - HasThreadState (TS_Interruptible)) + HasThreadState (TS_WaitSleepJoin)) { HANDLE handle = GetThreadHandle(); if (handle != INVALID_HANDLE_VALUE) @@ -4461,7 +4461,7 @@ void Thread::HandleThreadInterrupt () } if ((m_UserInterrupt & TI_Interrupt) != 0) { - ResetThreadState ((ThreadState)(TS_Interrupted | TS_Interruptible)); + ResetThreadState ((ThreadState)(TS_Interrupted | TS_WaitSleepJoin)); InterlockedAnd (&m_UserInterrupt, ~TI_Interrupt); COMPlusThrow(kThreadInterruptedException); diff --git a/src/coreclr/vm/threads.h b/src/coreclr/vm/threads.h index 03dff6556b8bf3..339e7f04eb1ab3 100644 --- a/src/coreclr/vm/threads.h +++ b/src/coreclr/vm/threads.h @@ -549,7 +549,7 @@ class Thread // unused = 0x00800000, TS_TPWorkerThread = 0x01000000, // is this a threadpool worker thread? [cDAC] [Thread]: Contract depends on this value. - TS_Interruptible = 0x02000000, // sitting in a Sleep(), Wait(), Join() + TS_WaitSleepJoin = 0x02000000, // sitting in a Sleep(), Wait(), Join(). [cDAC] [Thread]: Contract depends on this value. TS_Interrupted = 0x04000000, // was awakened by an interrupt APC. !!! This can be moved to TSNC // unused @@ -614,9 +614,7 @@ class Thread // // Once we are completely independent of the OS UEF, we could remove this. TSNC_SkipManagedPersonalityRoutine = 0x02000000, // Ignore the ProcessCLRException calls when propagating exception to external native code - TSNC_DebuggerSleepWaitJoin = 0x04000000, // Indicates to the debugger that this thread is in a sleep wait or join state - // This almost mirrors the TS_Interruptible state however that flag can change - // during GC-preemptive mode whereas this one cannot. + // unused = 0x04000000, // unused = 0x08000000, TSNC_TSLTakenForStartup = 0x10000000, // The ThreadStoreLock (TSL) is held by another mechanism during // thread startup so can be skipped. diff --git a/src/coreclr/vm/threadsuspend.cpp b/src/coreclr/vm/threadsuspend.cpp index b2e81e569ea905..dcc47a08214feb 100644 --- a/src/coreclr/vm/threadsuspend.cpp +++ b/src/coreclr/vm/threadsuspend.cpp @@ -1538,7 +1538,7 @@ Thread::UserAbort(EEPolicy::ThreadAbortTypes abortType, DWORD timeout) // If the thread is in sleep, wait, or join interrupt it // However, we do NOT want to interrupt if the thread is already processing an exception - if (m_State & TS_Interruptible) + if (m_State & TS_WaitSleepJoin) { UserInterrupt(TI_Abort); // if the user wakes up because of this, it will read the // abort requested bit and initiate the abort @@ -2221,7 +2221,7 @@ void Thread::HandleThreadAbort () if (ReadyForAbort()) { - ResetThreadState ((ThreadState)(TS_Interrupted | TS_Interruptible)); + ResetThreadState ((ThreadState)(TS_Interrupted | TS_WaitSleepJoin)); // We are going to abort. Abort satisfies Thread.Interrupt requirement. InterlockedExchange (&m_UserInterrupt, 0); @@ -2267,7 +2267,7 @@ void Thread::PreWorkForThreadAbort() SetAbortInitiated(); // if an abort and interrupt happen at the same time (e.g. on a sleeping thread), // the abort is favored. But we do need to reset the interrupt bits. - ResetThreadState((ThreadState)(TS_Interruptible | TS_Interrupted)); + ResetThreadState((ThreadState)(TS_WaitSleepJoin | TS_Interrupted)); ResetUserInterrupted(); } diff --git a/src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Abstractions/Contracts/IThread.cs b/src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Abstractions/Contracts/IThread.cs index 08a6d8d291850c..077f4fa630d8c5 100644 --- a/src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Abstractions/Contracts/IThread.cs +++ b/src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Abstractions/Contracts/IThread.cs @@ -33,6 +33,7 @@ public enum ThreadState Unstarted = 0x00000400, // Thread has never been started Stopped = 0x00010000, // Thread has started to shut down ThreadPoolWorker = 0x01000000, // Thread is a thread pool worker thread + WaitSleepJoin = 0x02000000, // Thread is in a Sleep(), Wait(), Join() Detached = unchecked((int)0x80000000), // Thread was detached } diff --git a/src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/Thread_1.cs b/src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/Thread_1.cs index 067ffc5eeccfa9..e697ca3e5943ab 100644 --- a/src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/Thread_1.cs +++ b/src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/Thread_1.cs @@ -27,6 +27,7 @@ private enum ThreadState_1 Unstarted = 0x400, Stopped = 0x10000, ThreadPoolWorker = 0x1000000, + WaitSleepJoin = 0x2000000, Detached = unchecked((int)0x80000000) } @@ -74,6 +75,8 @@ private static Contracts.ThreadState GetThreadState(ThreadState_1 state) result |= Contracts.ThreadState.Unstarted; if (state.HasFlag(ThreadState_1.Stopped)) result |= Contracts.ThreadState.Stopped; + if (state.HasFlag(ThreadState_1.WaitSleepJoin)) + result |= Contracts.ThreadState.WaitSleepJoin; if (state.HasFlag(ThreadState_1.ThreadPoolWorker)) result |= Contracts.ThreadState.ThreadPoolWorker; if (state.HasFlag(ThreadState_1.Detached)) diff --git a/src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Legacy/Dbi/DacDbiImpl.cs b/src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Legacy/Dbi/DacDbiImpl.cs index 9ec9c2f30c53e0..95db5cf8182ab4 100644 --- a/src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Legacy/Dbi/DacDbiImpl.cs +++ b/src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Legacy/Dbi/DacDbiImpl.cs @@ -744,8 +744,50 @@ public int HasUnhandledException(ulong vmThread, Interop.BOOL* pResult) public int GetUserState(ulong vmThread, int* pRetVal) => LegacyFallbackHelper.CanFallback() && _legacy is not null ? _legacy.GetUserState(vmThread, pRetVal) : HResults.E_NOTIMPL; - public int GetPartialUserState(ulong vmThread, int* pRetVal) - => LegacyFallbackHelper.CanFallback() && _legacy is not null ? _legacy.GetPartialUserState(vmThread, pRetVal) : HResults.E_NOTIMPL; + public int GetPartialUserState(ulong vmThread, CorDebugUserState* pRetVal) + { + *pRetVal = default; + int hr = HResults.S_OK; + try + { + TargetPointer threadPtr = new TargetPointer(vmThread); + Contracts.ThreadData threadData = _target.Contracts.Thread.GetThreadData(threadPtr); + Contracts.ThreadState threadState = threadData.State; + + CorDebugUserState result = default; + if ((threadState & Contracts.ThreadState.Background) != 0) + result |= CorDebugUserState.USER_BACKGROUND; + + if ((threadState & Contracts.ThreadState.Unstarted) != 0) + result |= CorDebugUserState.USER_UNSTARTED; + + if ((threadState & Contracts.ThreadState.Stopped) != 0) + result |= CorDebugUserState.USER_STOPPED; + + if ((threadState & Contracts.ThreadState.WaitSleepJoin) != 0) + result |= CorDebugUserState.USER_WAIT_SLEEP_JOIN; + + if ((threadState & Contracts.ThreadState.ThreadPoolWorker) != 0) + result |= CorDebugUserState.USER_THREADPOOL; + + *pRetVal = result; + } + catch (System.Exception ex) + { + hr = ex.HResult; + } +#if DEBUG + if (_legacy is not null) + { + CorDebugUserState retValLocal; + int hrLocal = _legacy.GetPartialUserState(vmThread, &retValLocal); + Debug.ValidateHResult(hr, hrLocal); + if (hr == HResults.S_OK) + Debug.Assert(*pRetVal == retValLocal, $"cDAC: {*pRetVal}, DAC: {retValLocal}"); + } +#endif + return hr; + } public int GetConnectionID(ulong vmThread, uint* pRetVal) { @@ -2034,4 +2076,5 @@ public int GetAsyncLocals(ulong vmMethod, ulong codeAddr, uint state, nint pAsyn public int GetGenericArgTokenIndex(ulong vmMethod, uint* pIndex) => LegacyFallbackHelper.CanFallback() && _legacy is not null ? _legacy.GetGenericArgTokenIndex(vmMethod, pIndex) : HResults.E_NOTIMPL; + } diff --git a/src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Legacy/Dbi/IDacDbiInterface.cs b/src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Legacy/Dbi/IDacDbiInterface.cs index 107627c28b6e86..d675d433240dfd 100644 --- a/src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Legacy/Dbi/IDacDbiInterface.cs +++ b/src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Legacy/Dbi/IDacDbiInterface.cs @@ -1,6 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using System; using System.Runtime.InteropServices; using System.Runtime.InteropServices.Marshalling; @@ -145,6 +146,16 @@ public enum DynamicMethodType kLCGMethod = 2, } +[Flags] +public enum CorDebugUserState +{ + USER_BACKGROUND = 0x04, + USER_UNSTARTED = 0x08, + USER_STOPPED = 0x10, + USER_WAIT_SLEEP_JOIN = 0x20, + USER_THREADPOOL = 0x100, +} + // Name-surface projection of IDacDbiInterface in native method order for COM binding validation. // Parameter shapes are intentionally coarse placeholders and will be refined with method implementation work. [GeneratedComInterface] @@ -248,7 +259,7 @@ public unsafe partial interface IDacDbiInterface int GetUserState(ulong vmThread, int* pRetVal); [PreserveSig] - int GetPartialUserState(ulong vmThread, int* pRetVal); + int GetPartialUserState(ulong vmThread, CorDebugUserState* pRetVal); [PreserveSig] int GetConnectionID(ulong vmThread, uint* pRetVal); diff --git a/src/native/managed/cdac/tests/DumpTests/DacDbi/DacDbiThreadDumpTests.cs b/src/native/managed/cdac/tests/DumpTests/DacDbi/DacDbiThreadDumpTests.cs index 433b7cf0385cfd..0d6fe70b6a29b0 100644 --- a/src/native/managed/cdac/tests/DumpTests/DacDbi/DacDbiThreadDumpTests.cs +++ b/src/native/managed/cdac/tests/DumpTests/DacDbi/DacDbiThreadDumpTests.cs @@ -245,6 +245,35 @@ public unsafe void GetCurrentException_AtLeastOneThreadHasException(TestConfigur Assert.True(foundException, "Expected at least one thread to have a current exception in the FailFast dump."); } + [ConditionalTheory] + [MemberData(nameof(TestConfigurations))] + public unsafe void GetPartialUserState_CrossValidateWithContract(TestConfiguration config) + { + InitializeDumpTest(config); + DacDbiImpl dbi = CreateDacDbi(); + + IThread threadContract = Target.Contracts.Thread; + ThreadStoreData storeData = threadContract.GetThreadStoreData(); + + TargetPointer current = storeData.FirstThread; + while (current != TargetPointer.Null) + { + CorDebugUserState userState; + int hr = dbi.GetPartialUserState(current, &userState); + Assert.Equal(System.HResults.S_OK, hr); + + ThreadData data = threadContract.GetThreadData(current); + + Assert.Equal((data.State & ThreadState.Background) != 0, userState.HasFlag(CorDebugUserState.USER_BACKGROUND)); + Assert.Equal((data.State & ThreadState.Unstarted) != 0, userState.HasFlag(CorDebugUserState.USER_UNSTARTED)); + Assert.Equal((data.State & ThreadState.Stopped) != 0, userState.HasFlag(CorDebugUserState.USER_STOPPED)); + Assert.Equal((data.State & ThreadState.WaitSleepJoin) != 0, userState.HasFlag(CorDebugUserState.USER_WAIT_SLEEP_JOIN)); + Assert.Equal((data.State & ThreadState.ThreadPoolWorker) != 0, userState.HasFlag(CorDebugUserState.USER_THREADPOOL)); + + current = data.NextThread; + } + } + [UnmanagedCallersOnly] private static unsafe void CountThreadCallback(ulong addr, nint userData) { diff --git a/src/native/managed/cdac/tests/MockDescriptors/MockDescriptors.Thread.cs b/src/native/managed/cdac/tests/MockDescriptors/MockDescriptors.Thread.cs index 61c3d523afcde9..b69e50151771af 100644 --- a/src/native/managed/cdac/tests/MockDescriptors/MockDescriptors.Thread.cs +++ b/src/native/managed/cdac/tests/MockDescriptors/MockDescriptors.Thread.cs @@ -228,6 +228,12 @@ public ulong OSId set => WritePointerField(OSIdFieldName, value); } + public uint State + { + get => ReadUInt32Field(StateFieldName); + set => WriteUInt32Field(StateFieldName, value); + } + public ulong RuntimeThreadLocals { get => ReadPointerField(RuntimeThreadLocalsFieldName); diff --git a/src/native/managed/cdac/tests/ThreadTests.cs b/src/native/managed/cdac/tests/ThreadTests.cs index e58d224aa5ba4a..5529fb4687a389 100644 --- a/src/native/managed/cdac/tests/ThreadTests.cs +++ b/src/native/managed/cdac/tests/ThreadTests.cs @@ -95,6 +95,30 @@ public void GetThreadData(MockTarget.Architecture arch) Assert.Equal(new TargetNUInt(osId), data.OSId); } + [Theory] + [ClassData(typeof(MockTarget.StdArch))] + public void GetThreadData_MapsStateFlags(MockTarget.Architecture arch) + { + const uint id = 1; + const ulong osId = 1234; + const uint state = (uint)(ThreadState.WaitSleepJoin | ThreadState.Background); + MockThread? thread = null; + + TestPlaceholderTarget target = CreateTarget( + arch, + threadBuilder => + { + thread = threadBuilder.AddThread(id, osId); + thread.State = state; + }); + + IThread contract = target.Contracts.Thread; + ThreadData data = contract.GetThreadData(new TargetPointer(thread!.Address)); + Assert.True(data.State.HasFlag(ThreadState.Background)); + Assert.True(data.State.HasFlag(ThreadState.WaitSleepJoin)); + Assert.False(data.State.HasFlag(ThreadState.Stopped)); + } + [Theory] [ClassData(typeof(MockTarget.StdArch))] public void IterateThreads(MockTarget.Architecture arch) From 6db607e6b31a2cbbaae24aa29542c08369da3175 Mon Sep 17 00:00:00 2001 From: BoyBaykiller <88141582+BoyBaykiller@users.noreply.github.com> Date: Fri, 8 May 2026 09:13:51 +0200 Subject: [PATCH 057/109] JIT: Fix SELECT to relop changing type and check cond evaluates to 0 or 1 (#127933) ```cs static long Fail(bool cond) { if (cond) // cond is TYP_INT { return 1L; } return 0L; } ``` This get's transformed to `return cond;` However we need to insert a CAST from int to long to presever the type, which I am doing here. Also add `cond->OperIsCompare()` checks for the opts that rely on `cond` being either 0 or 1, since it could be "anything". --- src/coreclr/jit/ifconversion.cpp | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/src/coreclr/jit/ifconversion.cpp b/src/coreclr/jit/ifconversion.cpp index 5e00b2648cae43..51636fe614809b 100644 --- a/src/coreclr/jit/ifconversion.cpp +++ b/src/coreclr/jit/ifconversion.cpp @@ -814,7 +814,7 @@ GenTree* OptIfConversionDsc::TrySelectToCnsOpCond(GenTreeConditional* select) GenTree* trueInput = select->gtOp1; GenTree* falseInput = select->gtOp2; - if (!trueInput->IsIntegralConst() || !falseInput->IsIntegralConst()) + if (!cond->OperIsCompare() || !trueInput->IsIntegralConst() || !falseInput->IsIntegralConst()) { return nullptr; } @@ -822,13 +822,14 @@ GenTree* OptIfConversionDsc::TrySelectToCnsOpCond(GenTreeConditional* select) int64_t trueVal = trueInput->AsIntConCommon()->IntegralValue(); int64_t falseVal = falseInput->AsIntConCommon()->IntegralValue(); - if (trueVal == 1 && falseVal == 0) + if ((trueVal == 1 && falseVal == 0) || (trueVal == 0 && falseVal == 1)) { - return cond; - } - else if (trueVal == 0 && falseVal == 1) - { - return m_compiler->gtReverseCond(cond); + GenTree* retCond = (trueVal == 1) ? cond : m_compiler->gtReverseCond(cond); + if (retCond->TypeGet() != select->TypeGet()) + { + retCond = m_compiler->gtNewCastNode(select->TypeGet(), retCond, true, select->TypeGet()); + } + return retCond; } #ifdef TARGET_RISCV64 @@ -930,6 +931,11 @@ GenTree* OptIfConversionDsc::TrySelectToCondOpLcl(GenTreeConditional* select) GenTree* oper = select->gtOp1; GenTree* zero = select->gtOp2; + if (!cond->OperIsCompare()) + { + return nullptr; + } + bool isCondReversed = !zero->IsIntegralConst(); if (isCondReversed) std::swap(oper, zero); From 2fc2cf9e92e3c748a00e6b8879936c512a0803e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Fi=C5=A1era?= Date: Fri, 8 May 2026 11:55:12 +0200 Subject: [PATCH 058/109] [browser] Review concatenation logic in WebAssembly SDK (#127552) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../Microsoft.NET.Sdk.WebAssembly.Browser.targets | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/mono/nuget/Microsoft.NET.Sdk.WebAssembly.Pack/build/Microsoft.NET.Sdk.WebAssembly.Browser.targets b/src/mono/nuget/Microsoft.NET.Sdk.WebAssembly.Pack/build/Microsoft.NET.Sdk.WebAssembly.Browser.targets index 6442c23e87d1ac..ccb23e166edd7f 100644 --- a/src/mono/nuget/Microsoft.NET.Sdk.WebAssembly.Pack/build/Microsoft.NET.Sdk.WebAssembly.Browser.targets +++ b/src/mono/nuget/Microsoft.NET.Sdk.WebAssembly.Pack/build/Microsoft.NET.Sdk.WebAssembly.Browser.targets @@ -503,7 +503,7 @@ Copyright (c) .NET Foundation. All rights reserved. - <_WasmBuildBootJsonPath>$(IntermediateOutputPath)$(_WasmBootConfigFileName) + <_WasmBuildBootJsonPath>$([MSBuild]::NormalizePath($(IntermediateOutputPath), $(_WasmBootConfigFileName))) <_WasmBuildApplicationEnvironmentName>$(WasmApplicationEnvironmentName) <_WasmBuildApplicationEnvironmentName Condition="'$(_WasmBuildApplicationEnvironmentName)' == ''">Development @@ -872,7 +872,7 @@ Copyright (c) .NET Foundation. All rights reserved. <_BlazorExtensionsCandidate Include="@(BlazorPublishExtension->'%(FullPath)')"> $(PackageId) Computed - $(PublishDir)wwwroot + $([MSBuild]::NormalizeDirectory($(PublishDir), 'wwwroot')) $(StaticWebAssetBasePath) %(BlazorPublishExtension.RelativePath) Publish @@ -915,7 +915,7 @@ Copyright (c) .NET Foundation. All rights reserved. <_WasmPublishBootConfigCandidate - Include="$(IntermediateOutputPath)$(_WasmPublishBootConfigFileName)" + Include="$([MSBuild]::NormalizePath($(IntermediateOutputPath), $(_WasmPublishBootConfigFileName)))" RelativePath="_framework/$(_WasmBootConfigFileName)" /> <_WasmPublishBootConfigFingerprintPatterns Include="WasmBootConfigFiles" Pattern="*%(_WasmPublishBootConfigCandidate.Extension)" Expression="#[.{fingerprint}]!" Condition="'$(_WasmFingerprintBootConfig)' == 'true'" /> @@ -934,7 +934,7 @@ Copyright (c) .NET Foundation. All rights reserved. AssetTraitValue="manifest" CopyToOutputDirectory="Never" CopyToPublishDirectory="PreserveNewest" - ContentRoot="$(PublishDir)wwwroot" + ContentRoot="$([MSBuild]::NormalizeDirectory($(PublishDir), 'wwwroot'))" BasePath="$(StaticWebAssetBasePath)" > @@ -994,7 +994,7 @@ Copyright (c) .NET Foundation. All rights reserved. DebugLevel="$(WasmDebugLevel)" CacheBootResources="$(_BlazorCacheBootResources)" MergeWith="@(_WasmDotnetJsForPublish)" - OutputPath="$(IntermediateOutputPath)$(_WasmPublishBootConfigFileName)" + OutputPath="$([MSBuild]::NormalizePath($(IntermediateOutputPath), $(_WasmPublishBootConfigFileName)))" ConfigurationFiles="@(_WasmPublishConfigFile)" LazyLoadedAssemblies="@(BlazorWebAssemblyLazyLoad)" InvariantGlobalization="$(InvariantGlobalization)" @@ -1022,7 +1022,7 @@ Copyright (c) .NET Foundation. All rights reserved. /> - + From d7021d4a5806129a6e72c0da4910d34883f12997 Mon Sep 17 00:00:00 2001 From: Milos Kotlar Date: Fri, 8 May 2026 12:25:29 +0200 Subject: [PATCH 059/109] Switch ci-failure-scan to claude-opus-4.6 (#127948) ## Description Switches the `ci-failure-scan` agentic workflow from `claude-sonnet-4.6` to `claude-opus-4.6`. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .github/workflows/ci-failure-scan.lock.yml | 34 +++++++++++----------- .github/workflows/ci-failure-scan.md | 2 +- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/.github/workflows/ci-failure-scan.lock.yml b/.github/workflows/ci-failure-scan.lock.yml index 45c464a68d5a98..37c282d7066931 100644 --- a/.github/workflows/ci-failure-scan.lock.yml +++ b/.github/workflows/ci-failure-scan.lock.yml @@ -1,4 +1,4 @@ -# gh-aw-metadata: {"schema_version":"v3","frontmatter_hash":"9f73c4276266e2b227107862cdbff63e464a2f91e9c3cb0a5a749b407cea2b5b","compiler_version":"v0.68.1","strict":true,"agent_id":"copilot","agent_model":"claude-sonnet-4.6"} +# gh-aw-metadata: {"schema_version":"v3","frontmatter_hash":"67ab95173c3bd5a18c0d820b917dafe02bea8a4a191d963d78757cb5146d4d4c","compiler_version":"v0.68.1","strict":true,"agent_id":"copilot","agent_model":"claude-opus-4.6"} # gh-aw-manifest: {"version":1,"secrets":["COPILOT_GITHUB_TOKEN","COPILOT_PAT_0","COPILOT_PAT_1","COPILOT_PAT_2","COPILOT_PAT_3","COPILOT_PAT_4","COPILOT_PAT_5","COPILOT_PAT_6","COPILOT_PAT_7","COPILOT_PAT_8","COPILOT_PAT_9","GH_AW_CI_TRIGGER_TOKEN","GH_AW_GITHUB_MCP_SERVER_TOKEN","GH_AW_GITHUB_TOKEN","GITHUB_TOKEN"],"actions":[{"repo":"actions/checkout","sha":"de0fac2e4500dabe0009e67214ff5f5447ce83dd","version":"v6.0.2"},{"repo":"actions/download-artifact","sha":"3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c","version":"v8.0.1"},{"repo":"actions/github-script","sha":"3a2844b7e9c422d3c10d287c895573f7108da1b3","version":"v9"},{"repo":"actions/upload-artifact","sha":"bbbca2ddaa5d8feaa63e36b76fdaad77386f024f","version":"v7"},{"repo":"github/gh-aw-actions/setup","sha":"2fe53acc038ba01c3bbdc767d4b25df31ca5bdfc","version":"v0.68.1"}]} # ___ _ _ # / _ \ | | (_) @@ -124,7 +124,7 @@ jobs: env: GH_AW_INFO_ENGINE_ID: "copilot" GH_AW_INFO_ENGINE_NAME: "GitHub Copilot CLI" - GH_AW_INFO_MODEL: "claude-sonnet-4.6" + GH_AW_INFO_MODEL: "claude-opus-4.6" GH_AW_INFO_VERSION: "1.0.21" GH_AW_INFO_AGENT_VERSION: "1.0.21" GH_AW_INFO_CLI_VERSION: "v0.68.1" @@ -197,19 +197,19 @@ jobs: run: | bash "${RUNNER_TEMP}/gh-aw/actions/create_prompt_first.sh" { - cat << 'GH_AW_PROMPT_416b8e1b41d3a8c5_EOF' + cat << 'GH_AW_PROMPT_f1c65393e7e58de4_EOF' - GH_AW_PROMPT_416b8e1b41d3a8c5_EOF + GH_AW_PROMPT_f1c65393e7e58de4_EOF cat "${RUNNER_TEMP}/gh-aw/prompts/xpia.md" cat "${RUNNER_TEMP}/gh-aw/prompts/temp_folder_prompt.md" cat "${RUNNER_TEMP}/gh-aw/prompts/markdown.md" cat "${RUNNER_TEMP}/gh-aw/prompts/safe_outputs_prompt.md" - cat << 'GH_AW_PROMPT_416b8e1b41d3a8c5_EOF' + cat << 'GH_AW_PROMPT_f1c65393e7e58de4_EOF' Tools: create_issue(max:5), create_pull_request(max:10), missing_tool, missing_data, noop - GH_AW_PROMPT_416b8e1b41d3a8c5_EOF + GH_AW_PROMPT_f1c65393e7e58de4_EOF cat "${RUNNER_TEMP}/gh-aw/prompts/safe_outputs_create_pull_request.md" - cat << 'GH_AW_PROMPT_416b8e1b41d3a8c5_EOF' + cat << 'GH_AW_PROMPT_f1c65393e7e58de4_EOF' The following GitHub context information is available for this workflow: @@ -242,12 +242,12 @@ jobs: - **Note**: If a branch you need is not in the list above and is not listed as an additional fetched ref, it has NOT been checked out. For private repositories you cannot fetch it without proper authentication. If the branch is required and not available, exit with an error and ask the user to add it to the `fetch:` option of the `checkout:` configuration (e.g., `fetch: ["refs/pulls/open/*"]` for all open PR refs, or `fetch: ["main", "feature/my-branch"]` for specific branches). - GH_AW_PROMPT_416b8e1b41d3a8c5_EOF + GH_AW_PROMPT_f1c65393e7e58de4_EOF cat "${RUNNER_TEMP}/gh-aw/prompts/github_mcp_tools_with_safeoutputs_prompt.md" - cat << 'GH_AW_PROMPT_416b8e1b41d3a8c5_EOF' + cat << 'GH_AW_PROMPT_f1c65393e7e58de4_EOF' {{#runtime-import .github/workflows/ci-failure-scan.md}} - GH_AW_PROMPT_416b8e1b41d3a8c5_EOF + GH_AW_PROMPT_f1c65393e7e58de4_EOF } > "$GH_AW_PROMPT" - name: Interpolate variables and render templates uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9 @@ -413,9 +413,9 @@ jobs: mkdir -p "${RUNNER_TEMP}/gh-aw/safeoutputs" mkdir -p /tmp/gh-aw/safeoutputs mkdir -p /tmp/gh-aw/mcp-logs/safeoutputs - cat > "${RUNNER_TEMP}/gh-aw/safeoutputs/config.json" << 'GH_AW_SAFE_OUTPUTS_CONFIG_93f4d7e8f71e4c3f_EOF' + cat > "${RUNNER_TEMP}/gh-aw/safeoutputs/config.json" << 'GH_AW_SAFE_OUTPUTS_CONFIG_a3a51934d74963ff_EOF' {"create_issue":{"allowed_labels":["Known Build Error","blocking-clean-ci"],"labels":["agentic-workflows"],"max":5},"create_pull_request":{"allowed_files":["src/libraries/**","src/coreclr/**","src/mono/**","src/tests/**","src/native/**","eng/testing/**"],"draft":true,"labels":["agentic-workflows"],"max":10,"max_patch_size":1024,"protected_files":["package.json","bun.lockb","bunfig.toml","deno.json","deno.jsonc","deno.lock","global.json","NuGet.Config","Directory.Packages.props","mix.exs","mix.lock","go.mod","go.sum","stack.yaml","stack.yaml.lock","pom.xml","build.gradle","build.gradle.kts","settings.gradle","settings.gradle.kts","gradle.properties","package-lock.json","yarn.lock","pnpm-lock.yaml","npm-shrinkwrap.json","requirements.txt","Pipfile","Pipfile.lock","pyproject.toml","setup.py","setup.cfg","Gemfile","Gemfile.lock","uv.lock","CODEOWNERS"],"protected_files_policy":"blocked","protected_path_prefixes":[".github/",".agents/"],"title_prefix":"[ci-scan] "},"create_report_incomplete_issue":{},"missing_data":{},"missing_tool":{},"noop":{"max":1,"report-as-issue":"true"},"report_incomplete":{}} - GH_AW_SAFE_OUTPUTS_CONFIG_93f4d7e8f71e4c3f_EOF + GH_AW_SAFE_OUTPUTS_CONFIG_a3a51934d74963ff_EOF - name: Write Safe Outputs Tools env: GH_AW_TOOLS_META_JSON: | @@ -645,7 +645,7 @@ jobs: export MCP_GATEWAY_DOCKER_COMMAND='docker run -i --rm --network host -v /var/run/docker.sock:/var/run/docker.sock -e MCP_GATEWAY_PORT -e MCP_GATEWAY_DOMAIN -e MCP_GATEWAY_API_KEY -e MCP_GATEWAY_PAYLOAD_DIR -e MCP_GATEWAY_PAYLOAD_SIZE_THRESHOLD -e DEBUG -e MCP_GATEWAY_LOG_DIR -e GH_AW_MCP_LOG_DIR -e GH_AW_SAFE_OUTPUTS -e GH_AW_SAFE_OUTPUTS_CONFIG_PATH -e GH_AW_SAFE_OUTPUTS_TOOLS_PATH -e GH_AW_ASSETS_BRANCH -e GH_AW_ASSETS_MAX_SIZE_KB -e GH_AW_ASSETS_ALLOWED_EXTS -e DEFAULT_BRANCH -e GITHUB_MCP_SERVER_TOKEN -e GITHUB_MCP_GUARD_MIN_INTEGRITY -e GITHUB_MCP_GUARD_REPOS -e GITHUB_REPOSITORY -e GITHUB_SERVER_URL -e GITHUB_SHA -e GITHUB_WORKSPACE -e GITHUB_TOKEN -e GITHUB_RUN_ID -e GITHUB_RUN_NUMBER -e GITHUB_RUN_ATTEMPT -e GITHUB_JOB -e GITHUB_ACTION -e GITHUB_EVENT_NAME -e GITHUB_EVENT_PATH -e GITHUB_ACTOR -e GITHUB_ACTOR_ID -e GITHUB_TRIGGERING_ACTOR -e GITHUB_WORKFLOW -e GITHUB_WORKFLOW_REF -e GITHUB_WORKFLOW_SHA -e GITHUB_REF -e GITHUB_REF_NAME -e GITHUB_REF_TYPE -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e GH_AW_SAFE_OUTPUTS_PORT -e GH_AW_SAFE_OUTPUTS_API_KEY -v /tmp/gh-aw/mcp-payloads:/tmp/gh-aw/mcp-payloads:rw -v /opt:/opt:ro -v /tmp:/tmp:rw -v '"${GITHUB_WORKSPACE}"':'"${GITHUB_WORKSPACE}"':rw ghcr.io/github/gh-aw-mcpg:v0.2.17' mkdir -p /home/runner/.copilot - cat << GH_AW_MCP_CONFIG_f1265124db2abfb7_EOF | bash "${RUNNER_TEMP}/gh-aw/actions/start_mcp_gateway.sh" + cat << GH_AW_MCP_CONFIG_c371ad2870ad1169_EOF | bash "${RUNNER_TEMP}/gh-aw/actions/start_mcp_gateway.sh" { "mcpServers": { "github": { @@ -689,7 +689,7 @@ jobs: "payloadDir": "${MCP_GATEWAY_PAYLOAD_DIR}" } } - GH_AW_MCP_CONFIG_f1265124db2abfb7_EOF + GH_AW_MCP_CONFIG_c371ad2870ad1169_EOF - name: Download activation artifact uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: @@ -754,7 +754,7 @@ jobs: env: COPILOT_AGENT_RUNNER_TYPE: STANDALONE COPILOT_GITHUB_TOKEN: ${{ case(needs.pre_activation.outputs.copilot_pat_number == '0', secrets.COPILOT_PAT_0, needs.pre_activation.outputs.copilot_pat_number == '1', secrets.COPILOT_PAT_1, needs.pre_activation.outputs.copilot_pat_number == '2', secrets.COPILOT_PAT_2, needs.pre_activation.outputs.copilot_pat_number == '3', secrets.COPILOT_PAT_3, needs.pre_activation.outputs.copilot_pat_number == '4', secrets.COPILOT_PAT_4, needs.pre_activation.outputs.copilot_pat_number == '5', secrets.COPILOT_PAT_5, needs.pre_activation.outputs.copilot_pat_number == '6', secrets.COPILOT_PAT_6, needs.pre_activation.outputs.copilot_pat_number == '7', secrets.COPILOT_PAT_7, needs.pre_activation.outputs.copilot_pat_number == '8', secrets.COPILOT_PAT_8, needs.pre_activation.outputs.copilot_pat_number == '9', secrets.COPILOT_PAT_9, secrets.COPILOT_GITHUB_TOKEN) }} - COPILOT_MODEL: claude-sonnet-4.6 + COPILOT_MODEL: claude-opus-4.6 GH_AW_MCP_CONFIG: /home/runner/.copilot/mcp-config.json GH_AW_PHASE: agent GH_AW_PROMPT: /tmp/gh-aw/aw-prompts/prompt.txt @@ -1172,7 +1172,7 @@ jobs: env: COPILOT_AGENT_RUNNER_TYPE: STANDALONE COPILOT_GITHUB_TOKEN: ${{ case(needs.pre_activation.outputs.copilot_pat_number == '0', secrets.COPILOT_PAT_0, needs.pre_activation.outputs.copilot_pat_number == '1', secrets.COPILOT_PAT_1, needs.pre_activation.outputs.copilot_pat_number == '2', secrets.COPILOT_PAT_2, needs.pre_activation.outputs.copilot_pat_number == '3', secrets.COPILOT_PAT_3, needs.pre_activation.outputs.copilot_pat_number == '4', secrets.COPILOT_PAT_4, needs.pre_activation.outputs.copilot_pat_number == '5', secrets.COPILOT_PAT_5, needs.pre_activation.outputs.copilot_pat_number == '6', secrets.COPILOT_PAT_6, needs.pre_activation.outputs.copilot_pat_number == '7', secrets.COPILOT_PAT_7, needs.pre_activation.outputs.copilot_pat_number == '8', secrets.COPILOT_PAT_8, needs.pre_activation.outputs.copilot_pat_number == '9', secrets.COPILOT_PAT_9, secrets.COPILOT_GITHUB_TOKEN) }} - COPILOT_MODEL: claude-sonnet-4.6 + COPILOT_MODEL: claude-opus-4.6 GH_AW_PHASE: detection GH_AW_PROMPT: /tmp/gh-aw/aw-prompts/prompt.txt GH_AW_VERSION: v0.68.1 @@ -1273,7 +1273,7 @@ jobs: GH_AW_CALLER_WORKFLOW_ID: "${{ github.repository }}/ci-failure-scan" GH_AW_EFFECTIVE_TOKENS: ${{ needs.agent.outputs.effective_tokens }} GH_AW_ENGINE_ID: "copilot" - GH_AW_ENGINE_MODEL: "claude-sonnet-4.6" + GH_AW_ENGINE_MODEL: "claude-opus-4.6" GH_AW_WORKFLOW_ID: "ci-failure-scan" GH_AW_WORKFLOW_NAME: "CI Outer-Loop Failure Scanner" outputs: diff --git a/.github/workflows/ci-failure-scan.md b/.github/workflows/ci-failure-scan.md index c1aec2f41a41c8..8fa3343e25d1b0 100644 --- a/.github/workflows/ci-failure-scan.md +++ b/.github/workflows/ci-failure-scan.md @@ -57,7 +57,7 @@ jobs: # Consume the PAT number from the pre-activation step and select the corresponding secret engine: id: copilot - model: claude-sonnet-4.6 + model: claude-opus-4.6 env: # We cannot use line breaks in this expression as it leads to a syntax error in the compiled workflow # If none of the `COPILOT_PAT_#` secrets were selected, then the default COPILOT_GITHUB_TOKEN is used From 0fc441390817a63dcba1049b929215611d61c57c Mon Sep 17 00:00:00 2001 From: Milos Kotlar Date: Fri, 8 May 2026 15:06:17 +0200 Subject: [PATCH 060/109] Revert "[clr-ios] Propagate XSLT ActiveIssue from base to derived test classes" (#127947) Reverts dotnet/runtime#127788 --- .../Xslt/XslCompiledTransformApi/Errata4.cs | 1 - .../XslCompiledTransformApi/OutputSettings.cs | 1 - .../Xslt/XslCompiledTransformApi/TempFiles.cs | 1 - .../XslCompiledTransform.cs | 16 ---------------- .../XslTransformMultith.cs | 2 -- .../Xslt/XslCompiledTransformApi/XsltApiV2.cs | 1 + .../XslCompiledTransformApi/XsltArgumentList.cs | 10 ---------- .../XsltArgumentListMultith.cs | 3 --- .../Xslt/XslCompiledTransformApi/XsltSettings.cs | 1 - 9 files changed, 1 insertion(+), 35 deletions(-) diff --git a/src/libraries/System.Private.Xml/tests/Xslt/XslCompiledTransformApi/Errata4.cs b/src/libraries/System.Private.Xml/tests/Xslt/XslCompiledTransformApi/Errata4.cs index d5dd4082a8888b..0b5c13f8d95c0a 100644 --- a/src/libraries/System.Private.Xml/tests/Xslt/XslCompiledTransformApi/Errata4.cs +++ b/src/libraries/System.Private.Xml/tests/Xslt/XslCompiledTransformApi/Errata4.cs @@ -14,7 +14,6 @@ namespace System.Xml.XslCompiledTransformApiTests { //[TestCase(Name = "Xml 4th Errata tests for XslCompiledTransform", Params = new object[] { 300 })] [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/124344", typeof(PlatformDetection), nameof(PlatformDetection.IsAppleMobile), nameof(PlatformDetection.IsCoreCLR))] public class Errata4 : XsltApiTestCaseBase2 { private ITestOutputHelper _output; diff --git a/src/libraries/System.Private.Xml/tests/Xslt/XslCompiledTransformApi/OutputSettings.cs b/src/libraries/System.Private.Xml/tests/Xslt/XslCompiledTransformApi/OutputSettings.cs index cf3a01b7a807c7..5bf09df20ede9c 100644 --- a/src/libraries/System.Private.Xml/tests/Xslt/XslCompiledTransformApi/OutputSettings.cs +++ b/src/libraries/System.Private.Xml/tests/Xslt/XslCompiledTransformApi/OutputSettings.cs @@ -11,7 +11,6 @@ namespace System.Xml.XslCompiledTransformApiTests { //[TestCase(Name = "OutputSettings", Desc = "This testcase tests the OutputSettings on XslCompiledTransform", Param = "Debug")] [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/124344", typeof(PlatformDetection), nameof(PlatformDetection.IsAppleMobile), nameof(PlatformDetection.IsCoreCLR))] public class COutputSettings : XsltApiTestCaseBase2 { private XslCompiledTransform _xsl = null; diff --git a/src/libraries/System.Private.Xml/tests/Xslt/XslCompiledTransformApi/TempFiles.cs b/src/libraries/System.Private.Xml/tests/Xslt/XslCompiledTransformApi/TempFiles.cs index 816ec3315cbbec..aa5020f24f6da5 100644 --- a/src/libraries/System.Private.Xml/tests/Xslt/XslCompiledTransformApi/TempFiles.cs +++ b/src/libraries/System.Private.Xml/tests/Xslt/XslCompiledTransformApi/TempFiles.cs @@ -10,7 +10,6 @@ namespace System.Xml.XslCompiledTransformApiTests { //[TestCase(Name = "TemporaryFiles", Desc = "This testcase tests the Temporary Files property on XslCompiledTransform")] [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/124344", typeof(PlatformDetection), nameof(PlatformDetection.IsAppleMobile), nameof(PlatformDetection.IsCoreCLR))] public class TempFiles : XsltApiTestCaseBase2 { private XslCompiledTransform _xsl = null; diff --git a/src/libraries/System.Private.Xml/tests/Xslt/XslCompiledTransformApi/XslCompiledTransform.cs b/src/libraries/System.Private.Xml/tests/Xslt/XslCompiledTransformApi/XslCompiledTransform.cs index 675b8e87d2ab96..7f9707004c9bdf 100644 --- a/src/libraries/System.Private.Xml/tests/Xslt/XslCompiledTransformApi/XslCompiledTransform.cs +++ b/src/libraries/System.Private.Xml/tests/Xslt/XslCompiledTransformApi/XslCompiledTransform.cs @@ -82,7 +82,6 @@ protected void WLoad(XslCompiledTransform instance, MethodInfo meth, byte[] byte //[TestCase(Name = "Load(MethodInfo, ByteArray, TypeArray) tests", Desc = "This testcase tests private Load method via Reflection. This method is used by sharepoint")] [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/124344", typeof(PlatformDetection), nameof(PlatformDetection.IsAppleMobile), nameof(PlatformDetection.IsCoreCLR))] public class CLoadMethInfoTest : ReflectionTestCaseBase { private ITestOutputHelper _output; @@ -135,7 +134,6 @@ public void Var2() } //[TestCase(Name = "Null argument tests", Desc = "This testcase passes NULL arguments to all XslCompiledTransform methods")] - [ActiveIssue("https://github.com/dotnet/runtime/issues/124344", typeof(PlatformDetection), nameof(PlatformDetection.IsAppleMobile), nameof(PlatformDetection.IsCoreCLR))] public class CNullArgumentTest : XsltApiTestCaseBase2 { private ITestOutputHelper _output; @@ -480,7 +478,6 @@ public void Var14() //[TestCase(Name = "XslCompiledTransform.XmlResolver : Navigator, Writer", Desc = "NAVIGATOR,WRITER")] //[TestCase(Name = "XslCompiledTransform.XmlResolver : Navigator, TextWriter", Desc = "NAVIGATOR,TEXTWRITER")] [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/124344", typeof(PlatformDetection), nameof(PlatformDetection.IsAppleMobile), nameof(PlatformDetection.IsCoreCLR))] public class CXmlResolverTest : XsltApiTestCaseBase2, IDisposable { private ITestOutputHelper _output; @@ -673,7 +670,6 @@ public void XmlResolver7(XslInputType xslInputType, ReaderType readerType, Outpu //[TestCase(Name = "XslCompiledTransform.Load() - Integrity : Navigator, Writer", Desc = "NAVIGATOR,WRITER")] //[TestCase(Name = "XslCompiledTransform.Load() - Integrity : Navigator, TextWriter", Desc = "NAVIGATOR,TEXTWRITER")] [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/124344", typeof(PlatformDetection), nameof(PlatformDetection.IsAppleMobile), nameof(PlatformDetection.IsCoreCLR))] public class CLoadTest : XsltApiTestCaseBase2 { private ITestOutputHelper _output; @@ -1013,7 +1009,6 @@ public void LoadGeneric12(XslInputType xslInputType, ReaderType readerType) //[TestCase(Name = "XslCompiledTransform.Load(XmlResolver) - Integrity : URI, Writer", Desc = "URI,WRITER")] //[TestCase(Name = "XslCompiledTransform.Load(XmlResolver) - Integrity : URI, TextWriter", Desc = "URI,TEXTWRITER")] [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/124344", typeof(PlatformDetection), nameof(PlatformDetection.IsAppleMobile), nameof(PlatformDetection.IsCoreCLR))] public class CLoadXmlResolverTest : XsltApiTestCaseBase2 { private ITestOutputHelper _output; @@ -1446,7 +1441,6 @@ public void LoadGeneric11(XslInputType xslInputType, ReaderType readerType) //[TestCase(Name = "XslCompiledTransform.Load(Url, Resolver) : URI, Writer", Desc = "URI,WRITER")] //[TestCase(Name = "XslCompiledTransform.Load(Url, Resolver) : URI, TextWriter", Desc = "URI,TEXTWRITER")] [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/124344", typeof(PlatformDetection), nameof(PlatformDetection.IsAppleMobile), nameof(PlatformDetection.IsCoreCLR))] public class CLoadUrlResolverTest : XsltApiTestCaseBase2 { private ITestOutputHelper _output; @@ -1547,7 +1541,6 @@ private sealed class XmlAuditingUrlResolver : XmlUrlResolver //[TestCase(Name = "XslCompiledTransform.Load(Url) Integrity : URI, Stream", Desc = "URI,STREAM")] [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/124344", typeof(PlatformDetection), nameof(PlatformDetection.IsAppleMobile), nameof(PlatformDetection.IsCoreCLR))] public class CLoadStringTest : XsltApiTestCaseBase2 { private ITestOutputHelper _output; @@ -1667,7 +1660,6 @@ public void LoadUrl5(ReaderType readerType) //[TestCase(Name = "XslCompiledTransform .Load(IXPathNavigable) : Navigator, TextWriter", Desc = "NAVIGATOR,TEXTWRITER")] [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/124344", typeof(PlatformDetection), nameof(PlatformDetection.IsAppleMobile), nameof(PlatformDetection.IsCoreCLR))] public class CLoadXPathNavigableTest : XsltApiTestCaseBase2 { private ITestOutputHelper _output; @@ -1777,7 +1769,6 @@ public void LoadNavigator4() //[TestCase(Name = "XslCompiledTransform.Load(Reader) : Reader, Stream", Desc = "READER,STREAM")] [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/124344", typeof(PlatformDetection), nameof(PlatformDetection.IsAppleMobile), nameof(PlatformDetection.IsCoreCLR))] public class CLoadReaderTest : XsltApiTestCaseBase2 { private ITestOutputHelper _output; @@ -2168,7 +2159,6 @@ public override string Value //[TestCase(Name = "XslCompiledTransform.Transform() Integrity : Navigator, Writer", Desc = "NAVIGATOR,WRITER")] //[TestCase(Name = "XslCompiledTransform.Transform() Integrity : Navigator, TextWriter", Desc = "NAVIGATOR,TEXTWRITER")] [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/124344", typeof(PlatformDetection), nameof(PlatformDetection.IsAppleMobile), nameof(PlatformDetection.IsCoreCLR))] public class CTransformTestGeneric : XsltApiTestCaseBase2 { private ITestOutputHelper _output; @@ -2425,7 +2415,6 @@ public void TransformGeneric11(XslInputType xslInputType, ReaderType readerType, //[TestCase(Name = "XslCompiledTransform.Transform(XmlResolver) : Navigator, Writer", Desc = "NAVIGATOR,WRITER")] //[TestCase(Name = "XslCompiledTransform.Transform(XmlResolver) : Navigator, TextWriter", Desc = "NAVIGATOR,TEXTWRITER")] [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/124344", typeof(PlatformDetection), nameof(PlatformDetection.IsAppleMobile), nameof(PlatformDetection.IsCoreCLR))] public class CTransformResolverTest : XsltApiTestCaseBase2, IDisposable { private ITestOutputHelper _output; @@ -2639,7 +2628,6 @@ public void XmlResolver7(XslInputType xslInputType, ReaderType readerType, Outpu //[TestCase(Name = "XslCompiledTransform.Transform(String, String) : URI, String", Desc = "URI,STREAM")] //[TestCase(Name = "XslCompiledTransform.Transform(String, String) : Navigator, String", Desc = "NAVIGATOR,STREAM")] [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/124344", typeof(PlatformDetection), nameof(PlatformDetection.IsAppleMobile), nameof(PlatformDetection.IsCoreCLR))] public class CTransformStrStrTest : XsltApiTestCaseBase2 { private ITestOutputHelper _output; @@ -3013,7 +3001,6 @@ public void TransformStrStr13(XslInputType xslInputType, ReaderType readerType) //[TestCase(Name = "XslCompiledTransform.Transform(String, String, Resolver) : URI, String", Desc = "URI,STREAM")] //[TestCase(Name = "XslCompiledTransform.Transform(String, String, Resolver) : Navigator, String", Desc = "NAVIGATOR,STREAM")] [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/124344", typeof(PlatformDetection), nameof(PlatformDetection.IsAppleMobile), nameof(PlatformDetection.IsCoreCLR))] public class CTransformStrStrResolverTest : XsltApiTestCaseBase2, IDisposable { private ITestOutputHelper _output; @@ -3119,7 +3106,6 @@ public void TransformStrStrResolver3(object param, XslInputType xslInputType, Re //[TestCase(Name = "XslCompiledTransform.Transform(IXPathNavigable, XsltArgumentList, XmlWriter, XmlResolver)", Desc = "Constructor Tests", Param = "IXPathNavigable")] //[TestCase(Name = "XslCompiledTransform.Transform(XmlReader, XsltArgumentList, XmlWriter, XmlResolver)", Desc = "Constructor Tests", Param = "XmlReader")] [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/124344", typeof(PlatformDetection), nameof(PlatformDetection.IsAppleMobile), nameof(PlatformDetection.IsCoreCLR))] public class CTransformConstructorWithFourParametersTest : XsltApiTestCaseBase2 { private ITestOutputHelper _output; @@ -3327,7 +3313,6 @@ public void InValidCases(object param0, object param1, object param2) //[TestCase(Name = "NDP1_1SP1 Bugs (URI,STREAM)", Desc = "URI,STREAM")] //[TestCase(Name = "NDP1_1SP1 Bugs (NAVIGATOR,TEXTWRITER)", Desc = "NAVIGATOR,TEXTWRITER")] [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/124344", typeof(PlatformDetection), nameof(PlatformDetection.IsAppleMobile), nameof(PlatformDetection.IsCoreCLR))] public class CNDP1_1SP1Test : XsltApiTestCaseBase2 { private ITestOutputHelper _output; @@ -3420,7 +3405,6 @@ public void var4(XslInputType xslInputType, ReaderType readerType, OutputType ou //[TestCase(Name = "XslCompiledTransform Regression Tests for API", Desc = "XslCompiledTransform Regression Tests")] [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/124344", typeof(PlatformDetection), nameof(PlatformDetection.IsAppleMobile), nameof(PlatformDetection.IsCoreCLR))] public class CTransformRegressionTest : XsltApiTestCaseBase2, IDisposable { private ITestOutputHelper _output; diff --git a/src/libraries/System.Private.Xml/tests/Xslt/XslCompiledTransformApi/XslTransformMultith.cs b/src/libraries/System.Private.Xml/tests/Xslt/XslCompiledTransformApi/XslTransformMultith.cs index 29c08cd065b42e..29f58152ba8687 100644 --- a/src/libraries/System.Private.Xml/tests/Xslt/XslCompiledTransformApi/XslTransformMultith.cs +++ b/src/libraries/System.Private.Xml/tests/Xslt/XslCompiledTransformApi/XslTransformMultith.cs @@ -36,7 +36,6 @@ public SameInstanceXslTransformTestCase(ITestOutputHelper output) : base(output) //[TestCase(Name = "Same instance testing: Transform() - READER")] [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/124344", typeof(PlatformDetection), nameof(PlatformDetection.IsAppleMobile), nameof(PlatformDetection.IsCoreCLR))] public class SameInstanceXslTransformReader : SameInstanceXslTransformTestCase { private XPathDocument _xd; // Loads XML file @@ -321,7 +320,6 @@ public void proc12() //[TestCase(Name = "Same instance testing: Transform() - TEXTWRITER")] [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/124344", typeof(PlatformDetection), nameof(PlatformDetection.IsAppleMobile), nameof(PlatformDetection.IsCoreCLR))] public class SameInstanceXslTransformWriter : SameInstanceXslTransformTestCase { private XPathDocument _xd; // Loads XML file diff --git a/src/libraries/System.Private.Xml/tests/Xslt/XslCompiledTransformApi/XsltApiV2.cs b/src/libraries/System.Private.Xml/tests/Xslt/XslCompiledTransformApi/XsltApiV2.cs index a4cee46f961fe2..7dc7693a689ead 100644 --- a/src/libraries/System.Private.Xml/tests/Xslt/XslCompiledTransformApi/XsltApiV2.cs +++ b/src/libraries/System.Private.Xml/tests/Xslt/XslCompiledTransformApi/XsltApiV2.cs @@ -38,6 +38,7 @@ public enum NavType // //////////////////////////////////////////////////////////////// [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/124344", typeof(PlatformDetection), nameof(PlatformDetection.IsAppleMobile), nameof(PlatformDetection.IsCoreCLR))] public class XsltApiTestCaseBase2 { // Generic data for all derived test cases diff --git a/src/libraries/System.Private.Xml/tests/Xslt/XslCompiledTransformApi/XsltArgumentList.cs b/src/libraries/System.Private.Xml/tests/Xslt/XslCompiledTransformApi/XsltArgumentList.cs index aaa6d171936e14..71de03fbcabc9e 100644 --- a/src/libraries/System.Private.Xml/tests/Xslt/XslCompiledTransformApi/XsltArgumentList.cs +++ b/src/libraries/System.Private.Xml/tests/Xslt/XslCompiledTransformApi/XsltArgumentList.cs @@ -18,7 +18,6 @@ namespace System.Xml.XslCompiledTransformApiTests //[TestCase(Name = "XsltArgumentList - GetParam", Desc = "Get Param Test Cases")] [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/124344", typeof(PlatformDetection), nameof(PlatformDetection.IsAppleMobile), nameof(PlatformDetection.IsCoreCLR))] public class CArgIntegrity : XsltApiTestCaseBase2 { private ITestOutputHelper _output; @@ -602,7 +601,6 @@ public void GetParam20() /***********************************************************/ //[TestCase(Name = "XsltArgumentList - GetExtensionObject", Desc = "XsltArgumentList.GetExtensionObject")] - [ActiveIssue("https://github.com/dotnet/runtime/issues/124344", typeof(PlatformDetection), nameof(PlatformDetection.IsAppleMobile), nameof(PlatformDetection.IsCoreCLR))] public class CArgGetExtObj : XsltApiTestCaseBase2 { private ITestOutputHelper _output; @@ -986,7 +984,6 @@ public void GetExtObject12() //[TestCase(Name = "XsltArgumentList - AddParam : Navigator, Stream", Desc = "NAVIGATOR,STREAM")] //[TestCase(Name = "XsltArgumentList - AddParam : Navigator, Writer", Desc = "NAVIGATOR,WRITER")] //[TestCase(Name = "XsltArgumentList - AddParam : Navigator, TextWriter", Desc = "NAVIGATOR,TEXTWRITER")] - [ActiveIssue("https://github.com/dotnet/runtime/issues/124344", typeof(PlatformDetection), nameof(PlatformDetection.IsAppleMobile), nameof(PlatformDetection.IsCoreCLR))] public class CArgAddParam : XsltApiTestCaseBase2 { private ITestOutputHelper _output; @@ -1691,7 +1688,6 @@ public void AddExtObject32(XslInputType xslInputType, ReaderType readerType, Out //[TestCase(Name = "XsltArgumentList - AddParam Misc : Navigator, Stream", Desc = "NAVIGATOR,STREAM")] //[TestCase(Name = "XsltArgumentList - AddParam Misc : Navigator, Writer", Desc = "NAVIGATOR,WRITER")] //[TestCase(Name = "XsltArgumentList - AddParam Misc : Navigator, TextWriter", Desc = "NAVIGATOR,TEXTWRITER")] - [ActiveIssue("https://github.com/dotnet/runtime/issues/124344", typeof(PlatformDetection), nameof(PlatformDetection.IsAppleMobile), nameof(PlatformDetection.IsCoreCLR))] public class CArgAddParamMisc : XsltApiTestCaseBase2 { private ITestOutputHelper _output; @@ -2419,7 +2415,6 @@ public void AddParam3(object param0, object param1, XslInputType xslInputType, R //[TestCase(Name = "XsltArgumentList - AddExtensionObject : Navigator, Stream", Desc = "NAVIGATOR,STREAM")] //[TestCase(Name = "XsltArgumentList - AddExtensionObject : Navigator, Writer", Desc = "NAVIGATOR,WRITER")] //[TestCase(Name = "XsltArgumentList - AddExtensionObject : Navigator, TextWriter", Desc = "NAVIGATOR,TEXTWRITER")] - [ActiveIssue("https://github.com/dotnet/runtime/issues/124344", typeof(PlatformDetection), nameof(PlatformDetection.IsAppleMobile), nameof(PlatformDetection.IsCoreCLR))] public class CArgAddExtObj : XsltApiTestCaseBase2 { private ITestOutputHelper _output; @@ -3396,7 +3391,6 @@ public int Increment() //[TestCase(Name = "XsltArgumentList - RemoveParam : URI, Stream", Desc = "URI,STREAM")] //[TestCase(Name = "XsltArgumentList - RemoveParam : Navigator, Writer", Desc = "NAVIGATOR,WRITER")] //[TestCase(Name = "XsltArgumentList - RemoveParam : Navigator, TextWriter", Desc = "NAVIGATOR,TEXTWRITER")] - [ActiveIssue("https://github.com/dotnet/runtime/issues/124344", typeof(PlatformDetection), nameof(PlatformDetection.IsAppleMobile), nameof(PlatformDetection.IsCoreCLR))] public class CArgRemoveParam : XsltApiTestCaseBase2 { private string _baseline = string.Empty; @@ -3956,7 +3950,6 @@ public void RemoveParam15() //[TestCase(Name = "XsltArgumentList - RemoveExtensionObject : Reader, TextWriter", Desc = "READER,TEXTWRITER")] //[TestCase(Name = "XsltArgumentList - RemoveExtensionObject : URI, Reader", Desc = "URI,READER")] //[TestCase(Name = "XsltArgumentList - RemoveExtensionObject : Navigator, Stream", Desc = "NAVIGATOR,STREAM")] - [ActiveIssue("https://github.com/dotnet/runtime/issues/124344", typeof(PlatformDetection), nameof(PlatformDetection.IsAppleMobile), nameof(PlatformDetection.IsCoreCLR))] public class CArgRemoveExtObj : XsltApiTestCaseBase2 { private ITestOutputHelper _output; @@ -4223,7 +4216,6 @@ public void RemoveExtObj9(object param, XslInputType xslInputType, ReaderType re /***********************************************************/ //[TestCase(Name = "XsltArgumentList - Clear", Desc = "XsltArgumentList.Clear")] - [ActiveIssue("https://github.com/dotnet/runtime/issues/124344", typeof(PlatformDetection), nameof(PlatformDetection.IsAppleMobile), nameof(PlatformDetection.IsCoreCLR))] public class CArgClear : XsltApiTestCaseBase2 { private ITestOutputHelper _output; @@ -4477,7 +4469,6 @@ public void Clear8(object param, XslInputType xslInputType, ReaderType readerTyp } //[TestCase(Name = "XsltArgumentList - Events", Desc = "Events raised by xsl:message")] - [ActiveIssue("https://github.com/dotnet/runtime/issues/124344", typeof(PlatformDetection), nameof(PlatformDetection.IsAppleMobile), nameof(PlatformDetection.IsCoreCLR))] public class XsltEvents : XsltApiTestCaseBase2 { public bool EventRaised; @@ -4602,7 +4593,6 @@ public void EventsTests(object param0, object param1, object param2, object para } //[TestCase(Name = "XPathNodeIterator Tests", Desc = "XPathNodeIterator Tests using XsltArgumentList")] - [ActiveIssue("https://github.com/dotnet/runtime/issues/124344", typeof(PlatformDetection), nameof(PlatformDetection.IsAppleMobile), nameof(PlatformDetection.IsCoreCLR))] public class XPathNodeIteratorTests : XsltApiTestCaseBase2 { private ITestOutputHelper _output; diff --git a/src/libraries/System.Private.Xml/tests/Xslt/XslCompiledTransformApi/XsltArgumentListMultith.cs b/src/libraries/System.Private.Xml/tests/Xslt/XslCompiledTransformApi/XsltArgumentListMultith.cs index cd3fc86f17324b..ef1e1b19c69a5d 100644 --- a/src/libraries/System.Private.Xml/tests/Xslt/XslCompiledTransformApi/XsltArgumentListMultith.cs +++ b/src/libraries/System.Private.Xml/tests/Xslt/XslCompiledTransformApi/XsltArgumentListMultith.cs @@ -56,7 +56,6 @@ public CSameInstanceXsltArgTestCase2(ITestOutputHelper output) : base(output) //[TestCase(Name = "Same instance testing: XsltArgList - GetParam", Desc = "GetParam test cases")] [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/124344", typeof(PlatformDetection), nameof(PlatformDetection.IsAppleMobile), nameof(PlatformDetection.IsCoreCLR))] public class CSameInstanceXsltArgumentListGetParam : CSameInstanceXsltArgTestCase2 { private ITestOutputHelper _output; @@ -143,7 +142,6 @@ public void proc2() //[TestCase(Name = "Same instance testing: XsltArgList - GetExtensionObject", Desc = "GetExtensionObject test cases")] [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/124344", typeof(PlatformDetection), nameof(PlatformDetection.IsAppleMobile), nameof(PlatformDetection.IsCoreCLR))] public class CSameInstanceXsltArgumentListGetExtnObject : CSameInstanceXsltArgTestCase2 { private ITestOutputHelper _output; @@ -229,7 +227,6 @@ public void proc2() //[TestCase(Name = "Same instance testing: XsltArgList - Transform", Desc = "Multiple transforms")] [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/124344", typeof(PlatformDetection), nameof(PlatformDetection.IsAppleMobile), nameof(PlatformDetection.IsCoreCLR))] public class CSameInstanceXsltArgumentListTransform : CSameInstanceXsltArgTestCase2 { private ITestOutputHelper _output; diff --git a/src/libraries/System.Private.Xml/tests/Xslt/XslCompiledTransformApi/XsltSettings.cs b/src/libraries/System.Private.Xml/tests/Xslt/XslCompiledTransformApi/XsltSettings.cs index fb730ce8345b45..a14896236f8cd1 100644 --- a/src/libraries/System.Private.Xml/tests/Xslt/XslCompiledTransformApi/XsltSettings.cs +++ b/src/libraries/System.Private.Xml/tests/Xslt/XslCompiledTransformApi/XsltSettings.cs @@ -14,7 +14,6 @@ namespace System.Xml.XslCompiledTransformApiTests //[TestCase(Name = "XsltSettings-Retail", Desc = "This testcase tests the different settings on XsltSettings and the corresponding behavior in retail mode", Param = "Retail")] //[TestCase(Name = "XsltSettings-Debug", Desc = "This testcase tests the different settings on XsltSettings and the corresponding behavior in debug mode", Param = "Debug")] [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/124344", typeof(PlatformDetection), nameof(PlatformDetection.IsAppleMobile), nameof(PlatformDetection.IsCoreCLR))] public class CXsltSettings : XsltApiTestCaseBase2 { private ITestOutputHelper _output; From 9a712d9b29a08bc3ec78c5167e2f09aa407bc417 Mon Sep 17 00:00:00 2001 From: Rachel Jarvi Date: Fri, 8 May 2026 08:39:25 -0700 Subject: [PATCH 061/109] Making IPC events platform neutral (#127943) * Widening VMPTR to 8 bytes * Widening LsPtr to 8 bytes * Wrapping IPC event fields in Portable<> for endianness independence * Misc event cleanup --- src/coreclr/debug/daccess/dacdbiimpl.cpp | 2 +- src/coreclr/debug/di/breakpoint.cpp | 4 +- src/coreclr/debug/di/divalue.cpp | 2 +- src/coreclr/debug/di/module.cpp | 6 +- src/coreclr/debug/di/process.cpp | 241 ++-------- src/coreclr/debug/di/rspriv.h | 16 +- src/coreclr/debug/di/rsthread.cpp | 24 +- src/coreclr/debug/di/shimcallback.cpp | 16 +- src/coreclr/debug/di/valuehome.cpp | 24 +- src/coreclr/debug/ee/debugger.cpp | 326 ++----------- src/coreclr/debug/ee/debugger.h | 31 +- src/coreclr/debug/ee/funceval.cpp | 78 ++-- src/coreclr/debug/inc/dbgipcevents.h | 428 +++++++----------- src/coreclr/debug/inc/dbgipceventtypes.h | 14 - .../debug/shared/dbgtransportsession.cpp | 48 +- src/coreclr/inc/dbgportable.h | 11 + src/coreclr/vm/dbginterface.h | 10 - src/coreclr/vm/eedbginterface.h | 3 - src/coreclr/vm/eedbginterfaceimpl.cpp | 11 - src/coreclr/vm/eedbginterfaceimpl.h | 3 - 20 files changed, 342 insertions(+), 956 deletions(-) diff --git a/src/coreclr/debug/daccess/dacdbiimpl.cpp b/src/coreclr/debug/daccess/dacdbiimpl.cpp index 693852eb063b94..bce89a76385ff1 100644 --- a/src/coreclr/debug/daccess/dacdbiimpl.cpp +++ b/src/coreclr/debug/daccess/dacdbiimpl.cpp @@ -1823,7 +1823,7 @@ TypeHandle DacDbiInterfaceImpl::TypeDataWalk::ReadLoadedTypeArg(TypeHandleReadTy switch (elementType) { case ELEMENT_TYPE_PTR: - _ASSERTE(pData->numTypeArgs == 1); + _ASSERTE(pData->numTypeArgs == (UINT)1); return PtrOrByRefTypeArg(pData, retrieveWhich); break; diff --git a/src/coreclr/debug/di/breakpoint.cpp b/src/coreclr/debug/di/breakpoint.cpp index 068bd111f9bce4..7ab55940df3c10 100644 --- a/src/coreclr/debug/di/breakpoint.cpp +++ b/src/coreclr/debug/di/breakpoint.cpp @@ -202,12 +202,12 @@ HRESULT CordbFunctionBreakpoint::Activate(BOOL fActivate) pEvent->BreakpointData.funcMetadataToken = m_code->GetMetadataToken(); pEvent->BreakpointData.vmAssembly = m_code->GetModule()->GetRuntimeAssembly(); - pEvent->BreakpointData.encVersion = m_code->GetVersion(); + pEvent->BreakpointData.encVersion = (UINT)(m_code->GetVersion()); BOOL codeIsIL = m_code->IsIL(); pEvent->BreakpointData.isIL = m_offsetIsIl ? true : false; - pEvent->BreakpointData.offset = m_offset; + pEvent->BreakpointData.offset = (UINT)m_offset; if (codeIsIL) { pEvent->BreakpointData.nativeCodeMethodDescToken = pEvent->BreakpointData.nativeCodeMethodDescToken.NullPtr(); diff --git a/src/coreclr/debug/di/divalue.cpp b/src/coreclr/debug/di/divalue.cpp index ab5883fc342fef..709b33281d8736 100644 --- a/src/coreclr/debug/di/divalue.cpp +++ b/src/coreclr/debug/di/divalue.cpp @@ -460,7 +460,7 @@ HRESULT CordbValue::InternalCreateHandle(CorDebugHandleType handleType, m_appdomain->GetADToken()); CORDB_ADDRESS addr = GetValueHome() != NULL ? GetValueHome()->GetAddress() : (CORDB_ADDRESS)NULL; - event.CreateHandle.objectToken = CORDB_ADDRESS_TO_PTR(addr); + event.CreateHandle.objectToken = addr; event.CreateHandle.handleType = handleType; // Note: two-way event here... diff --git a/src/coreclr/debug/di/module.cpp b/src/coreclr/debug/di/module.cpp index 5249fa264bb343..558fccbb0a34f7 100644 --- a/src/coreclr/debug/di/module.cpp +++ b/src/coreclr/debug/di/module.cpp @@ -424,7 +424,7 @@ class CleanupRemoteBuffer true, pModule->GetAppDomain()->GetADToken()); - event.MetadataUpdateRequest.pMetadataStart = CORDB_ADDRESS_TO_PTR(bufferMetaData.pAddress); + event.MetadataUpdateRequest.pMetadataStart = bufferMetaData.pAddress; // Note: two-way event here... IfFailThrow(pProcess->SendIPCEvent(&event, sizeof(DebuggerIPCEvent))); @@ -548,7 +548,7 @@ void CordbModule::RefreshMetaData() // // Update it on the RS // - bufferMetaData.Init(PTR_TO_CORDB_ADDRESS(event.MetadataUpdateRequest.pMetadataStart), (ULONG) event.MetadataUpdateRequest.nMetadataSize); + bufferMetaData.Init(event.MetadataUpdateRequest.pMetadataStart, (ULONG) event.MetadataUpdateRequest.nMetadataSize); // init the cleanup object to ensure the buffer gets destroyed later cleanup.bufferMetaData = bufferMetaData; @@ -2217,7 +2217,7 @@ HRESULT CordbModule::ApplyChangesInternal(ULONG cbMetaData, retEvent->type == DB_IPCE_ENC_ADD_FUNCTION) { // Update the function collection to reflect this edit - hr = pModule->UpdateFunction(retEvent->EnCUpdate.memberMetadataToken, retEvent->EnCUpdate.newVersionNumber, NULL); + hr = pModule->UpdateFunction(retEvent->EnCUpdate.memberMetadataToken, (SIZE_T)(ULONG64)retEvent->EnCUpdate.newVersionNumber, NULL); } // mark the class and relevant type as old so we update it next time we try to query it diff --git a/src/coreclr/debug/di/process.cpp b/src/coreclr/debug/di/process.cpp index b47cc24cf3b563..b779b5a990727c 100644 --- a/src/coreclr/debug/di/process.cpp +++ b/src/coreclr/debug/di/process.cpp @@ -4862,7 +4862,7 @@ void CordbProcess::RawDispatchEvent( { PUBLIC_CALLBACK_IN_THIS_SCOPE(this, pLockHolder, pEvent); - pCallback4->DataBreakpoint(static_cast(this), pThread, reinterpret_cast(&(pEvent->DataBreakpointData.context)), sizeof(CONTEXT)); + pCallback4->DataBreakpoint(static_cast(this), pThread, reinterpret_cast(&(pEvent->DataBreakpointData.context)), pEvent->DataBreakpointData.contextSize); } break; } @@ -5039,42 +5039,6 @@ void CordbProcess::RawDispatchEvent( } break; - case DB_IPCE_CREATE_CONNECTION: - { - STRESS_LOG1(LF_CORDB, LL_INFO100, - "RCET::HRCE: Connection change %d \n", - pEvent->CreateConnection.connectionId); - - // pass back the connection id and the connection name. - PUBLIC_CALLBACK_IN_THIS_SCOPE(this, pLockHolder, pEvent); - pCallback2->CreateConnection( - this, - pEvent->CreateConnection.connectionId, - const_cast (pEvent->CreateConnection.wzConnectionName.GetString())); - } - break; - - case DB_IPCE_DESTROY_CONNECTION: - { - STRESS_LOG1(LF_CORDB, LL_INFO100, - "RCET::HRCE: Connection destroyed %d \n", - pEvent->ConnectionChange.connectionId); - PUBLIC_CALLBACK_IN_THIS_SCOPE(this, pLockHolder, pEvent); - pCallback2->DestroyConnection(this, pEvent->ConnectionChange.connectionId); - } - break; - - case DB_IPCE_CHANGE_CONNECTION: - { - STRESS_LOG1(LF_CORDB, LL_INFO100, - "RCET::HRCE: Connection changed %d \n", - pEvent->ConnectionChange.connectionId); - - PUBLIC_CALLBACK_IN_THIS_SCOPE(this, pLockHolder, pEvent); - pCallback2->ChangeConnection(this, pEvent->ConnectionChange.connectionId); - } - break; - case DB_IPCE_UNLOAD_MODULE: { STRESS_LOG3(LF_CORDB, LL_INFO100, "RCET::HRCE: unload module on thread %#x Mod:0x%x AD:0x%08x\n", @@ -5206,49 +5170,48 @@ void CordbProcess::RawDispatchEvent( _ASSERTE(pThread != NULL); _ASSERTE(pAppDomain != NULL); - const WCHAR * pszContent = pEvent->FirstLogMessage.szContent.GetString(); + // Read category and content strings from target memory using + // the address and character count provided in the event. + ULONG cchCategory = pEvent->FirstLogMessage.cchCategory; + ULONG cchContent = pEvent->FirstLogMessage.cchContent; + + const ULONG cchMax = 0x10000; + if (cchCategory > cchMax || cchContent > cchMax) { - PUBLIC_CALLBACK_IN_THIS_SCOPE(this, pLockHolder, pEvent); - pCallback1->LogMessage( - pAppDomain, - pThread, - pEvent->FirstLogMessage.iLevel, - const_cast (pEvent->FirstLogMessage.szCategory.GetString()), - const_cast (pszContent)); + IfFailThrow(E_UNEXPECTED); } - } - break; - case DB_IPCE_LOGSWITCH_SET_MESSAGE: - { + NewArrayHolder wszCategory(new WCHAR[cchCategory + 1]); + ULONG32 cbRead; + ULONG32 cbExpected = cchCategory * sizeof(WCHAR); + IfFailThrow(m_pDACDataTarget->ReadVirtual( + pEvent->FirstLogMessage.szCategory, + reinterpret_cast((WCHAR *)wszCategory), + cbExpected, + &cbRead)); + wszCategory[cchCategory] = W('\0'); - LOG((LF_CORDB, LL_INFO10000, - "[%x] RCET::DRCE: Log Switch Setting Message.\n", - GetCurrentThreadId())); - - _ASSERTE(pThread != NULL); - - const WCHAR *pstrLogSwitchName = pEvent->LogSwitchSettingMessage.szSwitchName.GetString(); - const WCHAR *pstrParentName = pEvent->LogSwitchSettingMessage.szParentSwitchName.GetString(); - - // from the thread object get the appdomain object - _ASSERTE(pAppDomain == pThread->m_pAppDomain); - _ASSERTE (pAppDomain != NULL); + NewArrayHolder wszContent(new WCHAR[cchContent + 1]); + cbExpected = cchContent * sizeof(WCHAR); + IfFailThrow(m_pDACDataTarget->ReadVirtual( + pEvent->FirstLogMessage.szContent, + reinterpret_cast((WCHAR *)wszContent), + cbExpected, + &cbRead)); + wszContent[cchContent] = W('\0'); { PUBLIC_CALLBACK_IN_THIS_SCOPE(this, pLockHolder, pEvent); - pCallback1->LogSwitch( - pAppDomain, - pThread, - pEvent->LogSwitchSettingMessage.iLevel, - pEvent->LogSwitchSettingMessage.iReason, - const_cast (pstrLogSwitchName), - const_cast (pstrParentName)); - + pCallback1->LogMessage( + pAppDomain, + pThread, + pEvent->FirstLogMessage.iLevel, + wszCategory, + wszContent); } } - break; + case DB_IPCE_CUSTOM_NOTIFICATION: { _ASSERTE(pThread != NULL); @@ -5507,12 +5470,12 @@ void CordbProcess::RawDispatchEvent( // lookup the version of the function that we are mapping from // this is the one that is currently running pCurFunction = pModule->LookupOrCreateFunction( - pEvent->EnCRemap.funcMetadataToken, pEvent->EnCRemap.currentVersionNumber); + pEvent->EnCRemap.funcMetadataToken, (SIZE_T)(ULONG64)pEvent->EnCRemap.currentVersionNumber); // lookup the version of the function that we are mapping to // it will always be the most recent pResumeFunction = pModule->LookupOrCreateFunction( - pEvent->EnCRemap.funcMetadataToken, pEvent->EnCRemap.resumeVersionNumber); + pEvent->EnCRemap.funcMetadataToken, (SIZE_T)(ULONG64)pEvent->EnCRemap.resumeVersionNumber); _ASSERTE(pCurFunction->GetEnCVersionNumber() < pResumeFunction->GetEnCVersionNumber()); @@ -5525,7 +5488,7 @@ void CordbProcess::RawDispatchEvent( // We want to be absolutely sure we don't accidentally keep a stale pointer // around because it would point to arbitrary stack space in the CLR potentially // leading to stack corruption. - _ASSERTE( pThread->m_EnCRemapFunctionIP == NULL ); + _ASSERTE( pThread->m_EnCRemapFunctionIP == (CORDB_ADDRESS)0 ); // Stash the address of the remap IP buffer. This indicates that calling // RemapFunction is valid and provides a communications channel between the RS @@ -6027,7 +5990,7 @@ HRESULT CordbProcess::IsTransitionStub(CORDB_ADDRESS address, BOOL *pfTransition InitIPCEvent(&eventData, DB_IPCE_IS_TRANSITION_STUB, true, VMPTR_AppDomain::NullPtr()); - eventData.IsTransitionStub.address = CORDB_ADDRESS_TO_PTR(address); + eventData.IsTransitionStub.address = address; hr = SendIPCEvent(&eventData, sizeof(eventData)); hr = WORST_HR(hr, eventData.hr); @@ -8377,20 +8340,6 @@ COM_METHOD CordbProcess::ModifyLogSwitch(_In_z_ WCHAR *pLogSwitchName, LONG lLev ATT_REQUIRE_STOPPED_MAY_FAIL(this); HRESULT hr = S_OK; - - _ASSERTE (pLogSwitchName != NULL); - - DebuggerIPCEvent *event = (DebuggerIPCEvent*) _alloca(CorDBIPC_BUFFER_SIZE); - InitIPCEvent(event, DB_IPCE_MODIFY_LOGSWITCH, false, VMPTR_AppDomain::NullPtr()); - event->LogSwitchSettingMessage.iLevel = lLevel; - event->LogSwitchSettingMessage.szSwitchName.SetStringTruncate(pLogSwitchName); - - hr = m_cordb->SendIPCEvent(this, event, CorDBIPC_BUFFER_SIZE); - hr = WORST_HR(hr, event->hr); - - LOG((LF_CORDB, LL_INFO10000, "[%x] CP::ModifyLogSwitch: ModifyLogSwitch sent.\n", - GetCurrentThreadId())); - return hr; } @@ -9261,65 +9210,6 @@ void Ls_Rs_StringBuffer::CopyLSDataToRS(ICorDebugDataTarget * pTarget) } } -//--------------------------------------------------------------------------------------- -// Marshals the arguments in a managed-debug event. -// -// Arguments: -// pManagedEvent - (IN/OUT) debug event to marshal. Events are not usable in the host process -// until they are marshalled. This will marshal the event in-place, and may convert -// some target addresses to host addresses. -// -// Return Value: -// S_OK on success. Else Error. -// -// Assumptions: -// Target is currently stopped and inspectable. -// After the event is marshalled, it has resources that must be cleaned up -// by calling code:DeleteIPCEventHelper. -// -// Notes: -// Call a Copy function (CopyManagedEventFromTarget, CopyRCEventFromIPCBlock)to -// get the event to marshal. -// This will marshal args from the target into the host. -// The debug event is fixed size. But since the debuggee is stopped, this can copy -// arbitrary-length buffers out of of the debuggee. -// -// This could be rolled into code:CordbProcess::RawDispatchEvent -//--------------------------------------------------------------------------------------- -void CordbProcess::MarshalManagedEvent(DebuggerIPCEvent * pManagedEvent) -{ - CONTRACTL - { - THROWS; - - // Event has already been copied, now we do some quick Marshalling. - // Thsi should be a private local copy, and not the one in the IPC block or Target. - PRECONDITION(CheckPointer(pManagedEvent)); - } - CONTRACTL_END; - - IfFailThrow(pManagedEvent->hr); - - // This may throw part way through marshalling. But that's ok because - // code:DeleteIPCEventHelper can cleanup a partially-marshalled event. - - // Do a pre-processing on the event - switch (pManagedEvent->type & DB_IPCE_TYPE_MASK) - { - case DB_IPCE_FIRST_LOG_MESSAGE: - { - pManagedEvent->FirstLogMessage.szContent.CopyLSDataToRS(this->m_pDACDataTarget); - break; - } - - default: - break; - } - - -} - - //--------------------------------------------------------------------------------------- // Copy a managed debug event from the target process into this local process // @@ -9333,7 +9223,6 @@ void CordbProcess::MarshalManagedEvent(DebuggerIPCEvent * pManagedEvent) // * False if this does not belong to this instance of ICorDebug. (perhaps it's an event // intended for another instance of the CLR in the target, or some rogue user code happening // to use our exception code). -// In either case, the event can still be cleaned up via code:DeleteIPCEventHelper. // // Throws on error. In the error case, the contents of pLocalManagedEvent are undefined. // They may have been partially copied from the target. The local managed event does not own @@ -9347,7 +9236,6 @@ void CordbProcess::MarshalManagedEvent(DebuggerIPCEvent * pManagedEvent) // This should always succeed in the well-behaved case. However, A bad debuggee can // always send a poor-formed debug event. // We don't distinguish between a badly formed event and an event that's not ours. -// The event still needs to be Marshaled before being used. (see code:CordbProcess::MarshalManagedEvent) // //--------------------------------------------------------------------------------------- bool CordbProcess::CopyManagedEventFromTarget( @@ -9357,7 +9245,6 @@ bool CordbProcess::CopyManagedEventFromTarget( _ASSERTE(pRecord != NULL); _ASSERTE(pLocalManagedEvent != NULL); - // Initialize the event enough such backout code can call code:DeleteIPCEventHelper. pLocalManagedEvent->type = DB_IPCE_DEBUGGER_INVALID; // Ensure we have a CLR instance ID by now. Either we had one already, or we're in @@ -9460,7 +9347,6 @@ HRESULT CordbProcess::EnsureClrInstanceIdSet() // This is copying from a shared-memory block, which is treated as local memory. // This just does a raw Byte copy, but does not do any Marshalling. // This does no validation on the event. -// The event still needs to be Marshaled before being used. (see code:CordbProcess::MarshalManagedEvent) // //--------------------------------------------------------------------------------------- void inline CordbProcess::CopyRCEventFromIPCBlock(DebuggerIPCEvent * pLocalManagedEvent) @@ -9972,8 +9858,7 @@ void CordbProcess::HandleRCEvent( return; } - // Marshals over some standard data from event. - MarshalManagedEvent(pManagedEvent); + IfFailThrow(pManagedEvent->hr); STRESS_LOG4(LF_CORDB, LL_INFO1000, "RCET::TP: Got %s for AD 0x%x, proc 0x%x(%d)\n", IPCENames::GetName(pManagedEvent->type), VmPtrToCookie(pManagedEvent->vmAppDomain), this->m_id, this->m_id); @@ -10385,7 +10270,7 @@ HRESULT CordbRCEventThread::WaitForIPCEventFromProcess(CordbProcess * pProcess, EX_TRY { - pProcess->MarshalManagedEvent(pEvent); + IfFailThrow(pEvent->hr); STRESS_LOG4(LF_CORDB, LL_INFO1000, "CRCET::SIPCE: Got %s for AD 0x%x, proc 0x%x(%d)\n", IPCENames::GetName(pEvent->type), @@ -10611,44 +10496,6 @@ void CordbWin32EventThread::ThreadProc() #endif } -// Define a holder that calls code:DeleteIPCEventHelper -using DeleteIPCEventHolder = SpecializedWrapper; - -//--------------------------------------------------------------------------------------- -// -// Helper to clean up IPCEvent before deleting it. -// This must be called after an event is marshalled via code:CordbProcess::MarshalManagedEvent -// -// Arguments: -// pManagedEvent - managed event to delete. -// -// Notes: -// This can delete a partially marshalled event. -// -void DeleteIPCEventHelper(DebuggerIPCEvent *pManagedEvent) -{ - CONTRACTL - { - // This is backout code that shouldn't need to throw. - NOTHROW; - } - CONTRACTL_END; - if (pManagedEvent == NULL) - { - return; - } - switch (pManagedEvent->type & DB_IPCE_TYPE_MASK) - { - case DB_IPCE_FIRST_LOG_MESSAGE: - pManagedEvent->FirstLogMessage.szContent.CleanUp(); - break; - - default: - break; - } - delete [] (BYTE *)pManagedEvent; -} - //--------------------------------------------------------------------------------------- // Handle a CLR specific notification event. // @@ -11406,8 +11253,8 @@ HRESULT CordbProcess::Filter( // 2. Notifications may come on unmanaged threads if they're coming from MDAs or CLR internal events // fired before the thread is created. // - BYTE * pManagedEventBuffer = new BYTE[CorDBIPC_BUFFER_SIZE]; - DeleteIPCEventHolder pManagedEvent(reinterpret_cast(pManagedEventBuffer)); + NewArrayHolder pManagedEventBuffer(new BYTE[CorDBIPC_BUFFER_SIZE]); + DebuggerIPCEvent * pManagedEvent = reinterpret_cast(pManagedEventBuffer.GetValue()); bool fOwner = CopyManagedEventFromTarget(pRecord, pManagedEvent); if (fOwner) @@ -11421,8 +11268,6 @@ HRESULT CordbProcess::Filter( // up exceptions for the CLR. *pContinueStatus = DBG_CONTINUE; } - - // holder will invoke DeleteIPCEventHelper(pManagedEvent). } #ifdef OUT_OF_PROCESS_SETTHREADCONTEXT else if (dwFirstChance && pRecord->ExceptionCode == STATUS_BREAKPOINT) @@ -13186,7 +13031,7 @@ void CordbProcess::HandleDebugEventForInteropDebugging(const DEBUG_EVENT * pEven fcd.debugCounter = 0; SafeReadStruct(PTR_TO_CORDB_ADDRESS(pDebuggerWord), &fcd); - _ASSERTE(fcd.debugCounter == 1); + _ASSERTE(fcd.debugCounter == (UINT)1); DequeueUnmanagedEvent(pUnmanagedThread); } @@ -14724,7 +14569,7 @@ HRESULT CordbProcess::ReleaseRemoteBuffer(void **ppBuffer) VMPTR_AppDomain::NullPtr()); // Indicate the buffer to release - event.ReleaseBuffer.pBuffer = (*ppBuffer); + event.ReleaseBuffer.pBuffer = (CORDB_ADDRESS)(*ppBuffer); // Make the request, which is synchronous HRESULT hr = SendIPCEvent(&event, sizeof(event)); diff --git a/src/coreclr/debug/di/rspriv.h b/src/coreclr/debug/di/rspriv.h index 69f2876a8c1650..d376dea2ba6ebc 100644 --- a/src/coreclr/debug/di/rspriv.h +++ b/src/coreclr/debug/di/rspriv.h @@ -2743,9 +2743,6 @@ const int DEBUG_EVENTQUEUE_SIZE = 30; const int DEBUG_EVENTQUEUE_SIZE = 10; #endif -void DeleteIPCEventHelper(DebuggerIPCEvent *pDel); - - // Private interface on CordbProcess that ShimProcess needs to emulate V2 functionality. // The fact that we need private hooks means that V3 is not sufficiently finished to allow building // a V2 debugger. This interface should shrink over time (and eventually go away) as the functionality gets exposed @@ -3225,9 +3222,6 @@ class CordbProcess : // Queue the RC event. void QueueRCEvent(DebuggerIPCEvent * pManagedEvent); - // This marshals a managed debug event from the - void MarshalManagedEvent(DebuggerIPCEvent * pManagedEvent); - // This copies a managed debug event from the IPC block and to pManagedEvent. // The event still needs to be marshalled. void CopyRCEventFromIPCBlock(DebuggerIPCEvent * pManagedEvent); @@ -3423,9 +3417,7 @@ class CordbProcess : memset( ipce, 0, sizeof(DebuggerIPCEvent) ); _ASSERTE((!vmAppDomain.IsNull()) || - type == DB_IPCE_GET_GCHANDLE_INFO || type == DB_IPCE_ENABLE_LOG_MESSAGES || - type == DB_IPCE_MODIFY_LOGSWITCH || type == DB_IPCE_ASYNC_BREAK || type == DB_IPCE_CONTINUE || type == DB_IPCE_GET_BUFFER || @@ -3436,11 +3428,8 @@ class CordbProcess : type == DB_IPCE_CONTROL_C_EVENT_RESULT || type == DB_IPCE_SET_REFERENCE || type == DB_IPCE_SET_ALL_DEBUG_STATE || - type == DB_IPCE_GET_THREAD_FOR_TASKID || type == DB_IPCE_DETACH_FROM_PROCESS || type == DB_IPCE_INTERCEPT_EXCEPTION || - type == DB_IPCE_GET_NGEN_COMPILER_FLAGS || - type == DB_IPCE_SET_NGEN_COMPILER_FLAGS || type == DB_IPCE_SET_VALUE_CLASS); ipce->type = type; @@ -3450,7 +3439,6 @@ class CordbProcess : ipce->vmThread = VMPTR_Thread::NullPtr(); ipce->replyRequired = twoWay; ipce->asyncSend = false; - ipce->next = NULL; } // Looks up a previously constructed CordbClass instance without creating. May return NULL if the @@ -6255,7 +6243,7 @@ class CordbThread : public CordbBase, public ICorDebugThread, // we need to communicate the IP back to LS. So we stash the address of where // to store the IP here and stuff it in on RemapFunction. // If we're not at an outstanding RemapOpportunity, this will be NULL - REMOTE_PTR m_EnCRemapFunctionIP; + CORDB_ADDRESS m_EnCRemapFunctionIP; private: void ClearStackFrameCache(); @@ -9926,7 +9914,7 @@ class CordbEval : public CordbBase, public ICorDebugEval, public ICorDebugEval2 bool m_complete; bool m_successful; bool m_aborted; - void *m_resultAddr; + CORDB_ADDRESS m_resultAddr; // This is an OBJECTHANDLE on the LS if func-eval creates a strong handle. // This is a resource in the left-side and must be cleaned up in the left-side. diff --git a/src/coreclr/debug/di/rsthread.cpp b/src/coreclr/debug/di/rsthread.cpp index 5636d7bf48da3d..fe1bab685a1252 100644 --- a/src/coreclr/debug/di/rsthread.cpp +++ b/src/coreclr/debug/di/rsthread.cpp @@ -80,7 +80,7 @@ CordbThread::CordbThread(CordbProcess * pProcess, VMPTR_Thread vmThread) : m_fFloatStateValid(false), m_floatStackTop(0), m_fException(false), - m_EnCRemapFunctionIP(NULL), + m_EnCRemapFunctionIP(0), m_userState(kInvalidUserState), m_hCachedThread(INVALID_HANDLE_VALUE), m_hCachedOutOfProcThread(INVALID_HANDLE_VALUE) @@ -1340,7 +1340,7 @@ void CordbThread::MarkStackFramesDirty() // Clear the stashed EnC remap IP address if any // This is important to ensure we don't try to write into LS memory which is no longer // being used to hold the remap IP. - m_EnCRemapFunctionIP = NULL; + m_EnCRemapFunctionIP = 0; m_fContextFresh = false; // invalidate the cached active CONTEXT m_vmLeftSideContext = VMPTR_CONTEXT::NullPtr(); // set the LS pointer to the active CONTEXT to NULL @@ -2509,12 +2509,12 @@ HRESULT CordbThread::SetRemapIP(SIZE_T offset) } // Write the value of the remap offset into the left side - HRESULT hr = GetProcess()->SafeWriteStruct(PTR_TO_CORDB_ADDRESS(m_EnCRemapFunctionIP), &offset); + HRESULT hr = GetProcess()->SafeWriteStruct(m_EnCRemapFunctionIP, &offset); // Prevent SetRemapIP from being called twice for the same RemapOpportunity // If we don't get any calls to RemapFunction, this member will be cleared in // code:CordbThread::MarkStackFramesDirty when Continue is called - m_EnCRemapFunctionIP = NULL; + m_EnCRemapFunctionIP = 0; return hr; } @@ -9096,7 +9096,7 @@ CordbEval::CordbEval(CordbThread *pThread) m_complete(false), m_successful(false), m_aborted(false), - m_resultAddr(NULL), + m_resultAddr((CORDB_ADDRESS)0), m_evalDuringException(false) { m_vmObjectHandle = VMPTR_OBJECTHANDLE::NullPtr(); @@ -9274,12 +9274,12 @@ HRESULT CordbEval::GatherArgInfo(ICorDebugValue *pValue, pValue->GetAddress(&addr); - argData->argAddr = CORDB_ADDRESS_TO_PTR(addr); + argData->argAddr = addr; argData->argElementType = ty; argData->argIsHandleValue = false; argData->argIsLiteral = false; - argData->fullArgType = NULL; + argData->fullArgType = (CORDB_ADDRESS)0; argData->fullArgTypeNodeCount = 0; // We have to have knowledge of our value implementation here, @@ -9308,7 +9308,7 @@ HRESULT CordbEval::GatherArgInfo(ICorDebugValue *pValue, // buffer area so the left side can get it. CordbReferenceValue *rv; rv = static_cast(pValue); - argData->argIsLiteral = rv->CopyLiteralData(argData->argLiteralData); + argData->argIsLiteral = rv->CopyLiteralData(reinterpret_cast(argData->argLiteralData)); if (rv->GetValueHome()) { rv->GetValueHome()->CopyToIPCEType(&(argData->argHome)); @@ -9352,7 +9352,7 @@ HRESULT CordbEval::GatherArgInfo(ICorDebugValue *pValue, void *buffer = NULL; IfFailRet(m_thread->GetProcess()->GetAndWriteRemoteBuffer(m_thread->GetAppDomain(), bufferSize, bufferFrom, &buffer)); - argData->fullArgType = buffer; + argData->fullArgType = (CORDB_ADDRESS)buffer; argData->fullArgTypeNodeCount = fullArgTypeNodeCount; // Is it enregistered? if ((addr == (CORDB_ADDRESS)NULL) && (pVCObjVal->GetValueHome() != NULL)) @@ -9371,7 +9371,7 @@ HRESULT CordbEval::GatherArgInfo(ICorDebugValue *pValue, // Is this a literal value? If, we'll copy the data to the // buffer area so the left side can get it. CordbGenericValue *gv = (CordbGenericValue*)pValue; - argData->argIsLiteral = gv->CopyLiteralData(argData->argLiteralData); + argData->argIsLiteral = gv->CopyLiteralData(reinterpret_cast(argData->argLiteralData)); // Is it enregistered? if ((addr == (CORDB_ADDRESS)NULL) && (gv->GetValueHome() != NULL)) { @@ -10160,7 +10160,9 @@ HRESULT CordbEval::NewStringWithLength(LPCWSTR wszString, UINT iLength) // Length of the string? Don't account for null as COMString::NewString is length-based - SIZE_T cbString = iLength * sizeof(WCHAR); + if (iLength > UINT_MAX / sizeof(WCHAR)) + return E_INVALIDARG; + UINT cbString = (UINT)(iLength * sizeof(WCHAR)); // Remember that we're doing a func eval for a new string. m_function = NULL; diff --git a/src/coreclr/debug/di/shimcallback.cpp b/src/coreclr/debug/di/shimcallback.cpp index 98fe5d8f56ea12..7a4370440a0109 100644 --- a/src/coreclr/debug/di/shimcallback.cpp +++ b/src/coreclr/debug/di/shimcallback.cpp @@ -1372,7 +1372,7 @@ HRESULT ShimProxyCallback::DataBreakpoint(ICorDebugProcess* pProcess, ICorDebugT // callbacks parameters. These are strong references RSExtSmartPtr m_pProcess; RSExtSmartPtr m_pThread; - CONTEXT m_context; + NewArrayHolder m_context; ULONG32 m_contextSize; public: @@ -1383,14 +1383,20 @@ HRESULT ShimProxyCallback::DataBreakpoint(ICorDebugProcess* pProcess, ICorDebugT this->m_pProcess.Assign(pProcess); this->m_pThread.Assign(pThread); - _ASSERTE(contextSize == sizeof(CONTEXT)); - this->m_contextSize = min(contextSize, (ULONG32)sizeof(CONTEXT)); - memcpy(&(this->m_context), pContext, this->m_contextSize); + this->m_contextSize = min(contextSize, (ULONG32)0x1000); + if (pContext != NULL && this->m_contextSize > 0) + { + m_context = new (nothrow) BYTE[this->m_contextSize]; + if (m_context != NULL) + memcpy(m_context, pContext, this->m_contextSize); + } } HRESULT Dispatch(DispatchArgs args) { - return args.GetCallback4()->DataBreakpoint(m_pProcess, m_pThread, reinterpret_cast(&m_context), m_contextSize); + if (m_context == NULL) + return E_OUTOFMEMORY; + return args.GetCallback4()->DataBreakpoint(m_pProcess, m_pThread, m_context, m_contextSize); } }; // end class AfterGarbageCollectionEvent diff --git a/src/coreclr/debug/di/valuehome.cpp b/src/coreclr/debug/di/valuehome.cpp index 5a12b504b6241c..c9014871af9944 100644 --- a/src/coreclr/debug/di/valuehome.cpp +++ b/src/coreclr/debug/di/valuehome.cpp @@ -30,7 +30,7 @@ void RegValueHome::CopyToIPCEType(RemoteAddress * pRegAddr) { pRegAddr->kind = RAK_REG; pRegAddr->reg1 = m_reg1Info.m_kRegNumber; - pRegAddr->reg1Addr = CORDB_ADDRESS_TO_PTR(m_reg1Info.m_regAddr); + pRegAddr->reg1Addr = m_reg1Info.m_regAddr; pRegAddr->reg1Value = m_reg1Info.m_regValue; } // RegValueHome::CopyToIPCEType @@ -256,10 +256,10 @@ void RegRegValueHome::CopyToIPCEType(RemoteAddress * pRegAddr) { pRegAddr->kind = RAK_REGREG; pRegAddr->reg1 = m_reg1Info.m_kRegNumber; - pRegAddr->reg1Addr = CORDB_ADDRESS_TO_PTR(m_reg1Info.m_regAddr); + pRegAddr->reg1Addr = m_reg1Info.m_regAddr; pRegAddr->reg1Value = m_reg1Info.m_regValue; pRegAddr->u.reg2 = m_reg2Info.m_kRegNumber; - pRegAddr->u.reg2Addr = CORDB_ADDRESS_TO_PTR(m_reg2Info.m_regAddr); + pRegAddr->u.reg2Addr = m_reg2Info.m_regAddr; pRegAddr->u.reg2Value = m_reg2Info.m_regValue; } // RegRegValueHome::CopyToIPCEType @@ -317,7 +317,7 @@ void RegMemValueHome::CopyToIPCEType(RemoteAddress * pRegAddr) { pRegAddr->kind = RAK_REGMEM; pRegAddr->reg1 = m_reg1Info.m_kRegNumber; - pRegAddr->reg1Addr = CORDB_ADDRESS_TO_PTR(m_reg1Info.m_regAddr); + pRegAddr->reg1Addr = m_reg1Info.m_regAddr; pRegAddr->reg1Value = m_reg1Info.m_regValue; pRegAddr->addr = m_memAddr; } // RegMemValueHome::CopyToIPCEType @@ -379,7 +379,7 @@ void MemRegValueHome::CopyToIPCEType(RemoteAddress * pRegAddr) { pRegAddr->kind = RAK_MEMREG; pRegAddr->reg1 = m_reg1Info.m_kRegNumber; - pRegAddr->reg1Addr = CORDB_ADDRESS_TO_PTR(m_reg1Info.m_regAddr); + pRegAddr->reg1Addr = m_reg1Info.m_regAddr; pRegAddr->reg1Value = m_reg1Info.m_regValue; pRegAddr->addr = m_memAddr; } // MemRegValueHome::CopyToIPCEType @@ -440,7 +440,7 @@ void MemRegValueHome::GetEnregisteredValue(MemoryRange valueOutBuffer) void FloatRegValueHome::CopyToIPCEType(RemoteAddress * pRegAddr) { pRegAddr->kind = RAK_FLOAT; - pRegAddr->reg1Addr = NULL; + pRegAddr->reg1Addr = (CORDB_ADDRESS)0; pRegAddr->floatIndex = m_floatIndex; } // FloatRegValueHome::CopyToIPCEType @@ -915,9 +915,9 @@ void HandleValueHome::SetValue(MemoryRange src, CordbType * pType) m_pProcess->InitIPCEvent(&event, DB_IPCE_SET_REFERENCE, true, VMPTR_AppDomain::NullPtr()); - event.SetReference.objectRefAddress = NULL; + event.SetReference.objectRefAddress = (CORDB_ADDRESS)0; event.SetReference.vmObjectHandle = m_vmObjectHandle; - event.SetReference.newReference = *((void **)src.StartAddress()); + event.SetReference.newReference = PTR_TO_CORDB_ADDRESS(*((void **)src.StartAddress())); // Note: two-way event here... IfFailThrow(m_pProcess->SendIPCEvent(&event, sizeof(DebuggerIPCEvent))); @@ -985,8 +985,8 @@ void VCRemoteValueHome::SetValue(MemoryRange src, CordbType * pType) // Finally, send over the Set Value Class message. m_pProcess->InitIPCEvent(&event, DB_IPCE_SET_VALUE_CLASS, true, VMPTR_AppDomain::NullPtr()); - event.SetValueClass.oldData = CORDB_ADDRESS_TO_PTR(m_remoteValue.pAddress); - event.SetValueClass.newData = buffer; + event.SetValueClass.oldData = m_remoteValue.pAddress; + event.SetValueClass.newData = PTR_TO_CORDB_ADDRESS(buffer); IfFailThrow(pType->TypeToBasicTypeData(&event.SetValueClass.type)); // Note: two-way event here... @@ -1044,9 +1044,9 @@ void RefRemoteValueHome::SetValue(MemoryRange src, CordbType * pType) m_pProcess->InitIPCEvent(&event, DB_IPCE_SET_REFERENCE, true, VMPTR_AppDomain::NullPtr()); - event.SetReference.objectRefAddress = CORDB_ADDRESS_TO_PTR(m_remoteValue.pAddress); + event.SetReference.objectRefAddress = m_remoteValue.pAddress; event.SetReference.vmObjectHandle = VMPTR_OBJECTHANDLE::NullPtr(); - event.SetReference.newReference = *((void **)src.StartAddress()); + event.SetReference.newReference = PTR_TO_CORDB_ADDRESS(*((void **)src.StartAddress())); // Note: two-way event here... IfFailThrow(m_pProcess->SendIPCEvent(&event, sizeof(DebuggerIPCEvent))); diff --git a/src/coreclr/debug/ee/debugger.cpp b/src/coreclr/debug/ee/debugger.cpp index 37ee6590142c02..561f7c73d5f61f 100644 --- a/src/coreclr/debug/ee/debugger.cpp +++ b/src/coreclr/debug/ee/debugger.cpp @@ -5769,6 +5769,7 @@ void Debugger::SendDataBreakpoint(Thread *thread, CONTEXT *context, // Send a breakpoint event to the Right Side DebuggerIPCEvent* ipce = m_pRCThread->GetIPCEventSendBuffer(); memcpy(&(ipce->DataBreakpointData.context), context, sizeof(CONTEXT)); + ipce->DataBreakpointData.contextSize = sizeof(CONTEXT); InitIPCEvent(ipce, DB_IPCE_DATA_BREAKPOINT, thread); @@ -6000,7 +6001,7 @@ void Debugger::LockAndSendEnCRemapEvent(DebuggerJitInfo * dji, SIZE_T currentIP, ipce->EnCRemap.currentVersionNumber = dji->m_encVersion; ipce->EnCRemap.resumeVersionNumber = dji->m_methodInfo->GetCurrentEnCVersion();; ipce->EnCRemap.currentILOffset = currentIP; - ipce->EnCRemap.resumeILOffset = resumeIP; + ipce->EnCRemap.resumeILOffset = PTR_TO_CORDB_ADDRESS(resumeIP); ipce->EnCRemap.funcMetadataToken = pMD->GetMemberDef(); LOG((LF_CORDB, LL_INFO10000, "D::LASEnCRE: methodDef 0x%x, from version %zx to %zx\n", @@ -7159,7 +7160,7 @@ HRESULT Debugger::SendExceptionHelperAndBlock( ipce->ExceptionCallback2.framePointer = framePointer; ipce->ExceptionCallback2.eventType = eventType; - ipce->ExceptionCallback2.nOffset = nOffset; + ipce->ExceptionCallback2.nOffset = (UINT)nOffset; ipce->ExceptionCallback2.dwFlags = dwFlags; ipce->ExceptionCallback2.vmExceptionHandle.SetRawPtr(exceptionHandle); @@ -7312,7 +7313,7 @@ void Debugger::SendExceptionEventsWorker( ipce->ExceptionCallback2.framePointer = framePointer; ipce->ExceptionCallback2.eventType = DEBUG_EXCEPTION_USER_FIRST_CHANCE; - ipce->ExceptionCallback2.nOffset = nOffset; + ipce->ExceptionCallback2.nOffset = (UINT)nOffset; ipce->ExceptionCallback2.dwFlags = fIsInterceptable ? DEBUG_EXCEPTION_CAN_BE_INTERCEPTED : 0; ipce->ExceptionCallback2.vmExceptionHandle.SetRawPtr(g_pEEInterface->GetThreadException(pThread)); @@ -7971,7 +7972,7 @@ void Debugger::SendCatchHandlerFound( ipce->ExceptionCallback2.framePointer = fp; ipce->ExceptionCallback2.eventType = DEBUG_EXCEPTION_CATCH_HANDLER_FOUND; - ipce->ExceptionCallback2.nOffset = nOffset; + ipce->ExceptionCallback2.nOffset = (UINT)nOffset; ipce->ExceptionCallback2.dwFlags = dwFlags; ipce->ExceptionCallback2.vmExceptionHandle.SetRawPtr(g_pEEInterface->GetThreadException(pThread)); @@ -9754,7 +9755,7 @@ void Debugger::FuncEvalComplete(Thread* pThread, DebuggerEval *pDE) ipce->FuncEvalComplete.funcEvalKey = pDE->m_funcEvalKey; ipce->FuncEvalComplete.successful = pDE->m_successful; ipce->FuncEvalComplete.aborted = pDE->m_aborted; - ipce->FuncEvalComplete.resultAddr = pDE->m_result; + ipce->FuncEvalComplete.resultAddr = (CORDB_ADDRESS)(pDE->m_result); ipce->FuncEvalComplete.vmAppDomain.SetRawPtr(pDomain); ipce->FuncEvalComplete.vmObjectHandle = pDE->m_vmObjectHandle; @@ -9768,11 +9769,11 @@ void Debugger::FuncEvalComplete(Thread* pThread, DebuggerEval *pDE) _ASSERTE(ipce->FuncEvalComplete.resultType.elementType != ELEMENT_TYPE_VALUETYPE); // We must adjust the result address to point to the right place - ipce->FuncEvalComplete.resultAddr = ArgSlotEndiannessFixup((ARG_SLOT*)ipce->FuncEvalComplete.resultAddr, - GetSizeForCorElementType(ipce->FuncEvalComplete.resultType.elementType)); + ipce->FuncEvalComplete.resultAddr = (CORDB_ADDRESS)(ArgSlotEndiannessFixup((ARG_SLOT*)(CORDB_ADDRESS_TO_PTR(ipce->FuncEvalComplete.resultAddr)), + GetSizeForCorElementType(ipce->FuncEvalComplete.resultType.elementType))); LOG((LF_CORDB, LL_INFO1000, "D::FEC: returned el %04x resultAddr %p\n", - ipce->FuncEvalComplete.resultType.elementType, ipce->FuncEvalComplete.resultAddr)); + ipce->FuncEvalComplete.resultType.elementType, (CORDB_ADDRESS_TO_PTR(ipce->FuncEvalComplete.resultAddr)))); m_pRCThread->SendIPCEvent(); @@ -10482,39 +10483,6 @@ bool Debugger::HandleIPCEvent(DebuggerIPCEvent * pEvent) } break; - case DB_IPCE_GET_GCHANDLE_INFO: - // Given an unvalidated GC-handle, find out all the info about it to view the object - // at the other end - { - OBJECTHANDLE objectHandle = pEvent->GetGCHandleInfo.GCHandle.GetRawPtr(); - - DebuggerIPCEvent * pIPCResult = m_pRCThread->GetIPCEventReceiveBuffer(); - - _ASSERTE(pIPCResult != NULL); - - InitIPCEvent(pIPCResult, DB_IPCE_GET_GCHANDLE_INFO_RESULT, NULL); - - bool fValid = SUCCEEDED(ValidateGCHandle(objectHandle)); - - AppDomain * pAppDomain = NULL; - - if(fValid) - { - // Get the appdomain - pAppDomain = AppDomain::GetCurrentDomain(); - - _ASSERTE(pAppDomain != NULL); - } - - pIPCResult->hr = S_OK; - pIPCResult->GetGCHandleInfoResult.vmAppDomain.SetRawPtr(pAppDomain); - pIPCResult->GetGCHandleInfoResult.fValid = fValid; - - m_pRCThread->SendIPCReply(); - - } - break; - case DB_IPCE_GET_BUFFER: { GetAndSendBuffer(m_pRCThread, pEvent->GetBuffer.bufSize); @@ -10523,7 +10491,7 @@ bool Debugger::HandleIPCEvent(DebuggerIPCEvent * pEvent) case DB_IPCE_RELEASE_BUFFER: { - SendReleaseBuffer(m_pRCThread, pEvent->ReleaseBuffer.pBuffer); + SendReleaseBuffer(m_pRCThread, (CORDB_ADDRESS_TO_PTR(pEvent->ReleaseBuffer.pBuffer))); } break; #ifdef FEATURE_METADATA_UPDATER @@ -10562,13 +10530,7 @@ bool Debugger::HandleIPCEvent(DebuggerIPCEvent * pEvent) break; case DB_IPCE_IS_TRANSITION_STUB: - GetAndSendTransitionStubInfo((CORDB_ADDRESS_TYPE*)pEvent->IsTransitionStub.address); - break; - - case DB_IPCE_MODIFY_LOGSWITCH: - g_pEEInterface->DebuggerModifyingLogSwitch (pEvent->LogSwitchSettingMessage.iLevel, - pEvent->LogSwitchSettingMessage.szSwitchName.GetString()); - + GetAndSendTransitionStubInfo((CORDB_ADDRESS_TYPE*)(CORDB_ADDRESS_TO_PTR(pEvent->IsTransitionStub.address))); break; case DB_IPCE_ENABLE_LOG_MESSAGES: @@ -10622,7 +10584,7 @@ bool Debugger::HandleIPCEvent(DebuggerIPCEvent * pEvent) pModule, pEvent->SetIP.mdMethod, pDJI, - pEvent->SetIP.offset, + (SIZE_T)pEvent->SetIP.offset, pEvent->SetIP.fIsIL ); } @@ -10751,9 +10713,9 @@ bool Debugger::HandleIPCEvent(DebuggerIPCEvent * pEvent) InitIPCReply(pEvent, DB_IPCE_SET_REFERENCE_RESULT); - pEvent->hr = SetReference(pEvent->SetReference.objectRefAddress, + pEvent->hr = SetReference(CORDB_ADDRESS_TO_PTR(pEvent->SetReference.objectRefAddress), pEvent->SetReference.vmObjectHandle, - pEvent->SetReference.newReference); + CORDB_ADDRESS_TO_PTR(pEvent->SetReference.newReference)); // Send the result of how the set reference went. m_pRCThread->SendIPCReply(); @@ -10767,8 +10729,8 @@ bool Debugger::HandleIPCEvent(DebuggerIPCEvent * pEvent) InitIPCReply(pEvent, DB_IPCE_SET_VALUE_CLASS_RESULT); - pEvent->hr = SetValueClass(pEvent->SetValueClass.oldData, - pEvent->SetValueClass.newData, + pEvent->hr = SetValueClass(CORDB_ADDRESS_TO_PTR(pEvent->SetValueClass.oldData), + CORDB_ADDRESS_TO_PTR(pEvent->SetValueClass.newData), &pEvent->SetValueClass.type); // Send the result of how the set reference went. @@ -10776,25 +10738,9 @@ bool Debugger::HandleIPCEvent(DebuggerIPCEvent * pEvent) } break; - case DB_IPCE_GET_THREAD_FOR_TASKID: - { - Thread *pThreadRet = NULL; - - // This is a synchronous event (reply required) - pEvent = m_pRCThread->GetIPCEventReceiveBuffer(); - - InitIPCReply(pEvent, DB_IPCE_GET_THREAD_FOR_TASKID_RESULT); - - pEvent->GetThreadForTaskIdResult.vmThreadToken.SetRawPtr(pThreadRet); - pEvent->hr = S_OK; - - m_pRCThread->SendIPCReply(); - } - break; - case DB_IPCE_CREATE_HANDLE: { - Object * pObject = (Object*)pEvent->CreateHandle.objectToken; + Object * pObject = (Object*)(CORDB_ADDRESS_TO_PTR(pEvent->CreateHandle.objectToken)); OBJECTREF objref = ObjectToOBJECTREF(pObject); AppDomain * pAppDomain = pEvent->vmAppDomain.GetRawPtr(); CorDebugHandleType handleType = pEvent->CreateHandle.handleType; @@ -10933,7 +10879,7 @@ bool Debugger::HandleIPCEvent(DebuggerIPCEvent * pEvent) DebuggerModule * pDebuggerModule = LookupOrCreateModule(pEvent->SetJMCFunctionStatus.vmAssembly); Module * pModule = pDebuggerModule->GetRuntimeModule(); - bool fStatus = (pEvent->SetJMCFunctionStatus.dwStatus != 0); + bool fStatus = (pEvent->SetJMCFunctionStatus.dwStatus != (DWORD)0); mdMethodDef token = pEvent->SetJMCFunctionStatus.funcMetadataToken; @@ -11014,7 +10960,7 @@ bool Debugger::HandleIPCEvent(DebuggerIPCEvent * pEvent) // Get data out of event DebuggerModule * pDebuggerModule = LookupOrCreateModule(pEvent->SetJMCFunctionStatus.vmAssembly); - bool fStatus = (pEvent->SetJMCFunctionStatus.dwStatus != 0); + bool fStatus = (pEvent->SetJMCFunctionStatus.dwStatus != (DWORD)0); // Prepare reply pEvent = m_pRCThread->GetIPCEventReceiveBuffer(); @@ -11078,7 +11024,7 @@ bool Debugger::HandleIPCEvent(DebuggerIPCEvent * pEvent) DebuggerIPCEvent * pResult = m_pRCThread->GetIPCEventReceiveBuffer(); InitIPCEvent(pResult, DB_IPCE_RESOLVE_UPDATE_METADATA_1_RESULT, NULL); - pResult->MetadataUpdateRequest.pMetadataStart = pData; + pResult->MetadataUpdateRequest.pMetadataStart = PTR_TO_CORDB_ADDRESS(pData); pResult->MetadataUpdateRequest.nMetadataSize = countBytes; pResult->hr = hr; LOG((LF_CORDB, LL_INFO1000000, "D::HIPCE metadataStart=0x%x, nMetadataSize=0x%x\n", pData, countBytes)); @@ -11091,7 +11037,7 @@ bool Debugger::HandleIPCEvent(DebuggerIPCEvent * pEvent) case DB_IPCE_RESOLVE_UPDATE_METADATA_2: { // Delete memory allocated with DB_IPCE_RESOLVE_UPDATE_METADATA_1. - BYTE * pData = (BYTE *) pEvent->MetadataUpdateRequest.pMetadataStart; + BYTE * pData = (BYTE *)(CORDB_ADDRESS_TO_PTR(pEvent->MetadataUpdateRequest.pMetadataStart)); DeleteInteropSafe(pData); DebuggerIPCEvent * pResult = m_pRCThread->GetIPCEventReceiveBuffer(); @@ -11723,7 +11669,7 @@ TypeHandle Debugger::TypeDataWalk::ReadTypeHandle() case ELEMENT_TYPE_SZARRAY: case ELEMENT_TYPE_PTR: case ELEMENT_TYPE_BYREF: - if(data->numTypeArgs == 1) + if(data->numTypeArgs == (UINT)1) { TypeHandle typar = ReadTypeHandle(); switch (et) @@ -11830,7 +11776,9 @@ HRESULT Debugger::GetAndSendBuffer(DebuggerRCThread* rcThread, ULONG bufSize) InitIPCEvent(event, DB_IPCE_GET_BUFFER_RESULT, NULL); // Allocate the buffer - event->GetBufferResult.hr = AllocateRemoteBuffer( bufSize, &event->GetBufferResult.pBuffer ); + void* pBuffer = NULL; + event->GetBufferResult.hr = AllocateRemoteBuffer( bufSize, &pBuffer ); + event->GetBufferResult.pBuffer = (CORDB_ADDRESS)pBuffer; // Send the result return rcThread->SendIPCReply(); @@ -13462,9 +13410,9 @@ LONG Debugger::FirstChanceSuspendHijackWorker(CONTEXT *pContext, // Signal the RS to tell us what to do SPEW(fprintf(stderr, "0x%x D::FCHF: Signaling hijack started.\n", tid)); SignalHijackStarted(); - SPEW(fprintf(stderr, "0x%x D::FCHF: Signaling hijack started complete. DebugCounter=0x%x\n", tid, pFcd->debugCounter)); + SPEW(fprintf(stderr, "0x%x D::FCHF: Signaling hijack started complete. DebugCounter=0x%x\n", tid, (UINT)pFcd->debugCounter)); - if (pFcd->action == HIJACK_ACTION_WAIT) + if ((HijackAction)pFcd->action == HIJACK_ACTION_WAIT) { // This exception does NOT belong to the CLR. // If we belong to the CLR, then we either: @@ -13513,10 +13461,10 @@ LONG Debugger::FirstChanceSuspendHijackWorker(CONTEXT *pContext, SPEW(fprintf(stderr, "0x%x D::FCHF: signaling HijackComplete.\n", tid)); SignalHijackComplete(); - SPEW(fprintf(stderr, "0x%x D::FCHF: done signaling HijackComplete. DebugCounter=0x%x\n", tid, pFcd->debugCounter)); + SPEW(fprintf(stderr, "0x%x D::FCHF: done signaling HijackComplete. DebugCounter=0x%x\n", tid, (UINT)pFcd->debugCounter)); // we should know what we are about to do now - _ASSERTE(pFcd->action != HIJACK_ACTION_WAIT); + _ASSERTE((HijackAction)pFcd->action != HIJACK_ACTION_WAIT); // cleanup from above SPEW(fprintf(stderr, "0x%x D::FCHF: set debugger word = NULL.\n", tid)); @@ -13524,7 +13472,7 @@ LONG Debugger::FirstChanceSuspendHijackWorker(CONTEXT *pContext, } // end can't stop region - if (pFcd->action == HIJACK_ACTION_EXIT_HANDLED) + if ((HijackAction)pFcd->action == HIJACK_ACTION_EXIT_HANDLED) { SPEW(fprintf(stderr, "0x%x D::FCHF: exiting with CONTINUE_EXECUTION\n", tid)); #if defined(OUT_OF_PROCESS_SETTHREADCONTEXT) && !defined(DACCESS_COMPILE) @@ -13538,7 +13486,7 @@ LONG Debugger::FirstChanceSuspendHijackWorker(CONTEXT *pContext, else { SPEW(fprintf(stderr, "0x%x D::FCHF: exiting with CONTINUE_SEARCH\n", tid)); - _ASSERTE(pFcd->action == HIJACK_ACTION_EXIT_UNHANDLED); + _ASSERTE((HijackAction)pFcd->action == HIJACK_ACTION_EXIT_UNHANDLED); return EXCEPTION_CONTINUE_SEARCH; } } @@ -13919,24 +13867,6 @@ Debugger::InsertToMethodInfoList( DebuggerMethodInfo *dmi ) return hr; } -//----------------------------------------------------------------------------- -// Helper to get an SString through the IPC buffer. -// We do this by putting the SString data into a LS_RS_buffer object, -// and then the RS reads it out as soon as it's queued. -// It's very very important that the SString's buffer is around while we send the event. -// So we pass the SString by reference in case there's an implicit conversion (because -// we don't want to do the conversion on a temporary object and then lose that object). -//----------------------------------------------------------------------------- -void SetLSBufferFromSString(Ls_Rs_StringBuffer * pBuffer, SString & str) -{ - // Copy string contents (+1 for null terminator) into a LS_RS_Buffer. - // Then the RS can pull it out as a null-terminated string. - pBuffer->SetLsData( - (BYTE*) str.GetUnicode(), - (str.GetCount() +1)* sizeof(WCHAR) - ); -} - //************************************************************* // This method sends a log message over to the right side for the debugger to log it. // @@ -14022,76 +13952,14 @@ void Debugger::SendRawLogMessage( pThread); ipce->FirstLogMessage.iLevel = iLevel; - ipce->FirstLogMessage.szCategory.SetString(pCategory->GetUnicode()); - SetLSBufferFromSString(&ipce->FirstLogMessage.szContent, *pMessage); + ipce->FirstLogMessage.szCategory = PTR_TO_CORDB_ADDRESS(pCategory->GetUnicode()); + ipce->FirstLogMessage.cchCategory = (ULONG)pCategory->GetCount(); + ipce->FirstLogMessage.szContent = PTR_TO_CORDB_ADDRESS(pMessage->GetUnicode()); + ipce->FirstLogMessage.cchContent = (ULONG)pMessage->GetCount(); m_pRCThread->SendIPCEvent(); } - -// This function sends a message to the right side informing it about -// the creation/modification of a LogSwitch -void Debugger::SendLogSwitchSetting(int iLevel, - int iReason, - _In_z_ LPCWSTR pLogSwitchName, - _In_z_ LPCWSTR pParentSwitchName) -{ - CONTRACTL - { - MAY_DO_HELPER_THREAD_DUTY_THROWS_CONTRACT; - MAY_DO_HELPER_THREAD_DUTY_GC_TRIGGERS_CONTRACT; - } - CONTRACTL_END; - -#ifdef LOGGING - MAKE_UTF8PTR_FROMWIDE(pLogSwitchNameUtf8, pLogSwitchName); - MAKE_UTF8PTR_FROMWIDE(pParentSwitchNameUtf8, pParentSwitchName); - LOG((LF_CORDB, LL_INFO1000, "D::SLSS: Sending log switch message switch=%s parent=%s.\n", - pLogSwitchNameUtf8, pParentSwitchNameUtf8)); -#endif // LOGGING - - // Send the message only if the debugger is attached to this appdomain. - if (!CORDebuggerAttached()) - { - return; - } - - Thread *pThread = g_pEEInterface->GetThread(); - SENDIPCEVENT_BEGIN(this, pThread); - - if (CORDebuggerAttached()) - { - DebuggerIPCEvent* ipce = m_pRCThread->GetIPCEventSendBuffer(); - InitIPCEvent(ipce, - DB_IPCE_LOGSWITCH_SET_MESSAGE, - pThread); - - ipce->LogSwitchSettingMessage.iLevel = iLevel; - ipce->LogSwitchSettingMessage.iReason = iReason; - - - ipce->LogSwitchSettingMessage.szSwitchName.SetString(pLogSwitchName); - - if (pParentSwitchName == NULL) - { - pParentSwitchName = W(""); - } - - ipce->LogSwitchSettingMessage.szParentSwitchName.SetString(pParentSwitchName); - - m_pRCThread->SendIPCEvent(); - - // Stop all Runtime threads - TrapAllRuntimeThreads(); - } - else - { - LOG((LF_CORDB,LL_INFO1000, "D::SLSS: Skipping SendIPCEvent because RS detached.")); - } - - SENDIPCEVENT_END; -} - // send a custom debugger notification to the RS // Arguments: // input: pThread - thread on which the notification occurred @@ -15107,130 +14975,6 @@ BOOL Debugger::IsThreadContextInvalid(Thread *pThread, CONTEXT *pCtx) return invalid; } - -// notification when a SQL connection begins -void Debugger::CreateConnection(CONNID dwConnectionId, _In_z_ WCHAR *wzName) -{ - CONTRACTL - { - MAY_DO_HELPER_THREAD_DUTY_THROWS_CONTRACT; - MAY_DO_HELPER_THREAD_DUTY_GC_TRIGGERS_CONTRACT; - } - CONTRACTL_END; - - LOG((LF_CORDB,LL_INFO1000, "D::CreateConnection %d\n.", dwConnectionId)); - - if (CORDBUnrecoverableError(this)) - return; - - Thread *pThread = g_pEEInterface->GetThread(); - SENDIPCEVENT_BEGIN(this, pThread); - - if (CORDebuggerAttached()) - { - DebuggerIPCEvent* ipce; - - // Send a update module syns event to the Right Side. - ipce = m_pRCThread->GetIPCEventSendBuffer(); - InitIPCEvent(ipce, DB_IPCE_CREATE_CONNECTION, - pThread); - ipce->CreateConnection.connectionId = dwConnectionId; - _ASSERTE(wzName != NULL); - ipce->CreateConnection.wzConnectionName.SetString(wzName); - - m_pRCThread->SendIPCEvent(); - } - else - { - LOG((LF_CORDB,LL_INFO1000, "D::CreateConnection: Skipping SendIPCEvent because RS detached.")); - } - - // Stop all Runtime threads if we actually sent an event - if (CORDebuggerAttached()) - { - TrapAllRuntimeThreads(); - } - - SENDIPCEVENT_END; -} - -// notification when a SQL connection ends -void Debugger::DestroyConnection(CONNID dwConnectionId) -{ - CONTRACTL - { - MAY_DO_HELPER_THREAD_DUTY_THROWS_CONTRACT; - MAY_DO_HELPER_THREAD_DUTY_GC_TRIGGERS_CONTRACT; - } - CONTRACTL_END; - - LOG((LF_CORDB,LL_INFO1000, "D::DestroyConnection %d\n.", dwConnectionId)); - - if (CORDBUnrecoverableError(this)) - return; - - Thread *thread = g_pEEInterface->GetThread(); - // Note that the debugger lock is reentrant, so we may or may not hold it already. - SENDIPCEVENT_BEGIN(this, thread); - - // Send a update module syns event to the Right Side. - DebuggerIPCEvent* ipce = m_pRCThread->GetIPCEventSendBuffer(); - InitIPCEvent(ipce, DB_IPCE_DESTROY_CONNECTION, - thread); - ipce->ConnectionChange.connectionId = dwConnectionId; - - // IPC event is now initialized, so we can send it over. - SendSimpleIPCEventAndBlock(); - - // This will block on the continue - SENDIPCEVENT_END; - -} - -// notification for SQL connection changes -void Debugger::ChangeConnection(CONNID dwConnectionId) -{ - CONTRACTL - { - MAY_DO_HELPER_THREAD_DUTY_THROWS_CONTRACT; - MAY_DO_HELPER_THREAD_DUTY_GC_TRIGGERS_CONTRACT; - } - CONTRACTL_END; - - LOG((LF_CORDB,LL_INFO1000, "D::ChangeConnection %d\n.", dwConnectionId)); - - if (CORDBUnrecoverableError(this)) - return; - - Thread *pThread = g_pEEInterface->GetThread(); - SENDIPCEVENT_BEGIN(this, pThread); - - if (CORDebuggerAttached()) - { - DebuggerIPCEvent* ipce; - - // Send a update module syns event to the Right Side. - ipce = m_pRCThread->GetIPCEventSendBuffer(); - InitIPCEvent(ipce, DB_IPCE_CHANGE_CONNECTION, - pThread); - ipce->ConnectionChange.connectionId = dwConnectionId; - m_pRCThread->SendIPCEvent(); - } - else - { - LOG((LF_CORDB,LL_INFO1000, "D::ChangeConnection: Skipping SendIPCEvent because RS detached.")); - } - - // Stop all Runtime threads if we actually sent an event - if (CORDebuggerAttached()) - { - TrapAllRuntimeThreads(); - } - - SENDIPCEVENT_END; -} - - // // Are we the helper thread? // Some important things about running on the helper thread: diff --git a/src/coreclr/debug/ee/debugger.h b/src/coreclr/debug/ee/debugger.h index 20139885d95316..08bb7ffe2815e9 100644 --- a/src/coreclr/debug/ee/debugger.h +++ b/src/coreclr/debug/ee/debugger.h @@ -776,8 +776,6 @@ class DebuggerRCThread #endif _ASSERTE(m_pDCB != NULL); - // In case this turns into a continuation event - GetRCThreadSendBuffer()->next = NULL; LOG((LF_CORDB,LL_EVERYTHING, "GIPCESBuffer: got event %p\n", GetRCThreadSendBuffer())); return GetRCThreadSendBuffer(); @@ -2133,15 +2131,6 @@ class Debugger : public DebugInterface HRESULT GetAndSendInterceptCommand(DebuggerIPCEvent *event); - //HRESULT GetAndSendJITFunctionData(DebuggerRCThread* rcThread, - // mdMethodDef methodToken, - // void* functionModuleToken); - HRESULT GetFuncData(mdMethodDef funcMetadataToken, - DebuggerModule* pDebuggerModule, - SIZE_T nVersion, - DebuggerIPCE_FuncData *data); - - // The following four functions convert between type handles and the data that is // shipped for types to and from the right-side. // @@ -2200,12 +2189,6 @@ class Debugger : public DebugInterface }; - - - HRESULT GetMethodDescData(MethodDesc *pFD, - DebuggerJitInfo *pJITInfo, - DebuggerIPCE_JITFuncData *data); - void GetAndSendTransitionStubInfo(CORDB_ADDRESS_TYPE *stubAddress); void SendBreakpoint(Thread *thread, T_CONTEXT *context, @@ -2484,11 +2467,6 @@ class Debugger : public DebugInterface SString * pSwitchName, SString * pMessage); - void SendLogSwitchSetting (int iLevel, - int iReason, - _In_z_ LPCWSTR pLogSwitchName, - _In_z_ LPCWSTR pParentSwitchName); - bool IsLoggingEnabled (void) { LIMITED_METHOD_CONTRACT; @@ -2558,11 +2536,6 @@ class Debugger : public DebugInterface BOOL IsThreadContextInvalid(Thread *pThread, T_CONTEXT *pCtx); - // notification for SQL fiber debugging support - void CreateConnection(CONNID dwConnectionId, _In_z_ WCHAR *wzName); - void DestroyConnection(CONNID dwConnectionId); - void ChangeConnection(CONNID dwConnectionId); - // // This function is used to identify the helper thread. // @@ -3525,10 +3498,10 @@ class DebuggerEval DebuggerIPCE_FuncEvalArgData *argData = GetArgData(); for (unsigned int i = 0; i < m_argCount; i++) { - if (argData[i].fullArgType != NULL) + if (argData[i].fullArgType != (CORDB_ADDRESS)0) { _ASSERTE(g_pDebugger != NULL); - g_pDebugger->ReleaseRemoteBuffer((BYTE*)argData[i].fullArgType, true); + g_pDebugger->ReleaseRemoteBuffer((BYTE*)CORDB_ADDRESS_TO_PTR(argData[i].fullArgType), true); } } diff --git a/src/coreclr/debug/ee/funceval.cpp b/src/coreclr/debug/ee/funceval.cpp index d40c71c6d4daff..263beaa911bbfc 100644 --- a/src/coreclr/debug/ee/funceval.cpp +++ b/src/coreclr/debug/ee/funceval.cpp @@ -258,7 +258,7 @@ static void ValidateFuncEvalReturnType(DebuggerIPCE_FuncEvalType evalType, Metho // // Given a register, return the value. // -static SIZE_T GetRegisterValue(DebuggerEval *pDE, CorDebugRegister reg, void *regAddr, SIZE_T regValue) +static SIZE_T GetRegisterValue(DebuggerEval *pDE, CorDebugRegister reg, CORDB_ADDRESS regAddr, ULONG64 regValue) { LIMITED_METHOD_CONTRACT; @@ -267,9 +267,9 @@ static SIZE_T GetRegisterValue(DebuggerEval *pDE, CorDebugRegister reg, void *re // Check whether the register address is the marker value for a register in a non-leaf frame. // This is related to the funceval breaking change. // - if (regAddr == CORDB_ADDRESS_TO_PTR(kNonLeafFrameRegAddr)) + if (regAddr == kNonLeafFrameRegAddr) { - ret = regValue; + ret = (SIZE_T)regValue; } else { @@ -472,7 +472,7 @@ static SIZE_T GetRegisterValue(DebuggerEval *pDE, CorDebugRegister reg, void *re // // Given a register, set its value. // -static void SetRegisterValue(DebuggerEval *pDE, CorDebugRegister reg, void *regAddr, SIZE_T newValue) +static void SetRegisterValue(DebuggerEval *pDE, CorDebugRegister reg, CORDB_ADDRESS regAddr, SIZE_T newValue) { CONTRACTL { @@ -482,7 +482,7 @@ static void SetRegisterValue(DebuggerEval *pDE, CorDebugRegister reg, void *regA // Check whether the register address is the marker value for a register in a non-leaf frame. // If so, then we can't update the register. Throw an exception to communicate this error. - if (regAddr == CORDB_ADDRESS_TO_PTR(kNonLeafFrameRegAddr)) + if (regAddr == kNonLeafFrameRegAddr) { COMPlusThrowHR(CORDBG_E_FUNC_EVAL_CANNOT_UPDATE_REGISTER_IN_NONLEAF_FRAME); return; @@ -874,7 +874,7 @@ static void GetFuncEvalArgValue(DebuggerEval *pDE, LPVOID pAddr = NULL; INT64 bigVal = 0; - if (pFEAD->argAddr != NULL) + if (pFEAD->argAddr != (CORDB_ADDRESS)0) { pAddr = *((void **)pMaybeInteriorPtrArg); } @@ -907,7 +907,7 @@ static void GetFuncEvalArgValue(DebuggerEval *pDE, } else { - _ASSERTE(pFEAD->argAddr != NULL); + _ASSERTE(pFEAD->argAddr != (CORDB_ADDRESS)0); #if defined(ENREGISTERED_PARAMTYPE_MAXSIZE) if (ArgIterator::IsArgPassedByRef(argTH)) { @@ -946,7 +946,7 @@ static void GetFuncEvalArgValue(DebuggerEval *pDE, } else { - if (pFEAD->argAddr) + if (pFEAD->argAddr != (CORDB_ADDRESS)0) { *pArgument = PtrToArgSlot(pAddr); } @@ -996,7 +996,7 @@ static void GetFuncEvalArgValue(DebuggerEval *pDE, pSource = pBufferArg; } - if (pFEAD->argAddr != NULL) + if (pFEAD->argAddr != (CORDB_ADDRESS)0) { if (!isByRef) { @@ -1262,7 +1262,7 @@ static void SetFuncEvalByRefArgValue(DebuggerEval *pDE, // If this was a literal arg, then copy the updated primitive back into the literal. memcpy(pFEAD->argLiteralData, &source, sizeof(pFEAD->argLiteralData)); } - else if (pFEAD->argAddr != NULL) + else if (pFEAD->argAddr != (CORDB_ADDRESS)0) { *((INT64 *)byRefMaybeInteriorPtrArg) = source; return; @@ -1344,7 +1344,7 @@ static void SetFuncEvalByRefArgValue(DebuggerEval *pDE, memcpy(pFEAD->argLiteralData, &source, sizeof(source)); } } - else if (pFEAD->argAddr == NULL) + else if (pFEAD->argAddr == (CORDB_ADDRESS)0) { // If the 32bit value is enregistered, copy it back to the proper regs. @@ -1442,9 +1442,9 @@ static void GCProtectAllPassedArgs(DebuggerEval *pDE, // In case any of the arguments is a by ref argument and points into the GC heap, // we need to GC protect their addresses as well. - if (pFEAD->argAddr != NULL) + if (pFEAD->argAddr != (CORDB_ADDRESS)0) { - pByRefMaybeInteriorPtrArray[currArgIndex] = pFEAD->argAddr; + pByRefMaybeInteriorPtrArray[currArgIndex] = CORDB_ADDRESS_TO_PTR(pFEAD->argAddr); } switch (pFEAD->argElementType) @@ -1460,9 +1460,9 @@ static void GCProtectAllPassedArgs(DebuggerEval *pDE, // _ASSERTE(sizeof(void *) == sizeof(INT64)); - if (pFEAD->argAddr != NULL) + if (pFEAD->argAddr != (CORDB_ADDRESS)0) { - pMaybeInteriorPtrArray[currArgIndex] = *((void **)(pFEAD->argAddr)); + pMaybeInteriorPtrArray[currArgIndex] = *((void **)CORDB_ADDRESS_TO_PTR(pFEAD->argAddr)); #ifdef _DEBUG if (currArgIndex < MAX_DATA_LOCATIONS_TRACKED) { @@ -1510,9 +1510,9 @@ static void GCProtectAllPassedArgs(DebuggerEval *pDE, // // If the value type address could be an interior pointer. // - if (pFEAD->argAddr != NULL) + if (pFEAD->argAddr != (CORDB_ADDRESS)0) { - pMaybeInteriorPtrArray[currArgIndex] = ((void **)(pFEAD->argAddr)); + pMaybeInteriorPtrArray[currArgIndex] = ((void **)CORDB_ADDRESS_TO_PTR(pFEAD->argAddr)); } INDEBUG(pDataLocationArray[currArgIndex] |= DL_MaybeInteriorPtrArray); @@ -1524,18 +1524,18 @@ static void GCProtectAllPassedArgs(DebuggerEval *pDE, case ELEMENT_TYPE_ARRAY: case ELEMENT_TYPE_SZARRAY: - if (pFEAD->argAddr != NULL) + if (pFEAD->argAddr != (CORDB_ADDRESS)0) { if (pFEAD->argIsHandleValue) { - OBJECTHANDLE oh = (OBJECTHANDLE)(pFEAD->argAddr); + OBJECTHANDLE oh = (OBJECTHANDLE)CORDB_ADDRESS_TO_PTR(pFEAD->argAddr); pBufferForArgsArray[currArgIndex] = (INT64)(size_t)oh; INDEBUG(pDataLocationArray[currArgIndex] |= DL_BufferForArgsArray); } else { - pObjectRefArray[currArgIndex] = *((OBJECTREF *)(pFEAD->argAddr)); + pObjectRefArray[currArgIndex] = *((OBJECTREF *)CORDB_ADDRESS_TO_PTR(pFEAD->argAddr)); INDEBUG(pDataLocationArray[currArgIndex] |= DL_ObjectRefArray); } @@ -1580,7 +1580,7 @@ static void GCProtectAllPassedArgs(DebuggerEval *pDE, #ifdef TARGET_X86 _ASSERTE(sizeof(void *) == sizeof(INT32)); - if (pFEAD->argAddr != NULL) + if (pFEAD->argAddr != (CORDB_ADDRESS)0) { if (pFEAD->argIsHandleValue) { @@ -1590,7 +1590,7 @@ static void GCProtectAllPassedArgs(DebuggerEval *pDE, } else { - pMaybeInteriorPtrArray[currArgIndex] = *((void **)(pFEAD->argAddr)); + pMaybeInteriorPtrArray[currArgIndex] = *((void **)CORDB_ADDRESS_TO_PTR(pFEAD->argAddr)); #ifdef _DEBUG if (currArgIndex < MAX_DATA_LOCATIONS_TRACKED) { @@ -1792,7 +1792,7 @@ void BoxFuncEvalThisParameter(DebuggerEval *pDE, { GCX_FORBID(); //pAddr is unprotected from the time we initialize it - if (pFEAD->argAddr != NULL) + if (pFEAD->argAddr != (CORDB_ADDRESS)0) { _ASSERTE(pDataLocationArray[0] & DL_MaybeInteriorPtrArray); pAddr = pMaybeInteriorPtrArray[0]; @@ -1821,8 +1821,8 @@ void BoxFuncEvalThisParameter(DebuggerEval *pDE, // type yet). // // A buffer should have been allocated for the full struct type - _ASSERTE(argData[0].fullArgType != NULL); - Debugger::TypeDataWalk walk((DebuggerIPCE_TypeArgData *) argData[0].fullArgType, argData[0].fullArgTypeNodeCount); + _ASSERTE(argData[0].fullArgType != (CORDB_ADDRESS)0); + Debugger::TypeDataWalk walk((DebuggerIPCE_TypeArgData *) CORDB_ADDRESS_TO_PTR(argData[0].fullArgType), argData[0].fullArgTypeNodeCount); TypeHandle typeHandle = walk.ReadTypeHandle(); @@ -2019,7 +2019,7 @@ void BoxFuncEvalArguments(DebuggerEval *pDE, INT64 bigVal; LPVOID pAddr = NULL; - if (pFEAD->argAddr != NULL) + if (pFEAD->argAddr != (CORDB_ADDRESS)0) { _ASSERTE(pDataLocationArray[currArgIndex] & DL_MaybeInteriorPtrArray); pAddr = pMaybeInteriorPtrArray[currArgIndex]; @@ -2124,7 +2124,7 @@ void GatherFuncEvalMethodInfo(DebuggerEval *pDE, // We should have a valid this pointer. // @todo: But the check should cover the register kind as well! // - if ((argData[0].argHome.kind == RAK_NONE) && (argData[0].argAddr == NULL)) + if ((argData[0].argHome.kind == RAK_NONE) && (argData[0].argAddr == (CORDB_ADDRESS)0)) { COMPlusThrow(kArgumentNullException); } @@ -2330,9 +2330,9 @@ void CopyArgsToBuffer(DebuggerEval *pDE, case ELEMENT_TYPE_U8: case ELEMENT_TYPE_R8: - if (pFEAD->argAddr != NULL) + if (pFEAD->argAddr != (CORDB_ADDRESS)0) { - *pDest = *(INT64*)(pFEAD->argAddr); + *pDest = *(INT64*)CORDB_ADDRESS_TO_PTR(pFEAD->argAddr); #ifdef _DEBUG if (currArgIndex < MAX_DATA_LOCATIONS_TRACKED) { @@ -2405,18 +2405,18 @@ void CopyArgsToBuffer(DebuggerEval *pDE, case ELEMENT_TYPE_ARRAY: case ELEMENT_TYPE_SZARRAY: - if (pFEAD->argAddr != NULL) + if (pFEAD->argAddr != (CORDB_ADDRESS)0) { if (!isByRef) { if (pFEAD->argIsHandleValue) { - OBJECTHANDLE oh = (OBJECTHANDLE)(pFEAD->argAddr); + OBJECTHANDLE oh = (OBJECTHANDLE)CORDB_ADDRESS_TO_PTR(pFEAD->argAddr); *pDest = (INT64)(size_t)oh; } else { - *pDest = *((SIZE_T*)(pFEAD->argAddr)); + *pDest = *((SIZE_T*)CORDB_ADDRESS_TO_PTR(pFEAD->argAddr)); } #ifdef _DEBUG if (currArgIndex < MAX_DATA_LOCATIONS_TRACKED) @@ -2429,11 +2429,11 @@ void CopyArgsToBuffer(DebuggerEval *pDE, { if (pFEAD->argIsHandleValue) { - *pDest = (INT64)(size_t)(pFEAD->argAddr); + *pDest = (INT64)(size_t)CORDB_ADDRESS_TO_PTR(pFEAD->argAddr); } else { - *pDest = *(SIZE_T*)(pFEAD->argAddr); + *pDest = *(SIZE_T*)CORDB_ADDRESS_TO_PTR(pFEAD->argAddr); } #ifdef _DEBUG if (currArgIndex < MAX_DATA_LOCATIONS_TRACKED) @@ -2497,19 +2497,19 @@ void CopyArgsToBuffer(DebuggerEval *pDE, default: // 4-byte, 2-byte, or 1-byte values - if (pFEAD->argAddr != NULL) + if (pFEAD->argAddr != (CORDB_ADDRESS)0) { if (!isByRef) { if (pFEAD->argIsHandleValue) { - OBJECTHANDLE oh = (OBJECTHANDLE)(pFEAD->argAddr); + OBJECTHANDLE oh = (OBJECTHANDLE)CORDB_ADDRESS_TO_PTR(pFEAD->argAddr); *pDest = (INT64)(size_t)oh; } else { GetAndSetLiteralValue(pDest, pFEArgInfo[currArgIndex].argSigType, - pFEAD->argAddr, pFEAD->argElementType); + CORDB_ADDRESS_TO_PTR(pFEAD->argAddr), pFEAD->argElementType); } #ifdef _DEBUG if (currArgIndex < MAX_DATA_LOCATIONS_TRACKED) @@ -2533,7 +2533,7 @@ void CopyArgsToBuffer(DebuggerEval *pDE, // be bashing memory right next to the source value as the function being called acts upon some // bigger value. GetAndSetLiteralValue(pDest, pFEArgInfo[currArgIndex].byrefArgSigType, - pFEAD->argAddr, pFEAD->argElementType); + CORDB_ADDRESS_TO_PTR(pFEAD->argAddr), pFEAD->argElementType); } #ifdef _DEBUG if (currArgIndex < MAX_DATA_LOCATIONS_TRACKED) @@ -2566,7 +2566,7 @@ void CopyArgsToBuffer(DebuggerEval *pDE, CorElementType relevantType = (isByRef ? pFEArgInfo[currArgIndex].byrefArgSigType : pFEArgInfo[currArgIndex].argSigType); - GetAndSetLiteralValue(pDest, relevantType, pFEAD->argLiteralData, pFEAD->argElementType); + GetAndSetLiteralValue(pDest, relevantType, CORDB_ADDRESS_TO_PTR(pFEAD->argLiteralData), pFEAD->argElementType); #ifdef _DEBUG if (currArgIndex < MAX_DATA_LOCATIONS_TRACKED) { diff --git a/src/coreclr/debug/inc/dbgipcevents.h b/src/coreclr/debug/inc/dbgipcevents.h index 5affc01830077a..a9a9bceaaa01d7 100644 --- a/src/coreclr/debug/inc/dbgipcevents.h +++ b/src/coreclr/debug/inc/dbgipcevents.h @@ -377,10 +377,10 @@ class MSLAYOUT GeneralLsPointer { protected: friend ULONG_PTR LsPtrToCookie(GeneralLsPointer p); - void * m_ptr; + Portable m_ptr; public: - bool IsNull() { return m_ptr == NULL; } + bool IsNull() { return m_ptr == (CORDB_ADDRESS)0; } }; class MSLAYOUT GeneralRsPointer @@ -394,7 +394,7 @@ class MSLAYOUT GeneralRsPointer // In some cases, we need to get a uuid from a pointer (ie, in a hash) inline ULONG_PTR LsPtrToCookie(GeneralLsPointer p) { - return (ULONG_PTR) p.m_ptr; + return (ULONG_PTR)(CORDB_ADDRESS)p.m_ptr; } #define VmPtrToCookie(vm) LsPtrToCookie((vm).ToLsPtr()) @@ -414,11 +414,11 @@ class MSLAYOUT LsPointer : public GeneralLsPointer public: void Set(void * p) { - m_ptr = p; + m_ptr = PTR_TO_CORDB_ADDRESS(p); } void * UnsafeGet() { - return m_ptr; + return CORDB_ADDRESS_TO_PTR((CORDB_ADDRESS)m_ptr); } static LsPointer NullPtr() @@ -433,8 +433,8 @@ class MSLAYOUT LsPointer : public GeneralLsPointer return t; } - bool operator!= (void * p) { return m_ptr != p; } - bool operator== (void * p) { return m_ptr == p; } + bool operator!= (void * p) { return (CORDB_ADDRESS)m_ptr != PTR_TO_CORDB_ADDRESS(p); } + bool operator== (void * p) { return (CORDB_ADDRESS)m_ptr == PTR_TO_CORDB_ADDRESS(p); } bool operator==(LsPointer p) { return p.m_ptr == this->m_ptr; } // We should never UnWrap() them in the RS, so we don't define that here. @@ -525,8 +525,8 @@ class MSLAYOUT LsPointer : public GeneralLsPointer return t; } - bool operator!= (void * p) { return m_ptr != p; } - bool operator== (void * p) { return m_ptr == p; } + bool operator!= (void * p) { return (CORDB_ADDRESS)m_ptr != PTR_TO_CORDB_ADDRESS(p); } + bool operator== (void * p) { return (CORDB_ADDRESS)m_ptr == PTR_TO_CORDB_ADDRESS(p); } bool operator==(LsPointer p) { return p.m_ptr == this->m_ptr; } // @todo - we want to be able to swap out Set + Unwrap functions @@ -534,13 +534,13 @@ class MSLAYOUT LsPointer : public GeneralLsPointer { SUPPORTS_DAC; // We could validate the pointer here. - m_ptr = p; + m_ptr = PTR_TO_CORDB_ADDRESS(p); } T * UnWrap() { // If we wanted to validate the pointer, here's our chance. - return static_cast(m_ptr); + return reinterpret_cast(CORDB_ADDRESS_TO_PTR((CORDB_ADDRESS)m_ptr)); } }; @@ -570,12 +570,6 @@ class MSLAYOUT RsPointer : public GeneralRsPointer #endif // !RIGHT_SIDE_COMPILE -// We must be binary compatible w/ a pointer. -static_assert(sizeof(LsPointer) == sizeof(GeneralLsPointer)); - -static_assert(sizeof(void*) == sizeof(GeneralLsPointer)); - - //----------------------------------------------------------------------------- // Definitions for Left-Side ptrs. @@ -649,7 +643,7 @@ class MSLAYOUT VMPTR_Base // - In DAC: must be marshalled to a host-pointer and then they can be used via DAC // - In RS: opaque handles. private: - TADDR m_addr; + Portable m_addr; public: typedef VMPTR_Base VMPTR_This; @@ -665,7 +659,7 @@ class MSLAYOUT VMPTR_Base TDacPtr GetDacPtr() const { SUPPORTS_DAC; - return TDacPtr(m_addr); + return TDacPtr((TADDR)m_addr); } @@ -675,13 +669,13 @@ class MSLAYOUT VMPTR_Base void SetDacTargetPtr(TADDR addr) { SUPPORTS_DAC; - m_addr = addr; + m_addr = (CORDB_ADDRESS)addr; } void SetHostPtr(const TTargetPtr * pObject) { SUPPORTS_DAC; - m_addr = PTR_HOST_TO_TADDR(pObject); + m_addr = (CORDB_ADDRESS)PTR_HOST_TO_TADDR(pObject); } @@ -695,7 +689,7 @@ class MSLAYOUT VMPTR_Base // This is commonly used by the Left-side to create a VMPTR_ for a notification event. void SetRawPtr(TTargetPtr * ptr) { - m_addr = reinterpret_cast(ptr); + m_addr = PTR_TO_CORDB_ADDRESS(ptr); } // This will get the raw underlying target pointer. @@ -703,7 +697,7 @@ class MSLAYOUT VMPTR_Base // hijack or in-proc worker threads) TTargetPtr * GetRawPtr() { - return reinterpret_cast(m_addr); + return reinterpret_cast((TADDR)m_addr); } // Convenience for converting TTargetPtr --> VMPTR @@ -729,21 +723,21 @@ class MSLAYOUT VMPTR_Base // @dbgtodo inspection: LSPTRs will go away entirely once we've moved completely over to DAC LsPointer ToLsPtr() { - return LsPointer::MakePtr( reinterpret_cast(m_addr)); + return LsPointer::MakePtr( reinterpret_cast((TADDR)m_addr)); } #endif // // Operators to emulate Pointer semantics. // - bool IsNull() { SUPPORTS_DAC; return m_addr == (TADDR)0; } + bool IsNull() { SUPPORTS_DAC; return m_addr == (CORDB_ADDRESS)0; } static VMPTR_This NullPtr() { SUPPORTS_DAC; VMPTR_This dummy; - dummy.m_addr = (TADDR)NULL; + dummy.m_addr = (CORDB_ADDRESS)NULL; return dummy; } @@ -1263,7 +1257,6 @@ inline bool IsEqualOrCloserToRoot(FramePointer fp1, FramePointer fp2) return !IsCloserToLeaf(fp1, fp2); } - // struct DebuggerIPCE_FuncData: DebuggerIPCE_FuncData holds data // to describe a given function, its // class, and a little bit about the code for the function. This is used @@ -1462,8 +1455,8 @@ struct MSLAYOUT DebuggerIPCE_STRData struct MSLAYOUT DebuggerIPCE_BasicTypeData { - CorElementType elementType; - mdTypeDef metadataToken; + Portable elementType; + Portable metadataToken; VMPTR_Assembly vmAssembly; VMPTR_TypeHandle vmTypeHandle; }; @@ -1489,7 +1482,7 @@ struct MSLAYOUT DebuggerIPCE_BasicTypeData // struct MSLAYOUT DebuggerIPCE_ExpandedTypeData { - CorElementType elementType; // Note this is _never_ E_T_VAR, E_T_WITH or E_T_MVAR + Portable elementType; // Note this is _never_ E_T_VAR, E_T_WITH or E_T_MVAR union MSLAYOUT { // used for E_T_CLASS and E_T_VALUECLASS, E_T_PTR, E_T_BYREF etc. @@ -1497,15 +1490,15 @@ struct MSLAYOUT DebuggerIPCE_ExpandedTypeData // For constructed E_T_CLASS or E_T_VALUECLASS the tokens will be set and the typeHandle will be non-NULL // For E_T_PTR etc. the tokens will be NULL and the typeHandle will be non-NULL. struct MSLAYOUT - { - mdTypeDef metadataToken; - VMPTR_Assembly vmAssembly; + { + Portable metadataToken; + VMPTR_Assembly vmAssembly; VMPTR_TypeHandle typeHandle; // if non-null then further fetches will be needed to get type arguments } ClassTypeData; // used for E_T_PTR, E_T_BYREF etc. struct MSLAYOUT - { + { DebuggerIPCE_BasicTypeData unaryTypeArg; // used only when sending back to debugger } UnaryTypeData; @@ -1513,13 +1506,13 @@ struct MSLAYOUT DebuggerIPCE_ExpandedTypeData // used for E_T_ARRAY etc. struct MSLAYOUT { - DebuggerIPCE_BasicTypeData arrayTypeArg; // used only when sending back to debugger - DWORD arrayRank; + DebuggerIPCE_BasicTypeData arrayTypeArg; // used only when sending back to debugger + Portable arrayRank; } ArrayTypeData; // used for E_T_FNPTR struct MSLAYOUT - { + { VMPTR_TypeHandle typeHandle; // if non-null then further fetches needed to get type arguments } NaryTypeData; @@ -1536,8 +1529,8 @@ struct MSLAYOUT DebuggerIPCE_ExpandedTypeData // flattened type argument data. struct MSLAYOUT DebuggerIPCE_TypeArgData { - DebuggerIPCE_ExpandedTypeData data; - unsigned int numTypeArgs; // number of immediate children on the type tree + DebuggerIPCE_ExpandedTypeData data; + Portable numTypeArgs; // number of immediate children on the type tree }; @@ -1605,24 +1598,22 @@ const CORDB_ADDRESS kNonLeafFrameRegAddr = (CORDB_ADDRESS)(-1); struct MSLAYOUT RemoteAddress { - RemoteAddressKind kind; - void *frame; - - CorDebugRegister reg1; - void *reg1Addr; - SIZE_T reg1Value; // this is the actual value of the register + Portable kind; + Portable reg1; + Portable reg1Addr; + Portable reg1Value; // this is the actual value of the register union MSLAYOUT { struct MSLAYOUT { - CorDebugRegister reg2; - void *reg2Addr; - SIZE_T reg2Value; // this is the actual value of the register + Portable reg2; + Portable reg2Addr; + Portable reg2Value; // this is the actual value of the register } u; - CORDB_ADDRESS addr; - DWORD floatIndex; + Portable addr; + Portable floatIndex; }; }; @@ -1652,14 +1643,14 @@ enum NameChangeType // struct MSLAYOUT DebuggerIPCE_FuncEvalArgData { - RemoteAddress argHome; // enregistered variable home - void *argAddr; // address if not enregistered - CorElementType argElementType; - unsigned int fullArgTypeNodeCount; // Pointer to LS (DebuggerIPCE_TypeArgData *) buffer holding full description of the argument type (if needed - only needed for struct types) - void *fullArgType; // Pointer to LS (DebuggerIPCE_TypeArgData *) buffer holding full description of the argument type (if needed - only needed for struct types) - BYTE argLiteralData[8]; // copy of generic value data - bool argIsLiteral; // true if value is in argLiteralData - bool argIsHandleValue; // true if argAddr is OBJECTHANDLE + RemoteAddress argHome; // enregistered variable home + Portable argAddr; // address if not enregistered + Portable argElementType; + Portable fullArgTypeNodeCount; // Pointer to LS (DebuggerIPCE_TypeArgData *) buffer holding full description of the argument type (if needed - only needed for struct types) + Portable fullArgType; // Pointer to LS (DebuggerIPCE_TypeArgData *) buffer holding full description of the argument type (if needed - only needed for struct types) + Portable argLiteralData[8]; // copy of generic value data + Portable argIsLiteral; // true if value is in argLiteralData + Portable argIsHandleValue; // true if argAddr is OBJECTHANDLE }; @@ -1669,21 +1660,19 @@ struct MSLAYOUT DebuggerIPCE_FuncEvalArgData // struct MSLAYOUT DebuggerIPCE_FuncEvalInfo { - VMPTR_Thread vmThreadToken; - DebuggerIPCE_FuncEvalType funcEvalType; - mdMethodDef funcMetadataToken; - mdTypeDef funcClassMetadataToken; - VMPTR_Assembly vmAssembly; - RSPTR_CORDBEVAL funcEvalKey; - bool evalDuringException; - - unsigned int argCount; - unsigned int genericArgsCount; - unsigned int genericArgsNodeCount; - - SIZE_T stringSize; - - SIZE_T arrayRank; + VMPTR_Thread vmThreadToken; + Portable funcEvalType; + Portable funcMetadataToken; + Portable funcClassMetadataToken; + VMPTR_Assembly vmAssembly; + RSPTR_CORDBEVAL funcEvalKey; + Portable evalDuringException; + + Portable argCount; + Portable genericArgsCount; + Portable genericArgsNodeCount; + Portable stringSize; + Portable arrayRank; }; @@ -1703,23 +1692,11 @@ enum HijackAction // struct MSLAYOUT DebuggerIPCFirstChanceData { - LSPTR_CONTEXT pLeftSideContext; - HijackAction action; - UINT debugCounter; + LSPTR_CONTEXT pLeftSideContext; + Portable action; + Portable debugCounter; }; -// -// DebuggerIPCSecondChanceData holds info communicated from the RS -// to the LS when setting up a second chance exception hijack. This is -// used when Win32 debugging only. -// -struct MSLAYOUT DebuggerIPCSecondChanceData -{ - DT_CONTEXT threadContext; -}; - - - //----------------------------------------------------------------------------- // This struct holds pointer from the LS and needs to copy to // the RS. We have to free the memory on the RS. @@ -1831,17 +1808,6 @@ struct MSLAYOUT Ls_Rs_StringBuffer : public Ls_Rs_BaseBuffer }; -// Data for an Managed Debug Assistant Probe (MDA). -struct MSLAYOUT DebuggerMDANotification -{ - Ls_Rs_StringBuffer szName; - Ls_Rs_StringBuffer szDescription; - Ls_Rs_StringBuffer szXml; - DWORD dwOSThreadId; - CorDebugMDAFlags flags; -}; - - // The only remaining problem is that register number mappings are different for each platform. It turns out // that the debugger only uses REGNUM_SP and REGNUM_AMBIENT_SP though, so we can just virtualize these two for // the target platform. @@ -1905,25 +1871,18 @@ static_assert(DBG_TARGET_REGNUM_AMBIENT_SP == ICorDebugInfo::REGNUM_AMBIENT_SP); // struct MSLAYOUT DebuggerIPCEvent { - DebuggerIPCEvent* next; - DebuggerIPCEventType type; - DWORD processId; - DWORD threadId; - VMPTR_AppDomain vmAppDomain; - VMPTR_Thread vmThread; + Portable type; + Portable processId; + Portable threadId; + VMPTR_AppDomain vmAppDomain; + VMPTR_Thread vmThread; - HRESULT hr; - bool replyRequired; - bool asyncSend; + Portable hr; + Portable replyRequired; + Portable asyncSend; union MSLAYOUT { - struct MSLAYOUT - { - // Pointer to a BOOL in the target. - CORDB_ADDRESS pfBeingDebugged; - } LeftSideStartupData; - struct MSLAYOUT { // Module whose metadata is being updated @@ -1965,37 +1924,35 @@ struct MSLAYOUT DebuggerIPCEvent VMPTR_Assembly vmAssembly; } UpdateModuleSymsData; - DebuggerMDANotification MDANotification; - struct MSLAYOUT { LSPTR_BREAKPOINT breakpointToken; - mdMethodDef funcMetadataToken; + Portable funcMetadataToken; VMPTR_Assembly vmAssembly; - bool isIL; - SIZE_T offset; - SIZE_T encVersion; - LSPTR_METHODDESC nativeCodeMethodDescToken; // points to the MethodDesc if !isIL - CORDB_ADDRESS codeStartAddress; + Portable isIL; + Portable offset; + Portable encVersion; + LSPTR_METHODDESC nativeCodeMethodDescToken; // points to the MethodDesc if !isIL + Portable codeStartAddress; } BreakpointData; struct MSLAYOUT { - mdMethodDef funcMetadataToken; + Portable funcMetadataToken; VMPTR_Module pModule; } DisableOptData; struct MSLAYOUT { - BOOL enableEvents; + Portable enableEvents; VMPTR_Object vmObj; } ForceCatchHandlerFoundData; struct MSLAYOUT { VMPTR_Module vmModule; - mdTypeDef classMetadataToken; - BOOL Enabled; + Portable classMetadataToken; + Portable Enabled; } CustomNotificationData; struct MSLAYOUT @@ -2005,96 +1962,77 @@ struct MSLAYOUT DebuggerIPCEvent struct MSLAYOUT { -#ifdef FEATURE_DATABREAKPOINT + Portable contextSize; CONTEXT context; -#else - int dummy; -#endif } DataBreakpointData; struct MSLAYOUT { - LSPTR_STEPPER stepperToken; - VMPTR_Thread vmThreadToken; - FramePointer frameToken; - bool stepIn; - bool rangeIL; - bool IsJMCStop; - unsigned int totalRangeCount; - CorDebugStepReason reason; - CorDebugUnmappedStop rgfMappingStop; - CorDebugIntercept rgfInterceptStop; - unsigned int rangeCount; + LSPTR_STEPPER stepperToken; + VMPTR_Thread vmThreadToken; + FramePointer frameToken; + Portable stepIn; + Portable rangeIL; + Portable IsJMCStop; + Portable totalRangeCount; + Portable reason; + Portable rgfMappingStop; + Portable rgfInterceptStop; + Portable rangeCount; COR_DEBUG_STEP_RANGE range; //note that this is an array } StepData; - struct MSLAYOUT - { - // An unvalidated GC-handle - VMPTR_OBJECTHANDLE GCHandle; - } GetGCHandleInfo; - - struct MSLAYOUT - { - // An unvalidated GC-handle for which we're returning the results - LSPTR_OBJECTHANDLE GCHandle; - - // The following are initialized by the LS in response to our query: - VMPTR_AppDomain vmAppDomain; // AD that handle is in (only applicable if fValid). - bool fValid; // Did the LS determine the GC handle to be valid? - } GetGCHandleInfoResult; - // Allocate memory on the left-side struct MSLAYOUT { - ULONG bufSize; // number of bytes to allocate + Portable bufSize; // number of bytes to allocate } GetBuffer; // Memory allocated on the left-side struct MSLAYOUT { - void *pBuffer; // LS pointer to the buffer allocated - HRESULT hr; // success / failure + Portable pBuffer; // LS pointer to the buffer allocated + Portable hr; // success / failure } GetBufferResult; // Free a buffer allocated on the left-side with GetBuffer struct MSLAYOUT { - void *pBuffer; // Pointer previously returned in GetBufferResult + Portable pBuffer; // Pointer previously returned in GetBufferResult } ReleaseBuffer; struct MSLAYOUT { - HRESULT hr; + Portable hr; } ReleaseBufferResult; // Apply an EnC edit struct MSLAYOUT { - VMPTR_Assembly vmAssembly; // Module to edit - DWORD cbDeltaMetadata; // size of blob pointed to by pDeltaMetadata - CORDB_ADDRESS pDeltaMetadata; // pointer to delta metadata in debuggee - // it's the RS's responsibility to allocate and free - // this (and pDeltaIL) using GetBuffer / ReleaseBuffer - CORDB_ADDRESS pDeltaIL; // pointer to delta IL in debugee - DWORD cbDeltaIL; // size of blob pointed to by pDeltaIL + VMPTR_Assembly vmAssembly; // Module to edit + Portable cbDeltaMetadata; // size of blob pointed to by pDeltaMetadata + Portable pDeltaMetadata; // pointer to delta metadata in debuggee + // it's the RS's responsibility to allocate and free + // this (and pDeltaIL) using GetBuffer / ReleaseBuffer + Portable pDeltaIL; // pointer to delta IL in debugee + Portable cbDeltaIL; // size of blob pointed to by pDeltaIL } ApplyChanges; struct MSLAYOUT { - HRESULT hr; + Portable hr; } ApplyChangesResult; struct MSLAYOUT { - mdTypeDef classMetadataToken; + Portable classMetadataToken; VMPTR_Assembly vmAssembly; LSPTR_ASSEMBLY classDebuggerAssemblyToken; } LoadClass; struct MSLAYOUT { - mdTypeDef classMetadataToken; + Portable classMetadataToken; VMPTR_Assembly vmAssembly; LSPTR_ASSEMBLY classDebuggerAssemblyToken; } UnloadClass; @@ -2102,59 +2040,56 @@ struct MSLAYOUT DebuggerIPCEvent struct MSLAYOUT { VMPTR_Assembly vmAssembly; - bool flag; + Portable flag; } SetClassLoad; struct MSLAYOUT { VMPTR_OBJECTHANDLE vmExceptionHandle; - bool firstChance; - bool continuable; + Portable firstChance; + Portable continuable; } Exception; struct MSLAYOUT { - VMPTR_Thread vmThreadToken; + VMPTR_Thread vmThreadToken; } ClearException; struct MSLAYOUT { - void *address; + Portable address; } IsTransitionStub; struct MSLAYOUT { - bool isStub; + Portable isStub; } IsTransitionStubResult; struct MSLAYOUT { - CORDB_ADDRESS startAddress; - bool fCanSetIPOnly; - VMPTR_Thread vmThreadToken; + Portable startAddress; + Portable fCanSetIPOnly; + VMPTR_Thread vmThreadToken; VMPTR_Assembly vmAssembly; - mdMethodDef mdMethod; + Portable mdMethod; VMPTR_MethodDesc vmMethodDesc; - SIZE_T offset; - bool fIsIL; - void * firstExceptionHandler; + Portable offset; + Portable fIsIL; } SetIP; // this is also used for CanSetIP struct MSLAYOUT { - int iLevel; + Portable iLevel; - EmbeddedIPCString szCategory; - Ls_Rs_StringBuffer szContent; + Portable szCategory; + Portable cchCategory; + Portable szContent; + Portable cchContent; } FirstLogMessage; struct MSLAYOUT { - int iLevel; - int iReason; - - EmbeddedIPCString szSwitchName; - EmbeddedIPCString szParentSwitchName; + Portable iLevel; } LogSwitchSettingMessage; // information needed to send to the RS as part of a custom notification from the target @@ -2164,29 +2099,29 @@ struct MSLAYOUT DebuggerIPCEvent VMPTR_Assembly vmAssembly; // metadata token for the type of the CustomNotification object's type - mdTypeDef classToken; + Portable classToken; } CustomNotification; struct MSLAYOUT { VMPTR_Thread vmThreadToken; - CorDebugThreadState debugState; + Portable debugState; } SetAllDebugState; DebuggerIPCE_FuncEvalInfo FuncEval; struct MSLAYOUT { - CORDB_ADDRESS argDataArea; + Portable argDataArea; LSPTR_DEBUGGEREVAL debuggerEvalKey; } FuncEvalSetupComplete; struct MSLAYOUT { RSPTR_CORDBEVAL funcEvalKey; - bool successful; - bool aborted; - void *resultAddr; + Portable successful; + Portable aborted; + Portable resultAddr; // AppDomain that the result is in. VMPTR_AppDomain vmAppDomain; @@ -2212,42 +2147,35 @@ struct MSLAYOUT DebuggerIPCEvent struct MSLAYOUT { - void *objectRefAddress; + Portable objectRefAddress; VMPTR_OBJECTHANDLE vmObjectHandle; - void *newReference; + Portable newReference; } SetReference; struct MSLAYOUT { - NameChangeType eventType; + Portable eventType; VMPTR_AppDomain vmAppDomain; - VMPTR_Thread vmThread; + VMPTR_Thread vmThread; } NameChange; - struct MSLAYOUT - { - VMPTR_Assembly vmAssembly; - BOOL fAllowJitOpts; - BOOL fEnableEnC; - } JitDebugInfo; - // EnC Remap opportunity struct MSLAYOUT { VMPTR_Assembly vmAssembly; - mdMethodDef funcMetadataToken ; // methodDef of function with remap opportunity - SIZE_T currentVersionNumber; // version currently executing - SIZE_T resumeVersionNumber; // latest version - SIZE_T currentILOffset; // the IL offset of the current IP - SIZE_T *resumeILOffset; // pointer into left-side where an offset to resume - // to should be written if remap is desired. + Portable funcMetadataToken; // methodDef of function with remap opportunity + Portable currentVersionNumber; // version currently executing + Portable resumeVersionNumber; // latest version + Portable currentILOffset; // the IL offset of the current IP + Portable resumeILOffset; // pointer into left-side where an offset to resume + // to should be written if remap is desired. } EnCRemap; // EnC Remap has taken place struct MSLAYOUT { VMPTR_Assembly vmAssembly; - mdMethodDef funcMetadataToken; // methodDef of function that was remapped + Portable funcMetadataToken; // methodDef of function that was remapped } EnCRemapComplete; // Notification that the LS is about to update a CLR data structure to account for a @@ -2255,17 +2183,17 @@ struct MSLAYOUT DebuggerIPCEvent struct MSLAYOUT { VMPTR_Assembly vmAssembly; - mdToken memberMetadataToken; // Either a methodDef token indicating the function that - // was updated/added, or a fieldDef token indicating the - // field which was added. - mdTypeDef classMetadataToken; // TypeDef token of the class in which the update was made - SIZE_T newVersionNumber; // The new function/module version + Portable memberMetadataToken; // Either a methodDef token indicating the function that + // was updated/added, or a fieldDef token indicating the + // field which was added. + Portable classMetadataToken; // TypeDef token of the class in which the update was made + Portable newVersionNumber; // The new function/module version } EnCUpdate; struct MSLAYOUT { - void *oldData; - void *newData; + Portable oldData; + Portable newData; DebuggerIPCE_BasicTypeData type; } SetValueClass; @@ -2276,35 +2204,14 @@ struct MSLAYOUT DebuggerIPCEvent struct MSLAYOUT { VMPTR_Assembly vmAssembly; - mdMethodDef funcMetadataToken; - DWORD dwStatus; + Portable funcMetadataToken; + Portable dwStatus; } SetJMCFunctionStatus; struct MSLAYOUT { - TASKID taskid; - } GetThreadForTaskId; - - struct MSLAYOUT - { - VMPTR_Thread vmThreadToken; - } GetThreadForTaskIdResult; - - struct MSLAYOUT - { - CONNID connectionId; - } ConnectionChange; - - struct MSLAYOUT - { - CONNID connectionId; - EmbeddedIPCString wzConnectionName; - } CreateConnection; - - struct MSLAYOUT - { - void *objectToken; - CorDebugHandleType handleType; + Portable objectToken; + Portable handleType; } CreateHandle; struct MSLAYOUT @@ -2316,22 +2223,22 @@ struct MSLAYOUT DebuggerIPCEvent struct MSLAYOUT { VMPTR_OBJECTHANDLE vmObjectHandle; - CorDebugHandleType handleType; + Portable handleType; } DisposeHandle; struct MSLAYOUT { - FramePointer framePointer; - SIZE_T nOffset; - CorDebugExceptionCallbackType eventType; - DWORD dwFlags; - VMPTR_OBJECTHANDLE vmExceptionHandle; + FramePointer framePointer; + Portable nOffset; + Portable eventType; + Portable dwFlags; + VMPTR_OBJECTHANDLE vmExceptionHandle; } ExceptionCallback2; struct MSLAYOUT { - CorDebugExceptionUnwindCallbackType eventType; - DWORD dwFlags; + Portable eventType; + Portable dwFlags; } ExceptionUnwind; struct MSLAYOUT @@ -2343,8 +2250,8 @@ struct MSLAYOUT DebuggerIPCEvent struct MSLAYOUT { VMPTR_Module vmModule; - void * pMetadataStart; - ULONG nMetadataSize; + Portable pMetadataStart; + Portable nMetadataSize; } MetadataUpdateRequest; }; }; @@ -2360,7 +2267,4 @@ struct MSLAYOUT DebuggerIPCEvent static_assert(sizeof(DebuggerIPCEvent) <= CorDBIPC_BUFFER_SIZE); static_assert(CorDBIPC_TRANSPORT_BUFFER_SIZE <= CorDBIPC_BUFFER_SIZE); -// 2*sizeof(WCHAR) for the two string terminating characters in the FirstLogMessage -#define LOG_MSG_PADDING 4 - #endif /* _DbgIPCEvents_h_ */ diff --git a/src/coreclr/debug/inc/dbgipceventtypes.h b/src/coreclr/debug/inc/dbgipceventtypes.h index 3e0ff8df70e9f8..43411e02cd2bf8 100644 --- a/src/coreclr/debug/inc/dbgipceventtypes.h +++ b/src/coreclr/debug/inc/dbgipceventtypes.h @@ -44,7 +44,6 @@ IPC_EVENT_TYPE1(DB_IPCE_USER_BREAKPOINT ,0x011C) IPC_EVENT_TYPE1(DB_IPCE_FIRST_LOG_MESSAGE ,0x011D) // DB_IPCE_CONTINUED_LOG_MESSAGE = 0x11E, used to be here in v1.1, // But we've removed that remove the v2.0 protocol -IPC_EVENT_TYPE1(DB_IPCE_LOGSWITCH_SET_MESSAGE ,0x011F) IPC_EVENT_TYPE1(DB_IPCE_CREATE_APP_DOMAIN ,0x0120) // IPC_EVENT_TYPE1(DB_IPCE_EXIT_APP_DOMAIN ,0x0121) IPC_EVENT_TYPE1(DB_IPCE_LOAD_ASSEMBLY ,0x0122) @@ -53,7 +52,6 @@ IPC_EVENT_TYPE1(DB_IPCE_SET_DEBUG_STATE_RESULT ,0x0124) IPC_EVENT_TYPE1(DB_IPCE_FUNC_EVAL_SETUP_RESULT ,0x0125) IPC_EVENT_TYPE1(DB_IPCE_FUNC_EVAL_COMPLETE ,0x0126) IPC_EVENT_TYPE1(DB_IPCE_SET_REFERENCE_RESULT ,0x0127) -IPC_EVENT_TYPE1(DB_IPCE_APP_DOMAIN_NAME_RESULT ,0x0128) IPC_EVENT_TYPE1(DB_IPCE_FUNC_EVAL_ABORT_RESULT ,0x0129) IPC_EVENT_TYPE1(DB_IPCE_NAME_CHANGE ,0x012a) IPC_EVENT_TYPE1(DB_IPCE_UPDATE_MODULE_SYMS ,0x012c) @@ -66,10 +64,6 @@ IPC_EVENT_TYPE1(DB_IPCE_ENC_UPDATE_FUNCTION ,0x0137) IPC_EVENT_TYPE1(DB_IPCE_SET_METHOD_JMC_STATUS_RESULT ,0x013a) IPC_EVENT_TYPE1(DB_IPCE_GET_METHOD_JMC_STATUS_RESULT ,0x013b) IPC_EVENT_TYPE1(DB_IPCE_SET_MODULE_JMC_STATUS_RESULT ,0x013c) -IPC_EVENT_TYPE1(DB_IPCE_GET_THREAD_FOR_TASKID_RESULT ,0x013d) -IPC_EVENT_TYPE1(DB_IPCE_CREATE_CONNECTION ,0x0141) -IPC_EVENT_TYPE1(DB_IPCE_DESTROY_CONNECTION ,0x0142) -IPC_EVENT_TYPE1(DB_IPCE_CHANGE_CONNECTION ,0x0143) IPC_EVENT_TYPE1(DB_IPCE_FUNC_EVAL_RUDE_ABORT_RESULT ,0x0144) IPC_EVENT_TYPE1(DB_IPCE_EXCEPTION_CALLBACK2 ,0x0147) IPC_EVENT_TYPE1(DB_IPCE_EXCEPTION_UNWIND ,0x0148) @@ -79,9 +73,6 @@ IPC_EVENT_TYPE1(DB_IPCE_INTERCEPT_EXCEPTION_COMPLETE ,0x014B) IPC_EVENT_TYPE1(DB_IPCE_ENC_REMAP_COMPLETE ,0x014C) IPC_EVENT_TYPE1(DB_IPCE_CREATE_PROCESS ,0x014D) IPC_EVENT_TYPE1(DB_IPCE_ENC_ADD_FUNCTION ,0x014E) -IPC_EVENT_TYPE1(DB_IPCE_GET_NGEN_COMPILER_FLAGS_RESULT,0x0151) -IPC_EVENT_TYPE1(DB_IPCE_SET_NGEN_COMPILER_FLAGS_RESULT,0x0152) -IPC_EVENT_TYPE1(DB_IPCE_GET_GCHANDLE_INFO_RESULT ,0x0157) IPC_EVENT_TYPE1(DB_IPCE_LEFTSIDE_STARTUP ,0x015C) IPC_EVENT_TYPE1(DB_IPCE_METADATA_UPDATE ,0x015D) IPC_EVENT_TYPE1(DB_IPCE_RESOLVE_UPDATE_METADATA_1_RESULT,0x015E) @@ -115,11 +106,8 @@ IPC_EVENT_TYPE2(DB_IPCE_SET_CLASS_LOAD_FLAG ,0x0217) IPC_EVENT_TYPE2(DB_IPCE_CONTINUE_EXCEPTION ,0x0219) IPC_EVENT_TYPE2(DB_IPCE_ATTACHING ,0x021A) IPC_EVENT_TYPE2(DB_IPCE_APPLY_CHANGES ,0x021B) -IPC_EVENT_TYPE2(DB_IPCE_SET_NGEN_COMPILER_FLAGS ,0x021F) -IPC_EVENT_TYPE2(DB_IPCE_GET_NGEN_COMPILER_FLAGS ,0x0220) IPC_EVENT_TYPE2(DB_IPCE_IS_TRANSITION_STUB ,0x0221) IPC_EVENT_TYPE2(DB_IPCE_IS_TRANSITION_STUB_RESULT ,0x0222) -IPC_EVENT_TYPE2(DB_IPCE_MODIFY_LOGSWITCH ,0x0223) IPC_EVENT_TYPE2(DB_IPCE_ENABLE_LOG_MESSAGES ,0x0224) IPC_EVENT_TYPE2(DB_IPCE_FUNC_EVAL ,0x0225) IPC_EVENT_TYPE2(DB_IPCE_SET_REFERENCE ,0x0228) @@ -132,13 +120,11 @@ IPC_EVENT_TYPE2(DB_IPCE_SET_VALUE_CLASS ,0x0234) IPC_EVENT_TYPE2(DB_IPCE_SET_METHOD_JMC_STATUS ,0x023a) IPC_EVENT_TYPE2(DB_IPCE_GET_METHOD_JMC_STATUS ,0x023b) IPC_EVENT_TYPE2(DB_IPCE_SET_MODULE_JMC_STATUS ,0x023c) -IPC_EVENT_TYPE2(DB_IPCE_GET_THREAD_FOR_TASKID ,0x023d) IPC_EVENT_TYPE2(DB_IPCE_FUNC_EVAL_RUDE_ABORT ,0x0241) IPC_EVENT_TYPE2(DB_IPCE_CREATE_HANDLE ,0x0244) IPC_EVENT_TYPE2(DB_IPCE_DISPOSE_HANDLE ,0x0245) IPC_EVENT_TYPE2(DB_IPCE_INTERCEPT_EXCEPTION ,0x0246) IPC_EVENT_TYPE2(DB_IPCE_DEBUGGER_INVALID ,0x0249) // An invalid event type -IPC_EVENT_TYPE2(DB_IPCE_GET_GCHANDLE_INFO ,0x0251) IPC_EVENT_TYPE2(DB_IPCE_RESOLVE_UPDATE_METADATA_1 ,0x0256) IPC_EVENT_TYPE2(DB_IPCE_RESOLVE_UPDATE_METADATA_2 ,0x0257) IPC_EVENT_TYPE2(DB_IPCE_DISABLE_OPTS ,0x0258) diff --git a/src/coreclr/debug/shared/dbgtransportsession.cpp b/src/coreclr/debug/shared/dbgtransportsession.cpp index ceb5af5a059a2f..6f8083f0690f92 100644 --- a/src/coreclr/debug/shared/dbgtransportsession.cpp +++ b/src/coreclr/debug/shared/dbgtransportsession.cpp @@ -2114,7 +2114,7 @@ void DbgTransportSession::TransportWorker() // significant data to vary wildy from event to event). DWORD DbgTransportSession::GetEventSize(DebuggerIPCEvent *pEvent) { - DWORD cbBaseSize = offsetof(DebuggerIPCEvent, LeftSideStartupData); + DWORD cbBaseSize = offsetof(DebuggerIPCEvent, MetadataUpdateData); DWORD cbAdditionalSize = 0; switch (pEvent->type & DB_IPCE_TYPE_MASK) @@ -2133,12 +2133,10 @@ DWORD DbgTransportSession::GetEventSize(DebuggerIPCEvent *pEvent) case DB_IPCE_INTERCEPT_EXCEPTION_RESULT: case DB_IPCE_INTERCEPT_EXCEPTION_COMPLETE: case DB_IPCE_CREATE_PROCESS: - case DB_IPCE_SET_NGEN_COMPILER_FLAGS_RESULT: case DB_IPCE_LEFTSIDE_STARTUP: case DB_IPCE_ASYNC_BREAK: case DB_IPCE_CONTINUE: case DB_IPCE_ATTACHING: - case DB_IPCE_GET_NGEN_COMPILER_FLAGS: case DB_IPCE_DETACH_FROM_PROCESS: case DB_IPCE_CONTROL_C_EVENT_RESULT: case DB_IPCE_BEFORE_GARBAGE_COLLECTION: @@ -2211,10 +2209,6 @@ DWORD DbgTransportSession::GetEventSize(DebuggerIPCEvent *pEvent) cbAdditionalSize = sizeof(pEvent->FirstLogMessage); break; - case DB_IPCE_LOGSWITCH_SET_MESSAGE: - cbAdditionalSize = sizeof(pEvent->LogSwitchSettingMessage); - break; - case DB_IPCE_CREATE_APP_DOMAIN: cbAdditionalSize = sizeof(pEvent->AppDomainData); break; @@ -2267,22 +2261,6 @@ DWORD DbgTransportSession::GetEventSize(DebuggerIPCEvent *pEvent) cbAdditionalSize = sizeof(pEvent->SetJMCFunctionStatus); break; - case DB_IPCE_GET_THREAD_FOR_TASKID_RESULT: - cbAdditionalSize = sizeof(pEvent->GetThreadForTaskIdResult); - break; - - case DB_IPCE_CREATE_CONNECTION: - cbAdditionalSize = sizeof(pEvent->CreateConnection); - break; - - case DB_IPCE_DESTROY_CONNECTION: - cbAdditionalSize = sizeof(pEvent->ConnectionChange); - break; - - case DB_IPCE_CHANGE_CONNECTION: - cbAdditionalSize = sizeof(pEvent->ConnectionChange); - break; - case DB_IPCE_EXCEPTION_CALLBACK2: cbAdditionalSize = sizeof(pEvent->ExceptionCallback2); break; @@ -2303,14 +2281,6 @@ DWORD DbgTransportSession::GetEventSize(DebuggerIPCEvent *pEvent) cbAdditionalSize = sizeof(pEvent->EnCUpdate); break; - case DB_IPCE_GET_NGEN_COMPILER_FLAGS_RESULT: - cbAdditionalSize = sizeof(pEvent->JitDebugInfo); - break; - - case DB_IPCE_GET_GCHANDLE_INFO_RESULT: - cbAdditionalSize = sizeof(pEvent->GetGCHandleInfoResult); - break; - case DB_IPCE_SET_IP: cbAdditionalSize = sizeof(pEvent->SetIP); break; @@ -2353,10 +2323,6 @@ DWORD DbgTransportSession::GetEventSize(DebuggerIPCEvent *pEvent) cbAdditionalSize = sizeof(pEvent->ApplyChanges); break; - case DB_IPCE_SET_NGEN_COMPILER_FLAGS: - cbAdditionalSize = sizeof(pEvent->JitDebugInfo); - break; - case DB_IPCE_IS_TRANSITION_STUB: cbAdditionalSize = sizeof(pEvent->IsTransitionStub); break; @@ -2365,10 +2331,6 @@ DWORD DbgTransportSession::GetEventSize(DebuggerIPCEvent *pEvent) cbAdditionalSize = sizeof(pEvent->IsTransitionStubResult); break; - case DB_IPCE_MODIFY_LOGSWITCH: - cbAdditionalSize = sizeof(pEvent->LogSwitchSettingMessage); - break; - case DB_IPCE_ENABLE_LOG_MESSAGES: cbAdditionalSize = sizeof(pEvent->LogSwitchSettingMessage); break; @@ -2409,10 +2371,6 @@ DWORD DbgTransportSession::GetEventSize(DebuggerIPCEvent *pEvent) cbAdditionalSize = sizeof(pEvent->SetJMCFunctionStatus); break; - case DB_IPCE_GET_THREAD_FOR_TASKID: - cbAdditionalSize = sizeof(pEvent->GetThreadForTaskId); - break; - case DB_IPCE_FUNC_EVAL_RUDE_ABORT: cbAdditionalSize = sizeof(pEvent->FuncEvalRudeAbort); break; @@ -2429,10 +2387,6 @@ DWORD DbgTransportSession::GetEventSize(DebuggerIPCEvent *pEvent) cbAdditionalSize = sizeof(pEvent->InterceptException); break; - case DB_IPCE_GET_GCHANDLE_INFO: - cbAdditionalSize = sizeof(pEvent->GetGCHandleInfo); - break; - case DB_IPCE_CUSTOM_NOTIFICATION: cbAdditionalSize = sizeof(pEvent->CustomNotification); break; diff --git a/src/coreclr/inc/dbgportable.h b/src/coreclr/inc/dbgportable.h index b9306ca9b0ca77..92644ec637115d 100644 --- a/src/coreclr/inc/dbgportable.h +++ b/src/coreclr/inc/dbgportable.h @@ -91,6 +91,17 @@ class Portable #endif // DBG_BYTE_SWAP_REQUIRED } + // Volatile-qualified accessor for fields accessed through volatile pointers + operator T () const volatile + { + T data = m_data; +#ifdef DBG_BYTE_SWAP_REQUIRED + return ByteSwap(data); +#else // DBG_BYTE_SWAP_REQUIRED + return data; +#endif // DBG_BYTE_SWAP_REQUIRED + } + bool operator == (T other) const { #ifdef DBG_BYTE_SWAP_REQUIRED diff --git a/src/coreclr/vm/dbginterface.h b/src/coreclr/vm/dbginterface.h index 90bf54abfee821..ba796e2df778e1 100644 --- a/src/coreclr/vm/dbginterface.h +++ b/src/coreclr/vm/dbginterface.h @@ -249,11 +249,6 @@ class DebugInterface virtual bool IsJMCMethod(Module* pModule, mdMethodDef tkMethod) = 0; - virtual void SendLogSwitchSetting (int iLevel, - int iReason, - _In_z_ LPCWSTR pLogSwitchName, - _In_z_ LPCWSTR pParentSwitchName) = 0; - virtual bool IsLoggingEnabled (void) = 0; virtual bool GetILOffsetFromNative (MethodDesc *PFD, @@ -348,11 +343,6 @@ class DebugInterface // Used by the interpreter to avoid calling OnMethodEnter when not stepping. virtual bool IsMethodEnterEnabled() = 0; - // notification for SQL fiber debugging support - virtual void CreateConnection(CONNID dwConnectionId, _In_z_ WCHAR *wzName) = 0; - virtual void DestroyConnection(CONNID dwConnectionId) = 0; - virtual void ChangeConnection(CONNID dwConnectionId) = 0; - // // This function is used to identify the helper thread. // diff --git a/src/coreclr/vm/eedbginterface.h b/src/coreclr/vm/eedbginterface.h index a6fd0182fd5a19..f972e89e645488 100644 --- a/src/coreclr/vm/eedbginterface.h +++ b/src/coreclr/vm/eedbginterface.h @@ -316,9 +316,6 @@ class EEDebugInterface #ifndef DACCESS_COMPILE - virtual void DebuggerModifyingLogSwitch (int iNewLevel, - const WCHAR *pLogSwitchName) = 0; - virtual HRESULT SetIPFromSrcToDst(Thread *pThread, SLOT addrStart, DWORD offFrom, diff --git a/src/coreclr/vm/eedbginterfaceimpl.cpp b/src/coreclr/vm/eedbginterfaceimpl.cpp index cba424243229c3..2bda6df9a40417 100644 --- a/src/coreclr/vm/eedbginterfaceimpl.cpp +++ b/src/coreclr/vm/eedbginterfaceimpl.cpp @@ -1317,17 +1317,6 @@ void EEDbgInterfaceImpl::GetRuntimeOffsets(SIZE_T *pTLSIndex, *pEEIsManagedExceptionStateMask = Thread::TSNC_DebuggerIsManagedException; } -void EEDbgInterfaceImpl::DebuggerModifyingLogSwitch (int iNewLevel, - const WCHAR *pLogSwitchName) -{ - CONTRACTL - { - THROWS; - GC_NOTRIGGER; - } - CONTRACTL_END; -} - HRESULT EEDbgInterfaceImpl::SetIPFromSrcToDst(Thread *pThread, SLOT addrStart, diff --git a/src/coreclr/vm/eedbginterfaceimpl.h b/src/coreclr/vm/eedbginterfaceimpl.h index 3e59d15da56ab3..acc1b2692b8d1f 100644 --- a/src/coreclr/vm/eedbginterfaceimpl.h +++ b/src/coreclr/vm/eedbginterfaceimpl.h @@ -278,9 +278,6 @@ class EEDbgInterfaceImpl : public EEDebugInterface SIZE_T *pEEFrameNextOffset, DWORD *pEEIsManagedExceptionStateMask); - void DebuggerModifyingLogSwitch (int iNewLevel, - const WCHAR *pLogSwitchName); - HRESULT SetIPFromSrcToDst(Thread *pThread, SLOT addrStart, DWORD offFrom, From a8dd2546461a577e41396d2107c2dc9b26450441 Mon Sep 17 00:00:00 2001 From: snickolls-arm <151848422+snickolls-arm@users.noreply.github.com> Date: Fri, 8 May 2026 17:24:10 +0100 Subject: [PATCH 062/109] Support spill temps with unknown size on ARM64 (#127917) Allocates spill temps to the UnknownSizeFrame when the type being spilled has an unknown size. The current slot recycling system has been adapted to handle TYP_SIMD and TYP_MASK as special cases. --- src/coreclr/jit/codegenarmarch.cpp | 15 +++--- src/coreclr/jit/compiler.h | 12 +++++ src/coreclr/jit/compiler.hpp | 42 +++++++++++------ src/coreclr/jit/emitarm64.cpp | 26 ++++++++-- src/coreclr/jit/lclvars.cpp | 41 ++++++++++++++++ src/coreclr/jit/regset.cpp | 76 ++++++++++++++++++++++-------- src/coreclr/jit/regset.h | 14 ++++-- 7 files changed, 178 insertions(+), 48 deletions(-) diff --git a/src/coreclr/jit/codegenarmarch.cpp b/src/coreclr/jit/codegenarmarch.cpp index 2b23d8b3f7b0af..6e177b0a7ad3d9 100644 --- a/src/coreclr/jit/codegenarmarch.cpp +++ b/src/coreclr/jit/codegenarmarch.cpp @@ -4873,14 +4873,13 @@ void CodeGen::genPushCalleeSavedRegisters(regNumber initReg, bool* pInitRegZeroe } #if defined(TARGET_ARM64) -/***************************************************************************** - * - * Generates code for creating the UnknownSizeFrame stack space. - * - * See Compiler::UnknownSizeFrame for implementation details. The space contains - * stack allocations for Vector. - */ - +//---------------------------------------------------------------------------- +// +// genUnknownSizeFrame: Generates code for creating the UnknownSizeFrame stack space. +// +// See Compiler::UnknownSizeFrame for implementation details. The space contains +// stack allocations for Vector. +// void CodeGen::genUnknownSizeFrame() { assert(m_compiler->compLocallocUsed && m_compiler->compUsesUnknownSizeFrame); diff --git a/src/coreclr/jit/compiler.h b/src/coreclr/jit/compiler.h index 875106b746944b..b5f4a002ef7a6a 100644 --- a/src/coreclr/jit/compiler.h +++ b/src/coreclr/jit/compiler.h @@ -1375,6 +1375,10 @@ class TempDsc } void tdAdjustTempOffs(int offs) { +#ifdef TARGET_ARM64 + // Cannot adjust temporary offsets on the UnknownSizeFrame. + assert(!varTypeHasUnknownSize(tdType)); +#endif tdOffs += offs; assert(tdLegalOffset()); } @@ -4320,6 +4324,7 @@ class Compiler void lvaAlignFrame(); void lvaAssignFrameOffsetsToPromotedStructs(); int lvaAllocateTemps(int stkOffs, bool mustDoubleAlign); + void lvaAllocateUnknownSizeTemp(TempDsc* temp); #ifdef DEBUG void lvaDumpRegLocation(unsigned lclNum); @@ -4521,6 +4526,13 @@ class Compiler return GetOffset(varDsc->GetUnknownSizeFrameIndex(), varDsc->TypeIs(TYP_MASK)); } + int GetAddressingOffset(TempDsc* tmpDsc) + { + assert(tmpDsc->tdTempOffs() >= 0); + assert(varTypeHasUnknownSize(tmpDsc->tdTempType())); + return GetOffset((unsigned)tmpDsc->tdTempOffs(), tmpDsc->tdTempType() == TYP_MASK); + } + // This system ensures we don't try and generate an address on the frame // without finishing all allocations. void Finalize() diff --git a/src/coreclr/jit/compiler.hpp b/src/coreclr/jit/compiler.hpp index 27add33c734fa6..a9492b5dd84131 100644 --- a/src/coreclr/jit/compiler.hpp +++ b/src/coreclr/jit/compiler.hpp @@ -2773,13 +2773,7 @@ inline FPbased = isFramePointerUsed(); if (lvaDoneFrameLayout == Compiler::FINAL_FRAME_LAYOUT) { - TempDsc* tmpDsc = codeGen->regSet.tmpFindNum(varNum); - // The temp might be in use, since this might be during code generation. - if (tmpDsc == nullptr) - { - tmpDsc = codeGen->regSet.tmpFindNum(varNum, RegSet::TEMP_USAGE_USED); - } - assert(tmpDsc != nullptr); + TempDsc* tmpDsc = codeGen->regSet.tmpGetNum(varNum); assert(!varTypeHasUnknownSize(tmpDsc->tdTempType())); varOffset = tmpDsc->tdTempOffs(); } @@ -3449,14 +3443,34 @@ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX /*****************************************************************************/ -/* static */ inline unsigned RegSet::tmpSlot(unsigned size) +/* static */ inline unsigned RegSet::tmpSlot(var_types type) { - noway_assert(size >= sizeof(int)); - noway_assert(size <= TEMP_MAX_SIZE); - assert((size % sizeof(int)) == 0); - - assert(size < UINT32_MAX); - return size / sizeof(int) - 1; + unsigned slot = UINT32_MAX; + switch (type) + { +#if defined(FEATURE_SIMD) && defined(TARGET_ARM64) + // Special slots are allocated for TYP_SIMD and TYP_MASK, because they + // have unknown size and therefore can't share slots with other types. + case TYP_SIMD: + slot = TEMP_SLOT_COUNT - 1; + break; + case TYP_MASK: + slot = TEMP_SLOT_COUNT - 2; + break; +#endif + default: + { + assert(!varTypeHasUnknownSize(type)); + unsigned size = genTypeSize(type); + noway_assert(size >= sizeof(int)); + noway_assert(size <= TEMP_MAX_SIZE); + assert((size % sizeof(int)) == 0); + slot = size / sizeof(int) - 1; + } + break; + } + assert(slot < TEMP_SLOT_COUNT); + return slot; } /***************************************************************************** diff --git a/src/coreclr/jit/emitarm64.cpp b/src/coreclr/jit/emitarm64.cpp index a0711a07f3cd7d..da56820d919774 100644 --- a/src/coreclr/jit/emitarm64.cpp +++ b/src/coreclr/jit/emitarm64.cpp @@ -8209,14 +8209,23 @@ void emitter::emitIns_R_S(instruction ins, emitAttr attr, regNumber reg1, int va assert(offs >= 0); - if (varx >= 0 && m_compiler->lvaIsUnknownSizeLocal(varx)) + if ((varx >= 0 && m_compiler->lvaIsUnknownSizeLocal(varx)) || + (varx < 0 && codeGen->regSet.tmpIsUnknownSizeTemp(varx))) { // SVE locals are TYP_SIMD or TYP_MASK, both should be placed on the UnknownSizeFrame. // The base address of these locals should be REG_UNKBASE (x19). assert(offs == 0); isSimple = false; reg2 = REG_UNKBASE; - imm = m_compiler->unkSizeFrame.GetAddressingOffset(m_compiler->lvaGetDesc(varx)); + + if (varx >= 0) + { + imm = m_compiler->unkSizeFrame.GetAddressingOffset(m_compiler->lvaGetDesc(varx)); + } + else + { + imm = m_compiler->unkSizeFrame.GetAddressingOffset(codeGen->regSet.tmpGetNum(varx)); + } switch (ins) { @@ -8522,7 +8531,8 @@ void emitter::emitIns_S_R(instruction ins, emitAttr attr, regNumber reg1, int va regNumber reg2 = REG_NA; ssize_t imm = 0; - if (varx >= 0 && m_compiler->lvaIsUnknownSizeLocal(varx)) + if ((varx >= 0 && m_compiler->lvaIsUnknownSizeLocal(varx)) || + (varx < 0 && codeGen->regSet.tmpIsUnknownSizeTemp(varx))) { // SVE locals are TYP_SIMD or TYP_MASK, both should be placed on the UnknownSizeFrame. // The base address of these locals should be REG_UNKBASE (x19). @@ -8531,10 +8541,18 @@ void emitter::emitIns_S_R(instruction ins, emitAttr attr, regNumber reg1, int va assert(attr == EA_SCALABLE); reg2 = REG_UNKBASE; - imm = m_compiler->unkSizeFrame.GetAddressingOffset(m_compiler->lvaGetDesc(varx)); fmt = isPredicateRegister(reg1) ? IF_SVE_JG_2A : IF_SVE_JH_2A; isSimple = false; + if (varx >= 0) + { + imm = m_compiler->unkSizeFrame.GetAddressingOffset(m_compiler->lvaGetDesc(varx)); + } + else + { + imm = m_compiler->unkSizeFrame.GetAddressingOffset(codeGen->regSet.tmpGetNum(varx)); + } + // TODO-SVE: Handle generation of base address for large immediate scaled by VL/PL. assert(isValidSimm<9>(imm)); } diff --git a/src/coreclr/jit/lclvars.cpp b/src/coreclr/jit/lclvars.cpp index 5178394885930b..adf573deda4674 100644 --- a/src/coreclr/jit/lclvars.cpp +++ b/src/coreclr/jit/lclvars.cpp @@ -4564,6 +4564,11 @@ void Compiler::lvaFixVirtualFrameOffsets() assert(codeGen->regSet.tmpAllFree()); for (TempDsc* temp = codeGen->regSet.tmpListBeg(); temp != nullptr; temp = codeGen->regSet.tmpListNxt(temp)) { + if (varTypeHasUnknownSize(temp->tdTempType())) + { + continue; + } + temp->tdAdjustTempOffs(delta + frameLocalsDelta); } @@ -6126,6 +6131,13 @@ int Compiler::lvaAllocateTemps(int stkOffs, bool mustDoubleAlign) var_types tempType = temp->tdTempType(); unsigned size = temp->tdTempSize(); + if (varTypeHasUnknownSize(tempType)) + { + // This temp will be allocated on the unknown size frame, get the offset from there. + lvaAllocateUnknownSizeTemp(temp); + continue; + } + /* Figure out and record the stack offset of the temp */ /* Need to align the offset? */ @@ -6183,6 +6195,35 @@ int Compiler::lvaAllocateTemps(int stkOffs, bool mustDoubleAlign) return stkOffs; } +//------------------------------------------------------------------------------- +// lvaAllocateUnknownSizeTemp: Allocate a slot for a temp on the UnknownSizeFrame +// +// Arguments: +// temp - The temp to allocate. varTypeHasUnknownSize() must be true for this +// temp. +void Compiler::lvaAllocateUnknownSizeTemp(TempDsc* temp) +{ + assert(varTypeHasUnknownSize(temp->tdTempType())); + + int offset = 0; + switch (temp->tdTempType()) + { +#if defined(TARGET_ARM64) && defined(FEATURE_SIMD) + case TYP_SIMD: + offset = unkSizeFrame.AllocVector(); + break; + case TYP_MASK: + offset = unkSizeFrame.AllocMask(); + break; +#endif + default: + unreached(); + } + assert(offset >= 0); + + temp->tdSetTempOffs(offset); +} + #ifdef DEBUG /***************************************************************************** diff --git a/src/coreclr/jit/regset.cpp b/src/coreclr/jit/regset.cpp index 58434e6a7912f5..2fcd275641bf46 100644 --- a/src/coreclr/jit/regset.cpp +++ b/src/coreclr/jit/regset.cpp @@ -625,12 +625,9 @@ TempDsc* RegSet::tmpGetTemp(var_types type) type = tmpNormalizeType(type); unsigned size = genTypeSize(type); - // If TYP_STRUCT ever gets in here we do bad things (tmpSlot returns -1) - noway_assert(size >= sizeof(int) && size != SIZE_UNKNOWN); - /* Find the slot to search for a free temp of the right size */ - unsigned slot = tmpSlot(size); + unsigned slot = tmpSlot(type); /* Look for a temp with a matching type */ @@ -687,19 +684,22 @@ void RegSet::tmpPreAllocateTemps(var_types type, unsigned count) assert(type == tmpNormalizeType(type)); unsigned size = genTypeSize(type); - // If TYP_STRUCT ever gets in here we do bad things (tmpSlot returns -1) - noway_assert(size >= sizeof(int) && size != SIZE_UNKNOWN); - // Find the slot to search for a free temp of the right size. - // Note that slots are shared by types of the identical size (e.g., TYP_REF and TYP_LONG on AMD64), + // Note that slots can be shared by types of the identical size (e.g., TYP_REF and TYP_LONG on AMD64), // so we can't assert that the slot is empty when we get here. - unsigned slot = tmpSlot(size); + unsigned slot = tmpSlot(type); for (unsigned i = 0; i < count; i++) { tmpCount++; - tmpSize += size; + + if (size != SIZE_UNKNOWN) + { + // We don't count temps that have unknown size, because they will be allocated in a different + // part of the frame to temps that have a known size. + tmpSize += size; + } #ifdef TARGET_ARM if (type == TYP_DOUBLE) @@ -738,7 +738,7 @@ void RegSet::tmpRlsTemp(TempDsc* temp) /* Add the temp to the 'free' list */ - slot = tmpSlot(temp->tdTempSize()); + slot = tmpSlot(temp->tdTempType()); #ifdef DEBUG if (m_compiler->verbose) @@ -795,6 +795,40 @@ TempDsc* RegSet::tmpFindNum(int tnum, TEMP_USAGE_TYPE usageType /* = TEMP_USAGE_ return nullptr; } +//---------------------------------------------------------------------------- +// tmpGetNum: Given a temp number, get the corresponding temp. +// +// This looks for temps in the free list and the used list, meaning it can only be used after code +// generation. +// +// It will assert that the temp is found. This should be called for a temp that is known to exist. +// +TempDsc* RegSet::tmpGetNum(int tnum) const +{ + TempDsc* tmp = tmpFindNum(tnum, TEMP_USAGE_FREE); + if (tmp == nullptr) + { + tmp = tmpFindNum(tnum, TEMP_USAGE_USED); + } + assert(tmp != nullptr); + return tmp; +} + +//---------------------------------------------------------------------------- +// tmpIsUnknownSizeTemp: Given a temp number, does the corresponding temp have an unknown size? +// +// It will assert that the temp is found. This should be called for a temp that is known to exist. +// +// Arguments: +// tnum - Temp number to test +// +// Returns: +// true when the temp has an unknown size at compile-time. +bool RegSet::tmpIsUnknownSizeTemp(int tnum) const +{ + return varTypeHasUnknownSize(tmpGetNum(tnum)->tdTempType()); +} + /***************************************************************************** * * A helper function is used to iterate over all the temps. @@ -832,12 +866,13 @@ TempDsc* RegSet::tmpListNxt(TempDsc* curTemp, TEMP_USAGE_TYPE usageType /* = TEM assert(curTemp != nullptr); TempDsc* temp = curTemp->tdNext; + unsigned size = curTemp->tdTempSize(); + if (temp == nullptr) { - unsigned size = curTemp->tdTempSize(); - // If there are no more temps in the list, check if there are more - // slots (for bigger sized temps) to walk. + // slots (for bigger sized temps) to walk. This is only possible if + // the temps have a known size. TempDsc* const* tmpLists; if (usageType == TEMP_USAGE_FREE) @@ -849,14 +884,17 @@ TempDsc* RegSet::tmpListNxt(TempDsc* curTemp, TEMP_USAGE_TYPE usageType /* = TEM tmpLists = tmpUsed; } - while (size < TEMP_MAX_SIZE && temp == nullptr) + unsigned slot = tmpSlot(curTemp->tdTempType()) + 1; + while (slot < TEMP_SLOT_COUNT && temp == nullptr) { - size += sizeof(int); - unsigned slot = tmpSlot(size); - temp = tmpLists[slot]; + temp = tmpLists[slot]; + slot++; } - assert((temp == nullptr) || (temp->tdTempSize() == size)); + if (temp == nullptr) + { + assert(slot == TEMP_SLOT_COUNT); + } } return temp; diff --git a/src/coreclr/jit/regset.h b/src/coreclr/jit/regset.h index c35d706d476dec..d20a9fb4ce6d23 100644 --- a/src/coreclr/jit/regset.h +++ b/src/coreclr/jit/regset.h @@ -212,6 +212,8 @@ class RegSet TempDsc* tmpGetTemp(var_types type); // get temp for the given type void tmpRlsTemp(TempDsc* temp); TempDsc* tmpFindNum(int temp, TEMP_USAGE_TYPE usageType = TEMP_USAGE_FREE) const; + TempDsc* tmpGetNum(int temp) const; + bool tmpIsUnknownSizeTemp(int tnum) const; void tmpEnd(); TempDsc* tmpListBeg(TEMP_USAGE_TYPE usageType = TEMP_USAGE_FREE) const; @@ -246,7 +248,7 @@ class RegSet // Used by RegSet::rsSpillChk() unsigned tmpGetCount; // Temps which haven't been released yet #endif - static unsigned tmpSlot(unsigned size); // which slot in tmpFree[] or tmpUsed[] to use + static unsigned tmpSlot(var_types type); // which slot in tmpFree[] or tmpUsed[] to use enum TEMP_CONSTANTS : unsigned { @@ -259,11 +261,17 @@ class RegSet #else // !FEATURE_SIMD TEMP_MAX_SIZE = sizeof(double), #endif // !FEATURE_SIMD + +#if defined(TARGET_ARM64) && defined(FEATURE_SIMD) + // There are two extra slots for temps with unknown size (TYP_SIMD/TYP_MASK) + TEMP_SLOT_COUNT = (TEMP_MAX_SIZE / sizeof(int)) + 2 +#else TEMP_SLOT_COUNT = (TEMP_MAX_SIZE / sizeof(int)) +#endif }; - TempDsc* tmpFree[TEMP_MAX_SIZE / sizeof(int)]; - TempDsc* tmpUsed[TEMP_MAX_SIZE / sizeof(int)]; + TempDsc* tmpFree[TEMP_SLOT_COUNT]; + TempDsc* tmpUsed[TEMP_SLOT_COUNT]; }; #endif // _REGSET_H From c4ef6f48e1ae52187f2e465db3ae2a4e204128ec Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Fri, 8 May 2026 10:45:41 -0700 Subject: [PATCH 063/109] Update devcontainer Dockerfile (#127460) The devcontainer package list was missing some requirements to build, so new codespaces could not build runtime. Update the Dockerfile to curl and run the install-dependencies script during creation to install the packages. --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: jtschuster <36744439+jtschuster@users.noreply.github.com> Co-authored-by: Adeel Mujahid <3840695+am11@users.noreply.github.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- .devcontainer/Dockerfile | 27 +++++---------------------- 1 file changed, 5 insertions(+), 22 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 987034cae61e02..60a31b564d61cf 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -4,25 +4,8 @@ ARG VARIANT="8.0-noble" FROM mcr.microsoft.com/devcontainers/dotnet:${VARIANT} -# Set up machine requirements to build the repo and the gh CLI -RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ - && apt-get -y install --no-install-recommends \ - clang \ - cmake \ - cpio \ - build-essential \ - python3 \ - curl \ - git \ - lldb \ - llvm \ - liblldb-dev \ - libunwind8 \ - libunwind8-dev \ - gettext \ - libicu-dev \ - liblttng-ust-dev \ - libssl-dev \ - libkrb5-dev \ - ninja-build \ - tzdata +SHELL [ "/bin/bash", "-c" ] + +# Set up machine requirements to build the repo and the gh CLI. +RUN curl --remote-name-all -sSL https://github.com/dotnet/runtime/raw/main/eng/common/native/{install-dependencies,init-os-and-arch}.sh && \ + bash install-dependencies.sh && rm {install-dependencies,init-os-and-arch}.sh From 54e46095dd3f192e1a8cf2576a252044c02c25d0 Mon Sep 17 00:00:00 2001 From: Egor Bogatov Date: Fri, 8 May 2026 20:02:58 +0200 Subject: [PATCH 064/109] JIT: fix value-probing schema index collision with handle histogram (#127959) Both `HandleHistogramProbeInstrumentor` and `ValueInstrumentor` were writing to the same `BasicBlock::bbHistogramSchemaIndex` field. The value instrumentor was essentially copy-pasted from the type histogram one and inherited the same field without adjusting for the fact that a block can be processed by both. ## The bug When a single basic block has both `BBF_HAS_HISTOGRAM_PROFILE` (e.g. a virtual call) and `BBF_HAS_VALUE_PROFILE` (a `SpanHelpers.Memmove` / `SpanHelpers.SequenceEqual` special intrinsic), schema build runs in this order: 1. `HandleHistogramProbeInstrumentor::BuildSchemaElements` writes `bbHistogramSchemaIndex = N` and appends `H` handle-histogram entries. 2. `ValueInstrumentor::BuildSchemaElements` **overwrites** with `bbHistogramSchemaIndex = N + H` and appends value entries. Then `HandleHistogramProbeInstrumentor::Instrument` runs first for the block, reads `N + H`, and `ReadHistogramAndAdvance` lands on a `ValueHistogramIntCount`/`ValueHistogramLongCount` kind. It returns early without setting `typeHistogram`/`methodHistogram`: * In **DEBUG**, the assert at https://github.com/dotnet/runtime/blob/main/src/coreclr/jit/fgprofile.cpp#L2077 (`"Expected at least one handle histogram when inserting probes"`) fires, and so does `InstrCount() == compHandleHistogramProbeCount` later. * In **retail**, `helperCallNode` stays `nullptr` and `gtNewOperNode(GT_COMMA, TYP_REF, helperCallNode, tmpNode2)` is built with a `nullptr` child -- malformed IR, not just a missed probe. The pattern is common: any method that has a virtual call followed by `Span.CopyTo` / `MemoryExtensions.SequenceEqual` / `Buffer.Memmove` in the same block can hit it once those calls inline down to the recognized `SpanHelpers` intrinsics. While at it I also noticed a copy-paste typo in `ValueInstrumentor::Prepare` that cleared `bbCountSchemaIndex` instead of its own field. Benign today (count instrumentor's `Prepare` cleared it earlier), but indicative of the shaky copy-paste. ## The fix Split the per-block schema index into two dedicated fields: * `bbHistogramSchemaIndex` -> `bbHandleHistogramSchemaIndex` (used by `HandleHistogramProbeInstrumentor`) * new `bbValueHistogramSchemaIndex` (used by `ValueInstrumentor`) The new field is placed right after the existing union so it consumes the pre-existing 4-byte tail padding before `bbTryIndex`/`bbHndIndex`. **`sizeof(BasicBlock)` is unchanged on x64 (280 bytes before and after**, verified with a temporary `PrintSize` probe). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/coreclr/jit/block.h | 8 ++++++-- src/coreclr/jit/fgprofile.cpp | 12 ++++++------ 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/src/coreclr/jit/block.h b/src/coreclr/jit/block.h index 33919a3e51e656..5d12efdc0888cf 100644 --- a/src/coreclr/jit/block.h +++ b/src/coreclr/jit/block.h @@ -1436,10 +1436,14 @@ struct BasicBlock : private LIR::Range union { - unsigned bbStkTempsOut; // base# for output stack temps - int bbHistogramSchemaIndex; // schema index for histogram instrumentation + unsigned bbStkTempsOut; // base# for output stack temps + int bbHandleHistogramSchemaIndex; // schema index for handle (class/method) histogram instrumentation }; + int bbValueHistogramSchemaIndex; // schema index for value histogram instrumentation + // Placed here so it consumes the existing tail padding before + // bbTryIndex/bbHndIndex without growing BasicBlock. + #define MAX_XCPTN_INDEX (USHRT_MAX - 1) // It would be nice to make bbTryIndex and bbHndIndex private, but there is still code that uses them directly, diff --git a/src/coreclr/jit/fgprofile.cpp b/src/coreclr/jit/fgprofile.cpp index a64c33d1403284..00a3661c5f6dac 100644 --- a/src/coreclr/jit/fgprofile.cpp +++ b/src/coreclr/jit/fgprofile.cpp @@ -2361,7 +2361,7 @@ void HandleHistogramProbeInstrumentor::Prepare(bool isPreImport) // for (BasicBlock* const block : m_compiler->Blocks()) { - block->bbHistogramSchemaIndex = -1; + block->bbHandleHistogramSchemaIndex = -1; } #endif } @@ -2382,7 +2382,7 @@ void HandleHistogramProbeInstrumentor::BuildSchemaElements(BasicBlock* block, Sc // Remember the schema index for this block. // - block->bbHistogramSchemaIndex = (int)schema.size(); + block->bbHandleHistogramSchemaIndex = (int)schema.size(); // Scan the statements and identify the class probes // @@ -2416,7 +2416,7 @@ void HandleHistogramProbeInstrumentor::Instrument(BasicBlock* block, Schema& sch // Scan the statements and add class probes // - int histogramSchemaIndex = block->bbHistogramSchemaIndex; + int histogramSchemaIndex = block->bbHandleHistogramSchemaIndex; assert((histogramSchemaIndex >= 0) && (histogramSchemaIndex < (int)schema.size())); HandleHistogramProbeInserter insertProbes(schema, profileMemory, &histogramSchemaIndex, m_instrCount); @@ -2445,7 +2445,7 @@ void ValueInstrumentor::Prepare(bool isPreImport) // for (BasicBlock* const block : m_compiler->Blocks()) { - block->bbCountSchemaIndex = -1; + block->bbValueHistogramSchemaIndex = -1; } #endif } @@ -2465,7 +2465,7 @@ void ValueInstrumentor::BuildSchemaElements(BasicBlock* block, Schema& schema) return; } - block->bbHistogramSchemaIndex = (int)schema.size(); + block->bbValueHistogramSchemaIndex = (int)schema.size(); BuildValueHistogramProbeSchemaGen schemaGen(schema, m_schemaCount); ValueHistogramProbeVisitor visitor(m_compiler, schemaGen); @@ -2491,7 +2491,7 @@ void ValueInstrumentor::Instrument(BasicBlock* block, Schema& schema, uint8_t* p return; } - int histogramSchemaIndex = block->bbHistogramSchemaIndex; + int histogramSchemaIndex = block->bbValueHistogramSchemaIndex; assert((histogramSchemaIndex >= 0) && (histogramSchemaIndex < (int)schema.size())); ValueHistogramProbeInserter insertProbes(schema, profileMemory, &histogramSchemaIndex, m_instrCount); From 0160e214998584c76b9c1ed5b87d3afbba9d40ed Mon Sep 17 00:00:00 2001 From: Jeff Handley Date: Fri, 8 May 2026 12:26:42 -0700 Subject: [PATCH 065/109] Migrate Copilot PAT pool to shared workflow import (#127946) Replaces the per-workflow inline `select-copilot-pat` action with the shared `pat_pool.md` now usable with in gh-aw v0.71.5. The new pattern fixes a bug where `COPILOT_PAT_0` was always selected because activation `needs:` did not incorporate jobs referenced in `engine.env` expressions (https://github.com/github/gh-aw/issues/30232, fixed in v0.71.5). Also adds a workflow that monitors the PAT pool health. --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .github/actions/select-copilot-pat/README.md | 116 -- .github/actions/select-copilot-pat/action.yml | 53 - .github/agents/agentic-workflows.agent.md | 110 +- .github/aw/actions-lock.json | 34 +- .github/mcp.json | 11 + .../workflows/breaking-change-doc.lock.yml | 857 ++++++++---- .github/workflows/breaking-change-doc.md | 50 +- .github/workflows/ci-failure-scan.lock.yml | 513 +++++--- .github/workflows/ci-failure-scan.md | 50 +- .github/workflows/code-review.lock.yml | 1118 ++++++++++------ .github/workflows/code-review.md | 53 +- .github/workflows/copilot-echo.lock.yml | 1162 +++++++++++------ .github/workflows/copilot-echo.md | 50 +- .github/workflows/shared/pat_pool.README.md | 187 +++ .github/workflows/shared/pat_pool.md | 117 ++ .github/workflows/validate-pat-pool.yml | 227 ++++ 16 files changed, 3046 insertions(+), 1662 deletions(-) delete mode 100644 .github/actions/select-copilot-pat/README.md delete mode 100644 .github/actions/select-copilot-pat/action.yml create mode 100644 .github/mcp.json create mode 100644 .github/workflows/shared/pat_pool.README.md create mode 100644 .github/workflows/shared/pat_pool.md create mode 100644 .github/workflows/validate-pat-pool.yml diff --git a/.github/actions/select-copilot-pat/README.md b/.github/actions/select-copilot-pat/README.md deleted file mode 100644 index 8b57f6377bcc84..00000000000000 --- a/.github/actions/select-copilot-pat/README.md +++ /dev/null @@ -1,116 +0,0 @@ -# Select Copilot PAT -Selects a random Copilot PAT from a numbered pool of secrets. This addresses limitations that arise from having a single PAT shared across all agentic workflows, such as rate-limiting. - -**This is a stop-gap workaround.** As soon as organization/enterprise billing is offered for agentic workflows, this approach will be removed from our workflows. - -## Repository Onboarding -To use Agentic Workflows in a dotnet org repository: - -1. Follow the instructions for [Configuring Your Repository | Agentic Authoring | GitHub Agentic Workflows][configure-repo]. -2. Copy this `select-copilot-pat` folder into the repository under `.github/actions/select-copilot-pat`, including both the `README.md` and `action.yml`. -3. Merge those additions into the repository and then follow the instructions for the PAT Creation and Usage below. - -> **Optional:** If you plan to manage secrets or workflows from the command line (e.g., `gh aw secrets set`), [install the `gh aw` CLI extension][cli-setup]: -> ```sh -> gh extension install github/gh-aw -> ``` - -## PAT Management -Team members provide PATs into the pools for the repository by adding them as repository secrets with secret names matching the pattern of `_<0-9>`, such as `COPILOT_PAT_0`. - -[Use this link to prefill the PAT creation form with the required settings][create-pat]: - -1. **Resource owner** is your **user account**, not an organization. -2. **Copilot Requests (Read)** must be the only permission granted. -3. **8-day expiration** must be used, which enforces a weekly renewal. -4. **Repository access** set to **Public repositories** only. - -The **Token Name** _does not_ need to match the secret name and is only visible to the owner of the PAT. It's recommended to use a token name indicating the PAT is used for dotnet org agentic workflows. The **Description** is also only used for your own reference. - -Team members providing PATs for workflows should set weekly recurring reminders to regenerate and update their PATs in the repository secrets. With an 8-day expiration, renewal can be done on the same day each week. - -PATs are added to repositories through the **Settings > Secrets and variables > Actions** UI, saved as **Repository secrets** and matching the `_<0-9>` naming convention. This can also be done using the GitHub CLI. - -```sh -gh aw secrets set "_<0-9>" --value "" --repo dotnet/ -``` - -## Workflow Output Attribution -Team members' PATs are _only_ used for the Copilot requests from within the agentic portion of the workflow. All outputs from the workflow use the `github-actions[bot]` account token. Issues, PRs, comments, and all other content generated by the workflow will be attributed to `github-actions[bot]`--not the team member's account or token. - -## Usage -Add the following frontmatter at the top-level of an agentic workflow. These elements are not supported through [imports][imports], so they must be copied into all workflows. - -Up to 10 `SECRET_#` environment variables can be passed to the action, numbered 0-9. Different workflows can use different pools of PATs if desired. Change the `secrets.COPILOT_PAT_0` through `secrets.COPILOT_PAT_9` secret names in both the `select-copilot-pat` step `env` values and in the `case` expression under the `engine: env` configuration. - -```yml -on: - # Add the pre-activation step of selecting a random PAT from the supplied secrets - steps: - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - name: Checkout the select-copilot-pat action folder - with: - persist-credentials: false - sparse-checkout: .github/actions/select-copilot-pat - sparse-checkout-cone-mode: true - fetch-depth: 1 - - - id: select-copilot-pat - name: Select Copilot token from pool - uses: ./.github/actions/select-copilot-pat - env: - # If the secret names are changed here, they must also be changed - # in the `engine: env` case expression - SECRET_0: ${{ secrets.COPILOT_PAT_0 }} - SECRET_1: ${{ secrets.COPILOT_PAT_1 }} - SECRET_2: ${{ secrets.COPILOT_PAT_2 }} - SECRET_3: ${{ secrets.COPILOT_PAT_3 }} - SECRET_4: ${{ secrets.COPILOT_PAT_4 }} - SECRET_5: ${{ secrets.COPILOT_PAT_5 }} - SECRET_6: ${{ secrets.COPILOT_PAT_6 }} - SECRET_7: ${{ secrets.COPILOT_PAT_7 }} - SECRET_8: ${{ secrets.COPILOT_PAT_8 }} - SECRET_9: ${{ secrets.COPILOT_PAT_9 }} - -# Add the pre-activation output of the randomly selected PAT -jobs: - pre-activation: - outputs: - copilot_pat_number: ${{ steps.select-copilot-pat.outputs.copilot_pat_number }} - -# Override the COPILOT_GITHUB_TOKEN expression used in the activation job -# Consume the PAT number from the pre-activation step and select the corresponding secret -engine: - id: copilot - env: - # We cannot use line breaks in this expression as it leads to a syntax error in the compiled workflow - # If none of the `COPILOT_PAT_#` secrets were selected, then the default COPILOT_GITHUB_TOKEN is used - COPILOT_GITHUB_TOKEN: ${{ case(needs.pre_activation.outputs.copilot_pat_number == '0', secrets.COPILOT_PAT_0, needs.pre_activation.outputs.copilot_pat_number == '1', secrets.COPILOT_PAT_1, needs.pre_activation.outputs.copilot_pat_number == '2', secrets.COPILOT_PAT_2, needs.pre_activation.outputs.copilot_pat_number == '3', secrets.COPILOT_PAT_3, needs.pre_activation.outputs.copilot_pat_number == '4', secrets.COPILOT_PAT_4, needs.pre_activation.outputs.copilot_pat_number == '5', secrets.COPILOT_PAT_5, needs.pre_activation.outputs.copilot_pat_number == '6', secrets.COPILOT_PAT_6, needs.pre_activation.outputs.copilot_pat_number == '7', secrets.COPILOT_PAT_7, needs.pre_activation.outputs.copilot_pat_number == '8', secrets.COPILOT_PAT_8, needs.pre_activation.outputs.copilot_pat_number == '9', secrets.COPILOT_PAT_9, secrets.COPILOT_GITHUB_TOKEN) }} -``` - -## References - -- [Agentic Workflows CLI Extension][cli-setup] -- [Agentic Authoring][configure-repo] -- [Authentication][authentication] -- [Agentic Workflow Imports][imports] -- [Custom Steps][steps] -- [Custom Jobs][jobs] -- [Job Outputs][job-outputs] -- [Engine Configuration][engine] -- [Engine Environment Variables][engine-vars] -- [Case Function in Workflow Expressions][case-expression] -- [Update agentic engine token handling to use user-provided secrets (github/gh-aw#18017)][secret-override] - -[cli-setup]: https://github.github.com/gh-aw/setup/cli/ -[configure-repo]: https://github.github.com/gh-aw/guides/agentic-authoring/#configuring-your-repository -[authentication]: https://github.github.com/gh-aw/reference/auth/ -[create-pat]: https://github.com/settings/personal-access-tokens/new?name=dotnet%20org%20agentic%20workflows&description=GitHub+Agentic+Workflows+-+Copilot+engine+authentication.++Used+for+dotnet+org+workflows.+MUST+be+configured+with+only+Copilot+Requests+permissions+and+user+account+as+resource+owner.+Weekly+expiration+and+required+renewal.&user_copilot_requests=read&expires_in=8 -[imports]: https://github.github.com/gh-aw/reference/imports/ -[steps]: https://github.github.com/gh-aw/reference/frontmatter/#custom-steps-steps -[jobs]: https://github.github.com/gh-aw/reference/frontmatter/#custom-jobs-jobs -[job-outputs]: https://github.github.com/gh-aw/reference/frontmatter/#job-outputs -[engine]: https://github.github.com/gh-aw/reference/frontmatter/#ai-engine-engine -[engine-vars]: https://github.github.com/gh-aw/reference/engines/#engine-environment-variables -[case-expression]: https://docs.github.com/en/actions/reference/workflows-and-actions/expressions#case -[secret-override]: https://github.com/github/gh-aw/pull/18017 diff --git a/.github/actions/select-copilot-pat/action.yml b/.github/actions/select-copilot-pat/action.yml deleted file mode 100644 index 198eb0393dbfe8..00000000000000 --- a/.github/actions/select-copilot-pat/action.yml +++ /dev/null @@ -1,53 +0,0 @@ -name: 'Select Copilot PAT from Pool' -description: > - Selects a random Copilot PAT from a numbered pool of secrets. Secrets - are passed as environment variables SECRET_0 through SECRET_9 - by the calling workflow step. - -inputs: - random-seed: - description: 'A seed number to use for the random PAT selection, for deterministic selection if needed.' - required: false - default: '' - -outputs: - copilot_pat_number: - description: 'The 0-9 secret number selected from the pool of specified secrets' - value: ${{ steps.select-pat-number.outputs.copilot_pat_number }} - -runs: - using: composite - steps: - - id: select-pat-number - shell: bash - env: - RANDOM_SEED: ${{ inputs.random-seed }} - run: | - # Collect all secret numbers with non-empty values from SECRET_0..SECRET_9 - PAT_NUMBERS=() - for i in $(seq 0 9); do - var="SECRET_${i}" - val="${!var}" - if [ -n "$val" ]; then - PAT_NUMBERS+=(${i}) - fi - done - - # If none of the secrets in the pool have values, then emit a warning and do not - # set an output value. The consumer can then fall back to using COPILOT_GITHUB_TOKEN. - if [ ${#PAT_NUMBERS[@]} -eq 0 ]; then - echo "::warning::None of the specified secrets had values (checked SECRET_0 through SECRET_9)" - exit 0 - fi - - # Select a random index using the seed if specified - if [ -n "$RANDOM_SEED" ]; then - RANDOM=$RANDOM_SEED - fi - - PAT_INDEX=$(( RANDOM % ${#PAT_NUMBERS[@]} )) - PAT_NUMBER="${PAT_NUMBERS[$PAT_INDEX]}" - echo "Selected token ${PAT_NUMBER} (index: ${PAT_INDEX}; pool size: ${#PAT_NUMBERS[@]})" - - # Set the PAT number as the output - echo "copilot_pat_number=${PAT_NUMBER}" >> "$GITHUB_OUTPUT" diff --git a/.github/agents/agentic-workflows.agent.md b/.github/agents/agentic-workflows.agent.md index c849fb43479020..ed8fc4cecfdf98 100644 --- a/.github/agents/agentic-workflows.agent.md +++ b/.github/agents/agentic-workflows.agent.md @@ -20,6 +20,7 @@ This is a **dispatcher agent** that routes your request to the appropriate speci - **Creating shared components**: Routes to `create-shared-agentic-workflow` prompt - **Fixing Dependabot PRs**: Routes to `dependabot` prompt — use this when Dependabot opens PRs that modify generated manifest files (`.github/workflows/package.json`, `.github/workflows/requirements.txt`, `.github/workflows/go.mod`). Never merge those PRs directly; instead update the source `.md` files and rerun `gh aw compile --dependabot` to bundle all fixes - **Analyzing test coverage**: Routes to `test-coverage` prompt — consult this whenever the workflow reads, analyzes, or reports on test coverage data from PRs or CI runs +- **CLI commands and triggering workflows**: Routes to `cli-commands` guide — consult this whenever the user asks how to run, compile, debug, or manage workflows from the command line, or when they need the MCP tool equivalent of a `gh aw` command Workflows may optionally include: @@ -31,7 +32,7 @@ Workflows may optionally include: - Workflow files: `.github/workflows/*.md` and `.github/workflows/**/*.md` - Workflow lock files: `.github/workflows/*.lock.yml` - Shared components: `.github/workflows/shared/*.md` -- Configuration: https://github.com/github/gh-aw/blob/v0.63.0/.github/aw/github-agentic-workflows.md +- Configuration: https://github.com/github/gh-aw/blob/v0.71.5/.github/aw/github-agentic-workflows.md ## Problems This Solves @@ -53,7 +54,7 @@ When you interact with this agent, it will: ### Create New Workflow **Load when**: User wants to create a new workflow from scratch, add automation, or design a workflow that doesn't exist yet -**Prompt file**: https://github.com/github/gh-aw/blob/v0.63.0/.github/aw/create-agentic-workflow.md +**Prompt file**: https://github.com/github/gh-aw/blob/v0.71.5/.github/aw/create-agentic-workflow.md **Use cases**: - "Create a workflow that triages issues" @@ -63,7 +64,7 @@ When you interact with this agent, it will: ### Update Existing Workflow **Load when**: User wants to modify, improve, or refactor an existing workflow -**Prompt file**: https://github.com/github/gh-aw/blob/v0.63.0/.github/aw/update-agentic-workflow.md +**Prompt file**: https://github.com/github/gh-aw/blob/v0.71.5/.github/aw/update-agentic-workflow.md **Use cases**: - "Add web-fetch tool to the issue-classifier workflow" @@ -73,7 +74,7 @@ When you interact with this agent, it will: ### Debug Workflow **Load when**: User needs to investigate, audit, debug, or understand a workflow, troubleshoot issues, analyze logs, or fix errors -**Prompt file**: https://github.com/github/gh-aw/blob/v0.63.0/.github/aw/debug-agentic-workflow.md +**Prompt file**: https://github.com/github/gh-aw/blob/v0.71.5/.github/aw/debug-agentic-workflow.md **Use cases**: - "Why is this workflow failing?" @@ -83,7 +84,7 @@ When you interact with this agent, it will: ### Upgrade Agentic Workflows **Load when**: User wants to upgrade workflows to a new gh-aw version or fix deprecations -**Prompt file**: https://github.com/github/gh-aw/blob/v0.63.0/.github/aw/upgrade-agentic-workflows.md +**Prompt file**: https://github.com/github/gh-aw/blob/v0.71.5/.github/aw/upgrade-agentic-workflows.md **Use cases**: - "Upgrade all workflows to the latest version" @@ -93,7 +94,7 @@ When you interact with this agent, it will: ### Create a Report-Generating Workflow **Load when**: The workflow being created or updated produces reports — recurring status updates, audit summaries, analyses, or any structured output posted as a GitHub issue, discussion, or comment -**Prompt file**: https://github.com/github/gh-aw/blob/v0.63.0/.github/aw/report.md +**Prompt file**: https://github.com/github/gh-aw/blob/v0.71.5/.github/aw/report.md **Use cases**: - "Create a weekly CI health report" @@ -103,7 +104,7 @@ When you interact with this agent, it will: ### Create Shared Agentic Workflow **Load when**: User wants to create a reusable workflow component or wrap an MCP server -**Prompt file**: https://github.com/github/gh-aw/blob/v0.63.0/.github/aw/create-shared-agentic-workflow.md +**Prompt file**: https://github.com/github/gh-aw/blob/v0.71.5/.github/aw/create-shared-agentic-workflow.md **Use cases**: - "Create a shared component for Notion integration" @@ -113,7 +114,7 @@ When you interact with this agent, it will: ### Fix Dependabot PRs **Load when**: User needs to close or fix open Dependabot PRs that update dependencies in generated manifest files (`.github/workflows/package.json`, `.github/workflows/requirements.txt`, `.github/workflows/go.mod`) -**Prompt file**: https://github.com/github/gh-aw/blob/v0.63.0/.github/aw/dependabot.md +**Prompt file**: https://github.com/github/gh-aw/blob/v0.71.5/.github/aw/dependabot.md **Use cases**: - "Fix the open Dependabot PRs for npm dependencies" @@ -123,7 +124,7 @@ When you interact with this agent, it will: ### Analyze Test Coverage **Load when**: The workflow reads, analyzes, or reports test coverage — whether triggered by a PR, a schedule, or a slash command. Always consult this prompt before designing the coverage data strategy. -**Prompt file**: https://github.com/github/gh-aw/blob/v0.63.0/.github/aw/test-coverage.md +**Prompt file**: https://github.com/github/gh-aw/blob/v0.71.5/.github/aw/test-coverage.md **Use cases**: - "Create a workflow that comments coverage on PRs" @@ -170,90 +171,47 @@ gh aw compile --validate ## Important Notes -- Always reference the instructions file at https://github.com/github/gh-aw/blob/v0.63.0/.github/aw/github-agentic-workflows.md for complete documentation +- Always reference the instructions file at https://github.com/github/gh-aw/blob/v0.71.5/.github/aw/github-agentic-workflows.md for complete documentation - Use the MCP tool `agentic-workflows` when running in GitHub Copilot Cloud - Workflows must be compiled to `.lock.yml` files before running in GitHub Actions - **Bash tools are enabled by default** - Don't restrict bash commands unnecessarily since workflows are sandboxed by the AWF - Follow security best practices: minimal permissions, explicit network access, no template injection -- **Network configuration**: Use ecosystem identifiers (`node`, `python`, `go`, etc.) or explicit FQDNs in `network.allowed`. Bare shorthands like `npm` or `pypi` are **not** valid. See https://github.com/github/gh-aw/blob/v0.63.0/.github/aw/network.md for the full list of valid ecosystem identifiers and domain patterns. +- **Network configuration**: Use ecosystem identifiers (`node`, `python`, `go`, etc.) or explicit FQDNs in `network.allowed`. Bare shorthands like `npm` or `pypi` are **not** valid. See https://github.com/github/gh-aw/blob/v0.71.5/.github/aw/network.md for the full list of valid ecosystem identifiers and domain patterns. - **Single-file output**: When creating a workflow, produce exactly **one** workflow `.md` file. Do not create separate documentation files (architecture docs, runbooks, usage guides, etc.). If documentation is needed, add a brief `## Usage` section inside the workflow file itself. +- **Triggering runs**: Always use `gh aw run ` to trigger a workflow on demand — not `gh workflow run .lock.yml`. `gh aw run` handles workflow resolution by short name, input parsing and validation, and correct run-tracking for agentic workflows. Use `--ref ` to run on a specific branch. +- **CLI commands reference**: For a complete guide on all `gh aw` commands and their MCP tool equivalents (for restricted environments), see https://github.com/github/gh-aw/blob/v0.71.5/.github/aw/cli-commands.md +- **Repository-specific requirements**: There are multiple sets of repository-specific instructions below that must be respected. They affect workflow authoring, updates, compilation, and reviews. ## Repository-Specific Requirements: Copilot PAT Pool -**⚠️ MANDATORY**: Every agentic workflow in this repository **must** include the `select-copilot-pat` integration. This selects a random Copilot PAT from a numbered pool of secrets to avoid rate-limiting from a single shared PAT. This is a stop-gap workaround until organization-level billing is offered for agentic workflows. +**⚠️ MANDATORY**: Every agentic workflow in this repository **must** utilize the Copilot PAT Pool as detailed in `.github/workflows/shared/pat_pool.README.md`. This mechanism selects a random Copilot PAT from a numbered pool of secrets to avoid rate-limiting from a single shared PAT. -These elements are **not supported through imports**, so they must be copied into the frontmatter of every agentic workflow. See `.github/actions/select-copilot-pat/README.md` for full documentation and `.github/workflows/copilot-echo.md` for a working example. +When **creating** or **updating** an agentic workflow, always include the following frontmatter that integrates the PAT pool. This should be used verbatim when first added. -When **creating** or **updating** an agentic workflow, always include the following three frontmatter blocks. These go between the `---` markers alongside the workflow's other frontmatter (permissions, safe-outputs, etc.). - -### Comment block (placed before the steps, inside the `on:` block) - -Always include this comment block before the steps to explain the PAT pool override: - -```yaml +```yml # ############################################################### -# Override the COPILOT_GITHUB_TOKEN secret usage for the workflow -# with a randomly-selected token from a pool of secrets. -# -# As soon as organization-level billing is offered for Agentic -# Workflows, this stop-gap approach will be removed. -# -# See: /.github/actions/select-copilot-pat/README.md +# Override COPILOT_GITHUB_TOKEN with a random PAT from the pool. +# This stop-gap will be removed when org billing is available. +# See: .github/workflows/shared/pat_pool.README.md for more info. # ############################################################### -``` +imports: + - shared/pat_pool.md -### Block 1: Pre-activation steps (nested under `on:`) - -Add this under the `on:` key, at the same level as the trigger configuration, immediately after the comment block above: - -```yaml - # Add the pre-activation step of selecting a random PAT from the supplied secrets - steps: - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - name: Checkout the select-copilot-pat action folder - with: - persist-credentials: false - sparse-checkout: .github/actions/select-copilot-pat - sparse-checkout-cone-mode: true - fetch-depth: 1 - - - id: select-copilot-pat - name: Select Copilot token from pool - uses: ./.github/actions/select-copilot-pat - env: - SECRET_0: ${{ secrets.COPILOT_PAT_0 }} - SECRET_1: ${{ secrets.COPILOT_PAT_1 }} - SECRET_2: ${{ secrets.COPILOT_PAT_2 }} - SECRET_3: ${{ secrets.COPILOT_PAT_3 }} - SECRET_4: ${{ secrets.COPILOT_PAT_4 }} - SECRET_5: ${{ secrets.COPILOT_PAT_5 }} - SECRET_6: ${{ secrets.COPILOT_PAT_6 }} - SECRET_7: ${{ secrets.COPILOT_PAT_7 }} - SECRET_8: ${{ secrets.COPILOT_PAT_8 }} - SECRET_9: ${{ secrets.COPILOT_PAT_9 }} +engine: + id: copilot + env: + COPILOT_GITHUB_TOKEN: ${{ case(needs.pat_pool.outputs.pat_number == '0', secrets.COPILOT_PAT_0, needs.pat_pool.outputs.pat_number == '1', secrets.COPILOT_PAT_1, needs.pat_pool.outputs.pat_number == '2', secrets.COPILOT_PAT_2, needs.pat_pool.outputs.pat_number == '3', secrets.COPILOT_PAT_3, needs.pat_pool.outputs.pat_number == '4', secrets.COPILOT_PAT_4, needs.pat_pool.outputs.pat_number == '5', secrets.COPILOT_PAT_5, needs.pat_pool.outputs.pat_number == '6', secrets.COPILOT_PAT_6, needs.pat_pool.outputs.pat_number == '7', secrets.COPILOT_PAT_7, needs.pat_pool.outputs.pat_number == '8', secrets.COPILOT_PAT_8, needs.pat_pool.outputs.pat_number == '9', secrets.COPILOT_PAT_9, secrets.COPILOT_GITHUB_TOKEN) }} ``` -### Block 2: Pre-activation job outputs (top-level `jobs:`) +When the workflow is being updated by hand, the `engine.env.COPILOT_GITHUB_TOKEN` may be reformatted to use a multi-line YAML string for the expression if desired for improved readability. -```yaml -jobs: - pre-activation: - outputs: - copilot_pat_number: ${{ steps.select-copilot-pat.outputs.copilot_pat_number }} -``` +If other `engine` properties are customized for the workflow, that customization will need to be added into this same `engine` block and hand-editing can rearrange the PAT pool frontmatter and comment for ideal maintainability. -### Block 3: Engine configuration with PAT override (top-level `engine:`) +## Repository-Specific Requirements: Schedule Seed -```yaml -engine: - id: copilot - env: - # We cannot use line breaks in this expression as it leads to a syntax error in the compiled workflow - # If none of the `COPILOT_PAT_#` secrets were selected, then the default COPILOT_GITHUB_TOKEN is used - COPILOT_GITHUB_TOKEN: ${{ case(needs.pre_activation.outputs.copilot_pat_number == '0', secrets.COPILOT_PAT_0, needs.pre_activation.outputs.copilot_pat_number == '1', secrets.COPILOT_PAT_1, needs.pre_activation.outputs.copilot_pat_number == '2', secrets.COPILOT_PAT_2, needs.pre_activation.outputs.copilot_pat_number == '3', secrets.COPILOT_PAT_3, needs.pre_activation.outputs.copilot_pat_number == '4', secrets.COPILOT_PAT_4, needs.pre_activation.outputs.copilot_pat_number == '5', secrets.COPILOT_PAT_5, needs.pre_activation.outputs.copilot_pat_number == '6', secrets.COPILOT_PAT_6, needs.pre_activation.outputs.copilot_pat_number == '7', secrets.COPILOT_PAT_7, needs.pre_activation.outputs.copilot_pat_number == '8', secrets.COPILOT_PAT_8, needs.pre_activation.outputs.copilot_pat_number == '9', secrets.COPILOT_PAT_9, secrets.COPILOT_GITHUB_TOKEN) }} +When compiling agentic workflows in this repository, always supply `--schedule-seed dotnet/runtime` so that scheduled cron triggers are deterministic and consistent across recompilations. + +```sh +gh aw compile --schedule-seed dotnet/runtime ``` -**Important notes about the engine block:** -- The `COPILOT_GITHUB_TOKEN` `case()` expression **must** remain on a single line — line breaks cause syntax errors in the compiled workflow. -- If no `COPILOT_PAT_#` secrets are configured, the expression falls back to the default `COPILOT_GITHUB_TOKEN` secret. -- Do **not** specify `engine: copilot` as a simple string — use the object form shown above so the `env:` override can be included. diff --git a/.github/aw/actions-lock.json b/.github/aw/actions-lock.json index aa95df86ba4de4..3871dc4b9d30ae 100644 --- a/.github/aw/actions-lock.json +++ b/.github/aw/actions-lock.json @@ -1,24 +1,44 @@ { "entries": { - "actions/github-script@v8": { - "repo": "actions/github-script", - "version": "v8", - "sha": "ed597411d8f924073f98dfc5c65a23a2325f34cd" + "actions/checkout@v6.0.2": { + "repo": "actions/checkout", + "version": "v6.0.2", + "sha": "de0fac2e4500dabe0009e67214ff5f5447ce83dd" + }, + "actions/download-artifact@v8.0.1": { + "repo": "actions/download-artifact", + "version": "v8.0.1", + "sha": "3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c" }, "actions/github-script@v9": { "repo": "actions/github-script", "version": "v9", "sha": "373c709c69115d41ff229c7e5df9f8788daa9553" }, + "actions/github-script@v9.0.0": { + "repo": "actions/github-script", + "version": "v9.0.0", + "sha": "3a2844b7e9c422d3c10d287c895573f7108da1b3" + }, + "actions/setup-node@v6.4.0": { + "repo": "actions/setup-node", + "version": "v6.4.0", + "sha": "48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e" + }, "actions/upload-artifact@v4": { "repo": "actions/upload-artifact", "version": "v4", "sha": "ea165f8d65b6e75b540449e92b4886f43607fa02" }, - "github/gh-aw-actions/setup@v0.68.1": { + "actions/upload-artifact@v7.0.1": { + "repo": "actions/upload-artifact", + "version": "v7.0.1", + "sha": "043fb46d1a93c77aae656e7c1c64a875d1fc6a0a" + }, + "github/gh-aw-actions/setup@v0.71.5": { "repo": "github/gh-aw-actions/setup", - "version": "v0.68.1", - "sha": "2fe53acc038ba01c3bbdc767d4b25df31ca5bdfc" + "version": "v0.71.5", + "sha": "b8068426813005612b960b5ab0b8bd2c27142323" } } } diff --git a/.github/mcp.json b/.github/mcp.json new file mode 100644 index 00000000000000..b953af2639e340 --- /dev/null +++ b/.github/mcp.json @@ -0,0 +1,11 @@ +{ + "mcpServers": { + "github-agentic-workflows": { + "command": "gh", + "args": [ + "aw", + "mcp-server" + ] + } + } +} \ No newline at end of file diff --git a/.github/workflows/breaking-change-doc.lock.yml b/.github/workflows/breaking-change-doc.lock.yml index 92c97cc4f74f2c..8832a724a9fd2c 100644 --- a/.github/workflows/breaking-change-doc.lock.yml +++ b/.github/workflows/breaking-change-doc.lock.yml @@ -1,3 +1,5 @@ +# gh-aw-metadata: {"schema_version":"v3","frontmatter_hash":"411454be0b76f8489d8af4a88ac252de655107e9042e5425155e4b22b1cbcb48","compiler_version":"v0.71.5","strict":true,"agent_id":"copilot"} +# gh-aw-manifest: {"version":1,"secrets":["COPILOT_GITHUB_TOKEN","COPILOT_PAT_0","COPILOT_PAT_1","COPILOT_PAT_2","COPILOT_PAT_3","COPILOT_PAT_4","COPILOT_PAT_5","COPILOT_PAT_6","COPILOT_PAT_7","COPILOT_PAT_8","COPILOT_PAT_9","GH_AW_GITHUB_MCP_SERVER_TOKEN","GH_AW_GITHUB_TOKEN","GITHUB_TOKEN"],"actions":[{"repo":"actions/checkout","sha":"de0fac2e4500dabe0009e67214ff5f5447ce83dd","version":"v6.0.2"},{"repo":"actions/download-artifact","sha":"3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c","version":"v8.0.1"},{"repo":"actions/github-script","sha":"373c709c69115d41ff229c7e5df9f8788daa9553","version":"v9"},{"repo":"actions/github-script","sha":"3a2844b7e9c422d3c10d287c895573f7108da1b3","version":"v9.0.0"},{"repo":"actions/setup-node","sha":"48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e","version":"v6.4.0"},{"repo":"actions/upload-artifact","sha":"043fb46d1a93c77aae656e7c1c64a875d1fc6a0a","version":"v7.0.1"},{"repo":"actions/upload-artifact","sha":"ea165f8d65b6e75b540449e92b4886f43607fa02","version":"v4"},{"repo":"github/gh-aw-actions/setup","sha":"b8068426813005612b960b5ab0b8bd2c27142323","version":"v0.71.5"}],"containers":[{"image":"ghcr.io/github/gh-aw-firewall/agent:0.25.40","digest":"sha256:14ff567e8d9d4c2fbc5e55c973488381c71d7e0fdbe72d30ee7b8a738fd86504","pinned_image":"ghcr.io/github/gh-aw-firewall/agent:0.25.40@sha256:14ff567e8d9d4c2fbc5e55c973488381c71d7e0fdbe72d30ee7b8a738fd86504"},{"image":"ghcr.io/github/gh-aw-firewall/api-proxy:0.25.40","digest":"sha256:2883ca3e5ae9f330cafdd9345bfd4ae17fc8da36c96d4c9a1f76e922b4c45280","pinned_image":"ghcr.io/github/gh-aw-firewall/api-proxy:0.25.40@sha256:2883ca3e5ae9f330cafdd9345bfd4ae17fc8da36c96d4c9a1f76e922b4c45280"},{"image":"ghcr.io/github/gh-aw-firewall/squid:0.25.40","digest":"sha256:b084f4a2c771f584ee68084ced52fa6b3245197a1889645d817462d307d3ac51","pinned_image":"ghcr.io/github/gh-aw-firewall/squid:0.25.40@sha256:b084f4a2c771f584ee68084ced52fa6b3245197a1889645d817462d307d3ac51"},{"image":"ghcr.io/github/gh-aw-mcpg:v0.3.6","digest":"sha256:2bb8eef86006a4c5963c55616a9c51c32f27bfdecb023b8aa6f91f6718d9171c","pinned_image":"ghcr.io/github/gh-aw-mcpg:v0.3.6@sha256:2bb8eef86006a4c5963c55616a9c51c32f27bfdecb023b8aa6f91f6718d9171c"},{"image":"ghcr.io/github/github-mcp-server:v1.0.3","digest":"sha256:2ac27ef03461ef2b877031b838a7d1fd7f12b12d4ace7796d8cad91446d55959","pinned_image":"ghcr.io/github/github-mcp-server:v1.0.3@sha256:2ac27ef03461ef2b877031b838a7d1fd7f12b12d4ace7796d8cad91446d55959"},{"image":"node:lts-alpine","digest":"sha256:d1b3b4da11eefd5941e7f0b9cf17783fc99d9c6fc34884a665f40a06dbdfc94f","pinned_image":"node:lts-alpine@sha256:d1b3b4da11eefd5941e7f0b9cf17783fc99d9c6fc34884a665f40a06dbdfc94f"}]} # ___ _ _ # / _ \ | | (_) # | |_| | __ _ ___ _ __ | |_ _ ___ @@ -12,7 +14,7 @@ # \ /\ / (_) | | | | ( | | | | (_) \ V V /\__ \ # \/ \/ \___/|_| |_|\_\|_| |_|\___/ \_/\_/ |___/ # -# This file was automatically generated by gh-aw (v0.65.6). DO NOT EDIT. +# This file was automatically generated by gh-aw (v0.71.5). DO NOT EDIT. # # To update this file, edit the corresponding .md file and run: # gh aw compile @@ -22,7 +24,43 @@ # # Generate breaking change documentation for merged PRs labeled needs-breaking-change-doc-created. Produces two markdown files (issue-draft.md and pr-comment.md) and optionally comments on the PR. # -# gh-aw-metadata: {"schema_version":"v3","frontmatter_hash":"7c86aef08973645499a88ff9ac23e1719f681df3b8dc13c01af6fb3fae9ca83c","compiler_version":"v0.65.6","strict":true,"agent_id":"copilot"} +# Resolved workflow manifest: +# Imports: +# - shared/pat_pool.md +# +# Secrets used: +# - COPILOT_GITHUB_TOKEN +# - COPILOT_PAT_0 +# - COPILOT_PAT_1 +# - COPILOT_PAT_2 +# - COPILOT_PAT_3 +# - COPILOT_PAT_4 +# - COPILOT_PAT_5 +# - COPILOT_PAT_6 +# - COPILOT_PAT_7 +# - COPILOT_PAT_8 +# - COPILOT_PAT_9 +# - GH_AW_GITHUB_MCP_SERVER_TOKEN +# - GH_AW_GITHUB_TOKEN +# - GITHUB_TOKEN +# +# Custom actions used: +# - actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 +# - actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 +# - actions/github-script@373c709c69115d41ff229c7e5df9f8788daa9553 # v9 +# - actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 +# - actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 +# - actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 +# - actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4 +# - github/gh-aw-actions/setup@b8068426813005612b960b5ab0b8bd2c27142323 # v0.71.5 +# +# Container images used: +# - ghcr.io/github/gh-aw-firewall/agent:0.25.40@sha256:14ff567e8d9d4c2fbc5e55c973488381c71d7e0fdbe72d30ee7b8a738fd86504 +# - ghcr.io/github/gh-aw-firewall/api-proxy:0.25.40@sha256:2883ca3e5ae9f330cafdd9345bfd4ae17fc8da36c96d4c9a1f76e922b4c45280 +# - ghcr.io/github/gh-aw-firewall/squid:0.25.40@sha256:b084f4a2c771f584ee68084ced52fa6b3245197a1889645d817462d307d3ac51 +# - ghcr.io/github/gh-aw-mcpg:v0.3.6@sha256:2bb8eef86006a4c5963c55616a9c51c32f27bfdecb023b8aa6f91f6718d9171c +# - ghcr.io/github/github-mcp-server:v1.0.3@sha256:2ac27ef03461ef2b877031b838a7d1fd7f12b12d4ace7796d8cad91446d55959 +# - node:lts-alpine@sha256:d1b3b4da11eefd5941e7f0b9cf17783fc99d9c6fc34884a665f40a06dbdfc94f name: "Breaking Change Documentation" "on": @@ -30,28 +68,6 @@ name: "Breaking Change Documentation" types: - closed - labeled - # steps: # Steps injected into pre-activation job - # - name: Checkout the select-copilot-pat action folder - # uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd - # with: - # fetch-depth: 1 - # persist-credentials: false - # sparse-checkout: .github/actions/select-copilot-pat - # sparse-checkout-cone-mode: true - # - env: - # SECRET_0: ${{ secrets.COPILOT_PAT_0 }} - # SECRET_1: ${{ secrets.COPILOT_PAT_1 }} - # SECRET_2: ${{ secrets.COPILOT_PAT_2 }} - # SECRET_3: ${{ secrets.COPILOT_PAT_3 }} - # SECRET_4: ${{ secrets.COPILOT_PAT_4 }} - # SECRET_5: ${{ secrets.COPILOT_PAT_5 }} - # SECRET_6: ${{ secrets.COPILOT_PAT_6 }} - # SECRET_7: ${{ secrets.COPILOT_PAT_7 }} - # SECRET_8: ${{ secrets.COPILOT_PAT_8 }} - # SECRET_9: ${{ secrets.COPILOT_PAT_9 }} - # id: select-copilot-pat - # name: Select Copilot token from pool - # uses: ./.github/actions/select-copilot-pat workflow_dispatch: inputs: aw_context: @@ -79,7 +95,9 @@ run-name: "Breaking Change Documentation" jobs: activation: - needs: pre_activation + needs: + - pat_pool + - pre_activation if: > needs.pre_activation.outputs.activated == 'true' && (github.event_name == 'workflow_dispatch' || ( @@ -89,52 +107,63 @@ jobs: )) runs-on: ubuntu-slim permissions: + actions: read contents: read outputs: body: ${{ steps.sanitized.outputs.body }} comment_id: "" comment_repo: "" + engine_id: ${{ steps.generate_aw_info.outputs.engine_id }} lockdown_check_failed: ${{ steps.generate_aw_info.outputs.lockdown_check_failed == 'true' }} model: ${{ steps.generate_aw_info.outputs.model }} secret_verification_result: ${{ steps.validate-secret.outputs.verification_result }} + setup-trace-id: ${{ steps.setup.outputs.trace-id }} + stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} text: ${{ steps.sanitized.outputs.text }} title: ${{ steps.sanitized.outputs.title }} steps: - name: Setup Scripts - uses: github/gh-aw-actions/setup@31130b20a8fd3ef263acbe2091267c0aace07e09 # v0.65.6 + id: setup + uses: github/gh-aw-actions/setup@b8068426813005612b960b5ab0b8bd2c27142323 # v0.71.5 with: destination: ${{ runner.temp }}/gh-aw/actions + job-name: ${{ github.job }} + trace-id: ${{ needs.pre_activation.outputs.setup-trace-id }} + env: + GH_AW_SETUP_WORKFLOW_NAME: "Breaking Change Documentation" + GH_AW_CURRENT_WORKFLOW_REF: ${{ github.repository }}/.github/workflows/breaking-change-doc.lock.yml@${{ github.ref }} + GH_AW_INFO_VERSION: "1.0.40" - name: Generate agentic run info id: generate_aw_info env: GH_AW_INFO_ENGINE_ID: "copilot" GH_AW_INFO_ENGINE_NAME: "GitHub Copilot CLI" - GH_AW_INFO_MODEL: ${{ vars.GH_AW_MODEL_AGENT_COPILOT || 'auto' }} - GH_AW_INFO_VERSION: "latest" - GH_AW_INFO_AGENT_VERSION: "latest" - GH_AW_INFO_CLI_VERSION: "v0.65.6" + GH_AW_INFO_MODEL: ${{ vars.GH_AW_MODEL_AGENT_COPILOT || 'claude-sonnet-4.6' }} + GH_AW_INFO_VERSION: "1.0.40" + GH_AW_INFO_AGENT_VERSION: "1.0.40" + GH_AW_INFO_CLI_VERSION: "v0.71.5" GH_AW_INFO_WORKFLOW_NAME: "Breaking Change Documentation" GH_AW_INFO_EXPERIMENTAL: "false" GH_AW_INFO_SUPPORTS_TOOLS_ALLOWLIST: "true" GH_AW_INFO_STAGED: "false" GH_AW_INFO_ALLOWED_DOMAINS: '["defaults"]' GH_AW_INFO_FIREWALL_ENABLED: "true" - GH_AW_INFO_AWF_VERSION: "v0.25.11" + GH_AW_INFO_AWF_VERSION: "v0.25.40" GH_AW_INFO_AWMG_VERSION: "" GH_AW_INFO_FIREWALL_TYPE: "squid" GH_AW_COMPILED_STRICT: "true" - uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8 + uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 with: script: | const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); - setupGlobals(core, github, context, exec, io); + setupGlobals(core, github, context, exec, io, getOctokit); const { main } = require('${{ runner.temp }}/gh-aw/actions/generate_aw_info.cjs'); await main(core, context); - name: Validate COPILOT_GITHUB_TOKEN secret id: validate-secret - run: ${RUNNER_TEMP}/gh-aw/actions/validate_multi_secret.sh COPILOT_GITHUB_TOKEN 'GitHub Copilot CLI' https://github.github.com/gh-aw/reference/engines/#github-copilot-default + run: bash "${RUNNER_TEMP}/gh-aw/actions/validate_multi_secret.sh" COPILOT_GITHUB_TOKEN 'GitHub Copilot CLI' https://github.github.com/gh-aw/reference/engines/#github-copilot-default env: - COPILOT_GITHUB_TOKEN: ${{ case(needs.pre_activation.outputs.copilot_pat_number == '0', secrets.COPILOT_PAT_0, needs.pre_activation.outputs.copilot_pat_number == '1', secrets.COPILOT_PAT_1, needs.pre_activation.outputs.copilot_pat_number == '2', secrets.COPILOT_PAT_2, needs.pre_activation.outputs.copilot_pat_number == '3', secrets.COPILOT_PAT_3, needs.pre_activation.outputs.copilot_pat_number == '4', secrets.COPILOT_PAT_4, needs.pre_activation.outputs.copilot_pat_number == '5', secrets.COPILOT_PAT_5, needs.pre_activation.outputs.copilot_pat_number == '6', secrets.COPILOT_PAT_6, needs.pre_activation.outputs.copilot_pat_number == '7', secrets.COPILOT_PAT_7, needs.pre_activation.outputs.copilot_pat_number == '8', secrets.COPILOT_PAT_8, needs.pre_activation.outputs.copilot_pat_number == '9', secrets.COPILOT_PAT_9, secrets.COPILOT_GITHUB_TOKEN) }} + COPILOT_GITHUB_TOKEN: ${{ case(needs.pat_pool.outputs.pat_number == '0', secrets.COPILOT_PAT_0, needs.pat_pool.outputs.pat_number == '1', secrets.COPILOT_PAT_1, needs.pat_pool.outputs.pat_number == '2', secrets.COPILOT_PAT_2, needs.pat_pool.outputs.pat_number == '3', secrets.COPILOT_PAT_3, needs.pat_pool.outputs.pat_number == '4', secrets.COPILOT_PAT_4, needs.pat_pool.outputs.pat_number == '5', secrets.COPILOT_PAT_5, needs.pat_pool.outputs.pat_number == '6', secrets.COPILOT_PAT_6, needs.pat_pool.outputs.pat_number == '7', secrets.COPILOT_PAT_7, needs.pat_pool.outputs.pat_number == '8', secrets.COPILOT_PAT_8, needs.pat_pool.outputs.pat_number == '9', secrets.COPILOT_PAT_9, secrets.COPILOT_GITHUB_TOKEN) }} - name: Checkout .github and .agents folders uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: @@ -142,35 +171,51 @@ jobs: sparse-checkout: | .github .agents + .claude + .codex + .crush + .gemini + .opencode + .pi sparse-checkout-cone-mode: true fetch-depth: 1 - - name: Check workflow file timestamps - uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8 + - name: Save agent config folders for base branch restoration + env: + GH_AW_AGENT_FOLDERS: ".agents .claude .codex .crush .gemini .github .opencode .pi" + GH_AW_AGENT_FILES: ".crush.json AGENTS.md CLAUDE.md GEMINI.md PI.md opencode.jsonc" + # poutine:ignore untrusted_checkout_exec + run: bash "${RUNNER_TEMP}/gh-aw/actions/save_base_github_folders.sh" + - name: Check workflow lock file + id: check-lock-file + uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 env: GH_AW_WORKFLOW_FILE: "breaking-change-doc.lock.yml" + GH_AW_CONTEXT_WORKFLOW_REF: "${{ github.workflow_ref }}" with: script: | const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); - setupGlobals(core, github, context, exec, io); + setupGlobals(core, github, context, exec, io, getOctokit); const { main } = require('${{ runner.temp }}/gh-aw/actions/check_workflow_timestamp_api.cjs'); await main(); - name: Check compile-agentic version - uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8 + uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 env: - GH_AW_COMPILED_VERSION: "v0.65.6" + GH_AW_COMPILED_VERSION: "v0.71.5" with: script: | const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); - setupGlobals(core, github, context, exec, io); + setupGlobals(core, github, context, exec, io, getOctokit); const { main } = require('${{ runner.temp }}/gh-aw/actions/check_version_updates.cjs'); await main(); - name: Compute current body text id: sanitized - uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8 + uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 + env: + GH_AW_ALLOWED_DOMAINS: "api.business.githubcopilot.com,api.enterprise.githubcopilot.com,api.github.com,api.githubcopilot.com,api.individual.githubcopilot.com,api.snapcraft.io,archive.ubuntu.com,azure.archive.ubuntu.com,crl.geotrust.com,crl.globalsign.com,crl.identrust.com,crl.sectigo.com,crl.thawte.com,crl.usertrust.com,crl.verisign.com,crl3.digicert.com,crl4.digicert.com,crls.ssl.com,github.com,host.docker.internal,json-schema.org,json.schemastore.org,keyserver.ubuntu.com,ocsp.digicert.com,ocsp.geotrust.com,ocsp.globalsign.com,ocsp.identrust.com,ocsp.sectigo.com,ocsp.ssl.com,ocsp.thawte.com,ocsp.usertrust.com,ocsp.verisign.com,packagecloud.io,packages.cloud.google.com,packages.microsoft.com,ppa.launchpad.net,raw.githubusercontent.com,registry.npmjs.org,s.symcb.com,s.symcd.com,security.ubuntu.com,telemetry.enterprise.githubcopilot.com,ts-crl.ws.symantec.com,ts-ocsp.ws.symantec.com,www.googleapis.com" with: script: | const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); - setupGlobals(core, github, context, exec, io); + setupGlobals(core, github, context, exec, io, getOctokit); const { main } = require('${{ runner.temp }}/gh-aw/actions/compute_text.cjs'); await main(); - name: Create prompt with built-in context @@ -188,19 +233,22 @@ jobs: GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }} # poutine:ignore untrusted_checkout_exec run: | - bash ${RUNNER_TEMP}/gh-aw/actions/create_prompt_first.sh + bash "${RUNNER_TEMP}/gh-aw/actions/create_prompt_first.sh" { - cat << 'GH_AW_PROMPT_f46a753a06b313f7_EOF' + cat << 'GH_AW_PROMPT_571edf9c05ec0872_EOF' - GH_AW_PROMPT_f46a753a06b313f7_EOF + GH_AW_PROMPT_571edf9c05ec0872_EOF cat "${RUNNER_TEMP}/gh-aw/prompts/xpia.md" cat "${RUNNER_TEMP}/gh-aw/prompts/temp_folder_prompt.md" cat "${RUNNER_TEMP}/gh-aw/prompts/markdown.md" cat "${RUNNER_TEMP}/gh-aw/prompts/safe_outputs_prompt.md" - cat << 'GH_AW_PROMPT_f46a753a06b313f7_EOF' + cat << 'GH_AW_PROMPT_571edf9c05ec0872_EOF' Tools: add_comment, missing_tool, missing_data, noop + GH_AW_PROMPT_571edf9c05ec0872_EOF + cat "${RUNNER_TEMP}/gh-aw/prompts/mcp_cli_tools_prompt.md" + cat << 'GH_AW_PROMPT_571edf9c05ec0872_EOF' The following GitHub context information is available for this workflow: {{#if __GH_AW_GITHUB_ACTOR__ }} @@ -229,27 +277,28 @@ jobs: {{/if}} - GH_AW_PROMPT_f46a753a06b313f7_EOF + GH_AW_PROMPT_571edf9c05ec0872_EOF cat "${RUNNER_TEMP}/gh-aw/prompts/github_mcp_tools_with_safeoutputs_prompt.md" - cat << 'GH_AW_PROMPT_f46a753a06b313f7_EOF' + cat << 'GH_AW_PROMPT_571edf9c05ec0872_EOF' {{#runtime-import .github/workflows/breaking-change-doc.md}} - GH_AW_PROMPT_f46a753a06b313f7_EOF + GH_AW_PROMPT_571edf9c05ec0872_EOF } > "$GH_AW_PROMPT" - name: Interpolate variables and render templates - uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8 + uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 env: GH_AW_PROMPT: /tmp/gh-aw/aw-prompts/prompt.txt + GH_AW_ENGINE_ID: "copilot" GH_AW_GITHUB_EVENT_INPUTS_PR_NUMBER: ${{ github.event.inputs.pr_number }} GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER: ${{ github.event.pull_request.number }} with: script: | const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); - setupGlobals(core, github, context, exec, io); + setupGlobals(core, github, context, exec, io, getOctokit); const { main } = require('${{ runner.temp }}/gh-aw/actions/interpolate_prompt.cjs'); await main(); - name: Substitute placeholders - uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8 + uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 env: GH_AW_PROMPT: /tmp/gh-aw/aw-prompts/prompt.txt GH_AW_GITHUB_ACTOR: ${{ github.actor }} @@ -261,11 +310,12 @@ jobs: GH_AW_GITHUB_REPOSITORY: ${{ github.repository }} GH_AW_GITHUB_RUN_ID: ${{ github.run_id }} GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }} + GH_AW_MCP_CLI_SERVERS_LIST: '- `safeoutputs` — run `safeoutputs --help` to see available tools' GH_AW_NEEDS_PRE_ACTIVATION_OUTPUTS_ACTIVATED: ${{ needs.pre_activation.outputs.activated }} with: script: | const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); - setupGlobals(core, github, context, exec, io); + setupGlobals(core, github, context, exec, io, getOctokit); const substitutePlaceholders = require('${{ runner.temp }}/gh-aw/actions/substitute_placeholders.cjs'); @@ -282,6 +332,7 @@ jobs: GH_AW_GITHUB_REPOSITORY: process.env.GH_AW_GITHUB_REPOSITORY, GH_AW_GITHUB_RUN_ID: process.env.GH_AW_GITHUB_RUN_ID, GH_AW_GITHUB_WORKSPACE: process.env.GH_AW_GITHUB_WORKSPACE, + GH_AW_MCP_CLI_SERVERS_LIST: process.env.GH_AW_MCP_CLI_SERVERS_LIST, GH_AW_NEEDS_PRE_ACTIVATION_OUTPUTS_ACTIVATED: process.env.GH_AW_NEEDS_PRE_ACTIVATION_OUTPUTS_ACTIVATED } }); @@ -289,24 +340,30 @@ jobs: env: GH_AW_PROMPT: /tmp/gh-aw/aw-prompts/prompt.txt # poutine:ignore untrusted_checkout_exec - run: bash ${RUNNER_TEMP}/gh-aw/actions/validate_prompt_placeholders.sh + run: bash "${RUNNER_TEMP}/gh-aw/actions/validate_prompt_placeholders.sh" - name: Print prompt env: GH_AW_PROMPT: /tmp/gh-aw/aw-prompts/prompt.txt # poutine:ignore untrusted_checkout_exec - run: bash ${RUNNER_TEMP}/gh-aw/actions/print_prompt_summary.sh + run: bash "${RUNNER_TEMP}/gh-aw/actions/print_prompt_summary.sh" - name: Upload activation artifact if: success() - uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7 + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 with: name: activation + include-hidden-files: true path: | /tmp/gh-aw/aw_info.json /tmp/gh-aw/aw-prompts/prompt.txt + /tmp/gh-aw/github_rate_limits.jsonl + /tmp/gh-aw/base + if-no-files-found: ignore retention-days: 1 agent: - needs: activation + needs: + - activation + - pat_pool runs-on: ubuntu-latest permissions: contents: read @@ -320,67 +377,83 @@ jobs: GH_AW_MCP_LOG_DIR: /tmp/gh-aw/mcp-logs/safeoutputs GH_AW_WORKFLOW_ID_SANITIZED: breakingchangedoc outputs: + agentic_engine_timeout: ${{ steps.detect-copilot-errors.outputs.agentic_engine_timeout || 'false' }} checkout_pr_success: ${{ steps.checkout-pr.outputs.checkout_pr_success || 'true' }} effective_tokens: ${{ steps.parse-mcp-gateway.outputs.effective_tokens }} has_patch: ${{ steps.collect_output.outputs.has_patch }} - inference_access_error: ${{ steps.detect-inference-error.outputs.inference_access_error || 'false' }} + inference_access_error: ${{ steps.detect-copilot-errors.outputs.inference_access_error || 'false' }} + mcp_policy_error: ${{ steps.detect-copilot-errors.outputs.mcp_policy_error || 'false' }} model: ${{ needs.activation.outputs.model }} + model_not_supported_error: ${{ steps.detect-copilot-errors.outputs.model_not_supported_error || 'false' }} output: ${{ steps.collect_output.outputs.output }} output_types: ${{ steps.collect_output.outputs.output_types }} + setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Setup Scripts - uses: github/gh-aw-actions/setup@31130b20a8fd3ef263acbe2091267c0aace07e09 # v0.65.6 + id: setup + uses: github/gh-aw-actions/setup@b8068426813005612b960b5ab0b8bd2c27142323 # v0.71.5 with: destination: ${{ runner.temp }}/gh-aw/actions + job-name: ${{ github.job }} + trace-id: ${{ needs.activation.outputs.setup-trace-id }} + env: + GH_AW_SETUP_WORKFLOW_NAME: "Breaking Change Documentation" + GH_AW_CURRENT_WORKFLOW_REF: ${{ github.repository }}/.github/workflows/breaking-change-doc.lock.yml@${{ github.ref }} + GH_AW_INFO_VERSION: "1.0.40" - name: Set runtime paths id: set-runtime-paths run: | - echo "GH_AW_SAFE_OUTPUTS=${RUNNER_TEMP}/gh-aw/safeoutputs/outputs.jsonl" >> "$GITHUB_OUTPUT" - echo "GH_AW_SAFE_OUTPUTS_CONFIG_PATH=${RUNNER_TEMP}/gh-aw/safeoutputs/config.json" >> "$GITHUB_OUTPUT" - echo "GH_AW_SAFE_OUTPUTS_TOOLS_PATH=${RUNNER_TEMP}/gh-aw/safeoutputs/tools.json" >> "$GITHUB_OUTPUT" + { + echo "GH_AW_SAFE_OUTPUTS=${RUNNER_TEMP}/gh-aw/safeoutputs/outputs.jsonl" + echo "GH_AW_SAFE_OUTPUTS_CONFIG_PATH=${RUNNER_TEMP}/gh-aw/safeoutputs/config.json" + echo "GH_AW_SAFE_OUTPUTS_TOOLS_PATH=${RUNNER_TEMP}/gh-aw/safeoutputs/tools.json" + } >> "$GITHUB_OUTPUT" - name: Checkout repository uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: persist-credentials: false - name: Create gh-aw temp directory - run: bash ${RUNNER_TEMP}/gh-aw/actions/create_gh_aw_tmp_dir.sh + run: bash "${RUNNER_TEMP}/gh-aw/actions/create_gh_aw_tmp_dir.sh" - name: Configure gh CLI for GitHub Enterprise - run: bash ${RUNNER_TEMP}/gh-aw/actions/configure_gh_for_ghe.sh + run: bash "${RUNNER_TEMP}/gh-aw/actions/configure_gh_for_ghe.sh" env: GH_TOKEN: ${{ github.token }} - name: Configure Git credentials env: REPO_NAME: ${{ github.repository }} SERVER_URL: ${{ github.server_url }} + GITHUB_TOKEN: ${{ github.token }} run: | git config --global user.email "github-actions[bot]@users.noreply.github.com" git config --global user.name "github-actions[bot]" git config --global am.keepcr true # Re-authenticate git with GitHub token SERVER_URL_STRIPPED="${SERVER_URL#https://}" - git remote set-url origin "https://x-access-token:${{ github.token }}@${SERVER_URL_STRIPPED}/${REPO_NAME}.git" + git remote set-url origin "https://x-access-token:${GITHUB_TOKEN}@${SERVER_URL_STRIPPED}/${REPO_NAME}.git" echo "Git configured with standard GitHub Actions identity" - name: Checkout PR branch id: checkout-pr if: | github.event.pull_request || github.event.issue.pull_request - uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8 + uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 env: GH_TOKEN: ${{ secrets.GH_AW_GITHUB_MCP_SERVER_TOKEN || secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} with: github-token: ${{ secrets.GH_AW_GITHUB_MCP_SERVER_TOKEN || secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} script: | const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); - setupGlobals(core, github, context, exec, io); + setupGlobals(core, github, context, exec, io, getOctokit); const { main } = require('${{ runner.temp }}/gh-aw/actions/checkout_pr_branch.cjs'); await main(); - name: Install GitHub Copilot CLI - run: ${RUNNER_TEMP}/gh-aw/actions/install_copilot_cli.sh latest + run: bash "${RUNNER_TEMP}/gh-aw/actions/install_copilot_cli.sh" 1.0.40 + env: + GH_HOST: github.com - name: Install AWF binary - run: bash ${RUNNER_TEMP}/gh-aw/actions/install_awf_binary.sh v0.25.11 + run: bash "${RUNNER_TEMP}/gh-aw/actions/install_awf_binary.sh" v0.25.40 - name: Determine automatic lockdown mode for GitHub MCP Server id: determine-automatic-lockdown - uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8 + uses: actions/github-script@373c709c69115d41ff229c7e5df9f8788daa9553 # v9 env: GH_AW_GITHUB_TOKEN: ${{ secrets.GH_AW_GITHUB_TOKEN }} GH_AW_GITHUB_MCP_SERVER_TOKEN: ${{ secrets.GH_AW_GITHUB_MCP_SERVER_TOKEN }} @@ -388,107 +461,142 @@ jobs: script: | const determineAutomaticLockdown = require('${{ runner.temp }}/gh-aw/actions/determine_automatic_lockdown.cjs'); await determineAutomaticLockdown(github, context, core); + - name: Download activation artifact + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 + with: + name: activation + path: /tmp/gh-aw + - name: Restore agent config folders from base branch + if: steps.checkout-pr.outcome == 'success' + env: + GH_AW_AGENT_FOLDERS: ".agents .claude .codex .crush .gemini .github .opencode .pi" + GH_AW_AGENT_FILES: ".crush.json AGENTS.md CLAUDE.md GEMINI.md PI.md opencode.jsonc" + run: bash "${RUNNER_TEMP}/gh-aw/actions/restore_base_github_folders.sh" - name: Download container images - run: bash ${RUNNER_TEMP}/gh-aw/actions/download_docker_images.sh ghcr.io/github/gh-aw-firewall/agent:0.25.11 ghcr.io/github/gh-aw-firewall/api-proxy:0.25.11 ghcr.io/github/gh-aw-firewall/squid:0.25.11 ghcr.io/github/gh-aw-mcpg:v0.2.11 ghcr.io/github/github-mcp-server:v0.32.0 node:lts-alpine - - name: Write Safe Outputs Config + run: bash "${RUNNER_TEMP}/gh-aw/actions/download_docker_images.sh" ghcr.io/github/gh-aw-firewall/agent:0.25.40@sha256:14ff567e8d9d4c2fbc5e55c973488381c71d7e0fdbe72d30ee7b8a738fd86504 ghcr.io/github/gh-aw-firewall/api-proxy:0.25.40@sha256:2883ca3e5ae9f330cafdd9345bfd4ae17fc8da36c96d4c9a1f76e922b4c45280 ghcr.io/github/gh-aw-firewall/squid:0.25.40@sha256:b084f4a2c771f584ee68084ced52fa6b3245197a1889645d817462d307d3ac51 ghcr.io/github/gh-aw-mcpg:v0.3.6@sha256:2bb8eef86006a4c5963c55616a9c51c32f27bfdecb023b8aa6f91f6718d9171c ghcr.io/github/github-mcp-server:v1.0.3@sha256:2ac27ef03461ef2b877031b838a7d1fd7f12b12d4ace7796d8cad91446d55959 node:lts-alpine@sha256:d1b3b4da11eefd5941e7f0b9cf17783fc99d9c6fc34884a665f40a06dbdfc94f + - name: Generate Safe Outputs Config run: | - mkdir -p ${RUNNER_TEMP}/gh-aw/safeoutputs + mkdir -p "${RUNNER_TEMP}/gh-aw/safeoutputs" mkdir -p /tmp/gh-aw/safeoutputs mkdir -p /tmp/gh-aw/mcp-logs/safeoutputs - cat > ${RUNNER_TEMP}/gh-aw/safeoutputs/config.json << 'GH_AW_SAFE_OUTPUTS_CONFIG_e4f1701b94f3ff9c_EOF' - {"add_comment":{"max":1,"target":"*"},"missing_data":{},"missing_tool":{},"noop":{"max":1,"report-as-issue":"false"}} - GH_AW_SAFE_OUTPUTS_CONFIG_e4f1701b94f3ff9c_EOF - - name: Write Safe Outputs Tools - run: | - cat > ${RUNNER_TEMP}/gh-aw/safeoutputs/tools_meta.json << 'GH_AW_SAFE_OUTPUTS_TOOLS_META_aa956acbe39a3949_EOF' - { - "description_suffixes": { - "add_comment": " CONSTRAINTS: Maximum 1 comment(s) can be added. Target: *." - }, - "repo_params": {}, - "dynamic_tools": [] - } - GH_AW_SAFE_OUTPUTS_TOOLS_META_aa956acbe39a3949_EOF - cat > ${RUNNER_TEMP}/gh-aw/safeoutputs/validation.json << 'GH_AW_SAFE_OUTPUTS_VALIDATION_65e8725d06d4acd6_EOF' - { - "add_comment": { - "defaultMax": 1, - "fields": { - "body": { - "required": true, - "type": "string", - "sanitize": true, - "maxLength": 65000 - }, - "item_number": { - "issueOrPRNumber": true - }, - "repo": { - "type": "string", - "maxLength": 256 + cat > "${RUNNER_TEMP}/gh-aw/safeoutputs/config.json" << 'GH_AW_SAFE_OUTPUTS_CONFIG_80ac430331ad7b0f_EOF' + {"add_comment":{"max":1,"target":"*"},"create_report_incomplete_issue":{},"missing_data":{},"missing_tool":{},"noop":{"max":1,"report-as-issue":"false"},"report_incomplete":{}} + GH_AW_SAFE_OUTPUTS_CONFIG_80ac430331ad7b0f_EOF + - name: Generate Safe Outputs Tools + env: + GH_AW_TOOLS_META_JSON: | + { + "description_suffixes": { + "add_comment": " CONSTRAINTS: Maximum 1 comment(s) can be added. Target: *. Supports reply_to_id for discussion threading." + }, + "repo_params": {}, + "dynamic_tools": [] + } + GH_AW_VALIDATION_JSON: | + { + "add_comment": { + "defaultMax": 1, + "fields": { + "body": { + "required": true, + "type": "string", + "sanitize": true, + "maxLength": 65000 + }, + "item_number": { + "issueOrPRNumber": true + }, + "reply_to_id": { + "type": "string", + "maxLength": 256 + }, + "repo": { + "type": "string", + "maxLength": 256 + } } - } - }, - "missing_data": { - "defaultMax": 20, - "fields": { - "alternatives": { - "type": "string", - "sanitize": true, - "maxLength": 256 - }, - "context": { - "type": "string", - "sanitize": true, - "maxLength": 256 - }, - "data_type": { - "type": "string", - "sanitize": true, - "maxLength": 128 - }, - "reason": { - "type": "string", - "sanitize": true, - "maxLength": 256 + }, + "missing_data": { + "defaultMax": 20, + "fields": { + "alternatives": { + "type": "string", + "sanitize": true, + "maxLength": 256 + }, + "context": { + "type": "string", + "sanitize": true, + "maxLength": 256 + }, + "data_type": { + "type": "string", + "sanitize": true, + "maxLength": 128 + }, + "reason": { + "type": "string", + "sanitize": true, + "maxLength": 256 + } } - } - }, - "missing_tool": { - "defaultMax": 20, - "fields": { - "alternatives": { - "type": "string", - "sanitize": true, - "maxLength": 512 - }, - "reason": { - "required": true, - "type": "string", - "sanitize": true, - "maxLength": 256 - }, - "tool": { - "type": "string", - "sanitize": true, - "maxLength": 128 + }, + "missing_tool": { + "defaultMax": 20, + "fields": { + "alternatives": { + "type": "string", + "sanitize": true, + "maxLength": 512 + }, + "reason": { + "required": true, + "type": "string", + "sanitize": true, + "maxLength": 256 + }, + "tool": { + "type": "string", + "sanitize": true, + "maxLength": 128 + } } - } - }, - "noop": { - "defaultMax": 1, - "fields": { - "message": { - "required": true, - "type": "string", - "sanitize": true, - "maxLength": 65000 + }, + "noop": { + "defaultMax": 1, + "fields": { + "message": { + "required": true, + "type": "string", + "sanitize": true, + "maxLength": 65000 + } + } + }, + "report_incomplete": { + "defaultMax": 5, + "fields": { + "details": { + "type": "string", + "sanitize": true, + "maxLength": 65000 + }, + "reason": { + "required": true, + "type": "string", + "sanitize": true, + "maxLength": 1024 + } } } } - } - GH_AW_SAFE_OUTPUTS_VALIDATION_65e8725d06d4acd6_EOF - node ${RUNNER_TEMP}/gh-aw/actions/generate_safe_outputs_tools.cjs + uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 + with: + script: | + const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); + setupGlobals(core, github, context, exec, io, getOctokit); + const { main } = require('${{ runner.temp }}/gh-aw/actions/generate_safe_outputs_tools.cjs'); + await main(); - name: Generate Safe Outputs MCP Server Config id: safe-outputs-config run: | @@ -527,7 +635,7 @@ jobs: export GH_AW_SAFE_OUTPUTS_CONFIG_PATH export GH_AW_MCP_LOG_DIR - bash ${RUNNER_TEMP}/gh-aw/actions/start_safe_outputs_server.sh + bash "${RUNNER_TEMP}/gh-aw/actions/start_safe_outputs_server.sh" - name: Start MCP Gateway id: start-mcp-gateway @@ -540,11 +648,12 @@ jobs: GITHUB_MCP_SERVER_TOKEN: ${{ secrets.GH_AW_GITHUB_MCP_SERVER_TOKEN || secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} run: | set -eo pipefail - mkdir -p /tmp/gh-aw/mcp-config + mkdir -p "${RUNNER_TEMP}/gh-aw/mcp-config" # Export gateway environment variables for MCP config and gateway script - export MCP_GATEWAY_PORT="80" + export MCP_GATEWAY_PORT="8080" export MCP_GATEWAY_DOMAIN="host.docker.internal" + export MCP_GATEWAY_HOST_DOMAIN="localhost" MCP_GATEWAY_API_KEY=$(openssl rand -base64 45 | tr -d '/+=') echo "::add-mask::${MCP_GATEWAY_API_KEY}" export MCP_GATEWAY_API_KEY @@ -554,15 +663,19 @@ jobs: export DEBUG="*" export GH_AW_ENGINE="copilot" - export MCP_GATEWAY_DOCKER_COMMAND='docker run -i --rm --network host -v /var/run/docker.sock:/var/run/docker.sock -e MCP_GATEWAY_PORT -e MCP_GATEWAY_DOMAIN -e MCP_GATEWAY_API_KEY -e MCP_GATEWAY_PAYLOAD_DIR -e MCP_GATEWAY_PAYLOAD_SIZE_THRESHOLD -e DEBUG -e MCP_GATEWAY_LOG_DIR -e GH_AW_MCP_LOG_DIR -e GH_AW_SAFE_OUTPUTS -e GH_AW_SAFE_OUTPUTS_CONFIG_PATH -e GH_AW_SAFE_OUTPUTS_TOOLS_PATH -e GH_AW_ASSETS_BRANCH -e GH_AW_ASSETS_MAX_SIZE_KB -e GH_AW_ASSETS_ALLOWED_EXTS -e DEFAULT_BRANCH -e GITHUB_MCP_SERVER_TOKEN -e GITHUB_MCP_GUARD_MIN_INTEGRITY -e GITHUB_MCP_GUARD_REPOS -e GITHUB_REPOSITORY -e GITHUB_SERVER_URL -e GITHUB_SHA -e GITHUB_WORKSPACE -e GITHUB_TOKEN -e GITHUB_RUN_ID -e GITHUB_RUN_NUMBER -e GITHUB_RUN_ATTEMPT -e GITHUB_JOB -e GITHUB_ACTION -e GITHUB_EVENT_NAME -e GITHUB_EVENT_PATH -e GITHUB_ACTOR -e GITHUB_ACTOR_ID -e GITHUB_TRIGGERING_ACTOR -e GITHUB_WORKFLOW -e GITHUB_WORKFLOW_REF -e GITHUB_WORKFLOW_SHA -e GITHUB_REF -e GITHUB_REF_NAME -e GITHUB_REF_TYPE -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e GH_AW_SAFE_OUTPUTS_PORT -e GH_AW_SAFE_OUTPUTS_API_KEY -v /tmp/gh-aw/mcp-payloads:/tmp/gh-aw/mcp-payloads:rw -v /opt:/opt:ro -v /tmp:/tmp:rw -v '"${GITHUB_WORKSPACE}"':'"${GITHUB_WORKSPACE}"':rw ghcr.io/github/gh-aw-mcpg:v0.2.11' + MCP_GATEWAY_UID=$(id -u 2>/dev/null || echo '0') + MCP_GATEWAY_GID=$(id -g 2>/dev/null || echo '0') + DOCKER_SOCK_GID=$(stat -c '%g' /var/run/docker.sock 2>/dev/null || echo '0') + export MCP_GATEWAY_DOCKER_COMMAND='docker run -i --rm --network host --add-host host.docker.internal:127.0.0.1 --user '"${MCP_GATEWAY_UID}"':'"${MCP_GATEWAY_GID}"' --group-add '"${DOCKER_SOCK_GID}"' -v /var/run/docker.sock:/var/run/docker.sock -e MCP_GATEWAY_PORT -e MCP_GATEWAY_DOMAIN -e MCP_GATEWAY_API_KEY -e MCP_GATEWAY_PAYLOAD_DIR -e MCP_GATEWAY_PAYLOAD_SIZE_THRESHOLD -e DEBUG -e MCP_GATEWAY_LOG_DIR -e GH_AW_MCP_LOG_DIR -e GH_AW_SAFE_OUTPUTS -e GH_AW_SAFE_OUTPUTS_CONFIG_PATH -e GH_AW_SAFE_OUTPUTS_TOOLS_PATH -e GH_AW_ASSETS_BRANCH -e GH_AW_ASSETS_MAX_SIZE_KB -e GH_AW_ASSETS_ALLOWED_EXTS -e DEFAULT_BRANCH -e GITHUB_MCP_SERVER_TOKEN -e GITHUB_MCP_GUARD_MIN_INTEGRITY -e GITHUB_MCP_GUARD_REPOS -e GITHUB_REPOSITORY -e GITHUB_SERVER_URL -e GITHUB_SHA -e GITHUB_WORKSPACE -e GITHUB_TOKEN -e GITHUB_RUN_ID -e GITHUB_RUN_NUMBER -e GITHUB_RUN_ATTEMPT -e GITHUB_JOB -e GITHUB_ACTION -e GITHUB_EVENT_NAME -e GITHUB_EVENT_PATH -e GITHUB_ACTOR -e GITHUB_ACTOR_ID -e GITHUB_TRIGGERING_ACTOR -e GITHUB_WORKFLOW -e GITHUB_WORKFLOW_REF -e GITHUB_WORKFLOW_SHA -e GITHUB_REF -e GITHUB_REF_NAME -e GITHUB_REF_TYPE -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e GH_AW_SAFE_OUTPUTS_PORT -e GH_AW_SAFE_OUTPUTS_API_KEY -v /tmp/gh-aw/mcp-payloads:/tmp/gh-aw/mcp-payloads:rw -v /opt:/opt:ro -v /tmp:/tmp:rw -v '"${GITHUB_WORKSPACE}"':'"${GITHUB_WORKSPACE}"':rw ghcr.io/github/gh-aw-mcpg:v0.3.6' mkdir -p /home/runner/.copilot - cat << GH_AW_MCP_CONFIG_443fee0fd0da6a12_EOF | bash ${RUNNER_TEMP}/gh-aw/actions/start_mcp_gateway.sh + GH_AW_NODE=$(which node 2>/dev/null || command -v node 2>/dev/null || echo node) + cat << GH_AW_MCP_CONFIG_8ceb2e233eee9e0c_EOF | "$GH_AW_NODE" "${RUNNER_TEMP}/gh-aw/actions/start_mcp_gateway.cjs" { "mcpServers": { "github": { "type": "stdio", - "container": "ghcr.io/github/github-mcp-server:v0.32.0", + "container": "ghcr.io/github/github-mcp-server:v1.0.3", "env": { "GITHUB_HOST": "\${GITHUB_SERVER_URL}", "GITHUB_PERSONAL_ACCESS_TOKEN": "\${GITHUB_MCP_SERVER_TOKEN}", @@ -598,15 +711,28 @@ jobs: "payloadDir": "${MCP_GATEWAY_PAYLOAD_DIR}" } } - GH_AW_MCP_CONFIG_443fee0fd0da6a12_EOF - - name: Download activation artifact - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 + GH_AW_MCP_CONFIG_8ceb2e233eee9e0c_EOF + - name: Mount MCP servers as CLIs + id: mount-mcp-clis + continue-on-error: true + env: + MCP_GATEWAY_API_KEY: ${{ steps.start-mcp-gateway.outputs.gateway-api-key }} + MCP_GATEWAY_DOMAIN: ${{ steps.start-mcp-gateway.outputs.gateway-domain }} + MCP_GATEWAY_PORT: ${{ steps.start-mcp-gateway.outputs.gateway-port }} + uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 with: - name: activation - path: /tmp/gh-aw - - name: Clean git credentials + script: | + const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); + setupGlobals(core, github, context, exec, io); + const { main } = require('${{ runner.temp }}/gh-aw/actions/mount_mcp_as_cli.cjs'); + await main(); + - name: Clean credentials + continue-on-error: true + run: bash "${RUNNER_TEMP}/gh-aw/actions/clean_git_credentials.sh" + - name: Audit pre-agent workspace + id: pre_agent_audit continue-on-error: true - run: bash ${RUNNER_TEMP}/gh-aw/actions/clean_git_credentials.sh + run: bash "${RUNNER_TEMP}/gh-aw/actions/audit_pre_agent_workspace.sh" - name: Execute GitHub Copilot CLI id: agentic_execution # Copilot CLI tool arguments (sorted): @@ -621,6 +747,7 @@ jobs: # --allow-tool shell(ls) # --allow-tool shell(pwd) # --allow-tool shell(pwsh) + # --allow-tool shell(safeoutputs:*) # --allow-tool shell(sort) # --allow-tool shell(tail) # --allow-tool shell(uniq) @@ -631,20 +758,26 @@ jobs: run: | set -o pipefail touch /tmp/gh-aw/agent-step-summary.md + GH_AW_NODE_BIN=$(command -v node 2>/dev/null || true) + export GH_AW_NODE_BIN + (umask 177 && touch /tmp/gh-aw/agent-stdio.log) + printf '%s\n' '{"$schema":"https://github.com/github/gh-aw-firewall/releases/download/v0.25.40/awf-config.schema.json","network":{"allowDomains":["api.business.githubcopilot.com","api.enterprise.githubcopilot.com","api.github.com","api.githubcopilot.com","api.individual.githubcopilot.com","api.snapcraft.io","archive.ubuntu.com","azure.archive.ubuntu.com","crl.geotrust.com","crl.globalsign.com","crl.identrust.com","crl.sectigo.com","crl.thawte.com","crl.usertrust.com","crl.verisign.com","crl3.digicert.com","crl4.digicert.com","crls.ssl.com","github.com","host.docker.internal","json-schema.org","json.schemastore.org","keyserver.ubuntu.com","ocsp.digicert.com","ocsp.geotrust.com","ocsp.globalsign.com","ocsp.identrust.com","ocsp.sectigo.com","ocsp.ssl.com","ocsp.thawte.com","ocsp.usertrust.com","ocsp.verisign.com","packagecloud.io","packages.cloud.google.com","packages.microsoft.com","ppa.launchpad.net","raw.githubusercontent.com","registry.npmjs.org","s.symcb.com","s.symcd.com","security.ubuntu.com","telemetry.enterprise.githubcopilot.com","ts-crl.ws.symantec.com","ts-ocsp.ws.symantec.com","www.googleapis.com"]},"apiProxy":{"enabled":true,"models":{"auto":["large"],"deep-research":["copilot/deep-research*","google/deep-research*"],"gemini-flash":["copilot/gemini-*flash*","google/gemini-*flash*"],"gemini-pro":["copilot/gemini-*pro*","google/gemini-*pro*"],"gpt-4.1":["copilot/gpt-4.1*","openai/gpt-4.1*"],"gpt-5":["copilot/gpt-5*","openai/gpt-5*"],"gpt-5-codex":["copilot/gpt-5*codex*","openai/gpt-5*codex*"],"gpt-5-mini":["copilot/gpt-5*mini*","openai/gpt-5*mini*"],"gpt-5-nano":["copilot/gpt-5*nano*","openai/gpt-5*nano*"],"gpt-5-pro":["copilot/gpt-5*pro*","openai/gpt-5*pro*"],"haiku":["copilot/*haiku*","anthropic/*haiku*"],"large":["sonnet","gpt-5-pro","gpt-5","gemini-pro"],"mini":["haiku","gpt-5-mini","gpt-5-nano","gemini-flash"],"opus":["copilot/*opus*","anthropic/*opus*"],"reasoning":["copilot/o1*","copilot/o3*","copilot/o4*","openai/o1*","openai/o3*","openai/o4*"],"small":["mini"],"sonnet":["copilot/*sonnet*","anthropic/*sonnet*"]}},"container":{"imageTag":"0.25.40,squid=sha256:b084f4a2c771f584ee68084ced52fa6b3245197a1889645d817462d307d3ac51,agent=sha256:14ff567e8d9d4c2fbc5e55c973488381c71d7e0fdbe72d30ee7b8a738fd86504,api-proxy=sha256:2883ca3e5ae9f330cafdd9345bfd4ae17fc8da36c96d4c9a1f76e922b4c45280,cli-proxy=sha256:3e7152911d4b4b7b97beef9d3d7d924ff7902227e86001ef3838fb728d5d514c"}}' > "${RUNNER_TEMP}/gh-aw/awf-config.json" && cp "${RUNNER_TEMP}/gh-aw/awf-config.json" /tmp/gh-aw/awf-config.json # shellcheck disable=SC1003 - sudo -E awf --container-workdir "${GITHUB_WORKSPACE}" --mount "${RUNNER_TEMP}/gh-aw:${RUNNER_TEMP}/gh-aw:ro" --mount "${RUNNER_TEMP}/gh-aw:/host${RUNNER_TEMP}/gh-aw:ro" --env-all --exclude-env COPILOT_GITHUB_TOKEN --exclude-env GITHUB_MCP_SERVER_TOKEN --exclude-env MCP_GATEWAY_API_KEY --allow-domains api.business.githubcopilot.com,api.enterprise.githubcopilot.com,api.github.com,api.githubcopilot.com,api.individual.githubcopilot.com,api.snapcraft.io,archive.ubuntu.com,azure.archive.ubuntu.com,crl.geotrust.com,crl.globalsign.com,crl.identrust.com,crl.sectigo.com,crl.thawte.com,crl.usertrust.com,crl.verisign.com,crl3.digicert.com,crl4.digicert.com,crls.ssl.com,github.com,host.docker.internal,json-schema.org,json.schemastore.org,keyserver.ubuntu.com,ocsp.digicert.com,ocsp.geotrust.com,ocsp.globalsign.com,ocsp.identrust.com,ocsp.sectigo.com,ocsp.ssl.com,ocsp.thawte.com,ocsp.usertrust.com,ocsp.verisign.com,packagecloud.io,packages.cloud.google.com,packages.microsoft.com,ppa.launchpad.net,raw.githubusercontent.com,registry.npmjs.org,s.symcb.com,s.symcd.com,security.ubuntu.com,telemetry.enterprise.githubcopilot.com,ts-crl.ws.symantec.com,ts-ocsp.ws.symantec.com,www.googleapis.com --log-level info --proxy-logs-dir /tmp/gh-aw/sandbox/firewall/logs --audit-dir /tmp/gh-aw/sandbox/firewall/audit --enable-host-access --image-tag 0.25.11 --skip-pull --enable-api-proxy \ - -- /bin/bash -c '/usr/local/bin/copilot --add-dir /tmp/gh-aw/ --log-level all --log-dir /tmp/gh-aw/sandbox/agent/logs/ --disable-builtin-mcps --allow-tool github --allow-tool safeoutputs --allow-tool '\''shell(cat)'\'' --allow-tool '\''shell(date)'\'' --allow-tool '\''shell(echo)'\'' --allow-tool '\''shell(gh:*)'\'' --allow-tool '\''shell(grep)'\'' --allow-tool '\''shell(head)'\'' --allow-tool '\''shell(ls)'\'' --allow-tool '\''shell(pwd)'\'' --allow-tool '\''shell(pwsh)'\'' --allow-tool '\''shell(sort)'\'' --allow-tool '\''shell(tail)'\'' --allow-tool '\''shell(uniq)'\'' --allow-tool '\''shell(wc)'\'' --allow-tool '\''shell(yq)'\'' --allow-tool write --allow-all-paths --add-dir "${GITHUB_WORKSPACE}" --prompt "$(cat /tmp/gh-aw/aw-prompts/prompt.txt)"' 2>&1 | tee -a /tmp/gh-aw/agent-stdio.log + sudo -E awf --config "${RUNNER_TEMP}/gh-aw/awf-config.json" --container-workdir "${GITHUB_WORKSPACE}" --mount "${RUNNER_TEMP}/gh-aw:${RUNNER_TEMP}/gh-aw:ro" --mount "${RUNNER_TEMP}/gh-aw:/host${RUNNER_TEMP}/gh-aw:ro" --env-all --exclude-env COPILOT_GITHUB_TOKEN --exclude-env GITHUB_MCP_SERVER_TOKEN --exclude-env MCP_GATEWAY_API_KEY --log-level info --proxy-logs-dir /tmp/gh-aw/sandbox/firewall/logs --audit-dir /tmp/gh-aw/sandbox/firewall/audit --enable-host-access --allow-host-ports 80,443,8080 --skip-pull \ + -- /bin/bash -c 'export PATH="${RUNNER_TEMP}/gh-aw/mcp-cli/bin:$PATH" && export PATH="$(find /opt/hostedtoolcache /home/runner/work/_tool -maxdepth 4 -type d -name bin 2>/dev/null | tr '\''\n'\'' '\'':'\'')$PATH"; [ -n "$GOROOT" ] && export PATH="$GOROOT/bin:$PATH" || true && GH_AW_NODE_EXEC="${GH_AW_NODE_BIN:-}"; if [ -z "$GH_AW_NODE_EXEC" ] || [ ! -x "$GH_AW_NODE_EXEC" ]; then GH_AW_NODE_EXEC="$(command -v node 2>/dev/null || echo node)"; fi; "$GH_AW_NODE_EXEC" ${RUNNER_TEMP}/gh-aw/actions/copilot_harness.cjs /usr/local/bin/copilot --add-dir /tmp/gh-aw/ --log-level all --log-dir /tmp/gh-aw/sandbox/agent/logs/ --disable-builtin-mcps --no-ask-user --allow-tool github --allow-tool safeoutputs --allow-tool '\''shell(cat)'\'' --allow-tool '\''shell(date)'\'' --allow-tool '\''shell(echo)'\'' --allow-tool '\''shell(gh:*)'\'' --allow-tool '\''shell(grep)'\'' --allow-tool '\''shell(head)'\'' --allow-tool '\''shell(ls)'\'' --allow-tool '\''shell(pwd)'\'' --allow-tool '\''shell(pwsh)'\'' --allow-tool '\''shell(safeoutputs:*)'\'' --allow-tool '\''shell(sort)'\'' --allow-tool '\''shell(tail)'\'' --allow-tool '\''shell(uniq)'\'' --allow-tool '\''shell(wc)'\'' --allow-tool '\''shell(yq)'\'' --allow-tool write --allow-all-paths --add-dir "${GITHUB_WORKSPACE}" --prompt-file /tmp/gh-aw/aw-prompts/prompt.txt' 2>&1 | tee -a /tmp/gh-aw/agent-stdio.log env: COPILOT_AGENT_RUNNER_TYPE: STANDALONE - COPILOT_GITHUB_TOKEN: ${{ case(needs.pre_activation.outputs.copilot_pat_number == '0', secrets.COPILOT_PAT_0, needs.pre_activation.outputs.copilot_pat_number == '1', secrets.COPILOT_PAT_1, needs.pre_activation.outputs.copilot_pat_number == '2', secrets.COPILOT_PAT_2, needs.pre_activation.outputs.copilot_pat_number == '3', secrets.COPILOT_PAT_3, needs.pre_activation.outputs.copilot_pat_number == '4', secrets.COPILOT_PAT_4, needs.pre_activation.outputs.copilot_pat_number == '5', secrets.COPILOT_PAT_5, needs.pre_activation.outputs.copilot_pat_number == '6', secrets.COPILOT_PAT_6, needs.pre_activation.outputs.copilot_pat_number == '7', secrets.COPILOT_PAT_7, needs.pre_activation.outputs.copilot_pat_number == '8', secrets.COPILOT_PAT_8, needs.pre_activation.outputs.copilot_pat_number == '9', secrets.COPILOT_PAT_9, secrets.COPILOT_GITHUB_TOKEN) }} - COPILOT_MODEL: ${{ vars.GH_AW_MODEL_AGENT_COPILOT || '' }} + COPILOT_API_KEY: dummy-byok-key-for-offline-mode + COPILOT_GITHUB_TOKEN: ${{ case(needs.pat_pool.outputs.pat_number == '0', secrets.COPILOT_PAT_0, needs.pat_pool.outputs.pat_number == '1', secrets.COPILOT_PAT_1, needs.pat_pool.outputs.pat_number == '2', secrets.COPILOT_PAT_2, needs.pat_pool.outputs.pat_number == '3', secrets.COPILOT_PAT_3, needs.pat_pool.outputs.pat_number == '4', secrets.COPILOT_PAT_4, needs.pat_pool.outputs.pat_number == '5', secrets.COPILOT_PAT_5, needs.pat_pool.outputs.pat_number == '6', secrets.COPILOT_PAT_6, needs.pat_pool.outputs.pat_number == '7', secrets.COPILOT_PAT_7, needs.pat_pool.outputs.pat_number == '8', secrets.COPILOT_PAT_8, needs.pat_pool.outputs.pat_number == '9', secrets.COPILOT_PAT_9, secrets.COPILOT_GITHUB_TOKEN) }} + COPILOT_MODEL: ${{ vars.GH_AW_MODEL_AGENT_COPILOT || 'claude-sonnet-4.6' }} GH_AW_MCP_CONFIG: /home/runner/.copilot/mcp-config.json GH_AW_PHASE: agent GH_AW_PROMPT: /tmp/gh-aw/aw-prompts/prompt.txt GH_AW_SAFE_OUTPUTS: ${{ steps.set-runtime-paths.outputs.GH_AW_SAFE_OUTPUTS }} - GH_AW_VERSION: v0.65.6 + GH_AW_VERSION: v0.71.5 GITHUB_API_URL: ${{ github.api_url }} GITHUB_AW: true + GITHUB_COPILOT_INTEGRATION_ID: agentic-workflows GITHUB_HEAD_REF: ${{ github.head_ref }} GITHUB_MCP_SERVER_TOKEN: ${{ secrets.GH_AW_GITHUB_MCP_SERVER_TOKEN || secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} GITHUB_REF_NAME: ${{ github.ref_name }} @@ -656,27 +789,28 @@ jobs: GIT_COMMITTER_EMAIL: github-actions[bot]@users.noreply.github.com GIT_COMMITTER_NAME: github-actions[bot] XDG_CONFIG_HOME: /home/runner - - name: Detect inference access error - id: detect-inference-error + - name: Detect Copilot errors + id: detect-copilot-errors if: always() continue-on-error: true - run: bash ${RUNNER_TEMP}/gh-aw/actions/detect_inference_access_error.sh + run: node "${RUNNER_TEMP}/gh-aw/actions/detect_copilot_errors.cjs" - name: Configure Git credentials env: REPO_NAME: ${{ github.repository }} SERVER_URL: ${{ github.server_url }} + GITHUB_TOKEN: ${{ github.token }} run: | git config --global user.email "github-actions[bot]@users.noreply.github.com" git config --global user.name "github-actions[bot]" git config --global am.keepcr true # Re-authenticate git with GitHub token SERVER_URL_STRIPPED="${SERVER_URL#https://}" - git remote set-url origin "https://x-access-token:${{ github.token }}@${SERVER_URL_STRIPPED}/${REPO_NAME}.git" + git remote set-url origin "https://x-access-token:${GITHUB_TOKEN}@${SERVER_URL_STRIPPED}/${REPO_NAME}.git" echo "Git configured with standard GitHub Actions identity" - name: Copy Copilot session state files to logs if: always() continue-on-error: true - run: bash ${RUNNER_TEMP}/gh-aw/actions/copy_copilot_session_state.sh + run: bash "${RUNNER_TEMP}/gh-aw/actions/copy_copilot_session_state.sh" - name: Stop MCP Gateway if: always() continue-on-error: true @@ -685,14 +819,14 @@ jobs: MCP_GATEWAY_API_KEY: ${{ steps.start-mcp-gateway.outputs.gateway-api-key }} GATEWAY_PID: ${{ steps.start-mcp-gateway.outputs.gateway-pid }} run: | - bash ${RUNNER_TEMP}/gh-aw/actions/stop_mcp_gateway.sh "$GATEWAY_PID" + bash "${RUNNER_TEMP}/gh-aw/actions/stop_mcp_gateway.sh" "$GATEWAY_PID" - name: Redact secrets in logs if: always() - uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8 + uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 with: script: | const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); - setupGlobals(core, github, context, exec, io); + setupGlobals(core, github, context, exec, io, getOctokit); const { main } = require('${{ runner.temp }}/gh-aw/actions/redact_secrets.cjs'); await main(); env: @@ -713,7 +847,7 @@ jobs: SECRET_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Append agent step summary if: always() - run: bash ${RUNNER_TEMP}/gh-aw/actions/append_agent_step_summary.sh + run: bash "${RUNNER_TEMP}/gh-aw/actions/append_agent_step_summary.sh" - name: Copy Safe Outputs if: always() env: @@ -724,7 +858,7 @@ jobs: - name: Ingest agent output id: collect_output if: always() - uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8 + uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 env: GH_AW_SAFE_OUTPUTS: ${{ steps.set-runtime-paths.outputs.GH_AW_SAFE_OUTPUTS }} GH_AW_ALLOWED_DOMAINS: "api.business.githubcopilot.com,api.enterprise.githubcopilot.com,api.github.com,api.githubcopilot.com,api.individual.githubcopilot.com,api.snapcraft.io,archive.ubuntu.com,azure.archive.ubuntu.com,crl.geotrust.com,crl.globalsign.com,crl.identrust.com,crl.sectigo.com,crl.thawte.com,crl.usertrust.com,crl.verisign.com,crl3.digicert.com,crl4.digicert.com,crls.ssl.com,github.com,host.docker.internal,json-schema.org,json.schemastore.org,keyserver.ubuntu.com,ocsp.digicert.com,ocsp.geotrust.com,ocsp.globalsign.com,ocsp.identrust.com,ocsp.sectigo.com,ocsp.ssl.com,ocsp.thawte.com,ocsp.usertrust.com,ocsp.verisign.com,packagecloud.io,packages.cloud.google.com,packages.microsoft.com,ppa.launchpad.net,raw.githubusercontent.com,registry.npmjs.org,s.symcb.com,s.symcd.com,security.ubuntu.com,telemetry.enterprise.githubcopilot.com,ts-crl.ws.symantec.com,ts-ocsp.ws.symantec.com,www.googleapis.com" @@ -733,28 +867,28 @@ jobs: with: script: | const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); - setupGlobals(core, github, context, exec, io); + setupGlobals(core, github, context, exec, io, getOctokit); const { main } = require('${{ runner.temp }}/gh-aw/actions/collect_ndjson_output.cjs'); await main(); - name: Parse agent logs for step summary if: always() - uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8 + uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 env: GH_AW_AGENT_OUTPUT: /tmp/gh-aw/sandbox/agent/logs/ with: script: | const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); - setupGlobals(core, github, context, exec, io); + setupGlobals(core, github, context, exec, io, getOctokit); const { main } = require('${{ runner.temp }}/gh-aw/actions/parse_copilot_log.cjs'); await main(); - name: Parse MCP Gateway logs for step summary if: always() id: parse-mcp-gateway - uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8 + uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 with: script: | const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); - setupGlobals(core, github, context, exec, io); + setupGlobals(core, github, context, exec, io, getOctokit); const { main } = require('${{ runner.temp }}/gh-aw/actions/parse_mcp_gateway_log.cjs'); await main(); - name: Print firewall logs @@ -763,9 +897,9 @@ jobs: env: AWF_LOGS_DIR: /tmp/gh-aw/sandbox/firewall/logs run: | - # Fix permissions on firewall logs so they can be uploaded as artifacts + # Fix permissions on firewall logs/audit dirs so they can be uploaded as artifacts # AWF runs with sudo, creating files owned by root - sudo chmod -R a+r /tmp/gh-aw/sandbox/firewall/logs 2>/dev/null || true + sudo chmod -R a+r /tmp/gh-aw/sandbox/firewall 2>/dev/null || true # Only run awf logs summary if awf command exists (it may not be installed if workflow failed before install step) if command -v awf &> /dev/null; then awf logs summary | tee -a "$GITHUB_STEP_SUMMARY" @@ -775,7 +909,23 @@ jobs: - name: Parse token usage for step summary if: always() continue-on-error: true - run: bash ${RUNNER_TEMP}/gh-aw/actions/parse_token_usage.sh + uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 + with: + script: | + const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); + setupGlobals(core, github, context, exec, io, getOctokit); + const { main } = require('${{ runner.temp }}/gh-aw/actions/parse_token_usage.cjs'); + await main(); + - name: Print AWF reflect summary + if: always() + continue-on-error: true + uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 + with: + script: | + const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); + setupGlobals(core, github, context, exec, io, getOctokit); + const { main } = require('${{ runner.temp }}/gh-aw/actions/awf_reflect_summary.cjs'); + await main(); - name: Write agent output placeholder if missing if: always() run: | @@ -794,7 +944,7 @@ jobs: - name: Upload agent artifacts if: always() continue-on-error: true - uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7 + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 with: name: agent path: | @@ -802,22 +952,19 @@ jobs: /tmp/gh-aw/sandbox/agent/logs/ /tmp/gh-aw/redacted-urls.log /tmp/gh-aw/mcp-logs/ + /tmp/gh-aw/agent_usage.json /tmp/gh-aw/agent-stdio.log + /tmp/gh-aw/pre-agent-audit.txt /tmp/gh-aw/agent/ + /tmp/gh-aw/github_rate_limits.jsonl /tmp/gh-aw/safeoutputs.jsonl /tmp/gh-aw/agent_output.json /tmp/gh-aw/aw-*.patch /tmp/gh-aw/aw-*.bundle - if-no-files-found: ignore - - name: Upload firewall audit logs - if: always() - continue-on-error: true - uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7 - with: - name: firewall-audit-logs - path: | + /tmp/gh-aw/awf-config.json /tmp/gh-aw/sandbox/firewall/logs/ /tmp/gh-aw/sandbox/firewall/audit/ + /tmp/gh-aw/sandbox/firewall/awf-reflect.json if-no-files-found: ignore conclusion: @@ -825,8 +972,11 @@ jobs: - activation - agent - detection + - pat_pool - safe_outputs - if: always() && (needs.agent.result != 'skipped' || needs.activation.outputs.lockdown_check_failed == 'true') + if: > + always() && (needs.agent.result != 'skipped' || needs.activation.outputs.lockdown_check_failed == 'true' || + needs.activation.outputs.stale_lock_file_failed == 'true') runs-on: ubuntu-slim permissions: contents: read @@ -837,14 +987,22 @@ jobs: group: "gh-aw-conclusion-breaking-change-doc" cancel-in-progress: false outputs: + incomplete_count: ${{ steps.report_incomplete.outputs.incomplete_count }} noop_message: ${{ steps.noop.outputs.noop_message }} tools_reported: ${{ steps.missing_tool.outputs.tools_reported }} total_count: ${{ steps.missing_tool.outputs.total_count }} steps: - name: Setup Scripts - uses: github/gh-aw-actions/setup@31130b20a8fd3ef263acbe2091267c0aace07e09 # v0.65.6 + id: setup + uses: github/gh-aw-actions/setup@b8068426813005612b960b5ab0b8bd2c27142323 # v0.71.5 with: destination: ${{ runner.temp }}/gh-aw/actions + job-name: ${{ github.job }} + trace-id: ${{ needs.activation.outputs.setup-trace-id }} + env: + GH_AW_SETUP_WORKFLOW_NAME: "Breaking Change Documentation" + GH_AW_CURRENT_WORKFLOW_REF: ${{ github.repository }}/.github/workflows/breaking-change-doc.lock.yml@${{ github.ref }} + GH_AW_INFO_VERSION: "1.0.40" - name: Download agent output artifact id: download-agent-output continue-on-error: true @@ -859,9 +1017,9 @@ jobs: mkdir -p /tmp/gh-aw/ find "/tmp/gh-aw/" -type f -print echo "GH_AW_AGENT_OUTPUT=/tmp/gh-aw/agent_output.json" >> "$GITHUB_OUTPUT" - - name: Process No-Op Messages + - name: Process no-op messages id: noop - uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8 + uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 env: GH_AW_AGENT_OUTPUT: ${{ steps.setup-agent-output-env.outputs.GH_AW_AGENT_OUTPUT }} GH_AW_NOOP_MAX: "1" @@ -873,12 +1031,28 @@ jobs: github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} script: | const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); - setupGlobals(core, github, context, exec, io); + setupGlobals(core, github, context, exec, io, getOctokit); const { main } = require('${{ runner.temp }}/gh-aw/actions/handle_noop_message.cjs'); await main(); - - name: Record Missing Tool + - name: Log detection run + id: detection_runs + uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 + env: + GH_AW_AGENT_OUTPUT: ${{ steps.setup-agent-output-env.outputs.GH_AW_AGENT_OUTPUT }} + GH_AW_WORKFLOW_NAME: "Breaking Change Documentation" + GH_AW_RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} + GH_AW_DETECTION_CONCLUSION: ${{ needs.detection.outputs.detection_conclusion }} + GH_AW_DETECTION_REASON: ${{ needs.detection.outputs.detection_reason }} + with: + github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} + script: | + const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); + setupGlobals(core, github, context, exec, io, getOctokit); + const { main } = require('${{ runner.temp }}/gh-aw/actions/handle_detection_runs.cjs'); + await main(); + - name: Record missing tool id: missing_tool - uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8 + uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 env: GH_AW_AGENT_OUTPUT: ${{ steps.setup-agent-output-env.outputs.GH_AW_AGENT_OUTPUT }} GH_AW_MISSING_TOOL_CREATE_ISSUE: "true" @@ -887,37 +1061,61 @@ jobs: github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} script: | const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); - setupGlobals(core, github, context, exec, io); + setupGlobals(core, github, context, exec, io, getOctokit); const { main } = require('${{ runner.temp }}/gh-aw/actions/missing_tool.cjs'); await main(); - - name: Handle Agent Failure + - name: Record incomplete + id: report_incomplete + uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 + env: + GH_AW_AGENT_OUTPUT: ${{ steps.setup-agent-output-env.outputs.GH_AW_AGENT_OUTPUT }} + GH_AW_REPORT_INCOMPLETE_CREATE_ISSUE: "true" + GH_AW_WORKFLOW_NAME: "Breaking Change Documentation" + with: + github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} + script: | + const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); + setupGlobals(core, github, context, exec, io, getOctokit); + const { main } = require('${{ runner.temp }}/gh-aw/actions/report_incomplete_handler.cjs'); + await main(); + - name: Handle agent failure id: handle_agent_failure if: always() - uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8 + uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 env: GH_AW_AGENT_OUTPUT: ${{ steps.setup-agent-output-env.outputs.GH_AW_AGENT_OUTPUT }} GH_AW_WORKFLOW_NAME: "Breaking Change Documentation" GH_AW_RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} GH_AW_AGENT_CONCLUSION: ${{ needs.agent.result }} GH_AW_WORKFLOW_ID: "breaking-change-doc" + GH_AW_ACTION_FAILURE_ISSUE_EXPIRES_HOURS: "168" GH_AW_ENGINE_ID: "copilot" GH_AW_SECRET_VERIFICATION_RESULT: ${{ needs.activation.outputs.secret_verification_result }} GH_AW_CHECKOUT_PR_SUCCESS: ${{ needs.agent.outputs.checkout_pr_success }} GH_AW_INFERENCE_ACCESS_ERROR: ${{ needs.agent.outputs.inference_access_error }} + GH_AW_MCP_POLICY_ERROR: ${{ needs.agent.outputs.mcp_policy_error }} + GH_AW_AGENTIC_ENGINE_TIMEOUT: ${{ needs.agent.outputs.agentic_engine_timeout }} + GH_AW_MODEL_NOT_SUPPORTED_ERROR: ${{ needs.agent.outputs.model_not_supported_error }} + GH_AW_ENGINE_API_HOSTS: "api.enterprise.githubcopilot.com,api.githubcopilot.com,api.business.githubcopilot.com,api.individual.githubcopilot.com" GH_AW_LOCKDOWN_CHECK_FAILED: ${{ needs.activation.outputs.lockdown_check_failed }} + GH_AW_STALE_LOCK_FILE_FAILED: ${{ needs.activation.outputs.stale_lock_file_failed }} GH_AW_GROUP_REPORTS: "false" GH_AW_FAILURE_REPORT_AS_ISSUE: "true" + GH_AW_MISSING_TOOL_REPORT_AS_FAILURE: "true" + GH_AW_MISSING_DATA_REPORT_AS_FAILURE: "true" GH_AW_TIMEOUT_MINUTES: "20" with: github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} script: | const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); - setupGlobals(core, github, context, exec, io); + setupGlobals(core, github, context, exec, io, getOctokit); const { main } = require('${{ runner.temp }}/gh-aw/actions/handle_agent_failure.cjs'); await main(); detection: - needs: agent + needs: + - activation + - agent if: > always() && needs.agent.result != 'skipped' && (needs.agent.outputs.output_types != '' || needs.agent.outputs.has_patch == 'true') runs-on: ubuntu-latest @@ -925,12 +1123,20 @@ jobs: contents: read outputs: detection_conclusion: ${{ steps.detection_conclusion.outputs.conclusion }} + detection_reason: ${{ steps.detection_conclusion.outputs.reason }} detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Setup Scripts - uses: github/gh-aw-actions/setup@31130b20a8fd3ef263acbe2091267c0aace07e09 # v0.65.6 + id: setup + uses: github/gh-aw-actions/setup@b8068426813005612b960b5ab0b8bd2c27142323 # v0.71.5 with: destination: ${{ runner.temp }}/gh-aw/actions + job-name: ${{ github.job }} + trace-id: ${{ needs.activation.outputs.setup-trace-id }} + env: + GH_AW_SETUP_WORKFLOW_NAME: "Breaking Change Documentation" + GH_AW_CURRENT_WORKFLOW_REF: ${{ github.repository }}/.github/workflows/breaking-change-doc.lock.yml@${{ github.ref }} + GH_AW_INFO_VERSION: "1.0.40" - name: Download agent output artifact id: download-agent-output continue-on-error: true @@ -951,8 +1157,12 @@ jobs: with: persist-credentials: false # --- Threat Detection --- + - name: Clean stale firewall files from agent artifact + run: | + rm -rf /tmp/gh-aw/sandbox/firewall/logs + rm -rf /tmp/gh-aw/sandbox/firewall/audit - name: Download container images - run: bash ${RUNNER_TEMP}/gh-aw/actions/download_docker_images.sh ghcr.io/github/gh-aw-firewall/agent:0.25.11 ghcr.io/github/gh-aw-firewall/api-proxy:0.25.11 ghcr.io/github/gh-aw-firewall/squid:0.25.11 + run: bash "${RUNNER_TEMP}/gh-aw/actions/download_docker_images.sh" ghcr.io/github/gh-aw-firewall/agent:0.25.40@sha256:14ff567e8d9d4c2fbc5e55c973488381c71d7e0fdbe72d30ee7b8a738fd86504 ghcr.io/github/gh-aw-firewall/api-proxy:0.25.40@sha256:2883ca3e5ae9f330cafdd9345bfd4ae17fc8da36c96d4c9a1f76e922b4c45280 ghcr.io/github/gh-aw-firewall/squid:0.25.40@sha256:b084f4a2c771f584ee68084ced52fa6b3245197a1889645d817462d307d3ac51 - name: Check if detection needed id: detection_guard if: always() @@ -967,10 +1177,10 @@ jobs: echo "run_detection=false" >> "$GITHUB_OUTPUT" echo "Detection skipped: no agent outputs or patches to analyze" fi - - name: Clear MCP configuration for detection + - name: Clear MCP Config for detection if: always() && steps.detection_guard.outputs.run_detection == 'true' run: | - rm -f /tmp/gh-aw/mcp-config/mcp-servers.json + rm -f "${RUNNER_TEMP}/gh-aw/mcp-config/mcp-servers.json" rm -f /home/runner/.copilot/mcp-config.json rm -f "$GITHUB_WORKSPACE/.gemini/settings.json" - name: Prepare threat detection files @@ -989,7 +1199,7 @@ jobs: ls -la /tmp/gh-aw/threat-detection/ 2>/dev/null || true - name: Setup threat detection if: always() && steps.detection_guard.outputs.run_detection == 'true' - uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8 + uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 env: WORKFLOW_NAME: "Breaking Change Documentation" WORKFLOW_DESCRIPTION: "Generate breaking change documentation for merged PRs labeled needs-breaking-change-doc-created. Produces two markdown files (issue-draft.md and pr-comment.md) and optionally comments on the PR." @@ -997,7 +1207,7 @@ jobs: with: script: | const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); - setupGlobals(core, github, context, exec, io); + setupGlobals(core, github, context, exec, io, getOctokit); const { main } = require('${{ runner.temp }}/gh-aw/actions/setup_threat_detection.cjs'); await main(); - name: Ensure threat-detection directory and log @@ -1005,30 +1215,44 @@ jobs: run: | mkdir -p /tmp/gh-aw/threat-detection touch /tmp/gh-aw/threat-detection/detection.log + - name: Setup Node.js + uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 + with: + node-version: '24' + package-manager-cache: false - name: Install GitHub Copilot CLI - run: ${RUNNER_TEMP}/gh-aw/actions/install_copilot_cli.sh latest + run: bash "${RUNNER_TEMP}/gh-aw/actions/install_copilot_cli.sh" 1.0.40 + env: + GH_HOST: github.com - name: Install AWF binary - run: bash ${RUNNER_TEMP}/gh-aw/actions/install_awf_binary.sh v0.25.11 + run: bash "${RUNNER_TEMP}/gh-aw/actions/install_awf_binary.sh" v0.25.40 - name: Execute GitHub Copilot CLI if: always() && steps.detection_guard.outputs.run_detection == 'true' + continue-on-error: true id: detection_agentic_execution # Copilot CLI tool arguments (sorted): timeout-minutes: 20 run: | set -o pipefail touch /tmp/gh-aw/agent-step-summary.md + GH_AW_NODE_BIN=$(command -v node 2>/dev/null || true) + export GH_AW_NODE_BIN + (umask 177 && touch /tmp/gh-aw/threat-detection/detection.log) + printf '%s\n' '{"$schema":"https://github.com/github/gh-aw-firewall/releases/download/v0.25.40/awf-config.schema.json","network":{"allowDomains":["api.business.githubcopilot.com","api.enterprise.githubcopilot.com","api.github.com","api.githubcopilot.com","api.individual.githubcopilot.com","github.com","host.docker.internal","telemetry.enterprise.githubcopilot.com"]},"apiProxy":{"enabled":true},"container":{"imageTag":"0.25.40,squid=sha256:b084f4a2c771f584ee68084ced52fa6b3245197a1889645d817462d307d3ac51,agent=sha256:14ff567e8d9d4c2fbc5e55c973488381c71d7e0fdbe72d30ee7b8a738fd86504,api-proxy=sha256:2883ca3e5ae9f330cafdd9345bfd4ae17fc8da36c96d4c9a1f76e922b4c45280,cli-proxy=sha256:3e7152911d4b4b7b97beef9d3d7d924ff7902227e86001ef3838fb728d5d514c"}}' > "${RUNNER_TEMP}/gh-aw/awf-config.json" && cp "${RUNNER_TEMP}/gh-aw/awf-config.json" /tmp/gh-aw/awf-config.json # shellcheck disable=SC1003 - sudo -E awf --container-workdir "${GITHUB_WORKSPACE}" --mount "${RUNNER_TEMP}/gh-aw:${RUNNER_TEMP}/gh-aw:ro" --mount "${RUNNER_TEMP}/gh-aw:/host${RUNNER_TEMP}/gh-aw:ro" --env-all --exclude-env COPILOT_GITHUB_TOKEN --allow-domains api.business.githubcopilot.com,api.enterprise.githubcopilot.com,api.github.com,api.githubcopilot.com,api.individual.githubcopilot.com,github.com,host.docker.internal,telemetry.enterprise.githubcopilot.com --log-level info --proxy-logs-dir /tmp/gh-aw/sandbox/firewall/logs --audit-dir /tmp/gh-aw/sandbox/firewall/audit --enable-host-access --image-tag 0.25.11 --skip-pull --enable-api-proxy \ - -- /bin/bash -c '/usr/local/bin/copilot --add-dir /tmp/gh-aw/ --log-level all --log-dir /tmp/gh-aw/sandbox/agent/logs/ --disable-builtin-mcps --allow-all-tools --add-dir "${GITHUB_WORKSPACE}" --prompt "$(cat /tmp/gh-aw/aw-prompts/prompt.txt)"' 2>&1 | tee -a /tmp/gh-aw/threat-detection/detection.log + sudo -E awf --config "${RUNNER_TEMP}/gh-aw/awf-config.json" --container-workdir "${GITHUB_WORKSPACE}" --mount "${RUNNER_TEMP}/gh-aw:${RUNNER_TEMP}/gh-aw:ro" --mount "${RUNNER_TEMP}/gh-aw:/host${RUNNER_TEMP}/gh-aw:ro" --env-all --exclude-env COPILOT_GITHUB_TOKEN --log-level info --proxy-logs-dir /tmp/gh-aw/sandbox/firewall/logs --audit-dir /tmp/gh-aw/sandbox/firewall/audit --enable-host-access --allow-host-ports 80,443,8080 --skip-pull \ + -- /bin/bash -c 'export PATH="$(find /opt/hostedtoolcache /home/runner/work/_tool -maxdepth 4 -type d -name bin 2>/dev/null | tr '\''\n'\'' '\'':'\'')$PATH"; [ -n "$GOROOT" ] && export PATH="$GOROOT/bin:$PATH" || true && GH_AW_NODE_EXEC="${GH_AW_NODE_BIN:-}"; if [ -z "$GH_AW_NODE_EXEC" ] || [ ! -x "$GH_AW_NODE_EXEC" ]; then GH_AW_NODE_EXEC="$(command -v node 2>/dev/null || echo node)"; fi; "$GH_AW_NODE_EXEC" ${RUNNER_TEMP}/gh-aw/actions/copilot_harness.cjs /usr/local/bin/copilot --add-dir /tmp/gh-aw/ --log-level all --log-dir /tmp/gh-aw/sandbox/agent/logs/ --disable-builtin-mcps --no-ask-user --allow-all-tools --add-dir "${GITHUB_WORKSPACE}" --prompt-file /tmp/gh-aw/aw-prompts/prompt.txt' 2>&1 | tee -a /tmp/gh-aw/threat-detection/detection.log env: COPILOT_AGENT_RUNNER_TYPE: STANDALONE - COPILOT_GITHUB_TOKEN: ${{ case(needs.pre_activation.outputs.copilot_pat_number == '0', secrets.COPILOT_PAT_0, needs.pre_activation.outputs.copilot_pat_number == '1', secrets.COPILOT_PAT_1, needs.pre_activation.outputs.copilot_pat_number == '2', secrets.COPILOT_PAT_2, needs.pre_activation.outputs.copilot_pat_number == '3', secrets.COPILOT_PAT_3, needs.pre_activation.outputs.copilot_pat_number == '4', secrets.COPILOT_PAT_4, needs.pre_activation.outputs.copilot_pat_number == '5', secrets.COPILOT_PAT_5, needs.pre_activation.outputs.copilot_pat_number == '6', secrets.COPILOT_PAT_6, needs.pre_activation.outputs.copilot_pat_number == '7', secrets.COPILOT_PAT_7, needs.pre_activation.outputs.copilot_pat_number == '8', secrets.COPILOT_PAT_8, needs.pre_activation.outputs.copilot_pat_number == '9', secrets.COPILOT_PAT_9, secrets.COPILOT_GITHUB_TOKEN) }} - COPILOT_MODEL: ${{ vars.GH_AW_MODEL_DETECTION_COPILOT || '' }} + COPILOT_API_KEY: dummy-byok-key-for-offline-mode + COPILOT_GITHUB_TOKEN: ${{ case(needs.pat_pool.outputs.pat_number == '0', secrets.COPILOT_PAT_0, needs.pat_pool.outputs.pat_number == '1', secrets.COPILOT_PAT_1, needs.pat_pool.outputs.pat_number == '2', secrets.COPILOT_PAT_2, needs.pat_pool.outputs.pat_number == '3', secrets.COPILOT_PAT_3, needs.pat_pool.outputs.pat_number == '4', secrets.COPILOT_PAT_4, needs.pat_pool.outputs.pat_number == '5', secrets.COPILOT_PAT_5, needs.pat_pool.outputs.pat_number == '6', secrets.COPILOT_PAT_6, needs.pat_pool.outputs.pat_number == '7', secrets.COPILOT_PAT_7, needs.pat_pool.outputs.pat_number == '8', secrets.COPILOT_PAT_8, needs.pat_pool.outputs.pat_number == '9', secrets.COPILOT_PAT_9, secrets.COPILOT_GITHUB_TOKEN) }} + COPILOT_MODEL: ${{ vars.GH_AW_MODEL_DETECTION_COPILOT || 'claude-sonnet-4.6' }} GH_AW_PHASE: detection GH_AW_PROMPT: /tmp/gh-aw/aw-prompts/prompt.txt - GH_AW_VERSION: v0.65.6 + GH_AW_VERSION: v0.71.5 GITHUB_API_URL: ${{ github.api_url }} GITHUB_AW: true + GITHUB_COPILOT_INTEGRATION_ID: agentic-workflows GITHUB_HEAD_REF: ${{ github.head_ref }} GITHUB_REF_NAME: ${{ github.ref_name }} GITHUB_SERVER_URL: ${{ github.server_url }} @@ -1041,7 +1265,7 @@ jobs: XDG_CONFIG_HOME: /home/runner - name: Upload threat detection log if: always() && steps.detection_guard.outputs.run_detection == 'true' - uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7 + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 with: name: detection path: /tmp/gh-aw/threat-detection/detection.log @@ -1049,15 +1273,107 @@ jobs: - name: Parse and conclude threat detection id: detection_conclusion if: always() - uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8 + continue-on-error: true + uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 env: RUN_DETECTION: ${{ steps.detection_guard.outputs.run_detection }} + GH_AW_DETECTION_CONTINUE_ON_ERROR: "true" with: script: | - const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); - setupGlobals(core, github, context, exec, io); - const { main } = require('${{ runner.temp }}/gh-aw/actions/parse_threat_detection_results.cjs'); - await main(); + try { + const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); + setupGlobals(core, github, context, exec, io, getOctokit); + const { main } = require('${{ runner.temp }}/gh-aw/actions/parse_threat_detection_results.cjs'); + await main(); + } catch (loadErr) { + const continueOnError = process.env.GH_AW_DETECTION_CONTINUE_ON_ERROR !== 'false'; + const msg = 'ERR_SYSTEM: \u274C Unexpected error loading threat detection module: ' + (loadErr && loadErr.message ? loadErr.message : String(loadErr)); + core.error(msg); + core.setOutput('reason', 'parse_error'); + if (continueOnError) { + core.warning('\u26A0\uFE0F ' + msg); + core.setOutput('conclusion', 'warning'); + core.setOutput('success', 'false'); + } else { + core.setOutput('conclusion', 'failure'); + core.setOutput('success', 'false'); + core.setFailed(msg); + } + } + + pat_pool: + needs: pre_activation + runs-on: ubuntu-slim + outputs: + pat_number: ${{ steps.select-pat-number.outputs.copilot_pat_number }} + steps: + - name: Configure GH_HOST for enterprise compatibility + id: ghes-host-config + shell: bash + run: | + # Derive GH_HOST from GITHUB_SERVER_URL so the gh CLI targets the correct + # GitHub instance (GHES/GHEC). On github.com this is a harmless no-op. + GH_HOST="${GITHUB_SERVER_URL#https://}" + GH_HOST="${GH_HOST#http://}" + echo "GH_HOST=${GH_HOST}" >> "$GITHUB_ENV" + - name: Select Copilot token from pool + id: select-pat-number + run: | + # Collect pool entries with non-empty secrets from COPILOT_PAT_0..COPILOT_PAT_9. + PAT_NUMBERS=() + POOL_INDICATORS=(➖ ➖ ➖ ➖ ➖ ➖ ➖ ➖ ➖ ➖) + + for i in $(seq 0 9); do + var="COPILOT_PAT_${i}" + val="${!var}" + if [ -n "$val" ]; then + PAT_NUMBERS+=(${i}) + POOL_INDICATORS[${i}]="🟪" + fi + done + + # If none of the entries in the pool have values, emit a warning + # and do not set an output value. The consumer can fall back to + # using COPILOT_GITHUB_TOKEN. + if [ ${#PAT_NUMBERS[@]} -eq 0 ]; then + warning_message="::warning::None of the PAT pool entries had values " + warning_message+="(checked COPILOT_PAT_0 through COPILOT_PAT_9)" + echo "$warning_message" + exit 0 + fi + + # Select a random index using the seed if specified + if [ -n "$RANDOM_SEED" ]; then + RANDOM=$RANDOM_SEED + fi + + PAT_INDEX=$(( RANDOM % ${#PAT_NUMBERS[@]} )) + PAT_NUMBER="${PAT_NUMBERS[$PAT_INDEX]}" + POOL_INDICATORS[${PAT_NUMBER}]="✅" + + echo "Pool size: ${#PAT_NUMBERS[@]}" + echo "Selected PAT number ${PAT_NUMBER} (index: ${PAT_INDEX})" + + # Emit a markdown table of the pool entries to the step summary + echo "|0|1|2|3|4|5|6|7|8|9|" >> "$GITHUB_STEP_SUMMARY" + echo "|-|-|-|-|-|-|-|-|-|-|" >> "$GITHUB_STEP_SUMMARY" + (IFS='|'; printf '|%s' "${POOL_INDICATORS[@]}"; printf '|\n') >> "$GITHUB_STEP_SUMMARY" + + # Set the PAT number as the output + echo "copilot_pat_number=${PAT_NUMBER}" >> "$GITHUB_OUTPUT" + env: + COPILOT_PAT_0: ${{ secrets.COPILOT_PAT_0 }} + COPILOT_PAT_1: ${{ secrets.COPILOT_PAT_1 }} + COPILOT_PAT_2: ${{ secrets.COPILOT_PAT_2 }} + COPILOT_PAT_3: ${{ secrets.COPILOT_PAT_3 }} + COPILOT_PAT_4: ${{ secrets.COPILOT_PAT_4 }} + COPILOT_PAT_5: ${{ secrets.COPILOT_PAT_5 }} + COPILOT_PAT_6: ${{ secrets.COPILOT_PAT_6 }} + COPILOT_PAT_7: ${{ secrets.COPILOT_PAT_7 }} + COPILOT_PAT_8: ${{ secrets.COPILOT_PAT_8 }} + COPILOT_PAT_9: ${{ secrets.COPILOT_PAT_9 }} + RANDOM_SEED: ${{ github.aw.import-inputs.random_seed }} + shell: bash pre_activation: if: > @@ -1070,50 +1386,35 @@ jobs: runs-on: ubuntu-slim outputs: activated: ${{ steps.check_membership.outputs.is_team_member == 'true' }} - copilot_pat_number: ${{ steps.select-copilot-pat.outputs.copilot_pat_number }} matched_command: '' - select-copilot-pat_result: ${{ steps.select-copilot-pat.outcome }} + setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Setup Scripts - uses: github/gh-aw-actions/setup@31130b20a8fd3ef263acbe2091267c0aace07e09 # v0.65.6 + id: setup + uses: github/gh-aw-actions/setup@b8068426813005612b960b5ab0b8bd2c27142323 # v0.71.5 with: destination: ${{ runner.temp }}/gh-aw/actions + job-name: ${{ github.job }} + env: + GH_AW_SETUP_WORKFLOW_NAME: "Breaking Change Documentation" + GH_AW_CURRENT_WORKFLOW_REF: ${{ github.repository }}/.github/workflows/breaking-change-doc.lock.yml@${{ github.ref }} + GH_AW_INFO_VERSION: "1.0.40" - name: Check team membership for workflow id: check_membership - uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8 + uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 env: GH_AW_REQUIRED_ROLES: "admin,maintainer,write" with: github-token: ${{ secrets.GITHUB_TOKEN }} script: | const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); - setupGlobals(core, github, context, exec, io); + setupGlobals(core, github, context, exec, io, getOctokit); const { main } = require('${{ runner.temp }}/gh-aw/actions/check_membership.cjs'); await main(); - - name: Checkout the select-copilot-pat action folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - fetch-depth: 1 - persist-credentials: false - sparse-checkout: .github/actions/select-copilot-pat - sparse-checkout-cone-mode: true - - name: Select Copilot token from pool - id: select-copilot-pat - uses: ./.github/actions/select-copilot-pat - env: - SECRET_0: ${{ secrets.COPILOT_PAT_0 }} - SECRET_1: ${{ secrets.COPILOT_PAT_1 }} - SECRET_2: ${{ secrets.COPILOT_PAT_2 }} - SECRET_3: ${{ secrets.COPILOT_PAT_3 }} - SECRET_4: ${{ secrets.COPILOT_PAT_4 }} - SECRET_5: ${{ secrets.COPILOT_PAT_5 }} - SECRET_6: ${{ secrets.COPILOT_PAT_6 }} - SECRET_7: ${{ secrets.COPILOT_PAT_7 }} - SECRET_8: ${{ secrets.COPILOT_PAT_8 }} - SECRET_9: ${{ secrets.COPILOT_PAT_9 }} safe_outputs: needs: + - activation - agent - detection if: (!cancelled()) && needs.agent.result != 'skipped' && needs.detection.result == 'success' @@ -1126,9 +1427,12 @@ jobs: timeout-minutes: 15 env: GH_AW_CALLER_WORKFLOW_ID: "${{ github.repository }}/breaking-change-doc" + GH_AW_DETECTION_CONCLUSION: ${{ needs.detection.outputs.detection_conclusion }} + GH_AW_DETECTION_REASON: ${{ needs.detection.outputs.detection_reason }} GH_AW_EFFECTIVE_TOKENS: ${{ needs.agent.outputs.effective_tokens }} GH_AW_ENGINE_ID: "copilot" GH_AW_ENGINE_MODEL: ${{ needs.agent.outputs.model }} + GH_AW_ENGINE_VERSION: "1.0.40" GH_AW_WORKFLOW_ID: "breaking-change-doc" GH_AW_WORKFLOW_NAME: "Breaking Change Documentation" outputs: @@ -1142,9 +1446,16 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Setup Scripts - uses: github/gh-aw-actions/setup@31130b20a8fd3ef263acbe2091267c0aace07e09 # v0.65.6 + id: setup + uses: github/gh-aw-actions/setup@b8068426813005612b960b5ab0b8bd2c27142323 # v0.71.5 with: destination: ${{ runner.temp }}/gh-aw/actions + job-name: ${{ github.job }} + trace-id: ${{ needs.activation.outputs.setup-trace-id }} + env: + GH_AW_SETUP_WORKFLOW_NAME: "Breaking Change Documentation" + GH_AW_CURRENT_WORKFLOW_REF: ${{ github.repository }}/.github/workflows/breaking-change-doc.lock.yml@${{ github.ref }} + GH_AW_INFO_VERSION: "1.0.40" - name: Download agent output artifact id: download-agent-output continue-on-error: true @@ -1170,25 +1481,27 @@ jobs: echo "GH_HOST=${GH_HOST}" >> "$GITHUB_ENV" - name: Process Safe Outputs id: process_safe_outputs - uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8 + uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 env: GH_AW_AGENT_OUTPUT: ${{ steps.setup-agent-output-env.outputs.GH_AW_AGENT_OUTPUT }} GH_AW_ALLOWED_DOMAINS: "api.business.githubcopilot.com,api.enterprise.githubcopilot.com,api.github.com,api.githubcopilot.com,api.individual.githubcopilot.com,api.snapcraft.io,archive.ubuntu.com,azure.archive.ubuntu.com,crl.geotrust.com,crl.globalsign.com,crl.identrust.com,crl.sectigo.com,crl.thawte.com,crl.usertrust.com,crl.verisign.com,crl3.digicert.com,crl4.digicert.com,crls.ssl.com,github.com,host.docker.internal,json-schema.org,json.schemastore.org,keyserver.ubuntu.com,ocsp.digicert.com,ocsp.geotrust.com,ocsp.globalsign.com,ocsp.identrust.com,ocsp.sectigo.com,ocsp.ssl.com,ocsp.thawte.com,ocsp.usertrust.com,ocsp.verisign.com,packagecloud.io,packages.cloud.google.com,packages.microsoft.com,ppa.launchpad.net,raw.githubusercontent.com,registry.npmjs.org,s.symcb.com,s.symcd.com,security.ubuntu.com,telemetry.enterprise.githubcopilot.com,ts-crl.ws.symantec.com,ts-ocsp.ws.symantec.com,www.googleapis.com" GITHUB_SERVER_URL: ${{ github.server_url }} GITHUB_API_URL: ${{ github.api_url }} - GH_AW_SAFE_OUTPUTS_HANDLER_CONFIG: "{\"add_comment\":{\"max\":1,\"target\":\"*\"},\"missing_data\":{},\"missing_tool\":{},\"noop\":{\"max\":1,\"report-as-issue\":\"false\"}}" + GH_AW_SAFE_OUTPUTS_HANDLER_CONFIG: "{\"add_comment\":{\"max\":1,\"target\":\"*\"},\"create_report_incomplete_issue\":{},\"missing_data\":{},\"missing_tool\":{},\"noop\":{\"max\":1,\"report-as-issue\":\"false\"},\"report_incomplete\":{}}" with: github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} script: | const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); - setupGlobals(core, github, context, exec, io); + setupGlobals(core, github, context, exec, io, getOctokit); const { main } = require('${{ runner.temp }}/gh-aw/actions/safe_output_handler_manager.cjs'); await main(); - - name: Upload Safe Output Items + - name: Upload Safe Outputs Items if: always() - uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7 + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 with: - name: safe-output-items - path: /tmp/gh-aw/safe-output-items.jsonl + name: safe-outputs-items + path: | + /tmp/gh-aw/safe-output-items.jsonl + /tmp/gh-aw/temporary-id-map.json if-no-files-found: ignore diff --git a/.github/workflows/breaking-change-doc.md b/.github/workflows/breaking-change-doc.md index 3abd66915e76a8..8da0dbd845c699 100644 --- a/.github/workflows/breaking-change-doc.md +++ b/.github/workflows/breaking-change-doc.md @@ -54,55 +54,19 @@ on: required: false type: boolean default: false + # ############################################################### -# Override the COPILOT_GITHUB_TOKEN secret usage for the workflow -# with a randomly-selected token from a pool of secrets. -# -# As soon as organization-level billing is offered for Agentic -# Workflows, this stop-gap approach will be removed. -# -# See: /.github/actions/select-copilot-pat/README.md +# Override COPILOT_GITHUB_TOKEN with a random PAT from the pool. +# This stop-gap will be removed when org billing is available. +# See: .github/workflows/shared/pat_pool.README.md for more info. # ############################################################### +imports: + - shared/pat_pool.md - # Add the pre-activation step of selecting a random PAT from the supplied secrets - steps: - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - name: Checkout the select-copilot-pat action folder - with: - persist-credentials: false - sparse-checkout: .github/actions/select-copilot-pat - sparse-checkout-cone-mode: true - fetch-depth: 1 - - - id: select-copilot-pat - name: Select Copilot token from pool - uses: ./.github/actions/select-copilot-pat - env: - SECRET_0: ${{ secrets.COPILOT_PAT_0 }} - SECRET_1: ${{ secrets.COPILOT_PAT_1 }} - SECRET_2: ${{ secrets.COPILOT_PAT_2 }} - SECRET_3: ${{ secrets.COPILOT_PAT_3 }} - SECRET_4: ${{ secrets.COPILOT_PAT_4 }} - SECRET_5: ${{ secrets.COPILOT_PAT_5 }} - SECRET_6: ${{ secrets.COPILOT_PAT_6 }} - SECRET_7: ${{ secrets.COPILOT_PAT_7 }} - SECRET_8: ${{ secrets.COPILOT_PAT_8 }} - SECRET_9: ${{ secrets.COPILOT_PAT_9 }} - -# Add the pre-activation output of the randomly selected PAT -jobs: - pre-activation: - outputs: - copilot_pat_number: ${{ steps.select-copilot-pat.outputs.copilot_pat_number }} - -# Override the COPILOT_GITHUB_TOKEN expression used in the activation job -# Consume the PAT number from the pre-activation step and select the corresponding secret engine: id: copilot env: - # We cannot use line breaks in this expression as it leads to a syntax error in the compiled workflow - # If none of the `COPILOT_PAT_#` secrets were selected, then the default COPILOT_GITHUB_TOKEN is used - COPILOT_GITHUB_TOKEN: ${{ case(needs.pre_activation.outputs.copilot_pat_number == '0', secrets.COPILOT_PAT_0, needs.pre_activation.outputs.copilot_pat_number == '1', secrets.COPILOT_PAT_1, needs.pre_activation.outputs.copilot_pat_number == '2', secrets.COPILOT_PAT_2, needs.pre_activation.outputs.copilot_pat_number == '3', secrets.COPILOT_PAT_3, needs.pre_activation.outputs.copilot_pat_number == '4', secrets.COPILOT_PAT_4, needs.pre_activation.outputs.copilot_pat_number == '5', secrets.COPILOT_PAT_5, needs.pre_activation.outputs.copilot_pat_number == '6', secrets.COPILOT_PAT_6, needs.pre_activation.outputs.copilot_pat_number == '7', secrets.COPILOT_PAT_7, needs.pre_activation.outputs.copilot_pat_number == '8', secrets.COPILOT_PAT_8, needs.pre_activation.outputs.copilot_pat_number == '9', secrets.COPILOT_PAT_9, secrets.COPILOT_GITHUB_TOKEN) }} + COPILOT_GITHUB_TOKEN: ${{ case(needs.pat_pool.outputs.pat_number == '0', secrets.COPILOT_PAT_0, needs.pat_pool.outputs.pat_number == '1', secrets.COPILOT_PAT_1, needs.pat_pool.outputs.pat_number == '2', secrets.COPILOT_PAT_2, needs.pat_pool.outputs.pat_number == '3', secrets.COPILOT_PAT_3, needs.pat_pool.outputs.pat_number == '4', secrets.COPILOT_PAT_4, needs.pat_pool.outputs.pat_number == '5', secrets.COPILOT_PAT_5, needs.pat_pool.outputs.pat_number == '6', secrets.COPILOT_PAT_6, needs.pat_pool.outputs.pat_number == '7', secrets.COPILOT_PAT_7, needs.pat_pool.outputs.pat_number == '8', secrets.COPILOT_PAT_8, needs.pat_pool.outputs.pat_number == '9', secrets.COPILOT_PAT_9, secrets.COPILOT_GITHUB_TOKEN) }} --- # Breaking Change Documentation diff --git a/.github/workflows/ci-failure-scan.lock.yml b/.github/workflows/ci-failure-scan.lock.yml index 37c282d7066931..bb1861e00f1fed 100644 --- a/.github/workflows/ci-failure-scan.lock.yml +++ b/.github/workflows/ci-failure-scan.lock.yml @@ -1,5 +1,5 @@ -# gh-aw-metadata: {"schema_version":"v3","frontmatter_hash":"67ab95173c3bd5a18c0d820b917dafe02bea8a4a191d963d78757cb5146d4d4c","compiler_version":"v0.68.1","strict":true,"agent_id":"copilot","agent_model":"claude-opus-4.6"} -# gh-aw-manifest: {"version":1,"secrets":["COPILOT_GITHUB_TOKEN","COPILOT_PAT_0","COPILOT_PAT_1","COPILOT_PAT_2","COPILOT_PAT_3","COPILOT_PAT_4","COPILOT_PAT_5","COPILOT_PAT_6","COPILOT_PAT_7","COPILOT_PAT_8","COPILOT_PAT_9","GH_AW_CI_TRIGGER_TOKEN","GH_AW_GITHUB_MCP_SERVER_TOKEN","GH_AW_GITHUB_TOKEN","GITHUB_TOKEN"],"actions":[{"repo":"actions/checkout","sha":"de0fac2e4500dabe0009e67214ff5f5447ce83dd","version":"v6.0.2"},{"repo":"actions/download-artifact","sha":"3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c","version":"v8.0.1"},{"repo":"actions/github-script","sha":"3a2844b7e9c422d3c10d287c895573f7108da1b3","version":"v9"},{"repo":"actions/upload-artifact","sha":"bbbca2ddaa5d8feaa63e36b76fdaad77386f024f","version":"v7"},{"repo":"github/gh-aw-actions/setup","sha":"2fe53acc038ba01c3bbdc767d4b25df31ca5bdfc","version":"v0.68.1"}]} +# gh-aw-metadata: {"schema_version":"v3","frontmatter_hash":"21eb3c1eb69f0634e8a93fb2d8c84a0efdd0897abe61974c1c5806fc6fc4551b","compiler_version":"v0.71.5","strict":true,"agent_id":"copilot","agent_model":"claude-opus-4.6"} +# gh-aw-manifest: {"version":1,"secrets":["COPILOT_GITHUB_TOKEN","COPILOT_PAT_0","COPILOT_PAT_1","COPILOT_PAT_2","COPILOT_PAT_3","COPILOT_PAT_4","COPILOT_PAT_5","COPILOT_PAT_6","COPILOT_PAT_7","COPILOT_PAT_8","COPILOT_PAT_9","GH_AW_CI_TRIGGER_TOKEN","GH_AW_GITHUB_MCP_SERVER_TOKEN","GH_AW_GITHUB_TOKEN","GITHUB_TOKEN"],"actions":[{"repo":"actions/checkout","sha":"de0fac2e4500dabe0009e67214ff5f5447ce83dd","version":"v6.0.2"},{"repo":"actions/download-artifact","sha":"3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c","version":"v8.0.1"},{"repo":"actions/github-script","sha":"3a2844b7e9c422d3c10d287c895573f7108da1b3","version":"v9.0.0"},{"repo":"actions/setup-node","sha":"48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e","version":"v6.4.0"},{"repo":"actions/upload-artifact","sha":"043fb46d1a93c77aae656e7c1c64a875d1fc6a0a","version":"v7.0.1"},{"repo":"github/gh-aw-actions/setup","sha":"b8068426813005612b960b5ab0b8bd2c27142323","version":"v0.71.5"}],"containers":[{"image":"ghcr.io/github/gh-aw-firewall/agent:0.25.40","digest":"sha256:14ff567e8d9d4c2fbc5e55c973488381c71d7e0fdbe72d30ee7b8a738fd86504","pinned_image":"ghcr.io/github/gh-aw-firewall/agent:0.25.40@sha256:14ff567e8d9d4c2fbc5e55c973488381c71d7e0fdbe72d30ee7b8a738fd86504"},{"image":"ghcr.io/github/gh-aw-firewall/api-proxy:0.25.40","digest":"sha256:2883ca3e5ae9f330cafdd9345bfd4ae17fc8da36c96d4c9a1f76e922b4c45280","pinned_image":"ghcr.io/github/gh-aw-firewall/api-proxy:0.25.40@sha256:2883ca3e5ae9f330cafdd9345bfd4ae17fc8da36c96d4c9a1f76e922b4c45280"},{"image":"ghcr.io/github/gh-aw-firewall/squid:0.25.40","digest":"sha256:b084f4a2c771f584ee68084ced52fa6b3245197a1889645d817462d307d3ac51","pinned_image":"ghcr.io/github/gh-aw-firewall/squid:0.25.40@sha256:b084f4a2c771f584ee68084ced52fa6b3245197a1889645d817462d307d3ac51"},{"image":"ghcr.io/github/gh-aw-mcpg:v0.3.6","digest":"sha256:2bb8eef86006a4c5963c55616a9c51c32f27bfdecb023b8aa6f91f6718d9171c","pinned_image":"ghcr.io/github/gh-aw-mcpg:v0.3.6@sha256:2bb8eef86006a4c5963c55616a9c51c32f27bfdecb023b8aa6f91f6718d9171c"},{"image":"ghcr.io/github/github-mcp-server:v1.0.3","digest":"sha256:2ac27ef03461ef2b877031b838a7d1fd7f12b12d4ace7796d8cad91446d55959","pinned_image":"ghcr.io/github/github-mcp-server:v1.0.3@sha256:2ac27ef03461ef2b877031b838a7d1fd7f12b12d4ace7796d8cad91446d55959"},{"image":"node:lts-alpine","digest":"sha256:d1b3b4da11eefd5941e7f0b9cf17783fc99d9c6fc34884a665f40a06dbdfc94f","pinned_image":"node:lts-alpine@sha256:d1b3b4da11eefd5941e7f0b9cf17783fc99d9c6fc34884a665f40a06dbdfc94f"}]} # ___ _ _ # / _ \ | | (_) # | |_| | __ _ ___ _ __ | |_ _ ___ @@ -14,7 +14,7 @@ # \ /\ / (_) | | | | ( | | | | (_) \ V V /\__ \ # \/ \/ \___/|_| |_|\_\|_| |_|\___/ \_/\_/ |___/ # -# This file was automatically generated by gh-aw (v0.68.1). DO NOT EDIT. +# This file was automatically generated by gh-aw (v0.71.5). DO NOT EDIT. # # To update this file, edit the corresponding .md file and run: # gh aw compile @@ -24,6 +24,10 @@ # # Periodic scan of runtime-extra-platforms and outer-loop CI pipelines (JIT/GC stress, PGO, libraries-jitstress, etc.). Files Known Build Errors so failures are immediately ignorable in PR CI; opens companion skip PRs to remove the failure permanently after human review. # +# Resolved workflow manifest: +# Imports: +# - shared/pat_pool.md +# # Secrets used: # - COPILOT_GITHUB_TOKEN # - COPILOT_PAT_0 @@ -44,41 +48,29 @@ # Custom actions used: # - actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 # - actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 -# - actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9 -# - actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7 -# - github/gh-aw-actions/setup@2fe53acc038ba01c3bbdc767d4b25df31ca5bdfc # v0.68.1 +# - actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 +# - actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 +# - actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 +# - github/gh-aw-actions/setup@b8068426813005612b960b5ab0b8bd2c27142323 # v0.71.5 +# +# Container images used: +# - ghcr.io/github/gh-aw-firewall/agent:0.25.40@sha256:14ff567e8d9d4c2fbc5e55c973488381c71d7e0fdbe72d30ee7b8a738fd86504 +# - ghcr.io/github/gh-aw-firewall/api-proxy:0.25.40@sha256:2883ca3e5ae9f330cafdd9345bfd4ae17fc8da36c96d4c9a1f76e922b4c45280 +# - ghcr.io/github/gh-aw-firewall/squid:0.25.40@sha256:b084f4a2c771f584ee68084ced52fa6b3245197a1889645d817462d307d3ac51 +# - ghcr.io/github/gh-aw-mcpg:v0.3.6@sha256:2bb8eef86006a4c5963c55616a9c51c32f27bfdecb023b8aa6f91f6718d9171c +# - ghcr.io/github/github-mcp-server:v1.0.3@sha256:2ac27ef03461ef2b877031b838a7d1fd7f12b12d4ace7796d8cad91446d55959 +# - node:lts-alpine@sha256:d1b3b4da11eefd5941e7f0b9cf17783fc99d9c6fc34884a665f40a06dbdfc94f name: "CI Outer-Loop Failure Scanner" "on": + # permissions: {} # Permissions applied to pre-activation job # roles: # Roles processed as role check in pre-activation job # - admin # Roles processed as role check in pre-activation job # - maintainer # Roles processed as role check in pre-activation job # - write # Roles processed as role check in pre-activation job schedule: - - cron: "34 */12 * * *" + - cron: "31 */12 * * *" # Friendly format: every 12h (scattered) - # steps: # Steps injected into pre-activation job - # - name: Checkout the select-copilot-pat action folder - # uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd - # with: - # fetch-depth: 1 - # persist-credentials: false - # sparse-checkout: .github/actions/select-copilot-pat - # sparse-checkout-cone-mode: true - # - env: - # SECRET_0: ${{ secrets.COPILOT_PAT_0 }} - # SECRET_1: ${{ secrets.COPILOT_PAT_1 }} - # SECRET_2: ${{ secrets.COPILOT_PAT_2 }} - # SECRET_3: ${{ secrets.COPILOT_PAT_3 }} - # SECRET_4: ${{ secrets.COPILOT_PAT_4 }} - # SECRET_5: ${{ secrets.COPILOT_PAT_5 }} - # SECRET_6: ${{ secrets.COPILOT_PAT_6 }} - # SECRET_7: ${{ secrets.COPILOT_PAT_7 }} - # SECRET_8: ${{ secrets.COPILOT_PAT_8 }} - # SECRET_9: ${{ secrets.COPILOT_PAT_9 }} - # id: select-copilot-pat - # name: Select Copilot token from pool - # uses: ./.github/actions/select-copilot-pat workflow_dispatch: inputs: aw_context: @@ -97,7 +89,9 @@ run-name: "CI Outer-Loop Failure Scanner" jobs: activation: - needs: pre_activation + needs: + - pat_pool + - pre_activation if: needs.pre_activation.outputs.activated == 'true' runs-on: ubuntu-slim permissions: @@ -106,6 +100,7 @@ jobs: outputs: comment_id: "" comment_repo: "" + engine_id: ${{ steps.generate_aw_info.outputs.engine_id }} lockdown_check_failed: ${{ steps.generate_aw_info.outputs.lockdown_check_failed == 'true' }} model: ${{ steps.generate_aw_info.outputs.model }} secret_verification_result: ${{ steps.validate-secret.outputs.verification_result }} @@ -114,31 +109,35 @@ jobs: steps: - name: Setup Scripts id: setup - uses: github/gh-aw-actions/setup@2fe53acc038ba01c3bbdc767d4b25df31ca5bdfc # v0.68.1 + uses: github/gh-aw-actions/setup@b8068426813005612b960b5ab0b8bd2c27142323 # v0.71.5 with: destination: ${{ runner.temp }}/gh-aw/actions job-name: ${{ github.job }} trace-id: ${{ needs.pre_activation.outputs.setup-trace-id }} + env: + GH_AW_SETUP_WORKFLOW_NAME: "CI Outer-Loop Failure Scanner" + GH_AW_CURRENT_WORKFLOW_REF: ${{ github.repository }}/.github/workflows/ci-failure-scan.lock.yml@${{ github.ref }} + GH_AW_INFO_VERSION: "1.0.40" - name: Generate agentic run info id: generate_aw_info env: GH_AW_INFO_ENGINE_ID: "copilot" GH_AW_INFO_ENGINE_NAME: "GitHub Copilot CLI" GH_AW_INFO_MODEL: "claude-opus-4.6" - GH_AW_INFO_VERSION: "1.0.21" - GH_AW_INFO_AGENT_VERSION: "1.0.21" - GH_AW_INFO_CLI_VERSION: "v0.68.1" + GH_AW_INFO_VERSION: "1.0.40" + GH_AW_INFO_AGENT_VERSION: "1.0.40" + GH_AW_INFO_CLI_VERSION: "v0.71.5" GH_AW_INFO_WORKFLOW_NAME: "CI Outer-Loop Failure Scanner" GH_AW_INFO_EXPERIMENTAL: "false" GH_AW_INFO_SUPPORTS_TOOLS_ALLOWLIST: "true" GH_AW_INFO_STAGED: "false" GH_AW_INFO_ALLOWED_DOMAINS: '["defaults","github","dev.azure.com","helix.dot.net","*.blob.core.windows.net"]' GH_AW_INFO_FIREWALL_ENABLED: "true" - GH_AW_INFO_AWF_VERSION: "v0.25.18" + GH_AW_INFO_AWF_VERSION: "v0.25.40" GH_AW_INFO_AWMG_VERSION: "" GH_AW_INFO_FIREWALL_TYPE: "squid" GH_AW_COMPILED_STRICT: "true" - uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9 + uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 with: script: | const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); @@ -149,7 +148,7 @@ jobs: id: validate-secret run: bash "${RUNNER_TEMP}/gh-aw/actions/validate_multi_secret.sh" COPILOT_GITHUB_TOKEN 'GitHub Copilot CLI' https://github.github.com/gh-aw/reference/engines/#github-copilot-default env: - COPILOT_GITHUB_TOKEN: ${{ case(needs.pre_activation.outputs.copilot_pat_number == '0', secrets.COPILOT_PAT_0, needs.pre_activation.outputs.copilot_pat_number == '1', secrets.COPILOT_PAT_1, needs.pre_activation.outputs.copilot_pat_number == '2', secrets.COPILOT_PAT_2, needs.pre_activation.outputs.copilot_pat_number == '3', secrets.COPILOT_PAT_3, needs.pre_activation.outputs.copilot_pat_number == '4', secrets.COPILOT_PAT_4, needs.pre_activation.outputs.copilot_pat_number == '5', secrets.COPILOT_PAT_5, needs.pre_activation.outputs.copilot_pat_number == '6', secrets.COPILOT_PAT_6, needs.pre_activation.outputs.copilot_pat_number == '7', secrets.COPILOT_PAT_7, needs.pre_activation.outputs.copilot_pat_number == '8', secrets.COPILOT_PAT_8, needs.pre_activation.outputs.copilot_pat_number == '9', secrets.COPILOT_PAT_9, secrets.COPILOT_GITHUB_TOKEN) }} + COPILOT_GITHUB_TOKEN: ${{ case(needs.pat_pool.outputs.pat_number == '0', secrets.COPILOT_PAT_0, needs.pat_pool.outputs.pat_number == '1', secrets.COPILOT_PAT_1, needs.pat_pool.outputs.pat_number == '2', secrets.COPILOT_PAT_2, needs.pat_pool.outputs.pat_number == '3', secrets.COPILOT_PAT_3, needs.pat_pool.outputs.pat_number == '4', secrets.COPILOT_PAT_4, needs.pat_pool.outputs.pat_number == '5', secrets.COPILOT_PAT_5, needs.pat_pool.outputs.pat_number == '6', secrets.COPILOT_PAT_6, needs.pat_pool.outputs.pat_number == '7', secrets.COPILOT_PAT_7, needs.pat_pool.outputs.pat_number == '8', secrets.COPILOT_PAT_8, needs.pat_pool.outputs.pat_number == '9', secrets.COPILOT_PAT_9, secrets.COPILOT_GITHUB_TOKEN) }} - name: Checkout .github and .agents folders uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: @@ -157,11 +156,23 @@ jobs: sparse-checkout: | .github .agents + .claude + .codex + .crush + .gemini + .opencode + .pi sparse-checkout-cone-mode: true fetch-depth: 1 + - name: Save agent config folders for base branch restoration + env: + GH_AW_AGENT_FOLDERS: ".agents .claude .codex .crush .gemini .github .opencode .pi" + GH_AW_AGENT_FILES: ".crush.json AGENTS.md CLAUDE.md GEMINI.md PI.md opencode.jsonc" + # poutine:ignore untrusted_checkout_exec + run: bash "${RUNNER_TEMP}/gh-aw/actions/save_base_github_folders.sh" - name: Check workflow lock file id: check-lock-file - uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9 + uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 env: GH_AW_WORKFLOW_FILE: "ci-failure-scan.lock.yml" GH_AW_CONTEXT_WORKFLOW_REF: "${{ github.workflow_ref }}" @@ -172,9 +183,9 @@ jobs: const { main } = require('${{ runner.temp }}/gh-aw/actions/check_workflow_timestamp_api.cjs'); await main(); - name: Check compile-agentic version - uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9 + uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 env: - GH_AW_COMPILED_VERSION: "v0.68.1" + GH_AW_COMPILED_VERSION: "v0.71.5" with: script: | const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); @@ -197,20 +208,23 @@ jobs: run: | bash "${RUNNER_TEMP}/gh-aw/actions/create_prompt_first.sh" { - cat << 'GH_AW_PROMPT_f1c65393e7e58de4_EOF' + cat << 'GH_AW_PROMPT_4b37f3bd8c8088e0_EOF' - GH_AW_PROMPT_f1c65393e7e58de4_EOF + GH_AW_PROMPT_4b37f3bd8c8088e0_EOF cat "${RUNNER_TEMP}/gh-aw/prompts/xpia.md" cat "${RUNNER_TEMP}/gh-aw/prompts/temp_folder_prompt.md" cat "${RUNNER_TEMP}/gh-aw/prompts/markdown.md" cat "${RUNNER_TEMP}/gh-aw/prompts/safe_outputs_prompt.md" - cat << 'GH_AW_PROMPT_f1c65393e7e58de4_EOF' + cat << 'GH_AW_PROMPT_4b37f3bd8c8088e0_EOF' Tools: create_issue(max:5), create_pull_request(max:10), missing_tool, missing_data, noop - GH_AW_PROMPT_f1c65393e7e58de4_EOF + GH_AW_PROMPT_4b37f3bd8c8088e0_EOF cat "${RUNNER_TEMP}/gh-aw/prompts/safe_outputs_create_pull_request.md" - cat << 'GH_AW_PROMPT_f1c65393e7e58de4_EOF' + cat << 'GH_AW_PROMPT_4b37f3bd8c8088e0_EOF' + GH_AW_PROMPT_4b37f3bd8c8088e0_EOF + cat "${RUNNER_TEMP}/gh-aw/prompts/mcp_cli_tools_prompt.md" + cat << 'GH_AW_PROMPT_4b37f3bd8c8088e0_EOF' The following GitHub context information is available for this workflow: {{#if __GH_AW_GITHUB_ACTOR__ }} @@ -242,17 +256,18 @@ jobs: - **Note**: If a branch you need is not in the list above and is not listed as an additional fetched ref, it has NOT been checked out. For private repositories you cannot fetch it without proper authentication. If the branch is required and not available, exit with an error and ask the user to add it to the `fetch:` option of the `checkout:` configuration (e.g., `fetch: ["refs/pulls/open/*"]` for all open PR refs, or `fetch: ["main", "feature/my-branch"]` for specific branches). - GH_AW_PROMPT_f1c65393e7e58de4_EOF + GH_AW_PROMPT_4b37f3bd8c8088e0_EOF cat "${RUNNER_TEMP}/gh-aw/prompts/github_mcp_tools_with_safeoutputs_prompt.md" - cat << 'GH_AW_PROMPT_f1c65393e7e58de4_EOF' + cat << 'GH_AW_PROMPT_4b37f3bd8c8088e0_EOF' {{#runtime-import .github/workflows/ci-failure-scan.md}} - GH_AW_PROMPT_f1c65393e7e58de4_EOF + GH_AW_PROMPT_4b37f3bd8c8088e0_EOF } > "$GH_AW_PROMPT" - name: Interpolate variables and render templates - uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9 + uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 env: GH_AW_PROMPT: /tmp/gh-aw/aw-prompts/prompt.txt + GH_AW_ENGINE_ID: "copilot" with: script: | const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); @@ -260,7 +275,7 @@ jobs: const { main } = require('${{ runner.temp }}/gh-aw/actions/interpolate_prompt.cjs'); await main(); - name: Substitute placeholders - uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9 + uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 env: GH_AW_PROMPT: /tmp/gh-aw/aw-prompts/prompt.txt GH_AW_GITHUB_ACTOR: ${{ github.actor }} @@ -271,6 +286,7 @@ jobs: GH_AW_GITHUB_REPOSITORY: ${{ github.repository }} GH_AW_GITHUB_RUN_ID: ${{ github.run_id }} GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }} + GH_AW_MCP_CLI_SERVERS_LIST: '- `safeoutputs` — run `safeoutputs --help` to see available tools' GH_AW_NEEDS_PRE_ACTIVATION_OUTPUTS_ACTIVATED: ${{ needs.pre_activation.outputs.activated }} with: script: | @@ -291,6 +307,7 @@ jobs: GH_AW_GITHUB_REPOSITORY: process.env.GH_AW_GITHUB_REPOSITORY, GH_AW_GITHUB_RUN_ID: process.env.GH_AW_GITHUB_RUN_ID, GH_AW_GITHUB_WORKSPACE: process.env.GH_AW_GITHUB_WORKSPACE, + GH_AW_MCP_CLI_SERVERS_LIST: process.env.GH_AW_MCP_CLI_SERVERS_LIST, GH_AW_NEEDS_PRE_ACTIVATION_OUTPUTS_ACTIVATED: process.env.GH_AW_NEEDS_PRE_ACTIVATION_OUTPUTS_ACTIVATED } }); @@ -306,18 +323,22 @@ jobs: run: bash "${RUNNER_TEMP}/gh-aw/actions/print_prompt_summary.sh" - name: Upload activation artifact if: success() - uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7 + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 with: name: activation + include-hidden-files: true path: | /tmp/gh-aw/aw_info.json /tmp/gh-aw/aw-prompts/prompt.txt /tmp/gh-aw/github_rate_limits.jsonl + /tmp/gh-aw/base if-no-files-found: ignore retention-days: 1 agent: - needs: activation + needs: + - activation + - pat_pool runs-on: ubuntu-latest permissions: contents: read @@ -333,28 +354,37 @@ jobs: GH_AW_MCP_LOG_DIR: /tmp/gh-aw/mcp-logs/safeoutputs GH_AW_WORKFLOW_ID_SANITIZED: cifailurescan outputs: + agentic_engine_timeout: ${{ steps.detect-copilot-errors.outputs.agentic_engine_timeout || 'false' }} checkout_pr_success: ${{ steps.checkout-pr.outputs.checkout_pr_success || 'true' }} effective_tokens: ${{ steps.parse-mcp-gateway.outputs.effective_tokens }} has_patch: ${{ steps.collect_output.outputs.has_patch }} - inference_access_error: ${{ steps.detect-inference-error.outputs.inference_access_error || 'false' }} + inference_access_error: ${{ steps.detect-copilot-errors.outputs.inference_access_error || 'false' }} + mcp_policy_error: ${{ steps.detect-copilot-errors.outputs.mcp_policy_error || 'false' }} model: ${{ needs.activation.outputs.model }} + model_not_supported_error: ${{ steps.detect-copilot-errors.outputs.model_not_supported_error || 'false' }} output: ${{ steps.collect_output.outputs.output }} output_types: ${{ steps.collect_output.outputs.output_types }} setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Setup Scripts id: setup - uses: github/gh-aw-actions/setup@2fe53acc038ba01c3bbdc767d4b25df31ca5bdfc # v0.68.1 + uses: github/gh-aw-actions/setup@b8068426813005612b960b5ab0b8bd2c27142323 # v0.71.5 with: destination: ${{ runner.temp }}/gh-aw/actions job-name: ${{ github.job }} trace-id: ${{ needs.activation.outputs.setup-trace-id }} + env: + GH_AW_SETUP_WORKFLOW_NAME: "CI Outer-Loop Failure Scanner" + GH_AW_CURRENT_WORKFLOW_REF: ${{ github.repository }}/.github/workflows/ci-failure-scan.lock.yml@${{ github.ref }} + GH_AW_INFO_VERSION: "1.0.40" - name: Set runtime paths id: set-runtime-paths run: | - echo "GH_AW_SAFE_OUTPUTS=${RUNNER_TEMP}/gh-aw/safeoutputs/outputs.jsonl" >> "$GITHUB_OUTPUT" - echo "GH_AW_SAFE_OUTPUTS_CONFIG_PATH=${RUNNER_TEMP}/gh-aw/safeoutputs/config.json" >> "$GITHUB_OUTPUT" - echo "GH_AW_SAFE_OUTPUTS_TOOLS_PATH=${RUNNER_TEMP}/gh-aw/safeoutputs/tools.json" >> "$GITHUB_OUTPUT" + { + echo "GH_AW_SAFE_OUTPUTS=${RUNNER_TEMP}/gh-aw/safeoutputs/outputs.jsonl" + echo "GH_AW_SAFE_OUTPUTS_CONFIG_PATH=${RUNNER_TEMP}/gh-aw/safeoutputs/config.json" + echo "GH_AW_SAFE_OUTPUTS_TOOLS_PATH=${RUNNER_TEMP}/gh-aw/safeoutputs/tools.json" + } >> "$GITHUB_OUTPUT" - name: Checkout repository uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: @@ -383,7 +413,7 @@ jobs: id: checkout-pr if: | github.event.pull_request || github.event.issue.pull_request - uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9 + uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 env: GH_TOKEN: ${{ secrets.GH_AW_GITHUB_MCP_SERVER_TOKEN || secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} with: @@ -394,11 +424,11 @@ jobs: const { main } = require('${{ runner.temp }}/gh-aw/actions/checkout_pr_branch.cjs'); await main(); - name: Install GitHub Copilot CLI - run: bash "${RUNNER_TEMP}/gh-aw/actions/install_copilot_cli.sh" 1.0.21 + run: bash "${RUNNER_TEMP}/gh-aw/actions/install_copilot_cli.sh" 1.0.40 env: GH_HOST: github.com - name: Install AWF binary - run: bash "${RUNNER_TEMP}/gh-aw/actions/install_awf_binary.sh" v0.25.18 + run: bash "${RUNNER_TEMP}/gh-aw/actions/install_awf_binary.sh" v0.25.40 - name: Parse integrity filter lists id: parse-guard-vars env: @@ -406,17 +436,28 @@ jobs: GH_AW_TRUSTED_USERS_VAR: ${{ vars.GH_AW_GITHUB_TRUSTED_USERS || '' }} GH_AW_APPROVAL_LABELS_VAR: ${{ vars.GH_AW_GITHUB_APPROVAL_LABELS || '' }} run: bash "${RUNNER_TEMP}/gh-aw/actions/parse_guard_list.sh" + - name: Download activation artifact + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 + with: + name: activation + path: /tmp/gh-aw + - name: Restore agent config folders from base branch + if: steps.checkout-pr.outcome == 'success' + env: + GH_AW_AGENT_FOLDERS: ".agents .claude .codex .crush .gemini .github .opencode .pi" + GH_AW_AGENT_FILES: ".crush.json AGENTS.md CLAUDE.md GEMINI.md PI.md opencode.jsonc" + run: bash "${RUNNER_TEMP}/gh-aw/actions/restore_base_github_folders.sh" - name: Download container images - run: bash "${RUNNER_TEMP}/gh-aw/actions/download_docker_images.sh" ghcr.io/github/gh-aw-firewall/agent:0.25.18 ghcr.io/github/gh-aw-firewall/api-proxy:0.25.18 ghcr.io/github/gh-aw-firewall/squid:0.25.18 ghcr.io/github/gh-aw-mcpg:v0.2.17 ghcr.io/github/github-mcp-server:v0.32.0 node:lts-alpine - - name: Write Safe Outputs Config + run: bash "${RUNNER_TEMP}/gh-aw/actions/download_docker_images.sh" ghcr.io/github/gh-aw-firewall/agent:0.25.40@sha256:14ff567e8d9d4c2fbc5e55c973488381c71d7e0fdbe72d30ee7b8a738fd86504 ghcr.io/github/gh-aw-firewall/api-proxy:0.25.40@sha256:2883ca3e5ae9f330cafdd9345bfd4ae17fc8da36c96d4c9a1f76e922b4c45280 ghcr.io/github/gh-aw-firewall/squid:0.25.40@sha256:b084f4a2c771f584ee68084ced52fa6b3245197a1889645d817462d307d3ac51 ghcr.io/github/gh-aw-mcpg:v0.3.6@sha256:2bb8eef86006a4c5963c55616a9c51c32f27bfdecb023b8aa6f91f6718d9171c ghcr.io/github/github-mcp-server:v1.0.3@sha256:2ac27ef03461ef2b877031b838a7d1fd7f12b12d4ace7796d8cad91446d55959 node:lts-alpine@sha256:d1b3b4da11eefd5941e7f0b9cf17783fc99d9c6fc34884a665f40a06dbdfc94f + - name: Generate Safe Outputs Config run: | mkdir -p "${RUNNER_TEMP}/gh-aw/safeoutputs" mkdir -p /tmp/gh-aw/safeoutputs mkdir -p /tmp/gh-aw/mcp-logs/safeoutputs - cat > "${RUNNER_TEMP}/gh-aw/safeoutputs/config.json" << 'GH_AW_SAFE_OUTPUTS_CONFIG_a3a51934d74963ff_EOF' - {"create_issue":{"allowed_labels":["Known Build Error","blocking-clean-ci"],"labels":["agentic-workflows"],"max":5},"create_pull_request":{"allowed_files":["src/libraries/**","src/coreclr/**","src/mono/**","src/tests/**","src/native/**","eng/testing/**"],"draft":true,"labels":["agentic-workflows"],"max":10,"max_patch_size":1024,"protected_files":["package.json","bun.lockb","bunfig.toml","deno.json","deno.jsonc","deno.lock","global.json","NuGet.Config","Directory.Packages.props","mix.exs","mix.lock","go.mod","go.sum","stack.yaml","stack.yaml.lock","pom.xml","build.gradle","build.gradle.kts","settings.gradle","settings.gradle.kts","gradle.properties","package-lock.json","yarn.lock","pnpm-lock.yaml","npm-shrinkwrap.json","requirements.txt","Pipfile","Pipfile.lock","pyproject.toml","setup.py","setup.cfg","Gemfile","Gemfile.lock","uv.lock","CODEOWNERS"],"protected_files_policy":"blocked","protected_path_prefixes":[".github/",".agents/"],"title_prefix":"[ci-scan] "},"create_report_incomplete_issue":{},"missing_data":{},"missing_tool":{},"noop":{"max":1,"report-as-issue":"true"},"report_incomplete":{}} - GH_AW_SAFE_OUTPUTS_CONFIG_a3a51934d74963ff_EOF - - name: Write Safe Outputs Tools + cat > "${RUNNER_TEMP}/gh-aw/safeoutputs/config.json" << 'GH_AW_SAFE_OUTPUTS_CONFIG_69462a193cd33582_EOF' + {"create_issue":{"allowed_labels":["Known Build Error","blocking-clean-ci"],"labels":["agentic-workflows"],"max":5},"create_pull_request":{"allowed_files":["src/libraries/**","src/coreclr/**","src/mono/**","src/tests/**","src/native/**","eng/testing/**"],"draft":true,"labels":["agentic-workflows"],"max":10,"max_patch_files":100,"max_patch_size":1024,"protect_top_level_dot_folders":true,"protected_files":["package.json","bun.lockb","bunfig.toml","deno.json","deno.jsonc","deno.lock","global.json","NuGet.Config","Directory.Packages.props","mix.exs","mix.lock","go.mod","go.sum","stack.yaml","stack.yaml.lock","pom.xml","build.gradle","build.gradle.kts","settings.gradle","settings.gradle.kts","gradle.properties","package-lock.json","yarn.lock","pnpm-lock.yaml","npm-shrinkwrap.json","requirements.txt","Pipfile","Pipfile.lock","pyproject.toml","setup.py","setup.cfg","Gemfile","Gemfile.lock","uv.lock","CODEOWNERS","DESIGN.md","README.md","CONTRIBUTING.md","CHANGELOG.md","SECURITY.md","CODE_OF_CONDUCT.md","AGENTS.md","CLAUDE.md","GEMINI.md"],"protected_files_policy":"blocked","title_prefix":"[ci-scan] "},"create_report_incomplete_issue":{},"missing_data":{},"missing_tool":{},"noop":{"max":1,"report-as-issue":"true"},"report_incomplete":{}} + GH_AW_SAFE_OUTPUTS_CONFIG_69462a193cd33582_EOF + - name: Generate Safe Outputs Tools env: GH_AW_TOOLS_META_JSON: | { @@ -465,6 +506,11 @@ jobs: "create_pull_request": { "defaultMax": 1, "fields": { + "base": { + "type": "string", + "sanitize": true, + "maxLength": 128 + }, "body": { "required": true, "type": "string", @@ -572,7 +618,7 @@ jobs: } } } - uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9 + uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 with: script: | const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); @@ -628,11 +674,12 @@ jobs: GITHUB_MCP_SERVER_TOKEN: ${{ secrets.GH_AW_GITHUB_MCP_SERVER_TOKEN || secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} run: | set -eo pipefail - mkdir -p /tmp/gh-aw/mcp-config + mkdir -p "${RUNNER_TEMP}/gh-aw/mcp-config" # Export gateway environment variables for MCP config and gateway script - export MCP_GATEWAY_PORT="80" + export MCP_GATEWAY_PORT="8080" export MCP_GATEWAY_DOMAIN="host.docker.internal" + export MCP_GATEWAY_HOST_DOMAIN="localhost" MCP_GATEWAY_API_KEY=$(openssl rand -base64 45 | tr -d '/+=') echo "::add-mask::${MCP_GATEWAY_API_KEY}" export MCP_GATEWAY_API_KEY @@ -642,15 +689,19 @@ jobs: export DEBUG="*" export GH_AW_ENGINE="copilot" - export MCP_GATEWAY_DOCKER_COMMAND='docker run -i --rm --network host -v /var/run/docker.sock:/var/run/docker.sock -e MCP_GATEWAY_PORT -e MCP_GATEWAY_DOMAIN -e MCP_GATEWAY_API_KEY -e MCP_GATEWAY_PAYLOAD_DIR -e MCP_GATEWAY_PAYLOAD_SIZE_THRESHOLD -e DEBUG -e MCP_GATEWAY_LOG_DIR -e GH_AW_MCP_LOG_DIR -e GH_AW_SAFE_OUTPUTS -e GH_AW_SAFE_OUTPUTS_CONFIG_PATH -e GH_AW_SAFE_OUTPUTS_TOOLS_PATH -e GH_AW_ASSETS_BRANCH -e GH_AW_ASSETS_MAX_SIZE_KB -e GH_AW_ASSETS_ALLOWED_EXTS -e DEFAULT_BRANCH -e GITHUB_MCP_SERVER_TOKEN -e GITHUB_MCP_GUARD_MIN_INTEGRITY -e GITHUB_MCP_GUARD_REPOS -e GITHUB_REPOSITORY -e GITHUB_SERVER_URL -e GITHUB_SHA -e GITHUB_WORKSPACE -e GITHUB_TOKEN -e GITHUB_RUN_ID -e GITHUB_RUN_NUMBER -e GITHUB_RUN_ATTEMPT -e GITHUB_JOB -e GITHUB_ACTION -e GITHUB_EVENT_NAME -e GITHUB_EVENT_PATH -e GITHUB_ACTOR -e GITHUB_ACTOR_ID -e GITHUB_TRIGGERING_ACTOR -e GITHUB_WORKFLOW -e GITHUB_WORKFLOW_REF -e GITHUB_WORKFLOW_SHA -e GITHUB_REF -e GITHUB_REF_NAME -e GITHUB_REF_TYPE -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e GH_AW_SAFE_OUTPUTS_PORT -e GH_AW_SAFE_OUTPUTS_API_KEY -v /tmp/gh-aw/mcp-payloads:/tmp/gh-aw/mcp-payloads:rw -v /opt:/opt:ro -v /tmp:/tmp:rw -v '"${GITHUB_WORKSPACE}"':'"${GITHUB_WORKSPACE}"':rw ghcr.io/github/gh-aw-mcpg:v0.2.17' + MCP_GATEWAY_UID=$(id -u 2>/dev/null || echo '0') + MCP_GATEWAY_GID=$(id -g 2>/dev/null || echo '0') + DOCKER_SOCK_GID=$(stat -c '%g' /var/run/docker.sock 2>/dev/null || echo '0') + export MCP_GATEWAY_DOCKER_COMMAND='docker run -i --rm --network host --add-host host.docker.internal:127.0.0.1 --user '"${MCP_GATEWAY_UID}"':'"${MCP_GATEWAY_GID}"' --group-add '"${DOCKER_SOCK_GID}"' -v /var/run/docker.sock:/var/run/docker.sock -e MCP_GATEWAY_PORT -e MCP_GATEWAY_DOMAIN -e MCP_GATEWAY_API_KEY -e MCP_GATEWAY_PAYLOAD_DIR -e MCP_GATEWAY_PAYLOAD_SIZE_THRESHOLD -e DEBUG -e MCP_GATEWAY_LOG_DIR -e GH_AW_MCP_LOG_DIR -e GH_AW_SAFE_OUTPUTS -e GH_AW_SAFE_OUTPUTS_CONFIG_PATH -e GH_AW_SAFE_OUTPUTS_TOOLS_PATH -e GH_AW_ASSETS_BRANCH -e GH_AW_ASSETS_MAX_SIZE_KB -e GH_AW_ASSETS_ALLOWED_EXTS -e DEFAULT_BRANCH -e GITHUB_MCP_SERVER_TOKEN -e GITHUB_MCP_GUARD_MIN_INTEGRITY -e GITHUB_MCP_GUARD_REPOS -e GITHUB_REPOSITORY -e GITHUB_SERVER_URL -e GITHUB_SHA -e GITHUB_WORKSPACE -e GITHUB_TOKEN -e GITHUB_RUN_ID -e GITHUB_RUN_NUMBER -e GITHUB_RUN_ATTEMPT -e GITHUB_JOB -e GITHUB_ACTION -e GITHUB_EVENT_NAME -e GITHUB_EVENT_PATH -e GITHUB_ACTOR -e GITHUB_ACTOR_ID -e GITHUB_TRIGGERING_ACTOR -e GITHUB_WORKFLOW -e GITHUB_WORKFLOW_REF -e GITHUB_WORKFLOW_SHA -e GITHUB_REF -e GITHUB_REF_NAME -e GITHUB_REF_TYPE -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e GH_AW_SAFE_OUTPUTS_PORT -e GH_AW_SAFE_OUTPUTS_API_KEY -v /tmp/gh-aw/mcp-payloads:/tmp/gh-aw/mcp-payloads:rw -v /opt:/opt:ro -v /tmp:/tmp:rw -v '"${GITHUB_WORKSPACE}"':'"${GITHUB_WORKSPACE}"':rw ghcr.io/github/gh-aw-mcpg:v0.3.6' mkdir -p /home/runner/.copilot - cat << GH_AW_MCP_CONFIG_c371ad2870ad1169_EOF | bash "${RUNNER_TEMP}/gh-aw/actions/start_mcp_gateway.sh" + GH_AW_NODE=$(which node 2>/dev/null || command -v node 2>/dev/null || echo node) + cat << GH_AW_MCP_CONFIG_38b37234e4736353_EOF | "$GH_AW_NODE" "${RUNNER_TEMP}/gh-aw/actions/start_mcp_gateway.cjs" { "mcpServers": { "github": { "type": "stdio", - "container": "ghcr.io/github/github-mcp-server:v0.32.0", + "container": "ghcr.io/github/github-mcp-server:v1.0.3", "env": { "GITHUB_HOST": "\${GITHUB_SERVER_URL}", "GITHUB_PERSONAL_ACCESS_TOKEN": "\${GITHUB_MCP_SERVER_TOKEN}", @@ -689,15 +740,28 @@ jobs: "payloadDir": "${MCP_GATEWAY_PAYLOAD_DIR}" } } - GH_AW_MCP_CONFIG_c371ad2870ad1169_EOF - - name: Download activation artifact - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 + GH_AW_MCP_CONFIG_38b37234e4736353_EOF + - name: Mount MCP servers as CLIs + id: mount-mcp-clis + continue-on-error: true + env: + MCP_GATEWAY_API_KEY: ${{ steps.start-mcp-gateway.outputs.gateway-api-key }} + MCP_GATEWAY_DOMAIN: ${{ steps.start-mcp-gateway.outputs.gateway-domain }} + MCP_GATEWAY_PORT: ${{ steps.start-mcp-gateway.outputs.gateway-port }} + uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 with: - name: activation - path: /tmp/gh-aw - - name: Clean git credentials + script: | + const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); + setupGlobals(core, github, context, exec, io); + const { main } = require('${{ runner.temp }}/gh-aw/actions/mount_mcp_as_cli.cjs'); + await main(); + - name: Clean credentials continue-on-error: true run: bash "${RUNNER_TEMP}/gh-aw/actions/clean_git_credentials.sh" + - name: Audit pre-agent workspace + id: pre_agent_audit + continue-on-error: true + run: bash "${RUNNER_TEMP}/gh-aw/actions/audit_pre_agent_workspace.sh" - name: Execute GitHub Copilot CLI id: agentic_execution # Copilot CLI tool arguments (sorted): @@ -731,6 +795,7 @@ jobs: # --allow-tool shell(ls) # --allow-tool shell(mkdir) # --allow-tool shell(pwd) + # --allow-tool shell(safeoutputs:*) # --allow-tool shell(sed) # --allow-tool shell(sh) # --allow-tool shell(sort) @@ -747,21 +812,26 @@ jobs: run: | set -o pipefail touch /tmp/gh-aw/agent-step-summary.md + GH_AW_NODE_BIN=$(command -v node 2>/dev/null || true) + export GH_AW_NODE_BIN (umask 177 && touch /tmp/gh-aw/agent-stdio.log) + printf '%s\n' '{"$schema":"https://github.com/github/gh-aw-firewall/releases/download/v0.25.40/awf-config.schema.json","network":{"allowDomains":["*.blob.core.windows.net","*.githubusercontent.com","api.business.githubcopilot.com","api.enterprise.githubcopilot.com","api.github.com","api.githubcopilot.com","api.individual.githubcopilot.com","api.snapcraft.io","archive.ubuntu.com","azure.archive.ubuntu.com","codeload.github.com","crl.geotrust.com","crl.globalsign.com","crl.identrust.com","crl.sectigo.com","crl.thawte.com","crl.usertrust.com","crl.verisign.com","crl3.digicert.com","crl4.digicert.com","crls.ssl.com","dev.azure.com","docs.github.com","github-cloud.githubusercontent.com","github-cloud.s3.amazonaws.com","github.blog","github.com","github.githubassets.com","helix.dot.net","host.docker.internal","json-schema.org","json.schemastore.org","keyserver.ubuntu.com","lfs.github.com","objects.githubusercontent.com","ocsp.digicert.com","ocsp.geotrust.com","ocsp.globalsign.com","ocsp.identrust.com","ocsp.sectigo.com","ocsp.ssl.com","ocsp.thawte.com","ocsp.usertrust.com","ocsp.verisign.com","packagecloud.io","packages.cloud.google.com","packages.microsoft.com","ppa.launchpad.net","raw.githubusercontent.com","registry.npmjs.org","s.symcb.com","s.symcd.com","security.ubuntu.com","telemetry.enterprise.githubcopilot.com","ts-crl.ws.symantec.com","ts-ocsp.ws.symantec.com","www.googleapis.com"]},"apiProxy":{"enabled":true,"models":{"auto":["large"],"deep-research":["copilot/deep-research*","google/deep-research*"],"gemini-flash":["copilot/gemini-*flash*","google/gemini-*flash*"],"gemini-pro":["copilot/gemini-*pro*","google/gemini-*pro*"],"gpt-4.1":["copilot/gpt-4.1*","openai/gpt-4.1*"],"gpt-5":["copilot/gpt-5*","openai/gpt-5*"],"gpt-5-codex":["copilot/gpt-5*codex*","openai/gpt-5*codex*"],"gpt-5-mini":["copilot/gpt-5*mini*","openai/gpt-5*mini*"],"gpt-5-nano":["copilot/gpt-5*nano*","openai/gpt-5*nano*"],"gpt-5-pro":["copilot/gpt-5*pro*","openai/gpt-5*pro*"],"haiku":["copilot/*haiku*","anthropic/*haiku*"],"large":["sonnet","gpt-5-pro","gpt-5","gemini-pro"],"mini":["haiku","gpt-5-mini","gpt-5-nano","gemini-flash"],"opus":["copilot/*opus*","anthropic/*opus*"],"reasoning":["copilot/o1*","copilot/o3*","copilot/o4*","openai/o1*","openai/o3*","openai/o4*"],"small":["mini"],"sonnet":["copilot/*sonnet*","anthropic/*sonnet*"]}},"container":{"imageTag":"0.25.40,squid=sha256:b084f4a2c771f584ee68084ced52fa6b3245197a1889645d817462d307d3ac51,agent=sha256:14ff567e8d9d4c2fbc5e55c973488381c71d7e0fdbe72d30ee7b8a738fd86504,api-proxy=sha256:2883ca3e5ae9f330cafdd9345bfd4ae17fc8da36c96d4c9a1f76e922b4c45280,cli-proxy=sha256:3e7152911d4b4b7b97beef9d3d7d924ff7902227e86001ef3838fb728d5d514c"}}' > "${RUNNER_TEMP}/gh-aw/awf-config.json" && cp "${RUNNER_TEMP}/gh-aw/awf-config.json" /tmp/gh-aw/awf-config.json # shellcheck disable=SC1003 - sudo -E awf --container-workdir "${GITHUB_WORKSPACE}" --mount "${RUNNER_TEMP}/gh-aw:${RUNNER_TEMP}/gh-aw:ro" --mount "${RUNNER_TEMP}/gh-aw:/host${RUNNER_TEMP}/gh-aw:ro" --env-all --exclude-env COPILOT_GITHUB_TOKEN --exclude-env GITHUB_MCP_SERVER_TOKEN --exclude-env MCP_GATEWAY_API_KEY --allow-domains '*.blob.core.windows.net,*.githubusercontent.com,api.business.githubcopilot.com,api.enterprise.githubcopilot.com,api.github.com,api.githubcopilot.com,api.individual.githubcopilot.com,api.snapcraft.io,archive.ubuntu.com,azure.archive.ubuntu.com,codeload.github.com,crl.geotrust.com,crl.globalsign.com,crl.identrust.com,crl.sectigo.com,crl.thawte.com,crl.usertrust.com,crl.verisign.com,crl3.digicert.com,crl4.digicert.com,crls.ssl.com,dev.azure.com,docs.github.com,github-cloud.githubusercontent.com,github-cloud.s3.amazonaws.com,github.blog,github.com,github.githubassets.com,helix.dot.net,host.docker.internal,json-schema.org,json.schemastore.org,keyserver.ubuntu.com,lfs.github.com,objects.githubusercontent.com,ocsp.digicert.com,ocsp.geotrust.com,ocsp.globalsign.com,ocsp.identrust.com,ocsp.sectigo.com,ocsp.ssl.com,ocsp.thawte.com,ocsp.usertrust.com,ocsp.verisign.com,packagecloud.io,packages.cloud.google.com,packages.microsoft.com,ppa.launchpad.net,raw.githubusercontent.com,registry.npmjs.org,s.symcb.com,s.symcd.com,security.ubuntu.com,telemetry.enterprise.githubcopilot.com,ts-crl.ws.symantec.com,ts-ocsp.ws.symantec.com,www.googleapis.com' --log-level info --proxy-logs-dir /tmp/gh-aw/sandbox/firewall/logs --audit-dir /tmp/gh-aw/sandbox/firewall/audit --enable-host-access --image-tag 0.25.18 --skip-pull --enable-api-proxy \ - -- /bin/bash -c 'node ${RUNNER_TEMP}/gh-aw/actions/copilot_driver.cjs /usr/local/bin/copilot --add-dir /tmp/gh-aw/ --log-level all --log-dir /tmp/gh-aw/sandbox/agent/logs/ --disable-builtin-mcps --allow-tool github --allow-tool safeoutputs --allow-tool '\''shell(awk)'\'' --allow-tool '\''shell(basename)'\'' --allow-tool '\''shell(bash)'\'' --allow-tool '\''shell(cat)'\'' --allow-tool '\''shell(chmod)'\'' --allow-tool '\''shell(curl:*)'\'' --allow-tool '\''shell(cut)'\'' --allow-tool '\''shell(date)'\'' --allow-tool '\''shell(dirname)'\'' --allow-tool '\''shell(dotnet:*)'\'' --allow-tool '\''shell(echo)'\'' --allow-tool '\''shell(env)'\'' --allow-tool '\''shell(find)'\'' --allow-tool '\''shell(git add:*)'\'' --allow-tool '\''shell(git branch:*)'\'' --allow-tool '\''shell(git checkout:*)'\'' --allow-tool '\''shell(git commit:*)'\'' --allow-tool '\''shell(git merge:*)'\'' --allow-tool '\''shell(git rm:*)'\'' --allow-tool '\''shell(git status)'\'' --allow-tool '\''shell(git switch:*)'\'' --allow-tool '\''shell(git:*)'\'' --allow-tool '\''shell(grep)'\'' --allow-tool '\''shell(head)'\'' --allow-tool '\''shell(jq)'\'' --allow-tool '\''shell(ls)'\'' --allow-tool '\''shell(mkdir)'\'' --allow-tool '\''shell(pwd)'\'' --allow-tool '\''shell(sed)'\'' --allow-tool '\''shell(sh)'\'' --allow-tool '\''shell(sort)'\'' --allow-tool '\''shell(tail)'\'' --allow-tool '\''shell(tee)'\'' --allow-tool '\''shell(test)'\'' --allow-tool '\''shell(tr)'\'' --allow-tool '\''shell(uniq)'\'' --allow-tool '\''shell(wc)'\'' --allow-tool '\''shell(xargs)'\'' --allow-tool '\''shell(yq)'\'' --allow-tool write --allow-all-paths --add-dir "${GITHUB_WORKSPACE}" --prompt "$(cat /tmp/gh-aw/aw-prompts/prompt.txt)"' 2>&1 | tee -a /tmp/gh-aw/agent-stdio.log + sudo -E awf --config "${RUNNER_TEMP}/gh-aw/awf-config.json" --container-workdir "${GITHUB_WORKSPACE}" --mount "${RUNNER_TEMP}/gh-aw:${RUNNER_TEMP}/gh-aw:ro" --mount "${RUNNER_TEMP}/gh-aw:/host${RUNNER_TEMP}/gh-aw:ro" --env-all --exclude-env COPILOT_GITHUB_TOKEN --exclude-env GITHUB_MCP_SERVER_TOKEN --exclude-env MCP_GATEWAY_API_KEY --log-level info --proxy-logs-dir /tmp/gh-aw/sandbox/firewall/logs --audit-dir /tmp/gh-aw/sandbox/firewall/audit --enable-host-access --allow-host-ports 80,443,8080 --skip-pull \ + -- /bin/bash -c 'export PATH="${RUNNER_TEMP}/gh-aw/mcp-cli/bin:$PATH" && export PATH="$(find /opt/hostedtoolcache /home/runner/work/_tool -maxdepth 4 -type d -name bin 2>/dev/null | tr '\''\n'\'' '\'':'\'')$PATH"; [ -n "$GOROOT" ] && export PATH="$GOROOT/bin:$PATH" || true && GH_AW_NODE_EXEC="${GH_AW_NODE_BIN:-}"; if [ -z "$GH_AW_NODE_EXEC" ] || [ ! -x "$GH_AW_NODE_EXEC" ]; then GH_AW_NODE_EXEC="$(command -v node 2>/dev/null || echo node)"; fi; "$GH_AW_NODE_EXEC" ${RUNNER_TEMP}/gh-aw/actions/copilot_harness.cjs /usr/local/bin/copilot --add-dir /tmp/gh-aw/ --log-level all --log-dir /tmp/gh-aw/sandbox/agent/logs/ --disable-builtin-mcps --no-ask-user --allow-tool github --allow-tool safeoutputs --allow-tool '\''shell(awk)'\'' --allow-tool '\''shell(basename)'\'' --allow-tool '\''shell(bash)'\'' --allow-tool '\''shell(cat)'\'' --allow-tool '\''shell(chmod)'\'' --allow-tool '\''shell(curl:*)'\'' --allow-tool '\''shell(cut)'\'' --allow-tool '\''shell(date)'\'' --allow-tool '\''shell(dirname)'\'' --allow-tool '\''shell(dotnet:*)'\'' --allow-tool '\''shell(echo)'\'' --allow-tool '\''shell(env)'\'' --allow-tool '\''shell(find)'\'' --allow-tool '\''shell(git add:*)'\'' --allow-tool '\''shell(git branch:*)'\'' --allow-tool '\''shell(git checkout:*)'\'' --allow-tool '\''shell(git commit:*)'\'' --allow-tool '\''shell(git merge:*)'\'' --allow-tool '\''shell(git rm:*)'\'' --allow-tool '\''shell(git status)'\'' --allow-tool '\''shell(git switch:*)'\'' --allow-tool '\''shell(git:*)'\'' --allow-tool '\''shell(grep)'\'' --allow-tool '\''shell(head)'\'' --allow-tool '\''shell(jq)'\'' --allow-tool '\''shell(ls)'\'' --allow-tool '\''shell(mkdir)'\'' --allow-tool '\''shell(pwd)'\'' --allow-tool '\''shell(safeoutputs:*)'\'' --allow-tool '\''shell(sed)'\'' --allow-tool '\''shell(sh)'\'' --allow-tool '\''shell(sort)'\'' --allow-tool '\''shell(tail)'\'' --allow-tool '\''shell(tee)'\'' --allow-tool '\''shell(test)'\'' --allow-tool '\''shell(tr)'\'' --allow-tool '\''shell(uniq)'\'' --allow-tool '\''shell(wc)'\'' --allow-tool '\''shell(xargs)'\'' --allow-tool '\''shell(yq)'\'' --allow-tool write --allow-all-paths --add-dir "${GITHUB_WORKSPACE}" --prompt-file /tmp/gh-aw/aw-prompts/prompt.txt' 2>&1 | tee -a /tmp/gh-aw/agent-stdio.log env: COPILOT_AGENT_RUNNER_TYPE: STANDALONE - COPILOT_GITHUB_TOKEN: ${{ case(needs.pre_activation.outputs.copilot_pat_number == '0', secrets.COPILOT_PAT_0, needs.pre_activation.outputs.copilot_pat_number == '1', secrets.COPILOT_PAT_1, needs.pre_activation.outputs.copilot_pat_number == '2', secrets.COPILOT_PAT_2, needs.pre_activation.outputs.copilot_pat_number == '3', secrets.COPILOT_PAT_3, needs.pre_activation.outputs.copilot_pat_number == '4', secrets.COPILOT_PAT_4, needs.pre_activation.outputs.copilot_pat_number == '5', secrets.COPILOT_PAT_5, needs.pre_activation.outputs.copilot_pat_number == '6', secrets.COPILOT_PAT_6, needs.pre_activation.outputs.copilot_pat_number == '7', secrets.COPILOT_PAT_7, needs.pre_activation.outputs.copilot_pat_number == '8', secrets.COPILOT_PAT_8, needs.pre_activation.outputs.copilot_pat_number == '9', secrets.COPILOT_PAT_9, secrets.COPILOT_GITHUB_TOKEN) }} + COPILOT_API_KEY: dummy-byok-key-for-offline-mode + COPILOT_GITHUB_TOKEN: ${{ case(needs.pat_pool.outputs.pat_number == '0', secrets.COPILOT_PAT_0, needs.pat_pool.outputs.pat_number == '1', secrets.COPILOT_PAT_1, needs.pat_pool.outputs.pat_number == '2', secrets.COPILOT_PAT_2, needs.pat_pool.outputs.pat_number == '3', secrets.COPILOT_PAT_3, needs.pat_pool.outputs.pat_number == '4', secrets.COPILOT_PAT_4, needs.pat_pool.outputs.pat_number == '5', secrets.COPILOT_PAT_5, needs.pat_pool.outputs.pat_number == '6', secrets.COPILOT_PAT_6, needs.pat_pool.outputs.pat_number == '7', secrets.COPILOT_PAT_7, needs.pat_pool.outputs.pat_number == '8', secrets.COPILOT_PAT_8, needs.pat_pool.outputs.pat_number == '9', secrets.COPILOT_PAT_9, secrets.COPILOT_GITHUB_TOKEN) }} COPILOT_MODEL: claude-opus-4.6 GH_AW_MCP_CONFIG: /home/runner/.copilot/mcp-config.json GH_AW_PHASE: agent GH_AW_PROMPT: /tmp/gh-aw/aw-prompts/prompt.txt GH_AW_SAFE_OUTPUTS: ${{ steps.set-runtime-paths.outputs.GH_AW_SAFE_OUTPUTS }} - GH_AW_VERSION: v0.68.1 + GH_AW_VERSION: v0.71.5 GITHUB_API_URL: ${{ github.api_url }} GITHUB_AW: true + GITHUB_COPILOT_INTEGRATION_ID: agentic-workflows GITHUB_HEAD_REF: ${{ github.head_ref }} GITHUB_MCP_SERVER_TOKEN: ${{ secrets.GH_AW_GITHUB_MCP_SERVER_TOKEN || secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} GITHUB_REF_NAME: ${{ github.ref_name }} @@ -773,11 +843,11 @@ jobs: GIT_COMMITTER_EMAIL: github-actions[bot]@users.noreply.github.com GIT_COMMITTER_NAME: github-actions[bot] XDG_CONFIG_HOME: /home/runner - - name: Detect inference access error - id: detect-inference-error + - name: Detect Copilot errors + id: detect-copilot-errors if: always() continue-on-error: true - run: bash "${RUNNER_TEMP}/gh-aw/actions/detect_inference_access_error.sh" + run: node "${RUNNER_TEMP}/gh-aw/actions/detect_copilot_errors.cjs" - name: Configure Git credentials env: REPO_NAME: ${{ github.repository }} @@ -806,7 +876,7 @@ jobs: bash "${RUNNER_TEMP}/gh-aw/actions/stop_mcp_gateway.sh" "$GATEWAY_PID" - name: Redact secrets in logs if: always() - uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9 + uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 with: script: | const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); @@ -842,7 +912,7 @@ jobs: - name: Ingest agent output id: collect_output if: always() - uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9 + uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 env: GH_AW_SAFE_OUTPUTS: ${{ steps.set-runtime-paths.outputs.GH_AW_SAFE_OUTPUTS }} GH_AW_ALLOWED_DOMAINS: "*.blob.core.windows.net,*.githubusercontent.com,api.business.githubcopilot.com,api.enterprise.githubcopilot.com,api.github.com,api.githubcopilot.com,api.individual.githubcopilot.com,api.snapcraft.io,archive.ubuntu.com,azure.archive.ubuntu.com,codeload.github.com,crl.geotrust.com,crl.globalsign.com,crl.identrust.com,crl.sectigo.com,crl.thawte.com,crl.usertrust.com,crl.verisign.com,crl3.digicert.com,crl4.digicert.com,crls.ssl.com,dev.azure.com,docs.github.com,github-cloud.githubusercontent.com,github-cloud.s3.amazonaws.com,github.blog,github.com,github.githubassets.com,helix.dot.net,host.docker.internal,json-schema.org,json.schemastore.org,keyserver.ubuntu.com,lfs.github.com,objects.githubusercontent.com,ocsp.digicert.com,ocsp.geotrust.com,ocsp.globalsign.com,ocsp.identrust.com,ocsp.sectigo.com,ocsp.ssl.com,ocsp.thawte.com,ocsp.usertrust.com,ocsp.verisign.com,packagecloud.io,packages.cloud.google.com,packages.microsoft.com,ppa.launchpad.net,raw.githubusercontent.com,registry.npmjs.org,s.symcb.com,s.symcd.com,security.ubuntu.com,telemetry.enterprise.githubcopilot.com,ts-crl.ws.symantec.com,ts-ocsp.ws.symantec.com,www.googleapis.com" @@ -856,7 +926,7 @@ jobs: await main(); - name: Parse agent logs for step summary if: always() - uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9 + uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 env: GH_AW_AGENT_OUTPUT: /tmp/gh-aw/sandbox/agent/logs/ with: @@ -868,7 +938,7 @@ jobs: - name: Parse MCP Gateway logs for step summary if: always() id: parse-mcp-gateway - uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9 + uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 with: script: | const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); @@ -881,9 +951,9 @@ jobs: env: AWF_LOGS_DIR: /tmp/gh-aw/sandbox/firewall/logs run: | - # Fix permissions on firewall logs so they can be uploaded as artifacts + # Fix permissions on firewall logs/audit dirs so they can be uploaded as artifacts # AWF runs with sudo, creating files owned by root - sudo chmod -R a+r /tmp/gh-aw/sandbox/firewall/logs 2>/dev/null || true + sudo chmod -R a+r /tmp/gh-aw/sandbox/firewall 2>/dev/null || true # Only run awf logs summary if awf command exists (it may not be installed if workflow failed before install step) if command -v awf &> /dev/null; then awf logs summary | tee -a "$GITHUB_STEP_SUMMARY" @@ -893,13 +963,23 @@ jobs: - name: Parse token usage for step summary if: always() continue-on-error: true - uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9 + uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 with: script: | const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); setupGlobals(core, github, context, exec, io, getOctokit); const { main } = require('${{ runner.temp }}/gh-aw/actions/parse_token_usage.cjs'); await main(); + - name: Print AWF reflect summary + if: always() + continue-on-error: true + uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 + with: + script: | + const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); + setupGlobals(core, github, context, exec, io, getOctokit); + const { main } = require('${{ runner.temp }}/gh-aw/actions/awf_reflect_summary.cjs'); + await main(); - name: Write agent output placeholder if missing if: always() run: | @@ -909,7 +989,7 @@ jobs: - name: Upload agent artifacts if: always() continue-on-error: true - uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7 + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 with: name: agent path: | @@ -921,22 +1001,17 @@ jobs: !/tmp/gh-aw/proxy-logs/proxy-tls/ /tmp/gh-aw/agent_usage.json /tmp/gh-aw/agent-stdio.log + /tmp/gh-aw/pre-agent-audit.txt /tmp/gh-aw/agent/ /tmp/gh-aw/github_rate_limits.jsonl /tmp/gh-aw/safeoutputs.jsonl /tmp/gh-aw/agent_output.json /tmp/gh-aw/aw-*.patch /tmp/gh-aw/aw-*.bundle - if-no-files-found: ignore - - name: Upload firewall audit logs - if: always() - continue-on-error: true - uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7 - with: - name: firewall-audit-logs - path: | + /tmp/gh-aw/awf-config.json /tmp/gh-aw/sandbox/firewall/logs/ /tmp/gh-aw/sandbox/firewall/audit/ + /tmp/gh-aw/sandbox/firewall/awf-reflect.json if-no-files-found: ignore conclusion: @@ -944,6 +1019,7 @@ jobs: - activation - agent - detection + - pat_pool - safe_outputs if: > always() && (needs.agent.result != 'skipped' || needs.activation.outputs.lockdown_check_failed == 'true' || @@ -964,11 +1040,15 @@ jobs: steps: - name: Setup Scripts id: setup - uses: github/gh-aw-actions/setup@2fe53acc038ba01c3bbdc767d4b25df31ca5bdfc # v0.68.1 + uses: github/gh-aw-actions/setup@b8068426813005612b960b5ab0b8bd2c27142323 # v0.71.5 with: destination: ${{ runner.temp }}/gh-aw/actions job-name: ${{ github.job }} trace-id: ${{ needs.activation.outputs.setup-trace-id }} + env: + GH_AW_SETUP_WORKFLOW_NAME: "CI Outer-Loop Failure Scanner" + GH_AW_CURRENT_WORKFLOW_REF: ${{ github.repository }}/.github/workflows/ci-failure-scan.lock.yml@${{ github.ref }} + GH_AW_INFO_VERSION: "1.0.40" - name: Download agent output artifact id: download-agent-output continue-on-error: true @@ -983,9 +1063,9 @@ jobs: mkdir -p /tmp/gh-aw/ find "/tmp/gh-aw/" -type f -print echo "GH_AW_AGENT_OUTPUT=/tmp/gh-aw/agent_output.json" >> "$GITHUB_OUTPUT" - - name: Process No-Op Messages + - name: Process no-op messages id: noop - uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9 + uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 env: GH_AW_AGENT_OUTPUT: ${{ steps.setup-agent-output-env.outputs.GH_AW_AGENT_OUTPUT }} GH_AW_NOOP_MAX: "1" @@ -1000,9 +1080,25 @@ jobs: setupGlobals(core, github, context, exec, io, getOctokit); const { main } = require('${{ runner.temp }}/gh-aw/actions/handle_noop_message.cjs'); await main(); + - name: Log detection run + id: detection_runs + uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 + env: + GH_AW_AGENT_OUTPUT: ${{ steps.setup-agent-output-env.outputs.GH_AW_AGENT_OUTPUT }} + GH_AW_WORKFLOW_NAME: "CI Outer-Loop Failure Scanner" + GH_AW_RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} + GH_AW_DETECTION_CONCLUSION: ${{ needs.detection.outputs.detection_conclusion }} + GH_AW_DETECTION_REASON: ${{ needs.detection.outputs.detection_reason }} + with: + github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} + script: | + const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); + setupGlobals(core, github, context, exec, io, getOctokit); + const { main } = require('${{ runner.temp }}/gh-aw/actions/handle_detection_runs.cjs'); + await main(); - name: Record missing tool id: missing_tool - uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9 + uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 env: GH_AW_AGENT_OUTPUT: ${{ steps.setup-agent-output-env.outputs.GH_AW_AGENT_OUTPUT }} GH_AW_MISSING_TOOL_CREATE_ISSUE: "true" @@ -1016,7 +1112,7 @@ jobs: await main(); - name: Record incomplete id: report_incomplete - uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9 + uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 env: GH_AW_AGENT_OUTPUT: ${{ steps.setup-agent-output-env.outputs.GH_AW_AGENT_OUTPUT }} GH_AW_REPORT_INCOMPLETE_CREATE_ISSUE: "true" @@ -1031,23 +1127,30 @@ jobs: - name: Handle agent failure id: handle_agent_failure if: always() - uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9 + uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 env: GH_AW_AGENT_OUTPUT: ${{ steps.setup-agent-output-env.outputs.GH_AW_AGENT_OUTPUT }} GH_AW_WORKFLOW_NAME: "CI Outer-Loop Failure Scanner" GH_AW_RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} GH_AW_AGENT_CONCLUSION: ${{ needs.agent.result }} GH_AW_WORKFLOW_ID: "ci-failure-scan" + GH_AW_ACTION_FAILURE_ISSUE_EXPIRES_HOURS: "168" GH_AW_ENGINE_ID: "copilot" GH_AW_SECRET_VERIFICATION_RESULT: ${{ needs.activation.outputs.secret_verification_result }} GH_AW_CHECKOUT_PR_SUCCESS: ${{ needs.agent.outputs.checkout_pr_success }} GH_AW_INFERENCE_ACCESS_ERROR: ${{ needs.agent.outputs.inference_access_error }} + GH_AW_MCP_POLICY_ERROR: ${{ needs.agent.outputs.mcp_policy_error }} + GH_AW_AGENTIC_ENGINE_TIMEOUT: ${{ needs.agent.outputs.agentic_engine_timeout }} + GH_AW_MODEL_NOT_SUPPORTED_ERROR: ${{ needs.agent.outputs.model_not_supported_error }} + GH_AW_ENGINE_API_HOSTS: "api.enterprise.githubcopilot.com,api.githubcopilot.com,api.business.githubcopilot.com,api.individual.githubcopilot.com" GH_AW_CODE_PUSH_FAILURE_ERRORS: ${{ needs.safe_outputs.outputs.code_push_failure_errors }} GH_AW_CODE_PUSH_FAILURE_COUNT: ${{ needs.safe_outputs.outputs.code_push_failure_count }} GH_AW_LOCKDOWN_CHECK_FAILED: ${{ needs.activation.outputs.lockdown_check_failed }} GH_AW_STALE_LOCK_FILE_FAILED: ${{ needs.activation.outputs.stale_lock_file_failed }} GH_AW_GROUP_REPORTS: "false" GH_AW_FAILURE_REPORT_AS_ISSUE: "true" + GH_AW_MISSING_TOOL_REPORT_AS_FAILURE: "true" + GH_AW_MISSING_DATA_REPORT_AS_FAILURE: "true" GH_AW_TIMEOUT_MINUTES: "90" with: github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} @@ -1068,15 +1171,20 @@ jobs: contents: read outputs: detection_conclusion: ${{ steps.detection_conclusion.outputs.conclusion }} + detection_reason: ${{ steps.detection_conclusion.outputs.reason }} detection_success: ${{ steps.detection_conclusion.outputs.success }} steps: - name: Setup Scripts id: setup - uses: github/gh-aw-actions/setup@2fe53acc038ba01c3bbdc767d4b25df31ca5bdfc # v0.68.1 + uses: github/gh-aw-actions/setup@b8068426813005612b960b5ab0b8bd2c27142323 # v0.71.5 with: destination: ${{ runner.temp }}/gh-aw/actions job-name: ${{ github.job }} trace-id: ${{ needs.activation.outputs.setup-trace-id }} + env: + GH_AW_SETUP_WORKFLOW_NAME: "CI Outer-Loop Failure Scanner" + GH_AW_CURRENT_WORKFLOW_REF: ${{ github.repository }}/.github/workflows/ci-failure-scan.lock.yml@${{ github.ref }} + GH_AW_INFO_VERSION: "1.0.40" - name: Download agent output artifact id: download-agent-output continue-on-error: true @@ -1097,8 +1205,12 @@ jobs: with: persist-credentials: false # --- Threat Detection --- + - name: Clean stale firewall files from agent artifact + run: | + rm -rf /tmp/gh-aw/sandbox/firewall/logs + rm -rf /tmp/gh-aw/sandbox/firewall/audit - name: Download container images - run: bash "${RUNNER_TEMP}/gh-aw/actions/download_docker_images.sh" ghcr.io/github/gh-aw-firewall/agent:0.25.18 ghcr.io/github/gh-aw-firewall/api-proxy:0.25.18 ghcr.io/github/gh-aw-firewall/squid:0.25.18 + run: bash "${RUNNER_TEMP}/gh-aw/actions/download_docker_images.sh" ghcr.io/github/gh-aw-firewall/agent:0.25.40@sha256:14ff567e8d9d4c2fbc5e55c973488381c71d7e0fdbe72d30ee7b8a738fd86504 ghcr.io/github/gh-aw-firewall/api-proxy:0.25.40@sha256:2883ca3e5ae9f330cafdd9345bfd4ae17fc8da36c96d4c9a1f76e922b4c45280 ghcr.io/github/gh-aw-firewall/squid:0.25.40@sha256:b084f4a2c771f584ee68084ced52fa6b3245197a1889645d817462d307d3ac51 - name: Check if detection needed id: detection_guard if: always() @@ -1113,10 +1225,10 @@ jobs: echo "run_detection=false" >> "$GITHUB_OUTPUT" echo "Detection skipped: no agent outputs or patches to analyze" fi - - name: Clear MCP configuration for detection + - name: Clear MCP Config for detection if: always() && steps.detection_guard.outputs.run_detection == 'true' run: | - rm -f /tmp/gh-aw/mcp-config/mcp-servers.json + rm -f "${RUNNER_TEMP}/gh-aw/mcp-config/mcp-servers.json" rm -f /home/runner/.copilot/mcp-config.json rm -f "$GITHUB_WORKSPACE/.gemini/settings.json" - name: Prepare threat detection files @@ -1135,7 +1247,7 @@ jobs: ls -la /tmp/gh-aw/threat-detection/ 2>/dev/null || true - name: Setup threat detection if: always() && steps.detection_guard.outputs.run_detection == 'true' - uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9 + uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 env: WORKFLOW_NAME: "CI Outer-Loop Failure Scanner" WORKFLOW_DESCRIPTION: "Periodic scan of runtime-extra-platforms and outer-loop CI pipelines (JIT/GC stress, PGO, libraries-jitstress, etc.). Files Known Build Errors so failures are immediately ignorable in PR CI; opens companion skip PRs to remove the failure permanently after human review." @@ -1151,33 +1263,44 @@ jobs: run: | mkdir -p /tmp/gh-aw/threat-detection touch /tmp/gh-aw/threat-detection/detection.log + - name: Setup Node.js + uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 + with: + node-version: '24' + package-manager-cache: false - name: Install GitHub Copilot CLI - run: bash "${RUNNER_TEMP}/gh-aw/actions/install_copilot_cli.sh" 1.0.21 + run: bash "${RUNNER_TEMP}/gh-aw/actions/install_copilot_cli.sh" 1.0.40 env: GH_HOST: github.com - name: Install AWF binary - run: bash "${RUNNER_TEMP}/gh-aw/actions/install_awf_binary.sh" v0.25.18 + run: bash "${RUNNER_TEMP}/gh-aw/actions/install_awf_binary.sh" v0.25.40 - name: Execute GitHub Copilot CLI if: always() && steps.detection_guard.outputs.run_detection == 'true' + continue-on-error: true id: detection_agentic_execution # Copilot CLI tool arguments (sorted): timeout-minutes: 20 run: | set -o pipefail touch /tmp/gh-aw/agent-step-summary.md + GH_AW_NODE_BIN=$(command -v node 2>/dev/null || true) + export GH_AW_NODE_BIN (umask 177 && touch /tmp/gh-aw/threat-detection/detection.log) + printf '%s\n' '{"$schema":"https://github.com/github/gh-aw-firewall/releases/download/v0.25.40/awf-config.schema.json","network":{"allowDomains":["api.business.githubcopilot.com","api.enterprise.githubcopilot.com","api.github.com","api.githubcopilot.com","api.individual.githubcopilot.com","github.com","host.docker.internal","telemetry.enterprise.githubcopilot.com"]},"apiProxy":{"enabled":true},"container":{"imageTag":"0.25.40,squid=sha256:b084f4a2c771f584ee68084ced52fa6b3245197a1889645d817462d307d3ac51,agent=sha256:14ff567e8d9d4c2fbc5e55c973488381c71d7e0fdbe72d30ee7b8a738fd86504,api-proxy=sha256:2883ca3e5ae9f330cafdd9345bfd4ae17fc8da36c96d4c9a1f76e922b4c45280,cli-proxy=sha256:3e7152911d4b4b7b97beef9d3d7d924ff7902227e86001ef3838fb728d5d514c"}}' > "${RUNNER_TEMP}/gh-aw/awf-config.json" && cp "${RUNNER_TEMP}/gh-aw/awf-config.json" /tmp/gh-aw/awf-config.json # shellcheck disable=SC1003 - sudo -E awf --container-workdir "${GITHUB_WORKSPACE}" --mount "${RUNNER_TEMP}/gh-aw:${RUNNER_TEMP}/gh-aw:ro" --mount "${RUNNER_TEMP}/gh-aw:/host${RUNNER_TEMP}/gh-aw:ro" --env-all --exclude-env COPILOT_GITHUB_TOKEN --allow-domains api.business.githubcopilot.com,api.enterprise.githubcopilot.com,api.github.com,api.githubcopilot.com,api.individual.githubcopilot.com,github.com,host.docker.internal,telemetry.enterprise.githubcopilot.com --log-level info --proxy-logs-dir /tmp/gh-aw/sandbox/firewall/logs --audit-dir /tmp/gh-aw/sandbox/firewall/audit --enable-host-access --image-tag 0.25.18 --skip-pull --enable-api-proxy \ - -- /bin/bash -c 'node ${RUNNER_TEMP}/gh-aw/actions/copilot_driver.cjs /usr/local/bin/copilot --add-dir /tmp/gh-aw/ --log-level all --log-dir /tmp/gh-aw/sandbox/agent/logs/ --disable-builtin-mcps --allow-all-tools --add-dir "${GITHUB_WORKSPACE}" --prompt "$(cat /tmp/gh-aw/aw-prompts/prompt.txt)"' 2>&1 | tee -a /tmp/gh-aw/threat-detection/detection.log + sudo -E awf --config "${RUNNER_TEMP}/gh-aw/awf-config.json" --container-workdir "${GITHUB_WORKSPACE}" --mount "${RUNNER_TEMP}/gh-aw:${RUNNER_TEMP}/gh-aw:ro" --mount "${RUNNER_TEMP}/gh-aw:/host${RUNNER_TEMP}/gh-aw:ro" --env-all --exclude-env COPILOT_GITHUB_TOKEN --log-level info --proxy-logs-dir /tmp/gh-aw/sandbox/firewall/logs --audit-dir /tmp/gh-aw/sandbox/firewall/audit --enable-host-access --allow-host-ports 80,443,8080 --skip-pull \ + -- /bin/bash -c 'export PATH="$(find /opt/hostedtoolcache /home/runner/work/_tool -maxdepth 4 -type d -name bin 2>/dev/null | tr '\''\n'\'' '\'':'\'')$PATH"; [ -n "$GOROOT" ] && export PATH="$GOROOT/bin:$PATH" || true && GH_AW_NODE_EXEC="${GH_AW_NODE_BIN:-}"; if [ -z "$GH_AW_NODE_EXEC" ] || [ ! -x "$GH_AW_NODE_EXEC" ]; then GH_AW_NODE_EXEC="$(command -v node 2>/dev/null || echo node)"; fi; "$GH_AW_NODE_EXEC" ${RUNNER_TEMP}/gh-aw/actions/copilot_harness.cjs /usr/local/bin/copilot --add-dir /tmp/gh-aw/ --log-level all --log-dir /tmp/gh-aw/sandbox/agent/logs/ --disable-builtin-mcps --no-ask-user --allow-all-tools --add-dir "${GITHUB_WORKSPACE}" --prompt-file /tmp/gh-aw/aw-prompts/prompt.txt' 2>&1 | tee -a /tmp/gh-aw/threat-detection/detection.log env: COPILOT_AGENT_RUNNER_TYPE: STANDALONE - COPILOT_GITHUB_TOKEN: ${{ case(needs.pre_activation.outputs.copilot_pat_number == '0', secrets.COPILOT_PAT_0, needs.pre_activation.outputs.copilot_pat_number == '1', secrets.COPILOT_PAT_1, needs.pre_activation.outputs.copilot_pat_number == '2', secrets.COPILOT_PAT_2, needs.pre_activation.outputs.copilot_pat_number == '3', secrets.COPILOT_PAT_3, needs.pre_activation.outputs.copilot_pat_number == '4', secrets.COPILOT_PAT_4, needs.pre_activation.outputs.copilot_pat_number == '5', secrets.COPILOT_PAT_5, needs.pre_activation.outputs.copilot_pat_number == '6', secrets.COPILOT_PAT_6, needs.pre_activation.outputs.copilot_pat_number == '7', secrets.COPILOT_PAT_7, needs.pre_activation.outputs.copilot_pat_number == '8', secrets.COPILOT_PAT_8, needs.pre_activation.outputs.copilot_pat_number == '9', secrets.COPILOT_PAT_9, secrets.COPILOT_GITHUB_TOKEN) }} + COPILOT_API_KEY: dummy-byok-key-for-offline-mode + COPILOT_GITHUB_TOKEN: ${{ case(needs.pat_pool.outputs.pat_number == '0', secrets.COPILOT_PAT_0, needs.pat_pool.outputs.pat_number == '1', secrets.COPILOT_PAT_1, needs.pat_pool.outputs.pat_number == '2', secrets.COPILOT_PAT_2, needs.pat_pool.outputs.pat_number == '3', secrets.COPILOT_PAT_3, needs.pat_pool.outputs.pat_number == '4', secrets.COPILOT_PAT_4, needs.pat_pool.outputs.pat_number == '5', secrets.COPILOT_PAT_5, needs.pat_pool.outputs.pat_number == '6', secrets.COPILOT_PAT_6, needs.pat_pool.outputs.pat_number == '7', secrets.COPILOT_PAT_7, needs.pat_pool.outputs.pat_number == '8', secrets.COPILOT_PAT_8, needs.pat_pool.outputs.pat_number == '9', secrets.COPILOT_PAT_9, secrets.COPILOT_GITHUB_TOKEN) }} COPILOT_MODEL: claude-opus-4.6 GH_AW_PHASE: detection GH_AW_PROMPT: /tmp/gh-aw/aw-prompts/prompt.txt - GH_AW_VERSION: v0.68.1 + GH_AW_VERSION: v0.71.5 GITHUB_API_URL: ${{ github.api_url }} GITHUB_AW: true + GITHUB_COPILOT_INTEGRATION_ID: agentic-workflows GITHUB_HEAD_REF: ${{ github.head_ref }} GITHUB_REF_NAME: ${{ github.ref_name }} GITHUB_SERVER_URL: ${{ github.server_url }} @@ -1190,7 +1313,7 @@ jobs: XDG_CONFIG_HOME: /home/runner - name: Upload threat detection log if: always() && steps.detection_guard.outputs.run_detection == 'true' - uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7 + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 with: name: detection path: /tmp/gh-aw/threat-detection/detection.log @@ -1198,34 +1321,128 @@ jobs: - name: Parse and conclude threat detection id: detection_conclusion if: always() - uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9 + continue-on-error: true + uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 env: RUN_DETECTION: ${{ steps.detection_guard.outputs.run_detection }} + GH_AW_DETECTION_CONTINUE_ON_ERROR: "true" with: script: | - const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); - setupGlobals(core, github, context, exec, io, getOctokit); - const { main } = require('${{ runner.temp }}/gh-aw/actions/parse_threat_detection_results.cjs'); - await main(); + try { + const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); + setupGlobals(core, github, context, exec, io, getOctokit); + const { main } = require('${{ runner.temp }}/gh-aw/actions/parse_threat_detection_results.cjs'); + await main(); + } catch (loadErr) { + const continueOnError = process.env.GH_AW_DETECTION_CONTINUE_ON_ERROR !== 'false'; + const msg = 'ERR_SYSTEM: \u274C Unexpected error loading threat detection module: ' + (loadErr && loadErr.message ? loadErr.message : String(loadErr)); + core.error(msg); + core.setOutput('reason', 'parse_error'); + if (continueOnError) { + core.warning('\u26A0\uFE0F ' + msg); + core.setOutput('conclusion', 'warning'); + core.setOutput('success', 'false'); + } else { + core.setOutput('conclusion', 'failure'); + core.setOutput('success', 'false'); + core.setFailed(msg); + } + } + + pat_pool: + needs: pre_activation + runs-on: ubuntu-slim + outputs: + pat_number: ${{ steps.select-pat-number.outputs.copilot_pat_number }} + steps: + - name: Configure GH_HOST for enterprise compatibility + id: ghes-host-config + shell: bash + run: | + # Derive GH_HOST from GITHUB_SERVER_URL so the gh CLI targets the correct + # GitHub instance (GHES/GHEC). On github.com this is a harmless no-op. + GH_HOST="${GITHUB_SERVER_URL#https://}" + GH_HOST="${GH_HOST#http://}" + echo "GH_HOST=${GH_HOST}" >> "$GITHUB_ENV" + - name: Select Copilot token from pool + id: select-pat-number + run: | + # Collect pool entries with non-empty secrets from COPILOT_PAT_0..COPILOT_PAT_9. + PAT_NUMBERS=() + POOL_INDICATORS=(➖ ➖ ➖ ➖ ➖ ➖ ➖ ➖ ➖ ➖) + + for i in $(seq 0 9); do + var="COPILOT_PAT_${i}" + val="${!var}" + if [ -n "$val" ]; then + PAT_NUMBERS+=(${i}) + POOL_INDICATORS[${i}]="🟪" + fi + done + + # If none of the entries in the pool have values, emit a warning + # and do not set an output value. The consumer can fall back to + # using COPILOT_GITHUB_TOKEN. + if [ ${#PAT_NUMBERS[@]} -eq 0 ]; then + warning_message="::warning::None of the PAT pool entries had values " + warning_message+="(checked COPILOT_PAT_0 through COPILOT_PAT_9)" + echo "$warning_message" + exit 0 + fi + + # Select a random index using the seed if specified + if [ -n "$RANDOM_SEED" ]; then + RANDOM=$RANDOM_SEED + fi + + PAT_INDEX=$(( RANDOM % ${#PAT_NUMBERS[@]} )) + PAT_NUMBER="${PAT_NUMBERS[$PAT_INDEX]}" + POOL_INDICATORS[${PAT_NUMBER}]="✅" + + echo "Pool size: ${#PAT_NUMBERS[@]}" + echo "Selected PAT number ${PAT_NUMBER} (index: ${PAT_INDEX})" + + # Emit a markdown table of the pool entries to the step summary + echo "|0|1|2|3|4|5|6|7|8|9|" >> "$GITHUB_STEP_SUMMARY" + echo "|-|-|-|-|-|-|-|-|-|-|" >> "$GITHUB_STEP_SUMMARY" + (IFS='|'; printf '|%s' "${POOL_INDICATORS[@]}"; printf '|\n') >> "$GITHUB_STEP_SUMMARY" + + # Set the PAT number as the output + echo "copilot_pat_number=${PAT_NUMBER}" >> "$GITHUB_OUTPUT" + env: + COPILOT_PAT_0: ${{ secrets.COPILOT_PAT_0 }} + COPILOT_PAT_1: ${{ secrets.COPILOT_PAT_1 }} + COPILOT_PAT_2: ${{ secrets.COPILOT_PAT_2 }} + COPILOT_PAT_3: ${{ secrets.COPILOT_PAT_3 }} + COPILOT_PAT_4: ${{ secrets.COPILOT_PAT_4 }} + COPILOT_PAT_5: ${{ secrets.COPILOT_PAT_5 }} + COPILOT_PAT_6: ${{ secrets.COPILOT_PAT_6 }} + COPILOT_PAT_7: ${{ secrets.COPILOT_PAT_7 }} + COPILOT_PAT_8: ${{ secrets.COPILOT_PAT_8 }} + COPILOT_PAT_9: ${{ secrets.COPILOT_PAT_9 }} + RANDOM_SEED: ${{ github.aw.import-inputs.random_seed }} + shell: bash pre_activation: runs-on: ubuntu-slim outputs: activated: ${{ steps.check_membership.outputs.is_team_member == 'true' }} - copilot_pat_number: ${{ steps.select-copilot-pat.outputs.copilot_pat_number }} matched_command: '' - select-copilot-pat_result: ${{ steps.select-copilot-pat.outcome }} setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Setup Scripts id: setup - uses: github/gh-aw-actions/setup@2fe53acc038ba01c3bbdc767d4b25df31ca5bdfc # v0.68.1 + uses: github/gh-aw-actions/setup@b8068426813005612b960b5ab0b8bd2c27142323 # v0.71.5 with: destination: ${{ runner.temp }}/gh-aw/actions job-name: ${{ github.job }} + env: + GH_AW_SETUP_WORKFLOW_NAME: "CI Outer-Loop Failure Scanner" + GH_AW_CURRENT_WORKFLOW_REF: ${{ github.repository }}/.github/workflows/ci-failure-scan.lock.yml@${{ github.ref }} + GH_AW_INFO_VERSION: "1.0.40" - name: Check team membership for workflow id: check_membership - uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9 + uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 env: GH_AW_REQUIRED_ROLES: "admin,maintainer,write" with: @@ -1235,27 +1452,6 @@ jobs: setupGlobals(core, github, context, exec, io, getOctokit); const { main } = require('${{ runner.temp }}/gh-aw/actions/check_membership.cjs'); await main(); - - name: Checkout the select-copilot-pat action folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - fetch-depth: 1 - persist-credentials: false - sparse-checkout: .github/actions/select-copilot-pat - sparse-checkout-cone-mode: true - - name: Select Copilot token from pool - id: select-copilot-pat - uses: ./.github/actions/select-copilot-pat - env: - SECRET_0: ${{ secrets.COPILOT_PAT_0 }} - SECRET_1: ${{ secrets.COPILOT_PAT_1 }} - SECRET_2: ${{ secrets.COPILOT_PAT_2 }} - SECRET_3: ${{ secrets.COPILOT_PAT_3 }} - SECRET_4: ${{ secrets.COPILOT_PAT_4 }} - SECRET_5: ${{ secrets.COPILOT_PAT_5 }} - SECRET_6: ${{ secrets.COPILOT_PAT_6 }} - SECRET_7: ${{ secrets.COPILOT_PAT_7 }} - SECRET_8: ${{ secrets.COPILOT_PAT_8 }} - SECRET_9: ${{ secrets.COPILOT_PAT_9 }} safe_outputs: needs: @@ -1271,9 +1467,12 @@ jobs: timeout-minutes: 15 env: GH_AW_CALLER_WORKFLOW_ID: "${{ github.repository }}/ci-failure-scan" + GH_AW_DETECTION_CONCLUSION: ${{ needs.detection.outputs.detection_conclusion }} + GH_AW_DETECTION_REASON: ${{ needs.detection.outputs.detection_reason }} GH_AW_EFFECTIVE_TOKENS: ${{ needs.agent.outputs.effective_tokens }} GH_AW_ENGINE_ID: "copilot" GH_AW_ENGINE_MODEL: "claude-opus-4.6" + GH_AW_ENGINE_VERSION: "1.0.40" GH_AW_WORKFLOW_ID: "ci-failure-scan" GH_AW_WORKFLOW_NAME: "CI Outer-Loop Failure Scanner" outputs: @@ -1290,11 +1489,15 @@ jobs: steps: - name: Setup Scripts id: setup - uses: github/gh-aw-actions/setup@2fe53acc038ba01c3bbdc767d4b25df31ca5bdfc # v0.68.1 + uses: github/gh-aw-actions/setup@b8068426813005612b960b5ab0b8bd2c27142323 # v0.71.5 with: destination: ${{ runner.temp }}/gh-aw/actions job-name: ${{ github.job }} trace-id: ${{ needs.activation.outputs.setup-trace-id }} + env: + GH_AW_SETUP_WORKFLOW_NAME: "CI Outer-Loop Failure Scanner" + GH_AW_CURRENT_WORKFLOW_REF: ${{ github.repository }}/.github/workflows/ci-failure-scan.lock.yml@${{ github.ref }} + GH_AW_INFO_VERSION: "1.0.40" - name: Download agent output artifact id: download-agent-output continue-on-error: true @@ -1348,13 +1551,13 @@ jobs: echo "GH_HOST=${GH_HOST}" >> "$GITHUB_ENV" - name: Process Safe Outputs id: process_safe_outputs - uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9 + uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 env: GH_AW_AGENT_OUTPUT: ${{ steps.setup-agent-output-env.outputs.GH_AW_AGENT_OUTPUT }} GH_AW_ALLOWED_DOMAINS: "*.blob.core.windows.net,*.githubusercontent.com,api.business.githubcopilot.com,api.enterprise.githubcopilot.com,api.github.com,api.githubcopilot.com,api.individual.githubcopilot.com,api.snapcraft.io,archive.ubuntu.com,azure.archive.ubuntu.com,codeload.github.com,crl.geotrust.com,crl.globalsign.com,crl.identrust.com,crl.sectigo.com,crl.thawte.com,crl.usertrust.com,crl.verisign.com,crl3.digicert.com,crl4.digicert.com,crls.ssl.com,dev.azure.com,docs.github.com,github-cloud.githubusercontent.com,github-cloud.s3.amazonaws.com,github.blog,github.com,github.githubassets.com,helix.dot.net,host.docker.internal,json-schema.org,json.schemastore.org,keyserver.ubuntu.com,lfs.github.com,objects.githubusercontent.com,ocsp.digicert.com,ocsp.geotrust.com,ocsp.globalsign.com,ocsp.identrust.com,ocsp.sectigo.com,ocsp.ssl.com,ocsp.thawte.com,ocsp.usertrust.com,ocsp.verisign.com,packagecloud.io,packages.cloud.google.com,packages.microsoft.com,ppa.launchpad.net,raw.githubusercontent.com,registry.npmjs.org,s.symcb.com,s.symcd.com,security.ubuntu.com,telemetry.enterprise.githubcopilot.com,ts-crl.ws.symantec.com,ts-ocsp.ws.symantec.com,www.googleapis.com" GITHUB_SERVER_URL: ${{ github.server_url }} GITHUB_API_URL: ${{ github.api_url }} - GH_AW_SAFE_OUTPUTS_HANDLER_CONFIG: "{\"create_issue\":{\"allowed_labels\":[\"Known Build Error\",\"blocking-clean-ci\"],\"labels\":[\"agentic-workflows\"],\"max\":5},\"create_pull_request\":{\"allowed_files\":[\"src/libraries/**\",\"src/coreclr/**\",\"src/mono/**\",\"src/tests/**\",\"src/native/**\",\"eng/testing/**\"],\"draft\":true,\"labels\":[\"agentic-workflows\"],\"max\":10,\"max_patch_size\":1024,\"protected_files\":[\"package.json\",\"bun.lockb\",\"bunfig.toml\",\"deno.json\",\"deno.jsonc\",\"deno.lock\",\"global.json\",\"NuGet.Config\",\"Directory.Packages.props\",\"mix.exs\",\"mix.lock\",\"go.mod\",\"go.sum\",\"stack.yaml\",\"stack.yaml.lock\",\"pom.xml\",\"build.gradle\",\"build.gradle.kts\",\"settings.gradle\",\"settings.gradle.kts\",\"gradle.properties\",\"package-lock.json\",\"yarn.lock\",\"pnpm-lock.yaml\",\"npm-shrinkwrap.json\",\"requirements.txt\",\"Pipfile\",\"Pipfile.lock\",\"pyproject.toml\",\"setup.py\",\"setup.cfg\",\"Gemfile\",\"Gemfile.lock\",\"uv.lock\",\"CODEOWNERS\",\"AGENTS.md\"],\"protected_files_policy\":\"blocked\",\"protected_path_prefixes\":[\".github/\",\".agents/\"],\"title_prefix\":\"[ci-scan] \"},\"create_report_incomplete_issue\":{},\"missing_data\":{},\"missing_tool\":{},\"noop\":{\"max\":1,\"report-as-issue\":\"true\"},\"report_incomplete\":{}}" + GH_AW_SAFE_OUTPUTS_HANDLER_CONFIG: "{\"create_issue\":{\"allowed_labels\":[\"Known Build Error\",\"blocking-clean-ci\"],\"labels\":[\"agentic-workflows\"],\"max\":5},\"create_pull_request\":{\"allowed_files\":[\"src/libraries/**\",\"src/coreclr/**\",\"src/mono/**\",\"src/tests/**\",\"src/native/**\",\"eng/testing/**\"],\"draft\":true,\"labels\":[\"agentic-workflows\"],\"max\":10,\"max_patch_files\":100,\"max_patch_size\":1024,\"protect_top_level_dot_folders\":true,\"protected_files\":[\"package.json\",\"bun.lockb\",\"bunfig.toml\",\"deno.json\",\"deno.jsonc\",\"deno.lock\",\"global.json\",\"NuGet.Config\",\"Directory.Packages.props\",\"mix.exs\",\"mix.lock\",\"go.mod\",\"go.sum\",\"stack.yaml\",\"stack.yaml.lock\",\"pom.xml\",\"build.gradle\",\"build.gradle.kts\",\"settings.gradle\",\"settings.gradle.kts\",\"gradle.properties\",\"package-lock.json\",\"yarn.lock\",\"pnpm-lock.yaml\",\"npm-shrinkwrap.json\",\"requirements.txt\",\"Pipfile\",\"Pipfile.lock\",\"pyproject.toml\",\"setup.py\",\"setup.cfg\",\"Gemfile\",\"Gemfile.lock\",\"uv.lock\",\"CODEOWNERS\",\"DESIGN.md\",\"README.md\",\"CONTRIBUTING.md\",\"CHANGELOG.md\",\"SECURITY.md\",\"CODE_OF_CONDUCT.md\",\"AGENTS.md\",\"CLAUDE.md\",\"GEMINI.md\"],\"protected_files_policy\":\"blocked\",\"title_prefix\":\"[ci-scan] \"},\"create_report_incomplete_issue\":{},\"missing_data\":{},\"missing_tool\":{},\"noop\":{\"max\":1,\"report-as-issue\":\"true\"},\"report_incomplete\":{}}" GH_AW_CI_TRIGGER_TOKEN: ${{ secrets.GH_AW_CI_TRIGGER_TOKEN }} with: github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} @@ -1365,9 +1568,11 @@ jobs: await main(); - name: Upload Safe Outputs Items if: always() - uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7 + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 with: name: safe-outputs-items - path: /tmp/gh-aw/safe-output-items.jsonl + path: | + /tmp/gh-aw/safe-output-items.jsonl + /tmp/gh-aw/temporary-id-map.json if-no-files-found: ignore diff --git a/.github/workflows/ci-failure-scan.md b/.github/workflows/ci-failure-scan.md index 8fa3343e25d1b0..66c022456bb640 100644 --- a/.github/workflows/ci-failure-scan.md +++ b/.github/workflows/ci-failure-scan.md @@ -11,57 +11,21 @@ on: schedule: every 12h workflow_dispatch: roles: [admin, maintainer, write] + permissions: {} # ############################################################### -# Override the COPILOT_GITHUB_TOKEN secret usage for the workflow -# with a randomly-selected token from a pool of secrets. -# -# As soon as organization-level billing is offered for Agentic -# Workflows, this stop-gap approach will be removed. -# -# See: /.github/actions/select-copilot-pat/README.md +# Override COPILOT_GITHUB_TOKEN with a random PAT from the pool. +# This stop-gap will be removed when org billing is available. +# See: .github/workflows/shared/pat_pool.README.md for more info. # ############################################################### +imports: + - shared/pat_pool.md - # Add the pre-activation step of selecting a random PAT from the supplied secrets - steps: - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - name: Checkout the select-copilot-pat action folder - with: - persist-credentials: false - sparse-checkout: .github/actions/select-copilot-pat - sparse-checkout-cone-mode: true - fetch-depth: 1 - - - id: select-copilot-pat - name: Select Copilot token from pool - uses: ./.github/actions/select-copilot-pat - env: - SECRET_0: ${{ secrets.COPILOT_PAT_0 }} - SECRET_1: ${{ secrets.COPILOT_PAT_1 }} - SECRET_2: ${{ secrets.COPILOT_PAT_2 }} - SECRET_3: ${{ secrets.COPILOT_PAT_3 }} - SECRET_4: ${{ secrets.COPILOT_PAT_4 }} - SECRET_5: ${{ secrets.COPILOT_PAT_5 }} - SECRET_6: ${{ secrets.COPILOT_PAT_6 }} - SECRET_7: ${{ secrets.COPILOT_PAT_7 }} - SECRET_8: ${{ secrets.COPILOT_PAT_8 }} - SECRET_9: ${{ secrets.COPILOT_PAT_9 }} - -# Add the pre-activation output of the randomly selected PAT -jobs: - pre-activation: - outputs: - copilot_pat_number: ${{ steps.select-copilot-pat.outputs.copilot_pat_number }} - -# Override the COPILOT_GITHUB_TOKEN expression used in the activation job -# Consume the PAT number from the pre-activation step and select the corresponding secret engine: id: copilot model: claude-opus-4.6 env: - # We cannot use line breaks in this expression as it leads to a syntax error in the compiled workflow - # If none of the `COPILOT_PAT_#` secrets were selected, then the default COPILOT_GITHUB_TOKEN is used - COPILOT_GITHUB_TOKEN: ${{ case(needs.pre_activation.outputs.copilot_pat_number == '0', secrets.COPILOT_PAT_0, needs.pre_activation.outputs.copilot_pat_number == '1', secrets.COPILOT_PAT_1, needs.pre_activation.outputs.copilot_pat_number == '2', secrets.COPILOT_PAT_2, needs.pre_activation.outputs.copilot_pat_number == '3', secrets.COPILOT_PAT_3, needs.pre_activation.outputs.copilot_pat_number == '4', secrets.COPILOT_PAT_4, needs.pre_activation.outputs.copilot_pat_number == '5', secrets.COPILOT_PAT_5, needs.pre_activation.outputs.copilot_pat_number == '6', secrets.COPILOT_PAT_6, needs.pre_activation.outputs.copilot_pat_number == '7', secrets.COPILOT_PAT_7, needs.pre_activation.outputs.copilot_pat_number == '8', secrets.COPILOT_PAT_8, needs.pre_activation.outputs.copilot_pat_number == '9', secrets.COPILOT_PAT_9, secrets.COPILOT_GITHUB_TOKEN) }} + COPILOT_GITHUB_TOKEN: ${{ case(needs.pat_pool.outputs.pat_number == '0', secrets.COPILOT_PAT_0, needs.pat_pool.outputs.pat_number == '1', secrets.COPILOT_PAT_1, needs.pat_pool.outputs.pat_number == '2', secrets.COPILOT_PAT_2, needs.pat_pool.outputs.pat_number == '3', secrets.COPILOT_PAT_3, needs.pat_pool.outputs.pat_number == '4', secrets.COPILOT_PAT_4, needs.pat_pool.outputs.pat_number == '5', secrets.COPILOT_PAT_5, needs.pat_pool.outputs.pat_number == '6', secrets.COPILOT_PAT_6, needs.pat_pool.outputs.pat_number == '7', secrets.COPILOT_PAT_7, needs.pat_pool.outputs.pat_number == '8', secrets.COPILOT_PAT_8, needs.pat_pool.outputs.pat_number == '9', secrets.COPILOT_PAT_9, secrets.COPILOT_GITHUB_TOKEN) }} concurrency: group: "ci-failure-scan" diff --git a/.github/workflows/code-review.lock.yml b/.github/workflows/code-review.lock.yml index 1bcee15bcd04d8..c663c6aec37307 100644 --- a/.github/workflows/code-review.lock.yml +++ b/.github/workflows/code-review.lock.yml @@ -1,3 +1,5 @@ +# gh-aw-metadata: {"schema_version":"v3","frontmatter_hash":"582db9bfe35d0a77ccaffa71ac7e93847259d2b9bef47a3e543775f620fd1895","compiler_version":"v0.71.5","strict":true,"agent_id":"copilot","agent_model":"claude-opus-4.6"} +# gh-aw-manifest: {"version":1,"secrets":["COPILOT_GITHUB_TOKEN","COPILOT_PAT_0","COPILOT_PAT_1","COPILOT_PAT_2","COPILOT_PAT_3","COPILOT_PAT_4","COPILOT_PAT_5","COPILOT_PAT_6","COPILOT_PAT_7","COPILOT_PAT_8","COPILOT_PAT_9","GH_AW_GITHUB_MCP_SERVER_TOKEN","GH_AW_GITHUB_TOKEN","GITHUB_TOKEN"],"actions":[{"repo":"actions/checkout","sha":"de0fac2e4500dabe0009e67214ff5f5447ce83dd","version":"v6.0.2"},{"repo":"actions/download-artifact","sha":"3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c","version":"v8.0.1"},{"repo":"actions/github-script","sha":"373c709c69115d41ff229c7e5df9f8788daa9553","version":"v9"},{"repo":"actions/github-script","sha":"3a2844b7e9c422d3c10d287c895573f7108da1b3","version":"v9.0.0"},{"repo":"actions/setup-node","sha":"48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e","version":"v6.4.0"},{"repo":"actions/upload-artifact","sha":"043fb46d1a93c77aae656e7c1c64a875d1fc6a0a","version":"v7.0.1"},{"repo":"github/gh-aw-actions/setup","sha":"b8068426813005612b960b5ab0b8bd2c27142323","version":"v0.71.5"}],"containers":[{"image":"ghcr.io/github/gh-aw-firewall/agent:0.25.40","digest":"sha256:14ff567e8d9d4c2fbc5e55c973488381c71d7e0fdbe72d30ee7b8a738fd86504","pinned_image":"ghcr.io/github/gh-aw-firewall/agent:0.25.40@sha256:14ff567e8d9d4c2fbc5e55c973488381c71d7e0fdbe72d30ee7b8a738fd86504"},{"image":"ghcr.io/github/gh-aw-firewall/api-proxy:0.25.40","digest":"sha256:2883ca3e5ae9f330cafdd9345bfd4ae17fc8da36c96d4c9a1f76e922b4c45280","pinned_image":"ghcr.io/github/gh-aw-firewall/api-proxy:0.25.40@sha256:2883ca3e5ae9f330cafdd9345bfd4ae17fc8da36c96d4c9a1f76e922b4c45280"},{"image":"ghcr.io/github/gh-aw-firewall/squid:0.25.40","digest":"sha256:b084f4a2c771f584ee68084ced52fa6b3245197a1889645d817462d307d3ac51","pinned_image":"ghcr.io/github/gh-aw-firewall/squid:0.25.40@sha256:b084f4a2c771f584ee68084ced52fa6b3245197a1889645d817462d307d3ac51"},{"image":"ghcr.io/github/gh-aw-mcpg:v0.3.6","digest":"sha256:2bb8eef86006a4c5963c55616a9c51c32f27bfdecb023b8aa6f91f6718d9171c","pinned_image":"ghcr.io/github/gh-aw-mcpg:v0.3.6@sha256:2bb8eef86006a4c5963c55616a9c51c32f27bfdecb023b8aa6f91f6718d9171c"},{"image":"node:lts-alpine","digest":"sha256:d1b3b4da11eefd5941e7f0b9cf17783fc99d9c6fc34884a665f40a06dbdfc94f","pinned_image":"node:lts-alpine@sha256:d1b3b4da11eefd5941e7f0b9cf17783fc99d9c6fc34884a665f40a06dbdfc94f"}]} # ___ _ _ # / _ \ | | (_) # | |_| | __ _ ___ _ __ | |_ _ ___ @@ -12,7 +14,7 @@ # \ /\ / (_) | | | | ( | | | | (_) \ V V /\__ \ # \/ \/ \___/|_| |_|\_\|_| |_|\___/ \_/\_/ |___/ # -# This file was automatically generated by gh-aw (v0.63.1). DO NOT EDIT. +# This file was automatically generated by gh-aw (v0.71.5). DO NOT EDIT. # # To update this file, edit the corresponding .md file and run: # gh aw compile @@ -22,7 +24,41 @@ # # Review pull request changes for correctness, performance, and consistency with project conventions # -# gh-aw-metadata: {"schema_version":"v3","frontmatter_hash":"7f84227b06213ec31831335fb4cc2e40eb827273fac6455fc43725d476dedf06","compiler_version":"v0.63.1","strict":true,"agent_id":"copilot","agent_model":"claude-opus-4.6"} +# Resolved workflow manifest: +# Imports: +# - shared/pat_pool.md +# +# Secrets used: +# - COPILOT_GITHUB_TOKEN +# - COPILOT_PAT_0 +# - COPILOT_PAT_1 +# - COPILOT_PAT_2 +# - COPILOT_PAT_3 +# - COPILOT_PAT_4 +# - COPILOT_PAT_5 +# - COPILOT_PAT_6 +# - COPILOT_PAT_7 +# - COPILOT_PAT_8 +# - COPILOT_PAT_9 +# - GH_AW_GITHUB_MCP_SERVER_TOKEN +# - GH_AW_GITHUB_TOKEN +# - GITHUB_TOKEN +# +# Custom actions used: +# - actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 +# - actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 +# - actions/github-script@373c709c69115d41ff229c7e5df9f8788daa9553 # v9 +# - actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 +# - actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 +# - actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 +# - github/gh-aw-actions/setup@b8068426813005612b960b5ab0b8bd2c27142323 # v0.71.5 +# +# Container images used: +# - ghcr.io/github/gh-aw-firewall/agent:0.25.40@sha256:14ff567e8d9d4c2fbc5e55c973488381c71d7e0fdbe72d30ee7b8a738fd86504 +# - ghcr.io/github/gh-aw-firewall/api-proxy:0.25.40@sha256:2883ca3e5ae9f330cafdd9345bfd4ae17fc8da36c96d4c9a1f76e922b4c45280 +# - ghcr.io/github/gh-aw-firewall/squid:0.25.40@sha256:b084f4a2c771f584ee68084ced52fa6b3245197a1889645d817462d307d3ac51 +# - ghcr.io/github/gh-aw-mcpg:v0.3.6@sha256:2bb8eef86006a4c5963c55616a9c51c32f27bfdecb023b8aa6f91f6718d9171c +# - node:lts-alpine@sha256:d1b3b4da11eefd5941e7f0b9cf17783fc99d9c6fc34884a665f40a06dbdfc94f name: "Code Review" "on": @@ -30,28 +66,6 @@ name: "Code Review" types: - opened - synchronize - # steps: # Steps injected into pre-activation job - # - name: Checkout the select-copilot-pat action folder - # uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd - # with: - # fetch-depth: 1 - # persist-credentials: false - # sparse-checkout: .github/actions/select-copilot-pat - # sparse-checkout-cone-mode: true - # - env: - # SECRET_0: ${{ secrets.COPILOT_PAT_0 }} - # SECRET_1: ${{ secrets.COPILOT_PAT_1 }} - # SECRET_2: ${{ secrets.COPILOT_PAT_2 }} - # SECRET_3: ${{ secrets.COPILOT_PAT_3 }} - # SECRET_4: ${{ secrets.COPILOT_PAT_4 }} - # SECRET_5: ${{ secrets.COPILOT_PAT_5 }} - # SECRET_6: ${{ secrets.COPILOT_PAT_6 }} - # SECRET_7: ${{ secrets.COPILOT_PAT_7 }} - # SECRET_8: ${{ secrets.COPILOT_PAT_8 }} - # SECRET_9: ${{ secrets.COPILOT_PAT_9 }} - # id: select-copilot-pat - # name: Select Copilot token from pool - # uses: ./.github/actions/select-copilot-pat permissions: {} @@ -63,57 +77,70 @@ run-name: "Code Review" jobs: activation: - needs: pre_activation + needs: + - pat_pool + - pre_activation if: > needs.pre_activation.outputs.activated == 'true' && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.id == github.repository_id) runs-on: ubuntu-slim permissions: + actions: read contents: read outputs: body: ${{ steps.sanitized.outputs.body }} comment_id: "" comment_repo: "" + engine_id: ${{ steps.generate_aw_info.outputs.engine_id }} lockdown_check_failed: ${{ steps.generate_aw_info.outputs.lockdown_check_failed == 'true' }} model: ${{ steps.generate_aw_info.outputs.model }} secret_verification_result: ${{ steps.validate-secret.outputs.verification_result }} + setup-trace-id: ${{ steps.setup.outputs.trace-id }} + stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} text: ${{ steps.sanitized.outputs.text }} title: ${{ steps.sanitized.outputs.title }} steps: - name: Setup Scripts - uses: github/gh-aw-actions/setup@536ea1bad8c6715d098a9dc1afea8d403733acfe # v0.65.4 + id: setup + uses: github/gh-aw-actions/setup@b8068426813005612b960b5ab0b8bd2c27142323 # v0.71.5 with: destination: ${{ runner.temp }}/gh-aw/actions + job-name: ${{ github.job }} + trace-id: ${{ needs.pre_activation.outputs.setup-trace-id }} + env: + GH_AW_SETUP_WORKFLOW_NAME: "Code Review" + GH_AW_CURRENT_WORKFLOW_REF: ${{ github.repository }}/.github/workflows/code-review.lock.yml@${{ github.ref }} + GH_AW_INFO_VERSION: "1.0.40" - name: Generate agentic run info id: generate_aw_info env: GH_AW_INFO_ENGINE_ID: "copilot" GH_AW_INFO_ENGINE_NAME: "GitHub Copilot CLI" GH_AW_INFO_MODEL: "claude-opus-4.6" - GH_AW_INFO_VERSION: "latest" - GH_AW_INFO_AGENT_VERSION: "latest" - GH_AW_INFO_CLI_VERSION: "v0.63.1" + GH_AW_INFO_VERSION: "1.0.40" + GH_AW_INFO_AGENT_VERSION: "1.0.40" + GH_AW_INFO_CLI_VERSION: "v0.71.5" GH_AW_INFO_WORKFLOW_NAME: "Code Review" GH_AW_INFO_EXPERIMENTAL: "false" GH_AW_INFO_SUPPORTS_TOOLS_ALLOWLIST: "true" GH_AW_INFO_STAGED: "false" GH_AW_INFO_ALLOWED_DOMAINS: '["defaults"]' GH_AW_INFO_FIREWALL_ENABLED: "true" - GH_AW_INFO_AWF_VERSION: "v0.25.0" + GH_AW_INFO_AWF_VERSION: "v0.25.40" GH_AW_INFO_AWMG_VERSION: "" GH_AW_INFO_FIREWALL_TYPE: "squid" GH_AW_COMPILED_STRICT: "true" - uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8 + uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 with: script: | const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); - setupGlobals(core, github, context, exec, io); + setupGlobals(core, github, context, exec, io, getOctokit); const { main } = require('${{ runner.temp }}/gh-aw/actions/generate_aw_info.cjs'); await main(core, context); - name: Validate COPILOT_GITHUB_TOKEN secret id: validate-secret - run: ${RUNNER_TEMP}/gh-aw/actions/validate_multi_secret.sh COPILOT_GITHUB_TOKEN 'GitHub Copilot CLI' https://github.github.com/gh-aw/reference/engines/#github-copilot-default + run: bash "${RUNNER_TEMP}/gh-aw/actions/validate_multi_secret.sh" COPILOT_GITHUB_TOKEN 'GitHub Copilot CLI' https://github.github.com/gh-aw/reference/engines/#github-copilot-default env: - COPILOT_GITHUB_TOKEN: ${{ case(needs.pre_activation.outputs.copilot_pat_number == '0', secrets.COPILOT_PAT_0, needs.pre_activation.outputs.copilot_pat_number == '1', secrets.COPILOT_PAT_1, needs.pre_activation.outputs.copilot_pat_number == '2', secrets.COPILOT_PAT_2, needs.pre_activation.outputs.copilot_pat_number == '3', secrets.COPILOT_PAT_3, needs.pre_activation.outputs.copilot_pat_number == '4', secrets.COPILOT_PAT_4, needs.pre_activation.outputs.copilot_pat_number == '5', secrets.COPILOT_PAT_5, needs.pre_activation.outputs.copilot_pat_number == '6', secrets.COPILOT_PAT_6, needs.pre_activation.outputs.copilot_pat_number == '7', secrets.COPILOT_PAT_7, needs.pre_activation.outputs.copilot_pat_number == '8', secrets.COPILOT_PAT_8, needs.pre_activation.outputs.copilot_pat_number == '9', secrets.COPILOT_PAT_9, secrets.COPILOT_GITHUB_TOKEN) }} + COPILOT_GITHUB_TOKEN: ${{ case(needs.pat_pool.outputs.pat_number == '0', secrets.COPILOT_PAT_0, needs.pat_pool.outputs.pat_number == '1', secrets.COPILOT_PAT_1, needs.pat_pool.outputs.pat_number == '2', secrets.COPILOT_PAT_2, needs.pat_pool.outputs.pat_number == '3', secrets.COPILOT_PAT_3, needs.pat_pool.outputs.pat_number == '4', secrets.COPILOT_PAT_4, needs.pat_pool.outputs.pat_number == '5', secrets.COPILOT_PAT_5, needs.pat_pool.outputs.pat_number == '6', secrets.COPILOT_PAT_6, needs.pat_pool.outputs.pat_number == '7', secrets.COPILOT_PAT_7, needs.pat_pool.outputs.pat_number == '8', secrets.COPILOT_PAT_8, needs.pat_pool.outputs.pat_number == '9', secrets.COPILOT_PAT_9, secrets.COPILOT_GITHUB_TOKEN) }} - name: Checkout .github and .agents folders uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: @@ -121,25 +148,51 @@ jobs: sparse-checkout: | .github .agents + .claude + .codex + .crush + .gemini + .opencode + .pi sparse-checkout-cone-mode: true fetch-depth: 1 - - name: Check workflow file timestamps - uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8 + - name: Save agent config folders for base branch restoration + env: + GH_AW_AGENT_FOLDERS: ".agents .claude .codex .crush .gemini .github .opencode .pi" + GH_AW_AGENT_FILES: ".crush.json AGENTS.md CLAUDE.md GEMINI.md PI.md opencode.jsonc" + # poutine:ignore untrusted_checkout_exec + run: bash "${RUNNER_TEMP}/gh-aw/actions/save_base_github_folders.sh" + - name: Check workflow lock file + id: check-lock-file + uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 env: GH_AW_WORKFLOW_FILE: "code-review.lock.yml" + GH_AW_CONTEXT_WORKFLOW_REF: "${{ github.workflow_ref }}" with: script: | const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); - setupGlobals(core, github, context, exec, io); + setupGlobals(core, github, context, exec, io, getOctokit); const { main } = require('${{ runner.temp }}/gh-aw/actions/check_workflow_timestamp_api.cjs'); await main(); + - name: Check compile-agentic version + uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 + env: + GH_AW_COMPILED_VERSION: "v0.71.5" + with: + script: | + const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); + setupGlobals(core, github, context, exec, io, getOctokit); + const { main } = require('${{ runner.temp }}/gh-aw/actions/check_version_updates.cjs'); + await main(); - name: Compute current body text id: sanitized - uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8 + uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 + env: + GH_AW_ALLOWED_DOMAINS: "api.business.githubcopilot.com,api.enterprise.githubcopilot.com,api.github.com,api.githubcopilot.com,api.individual.githubcopilot.com,api.snapcraft.io,archive.ubuntu.com,azure.archive.ubuntu.com,crl.geotrust.com,crl.globalsign.com,crl.identrust.com,crl.sectigo.com,crl.thawte.com,crl.usertrust.com,crl.verisign.com,crl3.digicert.com,crl4.digicert.com,crls.ssl.com,github.com,host.docker.internal,json-schema.org,json.schemastore.org,keyserver.ubuntu.com,ocsp.digicert.com,ocsp.geotrust.com,ocsp.globalsign.com,ocsp.identrust.com,ocsp.sectigo.com,ocsp.ssl.com,ocsp.thawte.com,ocsp.usertrust.com,ocsp.verisign.com,packagecloud.io,packages.cloud.google.com,packages.microsoft.com,ppa.launchpad.net,raw.githubusercontent.com,registry.npmjs.org,s.symcb.com,s.symcd.com,security.ubuntu.com,telemetry.enterprise.githubcopilot.com,ts-crl.ws.symantec.com,ts-ocsp.ws.symantec.com,www.googleapis.com" with: script: | const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); - setupGlobals(core, github, context, exec, io); + setupGlobals(core, github, context, exec, io, getOctokit); const { main } = require('${{ runner.temp }}/gh-aw/actions/compute_text.cjs'); await main(); - name: Create prompt with built-in context @@ -156,19 +209,22 @@ jobs: GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }} # poutine:ignore untrusted_checkout_exec run: | - bash ${RUNNER_TEMP}/gh-aw/actions/create_prompt_first.sh + bash "${RUNNER_TEMP}/gh-aw/actions/create_prompt_first.sh" { - cat << 'GH_AW_PROMPT_EOF' + cat << 'GH_AW_PROMPT_83106f9cd568376e_EOF' - GH_AW_PROMPT_EOF + GH_AW_PROMPT_83106f9cd568376e_EOF cat "${RUNNER_TEMP}/gh-aw/prompts/xpia.md" cat "${RUNNER_TEMP}/gh-aw/prompts/temp_folder_prompt.md" cat "${RUNNER_TEMP}/gh-aw/prompts/markdown.md" cat "${RUNNER_TEMP}/gh-aw/prompts/safe_outputs_prompt.md" - cat << 'GH_AW_PROMPT_EOF' + cat << 'GH_AW_PROMPT_83106f9cd568376e_EOF' Tools: add_comment, missing_tool, missing_data, noop + GH_AW_PROMPT_83106f9cd568376e_EOF + cat "${RUNNER_TEMP}/gh-aw/prompts/mcp_cli_tools_prompt.md" + cat << 'GH_AW_PROMPT_83106f9cd568376e_EOF' The following GitHub context information is available for this workflow: {{#if __GH_AW_GITHUB_ACTOR__ }} @@ -200,28 +256,27 @@ jobs: - **Note**: If a branch you need is not in the list above and is not listed as an additional fetched ref, it has NOT been checked out. For private repositories you cannot fetch it without proper authentication. If the branch is required and not available, exit with an error and ask the user to add it to the `fetch:` option of the `checkout:` configuration (e.g., `fetch: ["refs/pulls/open/*"]` for all open PR refs, or `fetch: ["main", "feature/my-branch"]` for specific branches). - GH_AW_PROMPT_EOF + GH_AW_PROMPT_83106f9cd568376e_EOF cat "${RUNNER_TEMP}/gh-aw/prompts/github_mcp_tools_with_safeoutputs_prompt.md" - cat << 'GH_AW_PROMPT_EOF' + cat << 'GH_AW_PROMPT_83106f9cd568376e_EOF' - GH_AW_PROMPT_EOF - cat << 'GH_AW_PROMPT_EOF' {{#runtime-import .github/workflows/code-review.md}} - GH_AW_PROMPT_EOF + GH_AW_PROMPT_83106f9cd568376e_EOF } > "$GH_AW_PROMPT" - name: Interpolate variables and render templates - uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8 + uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 env: GH_AW_PROMPT: /tmp/gh-aw/aw-prompts/prompt.txt + GH_AW_ENGINE_ID: "copilot" GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER: ${{ github.event.pull_request.number }} with: script: | const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); - setupGlobals(core, github, context, exec, io); + setupGlobals(core, github, context, exec, io, getOctokit); const { main } = require('${{ runner.temp }}/gh-aw/actions/interpolate_prompt.cjs'); await main(); - name: Substitute placeholders - uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8 + uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 env: GH_AW_PROMPT: /tmp/gh-aw/aw-prompts/prompt.txt GH_AW_GITHUB_ACTOR: ${{ github.actor }} @@ -232,11 +287,12 @@ jobs: GH_AW_GITHUB_REPOSITORY: ${{ github.repository }} GH_AW_GITHUB_RUN_ID: ${{ github.run_id }} GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }} + GH_AW_MCP_CLI_SERVERS_LIST: '- `safeoutputs` — run `safeoutputs --help` to see available tools' GH_AW_NEEDS_PRE_ACTIVATION_OUTPUTS_ACTIVATED: ${{ needs.pre_activation.outputs.activated }} with: script: | const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); - setupGlobals(core, github, context, exec, io); + setupGlobals(core, github, context, exec, io, getOctokit); const substitutePlaceholders = require('${{ runner.temp }}/gh-aw/actions/substitute_placeholders.cjs'); @@ -252,6 +308,7 @@ jobs: GH_AW_GITHUB_REPOSITORY: process.env.GH_AW_GITHUB_REPOSITORY, GH_AW_GITHUB_RUN_ID: process.env.GH_AW_GITHUB_RUN_ID, GH_AW_GITHUB_WORKSPACE: process.env.GH_AW_GITHUB_WORKSPACE, + GH_AW_MCP_CLI_SERVERS_LIST: process.env.GH_AW_MCP_CLI_SERVERS_LIST, GH_AW_NEEDS_PRE_ACTIVATION_OUTPUTS_ACTIVATED: process.env.GH_AW_NEEDS_PRE_ACTIVATION_OUTPUTS_ACTIVATED } }); @@ -259,24 +316,30 @@ jobs: env: GH_AW_PROMPT: /tmp/gh-aw/aw-prompts/prompt.txt # poutine:ignore untrusted_checkout_exec - run: bash ${RUNNER_TEMP}/gh-aw/actions/validate_prompt_placeholders.sh + run: bash "${RUNNER_TEMP}/gh-aw/actions/validate_prompt_placeholders.sh" - name: Print prompt env: GH_AW_PROMPT: /tmp/gh-aw/aw-prompts/prompt.txt # poutine:ignore untrusted_checkout_exec - run: bash ${RUNNER_TEMP}/gh-aw/actions/print_prompt_summary.sh + run: bash "${RUNNER_TEMP}/gh-aw/actions/print_prompt_summary.sh" - name: Upload activation artifact if: success() - uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7 + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 with: name: activation + include-hidden-files: true path: | /tmp/gh-aw/aw_info.json /tmp/gh-aw/aw-prompts/prompt.txt + /tmp/gh-aw/github_rate_limits.jsonl + /tmp/gh-aw/base + if-no-files-found: ignore retention-days: 1 agent: - needs: activation + needs: + - activation + - pat_pool runs-on: ubuntu-latest permissions: contents: read @@ -290,71 +353,84 @@ jobs: GH_AW_MCP_LOG_DIR: /tmp/gh-aw/mcp-logs/safeoutputs GH_AW_WORKFLOW_ID_SANITIZED: codereview outputs: + agentic_engine_timeout: ${{ steps.detect-copilot-errors.outputs.agentic_engine_timeout || 'false' }} checkout_pr_success: ${{ steps.checkout-pr.outputs.checkout_pr_success || 'true' }} - detection_conclusion: ${{ steps.detection_conclusion.outputs.conclusion }} - detection_success: ${{ steps.detection_conclusion.outputs.success }} + effective_tokens: ${{ steps.parse-mcp-gateway.outputs.effective_tokens }} has_patch: ${{ steps.collect_output.outputs.has_patch }} - inference_access_error: ${{ steps.detect-inference-error.outputs.inference_access_error || 'false' }} + inference_access_error: ${{ steps.detect-copilot-errors.outputs.inference_access_error || 'false' }} + mcp_policy_error: ${{ steps.detect-copilot-errors.outputs.mcp_policy_error || 'false' }} model: ${{ needs.activation.outputs.model }} + model_not_supported_error: ${{ steps.detect-copilot-errors.outputs.model_not_supported_error || 'false' }} output: ${{ steps.collect_output.outputs.output }} output_types: ${{ steps.collect_output.outputs.output_types }} + setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Setup Scripts - uses: github/gh-aw-actions/setup@536ea1bad8c6715d098a9dc1afea8d403733acfe # v0.65.4 + id: setup + uses: github/gh-aw-actions/setup@b8068426813005612b960b5ab0b8bd2c27142323 # v0.71.5 with: destination: ${{ runner.temp }}/gh-aw/actions + job-name: ${{ github.job }} + trace-id: ${{ needs.activation.outputs.setup-trace-id }} + env: + GH_AW_SETUP_WORKFLOW_NAME: "Code Review" + GH_AW_CURRENT_WORKFLOW_REF: ${{ github.repository }}/.github/workflows/code-review.lock.yml@${{ github.ref }} + GH_AW_INFO_VERSION: "1.0.40" - name: Set runtime paths id: set-runtime-paths run: | - echo "GH_AW_SAFE_OUTPUTS=${RUNNER_TEMP}/gh-aw/safeoutputs/outputs.jsonl" >> "$GITHUB_OUTPUT" - echo "GH_AW_SAFE_OUTPUTS_CONFIG_PATH=${RUNNER_TEMP}/gh-aw/safeoutputs/config.json" >> "$GITHUB_OUTPUT" - echo "GH_AW_SAFE_OUTPUTS_TOOLS_PATH=${RUNNER_TEMP}/gh-aw/safeoutputs/tools.json" >> "$GITHUB_OUTPUT" + { + echo "GH_AW_SAFE_OUTPUTS=${RUNNER_TEMP}/gh-aw/safeoutputs/outputs.jsonl" + echo "GH_AW_SAFE_OUTPUTS_CONFIG_PATH=${RUNNER_TEMP}/gh-aw/safeoutputs/config.json" + echo "GH_AW_SAFE_OUTPUTS_TOOLS_PATH=${RUNNER_TEMP}/gh-aw/safeoutputs/tools.json" + } >> "$GITHUB_OUTPUT" - name: Checkout repository uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: persist-credentials: false fetch-depth: 50 - name: Create gh-aw temp directory - run: bash ${RUNNER_TEMP}/gh-aw/actions/create_gh_aw_tmp_dir.sh + run: bash "${RUNNER_TEMP}/gh-aw/actions/create_gh_aw_tmp_dir.sh" - name: Configure gh CLI for GitHub Enterprise - run: bash ${RUNNER_TEMP}/gh-aw/actions/configure_gh_for_ghe.sh + run: bash "${RUNNER_TEMP}/gh-aw/actions/configure_gh_for_ghe.sh" env: GH_TOKEN: ${{ github.token }} - name: Configure Git credentials env: REPO_NAME: ${{ github.repository }} SERVER_URL: ${{ github.server_url }} + GITHUB_TOKEN: ${{ github.token }} run: | git config --global user.email "github-actions[bot]@users.noreply.github.com" git config --global user.name "github-actions[bot]" git config --global am.keepcr true # Re-authenticate git with GitHub token SERVER_URL_STRIPPED="${SERVER_URL#https://}" - git remote set-url origin "https://x-access-token:${{ github.token }}@${SERVER_URL_STRIPPED}/${REPO_NAME}.git" + git remote set-url origin "https://x-access-token:${GITHUB_TOKEN}@${SERVER_URL_STRIPPED}/${REPO_NAME}.git" echo "Git configured with standard GitHub Actions identity" - name: Checkout PR branch id: checkout-pr if: | github.event.pull_request || github.event.issue.pull_request - uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8 + uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 env: GH_TOKEN: ${{ secrets.GH_AW_GITHUB_MCP_SERVER_TOKEN || secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} with: github-token: ${{ secrets.GH_AW_GITHUB_MCP_SERVER_TOKEN || secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} script: | const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); - setupGlobals(core, github, context, exec, io); + setupGlobals(core, github, context, exec, io, getOctokit); const { main } = require('${{ runner.temp }}/gh-aw/actions/checkout_pr_branch.cjs'); await main(); - name: Install GitHub Copilot CLI - run: ${RUNNER_TEMP}/gh-aw/actions/install_copilot_cli.sh latest + run: bash "${RUNNER_TEMP}/gh-aw/actions/install_copilot_cli.sh" 1.0.40 env: GH_HOST: github.com - name: Install AWF binary - run: bash ${RUNNER_TEMP}/gh-aw/actions/install_awf_binary.sh v0.25.0 + run: bash "${RUNNER_TEMP}/gh-aw/actions/install_awf_binary.sh" v0.25.40 - name: Determine automatic lockdown mode for GitHub MCP Server id: determine-automatic-lockdown - uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8 + uses: actions/github-script@373c709c69115d41ff229c7e5df9f8788daa9553 # v9 env: GH_AW_GITHUB_TOKEN: ${{ secrets.GH_AW_GITHUB_TOKEN }} GH_AW_GITHUB_MCP_SERVER_TOKEN: ${{ secrets.GH_AW_GITHUB_MCP_SERVER_TOKEN }} @@ -362,107 +438,142 @@ jobs: script: | const determineAutomaticLockdown = require('${{ runner.temp }}/gh-aw/actions/determine_automatic_lockdown.cjs'); await determineAutomaticLockdown(github, context, core); + - name: Download activation artifact + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 + with: + name: activation + path: /tmp/gh-aw + - name: Restore agent config folders from base branch + if: steps.checkout-pr.outcome == 'success' + env: + GH_AW_AGENT_FOLDERS: ".agents .claude .codex .crush .gemini .github .opencode .pi" + GH_AW_AGENT_FILES: ".crush.json AGENTS.md CLAUDE.md GEMINI.md PI.md opencode.jsonc" + run: bash "${RUNNER_TEMP}/gh-aw/actions/restore_base_github_folders.sh" - name: Download container images - run: bash ${RUNNER_TEMP}/gh-aw/actions/download_docker_images.sh ghcr.io/github/gh-aw-firewall/agent:0.25.0 ghcr.io/github/gh-aw-firewall/api-proxy:0.25.0 ghcr.io/github/gh-aw-firewall/squid:0.25.0 ghcr.io/github/gh-aw-mcpg:v0.2.4 node:lts-alpine - - name: Write Safe Outputs Config + run: bash "${RUNNER_TEMP}/gh-aw/actions/download_docker_images.sh" ghcr.io/github/gh-aw-firewall/agent:0.25.40@sha256:14ff567e8d9d4c2fbc5e55c973488381c71d7e0fdbe72d30ee7b8a738fd86504 ghcr.io/github/gh-aw-firewall/api-proxy:0.25.40@sha256:2883ca3e5ae9f330cafdd9345bfd4ae17fc8da36c96d4c9a1f76e922b4c45280 ghcr.io/github/gh-aw-firewall/squid:0.25.40@sha256:b084f4a2c771f584ee68084ced52fa6b3245197a1889645d817462d307d3ac51 ghcr.io/github/gh-aw-mcpg:v0.3.6@sha256:2bb8eef86006a4c5963c55616a9c51c32f27bfdecb023b8aa6f91f6718d9171c node:lts-alpine@sha256:d1b3b4da11eefd5941e7f0b9cf17783fc99d9c6fc34884a665f40a06dbdfc94f + - name: Generate Safe Outputs Config run: | - mkdir -p ${RUNNER_TEMP}/gh-aw/safeoutputs + mkdir -p "${RUNNER_TEMP}/gh-aw/safeoutputs" mkdir -p /tmp/gh-aw/safeoutputs mkdir -p /tmp/gh-aw/mcp-logs/safeoutputs - cat > ${RUNNER_TEMP}/gh-aw/safeoutputs/config.json << 'GH_AW_SAFE_OUTPUTS_CONFIG_EOF' - {"add_comment":{"hide_older_comments":true,"max":1,"target":"triggering"},"missing_data":{},"missing_tool":{},"noop":{"max":1,"report-as-issue":"true"}} - GH_AW_SAFE_OUTPUTS_CONFIG_EOF - - name: Write Safe Outputs Tools - run: | - cat > ${RUNNER_TEMP}/gh-aw/safeoutputs/tools_meta.json << 'GH_AW_SAFE_OUTPUTS_TOOLS_META_EOF' - { - "description_suffixes": { - "add_comment": " CONSTRAINTS: Maximum 1 comment(s) can be added. Target: triggering." - }, - "repo_params": {}, - "dynamic_tools": [] - } - GH_AW_SAFE_OUTPUTS_TOOLS_META_EOF - cat > ${RUNNER_TEMP}/gh-aw/safeoutputs/validation.json << 'GH_AW_SAFE_OUTPUTS_VALIDATION_EOF' - { - "add_comment": { - "defaultMax": 1, - "fields": { - "body": { - "required": true, - "type": "string", - "sanitize": true, - "maxLength": 65000 - }, - "item_number": { - "issueOrPRNumber": true - }, - "repo": { - "type": "string", - "maxLength": 256 + cat > "${RUNNER_TEMP}/gh-aw/safeoutputs/config.json" << 'GH_AW_SAFE_OUTPUTS_CONFIG_f06d560f0faee645_EOF' + {"add_comment":{"hide_older_comments":true,"max":1,"target":"triggering"},"create_report_incomplete_issue":{},"missing_data":{},"missing_tool":{},"noop":{"max":1,"report-as-issue":"true"},"report_incomplete":{}} + GH_AW_SAFE_OUTPUTS_CONFIG_f06d560f0faee645_EOF + - name: Generate Safe Outputs Tools + env: + GH_AW_TOOLS_META_JSON: | + { + "description_suffixes": { + "add_comment": " CONSTRAINTS: Maximum 1 comment(s) can be added. Target: triggering. Supports reply_to_id for discussion threading." + }, + "repo_params": {}, + "dynamic_tools": [] + } + GH_AW_VALIDATION_JSON: | + { + "add_comment": { + "defaultMax": 1, + "fields": { + "body": { + "required": true, + "type": "string", + "sanitize": true, + "maxLength": 65000 + }, + "item_number": { + "issueOrPRNumber": true + }, + "reply_to_id": { + "type": "string", + "maxLength": 256 + }, + "repo": { + "type": "string", + "maxLength": 256 + } } - } - }, - "missing_data": { - "defaultMax": 20, - "fields": { - "alternatives": { - "type": "string", - "sanitize": true, - "maxLength": 256 - }, - "context": { - "type": "string", - "sanitize": true, - "maxLength": 256 - }, - "data_type": { - "type": "string", - "sanitize": true, - "maxLength": 128 - }, - "reason": { - "type": "string", - "sanitize": true, - "maxLength": 256 + }, + "missing_data": { + "defaultMax": 20, + "fields": { + "alternatives": { + "type": "string", + "sanitize": true, + "maxLength": 256 + }, + "context": { + "type": "string", + "sanitize": true, + "maxLength": 256 + }, + "data_type": { + "type": "string", + "sanitize": true, + "maxLength": 128 + }, + "reason": { + "type": "string", + "sanitize": true, + "maxLength": 256 + } } - } - }, - "missing_tool": { - "defaultMax": 20, - "fields": { - "alternatives": { - "type": "string", - "sanitize": true, - "maxLength": 512 - }, - "reason": { - "required": true, - "type": "string", - "sanitize": true, - "maxLength": 256 - }, - "tool": { - "type": "string", - "sanitize": true, - "maxLength": 128 + }, + "missing_tool": { + "defaultMax": 20, + "fields": { + "alternatives": { + "type": "string", + "sanitize": true, + "maxLength": 512 + }, + "reason": { + "required": true, + "type": "string", + "sanitize": true, + "maxLength": 256 + }, + "tool": { + "type": "string", + "sanitize": true, + "maxLength": 128 + } } - } - }, - "noop": { - "defaultMax": 1, - "fields": { - "message": { - "required": true, - "type": "string", - "sanitize": true, - "maxLength": 65000 + }, + "noop": { + "defaultMax": 1, + "fields": { + "message": { + "required": true, + "type": "string", + "sanitize": true, + "maxLength": 65000 + } + } + }, + "report_incomplete": { + "defaultMax": 5, + "fields": { + "details": { + "type": "string", + "sanitize": true, + "maxLength": 65000 + }, + "reason": { + "required": true, + "type": "string", + "sanitize": true, + "maxLength": 1024 + } } } } - } - GH_AW_SAFE_OUTPUTS_VALIDATION_EOF - node ${RUNNER_TEMP}/gh-aw/actions/generate_safe_outputs_tools.cjs + uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 + with: + script: | + const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); + setupGlobals(core, github, context, exec, io, getOctokit); + const { main } = require('${{ runner.temp }}/gh-aw/actions/generate_safe_outputs_tools.cjs'); + await main(); - name: Generate Safe Outputs MCP Server Config id: safe-outputs-config run: | @@ -485,6 +596,7 @@ jobs: id: safe-outputs-start env: DEBUG: '*' + GH_AW_SAFE_OUTPUTS: ${{ steps.set-runtime-paths.outputs.GH_AW_SAFE_OUTPUTS }} GH_AW_SAFE_OUTPUTS_PORT: ${{ steps.safe-outputs-config.outputs.safe_outputs_port }} GH_AW_SAFE_OUTPUTS_API_KEY: ${{ steps.safe-outputs-config.outputs.safe_outputs_api_key }} GH_AW_SAFE_OUTPUTS_TOOLS_PATH: ${{ runner.temp }}/gh-aw/safeoutputs/tools.json @@ -493,13 +605,14 @@ jobs: run: | # Environment variables are set above to prevent template injection export DEBUG + export GH_AW_SAFE_OUTPUTS export GH_AW_SAFE_OUTPUTS_PORT export GH_AW_SAFE_OUTPUTS_API_KEY export GH_AW_SAFE_OUTPUTS_TOOLS_PATH export GH_AW_SAFE_OUTPUTS_CONFIG_PATH export GH_AW_MCP_LOG_DIR - bash ${RUNNER_TEMP}/gh-aw/actions/start_safe_outputs_server.sh + bash "${RUNNER_TEMP}/gh-aw/actions/start_safe_outputs_server.sh" - name: Start MCP Gateway id: start-mcp-gateway @@ -512,11 +625,12 @@ jobs: GITHUB_MCP_SERVER_TOKEN: ${{ secrets.GH_AW_GITHUB_MCP_SERVER_TOKEN || secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} run: | set -eo pipefail - mkdir -p /tmp/gh-aw/mcp-config + mkdir -p "${RUNNER_TEMP}/gh-aw/mcp-config" # Export gateway environment variables for MCP config and gateway script - export MCP_GATEWAY_PORT="80" + export MCP_GATEWAY_PORT="8080" export MCP_GATEWAY_DOMAIN="host.docker.internal" + export MCP_GATEWAY_HOST_DOMAIN="localhost" MCP_GATEWAY_API_KEY=$(openssl rand -base64 45 | tr -d '/+=') echo "::add-mask::${MCP_GATEWAY_API_KEY}" export MCP_GATEWAY_API_KEY @@ -527,10 +641,14 @@ jobs: export GH_AW_ENGINE="copilot" export GITHUB_PERSONAL_ACCESS_TOKEN="$GITHUB_MCP_SERVER_TOKEN" - export MCP_GATEWAY_DOCKER_COMMAND='docker run -i --rm --network host -v /var/run/docker.sock:/var/run/docker.sock -e MCP_GATEWAY_PORT -e MCP_GATEWAY_DOMAIN -e MCP_GATEWAY_API_KEY -e MCP_GATEWAY_PAYLOAD_DIR -e MCP_GATEWAY_PAYLOAD_SIZE_THRESHOLD -e DEBUG -e MCP_GATEWAY_LOG_DIR -e GH_AW_MCP_LOG_DIR -e GH_AW_SAFE_OUTPUTS -e GH_AW_SAFE_OUTPUTS_CONFIG_PATH -e GH_AW_SAFE_OUTPUTS_TOOLS_PATH -e GH_AW_ASSETS_BRANCH -e GH_AW_ASSETS_MAX_SIZE_KB -e GH_AW_ASSETS_ALLOWED_EXTS -e DEFAULT_BRANCH -e GITHUB_MCP_SERVER_TOKEN -e GITHUB_PERSONAL_ACCESS_TOKEN -e GITHUB_MCP_GUARD_MIN_INTEGRITY -e GITHUB_MCP_GUARD_REPOS -e GITHUB_REPOSITORY -e GITHUB_SERVER_URL -e GITHUB_SHA -e GITHUB_WORKSPACE -e GITHUB_TOKEN -e GITHUB_RUN_ID -e GITHUB_RUN_NUMBER -e GITHUB_RUN_ATTEMPT -e GITHUB_JOB -e GITHUB_ACTION -e GITHUB_EVENT_NAME -e GITHUB_EVENT_PATH -e GITHUB_ACTOR -e GITHUB_ACTOR_ID -e GITHUB_TRIGGERING_ACTOR -e GITHUB_WORKFLOW -e GITHUB_WORKFLOW_REF -e GITHUB_WORKFLOW_SHA -e GITHUB_REF -e GITHUB_REF_NAME -e GITHUB_REF_TYPE -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e GH_AW_SAFE_OUTPUTS_PORT -e GH_AW_SAFE_OUTPUTS_API_KEY -v /tmp/gh-aw/mcp-payloads:/tmp/gh-aw/mcp-payloads:rw -v /opt:/opt:ro -v /tmp:/tmp:rw -v '"${GITHUB_WORKSPACE}"':'"${GITHUB_WORKSPACE}"':rw ghcr.io/github/gh-aw-mcpg:v0.2.4' + MCP_GATEWAY_UID=$(id -u 2>/dev/null || echo '0') + MCP_GATEWAY_GID=$(id -g 2>/dev/null || echo '0') + DOCKER_SOCK_GID=$(stat -c '%g' /var/run/docker.sock 2>/dev/null || echo '0') + export MCP_GATEWAY_DOCKER_COMMAND='docker run -i --rm --network host --add-host host.docker.internal:127.0.0.1 --user '"${MCP_GATEWAY_UID}"':'"${MCP_GATEWAY_GID}"' --group-add '"${DOCKER_SOCK_GID}"' -v /var/run/docker.sock:/var/run/docker.sock -e MCP_GATEWAY_PORT -e MCP_GATEWAY_DOMAIN -e MCP_GATEWAY_API_KEY -e MCP_GATEWAY_PAYLOAD_DIR -e MCP_GATEWAY_PAYLOAD_SIZE_THRESHOLD -e DEBUG -e MCP_GATEWAY_LOG_DIR -e GH_AW_MCP_LOG_DIR -e GH_AW_SAFE_OUTPUTS -e GH_AW_SAFE_OUTPUTS_CONFIG_PATH -e GH_AW_SAFE_OUTPUTS_TOOLS_PATH -e GH_AW_ASSETS_BRANCH -e GH_AW_ASSETS_MAX_SIZE_KB -e GH_AW_ASSETS_ALLOWED_EXTS -e DEFAULT_BRANCH -e GITHUB_MCP_SERVER_TOKEN -e GITHUB_MCP_GUARD_MIN_INTEGRITY -e GITHUB_MCP_GUARD_REPOS -e GITHUB_REPOSITORY -e GITHUB_SERVER_URL -e GITHUB_SHA -e GITHUB_WORKSPACE -e GITHUB_TOKEN -e GITHUB_RUN_ID -e GITHUB_RUN_NUMBER -e GITHUB_RUN_ATTEMPT -e GITHUB_JOB -e GITHUB_ACTION -e GITHUB_EVENT_NAME -e GITHUB_EVENT_PATH -e GITHUB_ACTOR -e GITHUB_ACTOR_ID -e GITHUB_TRIGGERING_ACTOR -e GITHUB_WORKFLOW -e GITHUB_WORKFLOW_REF -e GITHUB_WORKFLOW_SHA -e GITHUB_REF -e GITHUB_REF_NAME -e GITHUB_REF_TYPE -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e GITHUB_PERSONAL_ACCESS_TOKEN -e GH_AW_SAFE_OUTPUTS_PORT -e GH_AW_SAFE_OUTPUTS_API_KEY -v /tmp/gh-aw/mcp-payloads:/tmp/gh-aw/mcp-payloads:rw -v /opt:/opt:ro -v /tmp:/tmp:rw -v '"${GITHUB_WORKSPACE}"':'"${GITHUB_WORKSPACE}"':rw ghcr.io/github/gh-aw-mcpg:v0.3.6' mkdir -p /home/runner/.copilot - cat << GH_AW_MCP_CONFIG_EOF | bash ${RUNNER_TEMP}/gh-aw/actions/start_mcp_gateway.sh + GH_AW_NODE=$(which node 2>/dev/null || command -v node 2>/dev/null || echo node) + cat << GH_AW_MCP_CONFIG_dbbe9b731b44ba8b_EOF | "$GH_AW_NODE" "${RUNNER_TEMP}/gh-aw/actions/start_mcp_gateway.cjs" { "mcpServers": { "github": { @@ -574,15 +692,28 @@ jobs: "payloadDir": "${MCP_GATEWAY_PAYLOAD_DIR}" } } - GH_AW_MCP_CONFIG_EOF - - name: Download activation artifact - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 + GH_AW_MCP_CONFIG_dbbe9b731b44ba8b_EOF + - name: Mount MCP servers as CLIs + id: mount-mcp-clis + continue-on-error: true + env: + MCP_GATEWAY_API_KEY: ${{ steps.start-mcp-gateway.outputs.gateway-api-key }} + MCP_GATEWAY_DOMAIN: ${{ steps.start-mcp-gateway.outputs.gateway-domain }} + MCP_GATEWAY_PORT: ${{ steps.start-mcp-gateway.outputs.gateway-port }} + uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 with: - name: activation - path: /tmp/gh-aw - - name: Clean git credentials + script: | + const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); + setupGlobals(core, github, context, exec, io); + const { main } = require('${{ runner.temp }}/gh-aw/actions/mount_mcp_as_cli.cjs'); + await main(); + - name: Clean credentials continue-on-error: true - run: bash ${RUNNER_TEMP}/gh-aw/actions/clean_git_credentials.sh + run: bash "${RUNNER_TEMP}/gh-aw/actions/clean_git_credentials.sh" + - name: Audit pre-agent workspace + id: pre_agent_audit + continue-on-error: true + run: bash "${RUNNER_TEMP}/gh-aw/actions/audit_pre_agent_workspace.sh" - name: Execute GitHub Copilot CLI id: agentic_execution # Copilot CLI tool arguments (sorted): @@ -590,20 +721,26 @@ jobs: run: | set -o pipefail touch /tmp/gh-aw/agent-step-summary.md + GH_AW_NODE_BIN=$(command -v node 2>/dev/null || true) + export GH_AW_NODE_BIN + (umask 177 && touch /tmp/gh-aw/agent-stdio.log) + printf '%s\n' '{"$schema":"https://github.com/github/gh-aw-firewall/releases/download/v0.25.40/awf-config.schema.json","network":{"allowDomains":["api.business.githubcopilot.com","api.enterprise.githubcopilot.com","api.github.com","api.githubcopilot.com","api.individual.githubcopilot.com","api.snapcraft.io","archive.ubuntu.com","azure.archive.ubuntu.com","crl.geotrust.com","crl.globalsign.com","crl.identrust.com","crl.sectigo.com","crl.thawte.com","crl.usertrust.com","crl.verisign.com","crl3.digicert.com","crl4.digicert.com","crls.ssl.com","github.com","host.docker.internal","json-schema.org","json.schemastore.org","keyserver.ubuntu.com","ocsp.digicert.com","ocsp.geotrust.com","ocsp.globalsign.com","ocsp.identrust.com","ocsp.sectigo.com","ocsp.ssl.com","ocsp.thawte.com","ocsp.usertrust.com","ocsp.verisign.com","packagecloud.io","packages.cloud.google.com","packages.microsoft.com","ppa.launchpad.net","raw.githubusercontent.com","registry.npmjs.org","s.symcb.com","s.symcd.com","security.ubuntu.com","telemetry.enterprise.githubcopilot.com","ts-crl.ws.symantec.com","ts-ocsp.ws.symantec.com","www.googleapis.com"]},"apiProxy":{"enabled":true,"models":{"auto":["large"],"deep-research":["copilot/deep-research*","google/deep-research*"],"gemini-flash":["copilot/gemini-*flash*","google/gemini-*flash*"],"gemini-pro":["copilot/gemini-*pro*","google/gemini-*pro*"],"gpt-4.1":["copilot/gpt-4.1*","openai/gpt-4.1*"],"gpt-5":["copilot/gpt-5*","openai/gpt-5*"],"gpt-5-codex":["copilot/gpt-5*codex*","openai/gpt-5*codex*"],"gpt-5-mini":["copilot/gpt-5*mini*","openai/gpt-5*mini*"],"gpt-5-nano":["copilot/gpt-5*nano*","openai/gpt-5*nano*"],"gpt-5-pro":["copilot/gpt-5*pro*","openai/gpt-5*pro*"],"haiku":["copilot/*haiku*","anthropic/*haiku*"],"large":["sonnet","gpt-5-pro","gpt-5","gemini-pro"],"mini":["haiku","gpt-5-mini","gpt-5-nano","gemini-flash"],"opus":["copilot/*opus*","anthropic/*opus*"],"reasoning":["copilot/o1*","copilot/o3*","copilot/o4*","openai/o1*","openai/o3*","openai/o4*"],"small":["mini"],"sonnet":["copilot/*sonnet*","anthropic/*sonnet*"]}},"container":{"imageTag":"0.25.40,squid=sha256:b084f4a2c771f584ee68084ced52fa6b3245197a1889645d817462d307d3ac51,agent=sha256:14ff567e8d9d4c2fbc5e55c973488381c71d7e0fdbe72d30ee7b8a738fd86504,api-proxy=sha256:2883ca3e5ae9f330cafdd9345bfd4ae17fc8da36c96d4c9a1f76e922b4c45280,cli-proxy=sha256:3e7152911d4b4b7b97beef9d3d7d924ff7902227e86001ef3838fb728d5d514c"}}' > "${RUNNER_TEMP}/gh-aw/awf-config.json" && cp "${RUNNER_TEMP}/gh-aw/awf-config.json" /tmp/gh-aw/awf-config.json # shellcheck disable=SC1003 - sudo -E awf --env-all --container-workdir "${GITHUB_WORKSPACE}" --mount "${RUNNER_TEMP}/gh-aw:${RUNNER_TEMP}/gh-aw:ro" --mount "${RUNNER_TEMP}/gh-aw:/host${RUNNER_TEMP}/gh-aw:ro" --allow-domains "api.business.githubcopilot.com,api.enterprise.githubcopilot.com,api.github.com,api.githubcopilot.com,api.individual.githubcopilot.com,api.snapcraft.io,archive.ubuntu.com,azure.archive.ubuntu.com,crl.geotrust.com,crl.globalsign.com,crl.identrust.com,crl.sectigo.com,crl.thawte.com,crl.usertrust.com,crl.verisign.com,crl3.digicert.com,crl4.digicert.com,crls.ssl.com,github.com,host.docker.internal,json-schema.org,json.schemastore.org,keyserver.ubuntu.com,ocsp.digicert.com,ocsp.geotrust.com,ocsp.globalsign.com,ocsp.identrust.com,ocsp.sectigo.com,ocsp.ssl.com,ocsp.thawte.com,ocsp.usertrust.com,ocsp.verisign.com,packagecloud.io,packages.cloud.google.com,packages.microsoft.com,ppa.launchpad.net,raw.githubusercontent.com,registry.npmjs.org,s.symcb.com,s.symcd.com,security.ubuntu.com,telemetry.enterprise.githubcopilot.com,ts-crl.ws.symantec.com,ts-ocsp.ws.symantec.com,www.googleapis.com" --log-level info --proxy-logs-dir /tmp/gh-aw/sandbox/firewall/logs --enable-host-access --image-tag 0.25.0 --skip-pull --enable-api-proxy \ - -- /bin/bash -c '/usr/local/bin/copilot --add-dir /tmp/gh-aw/ --log-level all --log-dir /tmp/gh-aw/sandbox/agent/logs/ --add-dir "${GITHUB_WORKSPACE}" --disable-builtin-mcps --allow-all-tools --allow-all-paths --prompt "$(cat /tmp/gh-aw/aw-prompts/prompt.txt)"' 2>&1 | tee -a /tmp/gh-aw/agent-stdio.log + sudo -E awf --config "${RUNNER_TEMP}/gh-aw/awf-config.json" --container-workdir "${GITHUB_WORKSPACE}" --mount "${RUNNER_TEMP}/gh-aw:${RUNNER_TEMP}/gh-aw:ro" --mount "${RUNNER_TEMP}/gh-aw:/host${RUNNER_TEMP}/gh-aw:ro" --env-all --exclude-env COPILOT_GITHUB_TOKEN --exclude-env GITHUB_MCP_SERVER_TOKEN --exclude-env MCP_GATEWAY_API_KEY --log-level info --proxy-logs-dir /tmp/gh-aw/sandbox/firewall/logs --audit-dir /tmp/gh-aw/sandbox/firewall/audit --enable-host-access --allow-host-ports 80,443,8080 --skip-pull \ + -- /bin/bash -c 'export PATH="${RUNNER_TEMP}/gh-aw/mcp-cli/bin:$PATH" && export PATH="$(find /opt/hostedtoolcache /home/runner/work/_tool -maxdepth 4 -type d -name bin 2>/dev/null | tr '\''\n'\'' '\'':'\'')$PATH"; [ -n "$GOROOT" ] && export PATH="$GOROOT/bin:$PATH" || true && GH_AW_NODE_EXEC="${GH_AW_NODE_BIN:-}"; if [ -z "$GH_AW_NODE_EXEC" ] || [ ! -x "$GH_AW_NODE_EXEC" ]; then GH_AW_NODE_EXEC="$(command -v node 2>/dev/null || echo node)"; fi; "$GH_AW_NODE_EXEC" ${RUNNER_TEMP}/gh-aw/actions/copilot_harness.cjs /usr/local/bin/copilot --add-dir /tmp/gh-aw/ --log-level all --log-dir /tmp/gh-aw/sandbox/agent/logs/ --disable-builtin-mcps --no-ask-user --allow-all-tools --allow-all-paths --add-dir "${GITHUB_WORKSPACE}" --prompt-file /tmp/gh-aw/aw-prompts/prompt.txt' 2>&1 | tee -a /tmp/gh-aw/agent-stdio.log env: COPILOT_AGENT_RUNNER_TYPE: STANDALONE - COPILOT_GITHUB_TOKEN: ${{ case(needs.pre_activation.outputs.copilot_pat_number == '0', secrets.COPILOT_PAT_0, needs.pre_activation.outputs.copilot_pat_number == '1', secrets.COPILOT_PAT_1, needs.pre_activation.outputs.copilot_pat_number == '2', secrets.COPILOT_PAT_2, needs.pre_activation.outputs.copilot_pat_number == '3', secrets.COPILOT_PAT_3, needs.pre_activation.outputs.copilot_pat_number == '4', secrets.COPILOT_PAT_4, needs.pre_activation.outputs.copilot_pat_number == '5', secrets.COPILOT_PAT_5, needs.pre_activation.outputs.copilot_pat_number == '6', secrets.COPILOT_PAT_6, needs.pre_activation.outputs.copilot_pat_number == '7', secrets.COPILOT_PAT_7, needs.pre_activation.outputs.copilot_pat_number == '8', secrets.COPILOT_PAT_8, needs.pre_activation.outputs.copilot_pat_number == '9', secrets.COPILOT_PAT_9, secrets.COPILOT_GITHUB_TOKEN) }} + COPILOT_API_KEY: dummy-byok-key-for-offline-mode + COPILOT_GITHUB_TOKEN: ${{ case(needs.pat_pool.outputs.pat_number == '0', secrets.COPILOT_PAT_0, needs.pat_pool.outputs.pat_number == '1', secrets.COPILOT_PAT_1, needs.pat_pool.outputs.pat_number == '2', secrets.COPILOT_PAT_2, needs.pat_pool.outputs.pat_number == '3', secrets.COPILOT_PAT_3, needs.pat_pool.outputs.pat_number == '4', secrets.COPILOT_PAT_4, needs.pat_pool.outputs.pat_number == '5', secrets.COPILOT_PAT_5, needs.pat_pool.outputs.pat_number == '6', secrets.COPILOT_PAT_6, needs.pat_pool.outputs.pat_number == '7', secrets.COPILOT_PAT_7, needs.pat_pool.outputs.pat_number == '8', secrets.COPILOT_PAT_8, needs.pat_pool.outputs.pat_number == '9', secrets.COPILOT_PAT_9, secrets.COPILOT_GITHUB_TOKEN) }} COPILOT_MODEL: claude-opus-4.6 GH_AW_MCP_CONFIG: /home/runner/.copilot/mcp-config.json GH_AW_PHASE: agent GH_AW_PROMPT: /tmp/gh-aw/aw-prompts/prompt.txt GH_AW_SAFE_OUTPUTS: ${{ steps.set-runtime-paths.outputs.GH_AW_SAFE_OUTPUTS }} - GH_AW_VERSION: v0.63.1 + GH_AW_VERSION: v0.71.5 GITHUB_API_URL: ${{ github.api_url }} GITHUB_AW: true + GITHUB_COPILOT_INTEGRATION_ID: agentic-workflows GITHUB_HEAD_REF: ${{ github.head_ref }} GITHUB_MCP_SERVER_TOKEN: ${{ secrets.GH_AW_GITHUB_MCP_SERVER_TOKEN || secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} GITHUB_REF_NAME: ${{ github.ref_name }} @@ -615,40 +752,28 @@ jobs: GIT_COMMITTER_EMAIL: github-actions[bot]@users.noreply.github.com GIT_COMMITTER_NAME: github-actions[bot] XDG_CONFIG_HOME: /home/runner - - name: Detect inference access error - id: detect-inference-error + - name: Detect Copilot errors + id: detect-copilot-errors if: always() continue-on-error: true - run: bash ${RUNNER_TEMP}/gh-aw/actions/detect_inference_access_error.sh + run: node "${RUNNER_TEMP}/gh-aw/actions/detect_copilot_errors.cjs" - name: Configure Git credentials env: REPO_NAME: ${{ github.repository }} SERVER_URL: ${{ github.server_url }} + GITHUB_TOKEN: ${{ github.token }} run: | git config --global user.email "github-actions[bot]@users.noreply.github.com" git config --global user.name "github-actions[bot]" git config --global am.keepcr true # Re-authenticate git with GitHub token SERVER_URL_STRIPPED="${SERVER_URL#https://}" - git remote set-url origin "https://x-access-token:${{ github.token }}@${SERVER_URL_STRIPPED}/${REPO_NAME}.git" + git remote set-url origin "https://x-access-token:${GITHUB_TOKEN}@${SERVER_URL_STRIPPED}/${REPO_NAME}.git" echo "Git configured with standard GitHub Actions identity" - name: Copy Copilot session state files to logs if: always() continue-on-error: true - run: | - # Copy Copilot session state files to logs folder for artifact collection - # This ensures they are in /tmp/gh-aw/ where secret redaction can scan them - SESSION_STATE_DIR="$HOME/.copilot/session-state" - LOGS_DIR="/tmp/gh-aw/sandbox/agent/logs" - - if [ -d "$SESSION_STATE_DIR" ]; then - echo "Copying Copilot session state files from $SESSION_STATE_DIR to $LOGS_DIR" - mkdir -p "$LOGS_DIR" - cp -v "$SESSION_STATE_DIR"/*.jsonl "$LOGS_DIR/" 2>/dev/null || true - echo "Session state files copied successfully" - else - echo "No session-state directory found at $SESSION_STATE_DIR" - fi + run: bash "${RUNNER_TEMP}/gh-aw/actions/copy_copilot_session_state.sh" - name: Stop MCP Gateway if: always() continue-on-error: true @@ -657,14 +782,14 @@ jobs: MCP_GATEWAY_API_KEY: ${{ steps.start-mcp-gateway.outputs.gateway-api-key }} GATEWAY_PID: ${{ steps.start-mcp-gateway.outputs.gateway-pid }} run: | - bash ${RUNNER_TEMP}/gh-aw/actions/stop_mcp_gateway.sh "$GATEWAY_PID" + bash "${RUNNER_TEMP}/gh-aw/actions/stop_mcp_gateway.sh" "$GATEWAY_PID" - name: Redact secrets in logs if: always() - uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8 + uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 with: script: | const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); - setupGlobals(core, github, context, exec, io); + setupGlobals(core, github, context, exec, io, getOctokit); const { main } = require('${{ runner.temp }}/gh-aw/actions/redact_secrets.cjs'); await main(); env: @@ -685,7 +810,7 @@ jobs: SECRET_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Append agent step summary if: always() - run: bash ${RUNNER_TEMP}/gh-aw/actions/append_agent_step_summary.sh + run: bash "${RUNNER_TEMP}/gh-aw/actions/append_agent_step_summary.sh" - name: Copy Safe Outputs if: always() env: @@ -696,7 +821,7 @@ jobs: - name: Ingest agent output id: collect_output if: always() - uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8 + uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 env: GH_AW_SAFE_OUTPUTS: ${{ steps.set-runtime-paths.outputs.GH_AW_SAFE_OUTPUTS }} GH_AW_ALLOWED_DOMAINS: "api.business.githubcopilot.com,api.enterprise.githubcopilot.com,api.github.com,api.githubcopilot.com,api.individual.githubcopilot.com,api.snapcraft.io,archive.ubuntu.com,azure.archive.ubuntu.com,crl.geotrust.com,crl.globalsign.com,crl.identrust.com,crl.sectigo.com,crl.thawte.com,crl.usertrust.com,crl.verisign.com,crl3.digicert.com,crl4.digicert.com,crls.ssl.com,github.com,host.docker.internal,json-schema.org,json.schemastore.org,keyserver.ubuntu.com,ocsp.digicert.com,ocsp.geotrust.com,ocsp.globalsign.com,ocsp.identrust.com,ocsp.sectigo.com,ocsp.ssl.com,ocsp.thawte.com,ocsp.usertrust.com,ocsp.verisign.com,packagecloud.io,packages.cloud.google.com,packages.microsoft.com,ppa.launchpad.net,raw.githubusercontent.com,registry.npmjs.org,s.symcb.com,s.symcd.com,security.ubuntu.com,telemetry.enterprise.githubcopilot.com,ts-crl.ws.symantec.com,ts-ocsp.ws.symantec.com,www.googleapis.com" @@ -705,27 +830,28 @@ jobs: with: script: | const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); - setupGlobals(core, github, context, exec, io); + setupGlobals(core, github, context, exec, io, getOctokit); const { main } = require('${{ runner.temp }}/gh-aw/actions/collect_ndjson_output.cjs'); await main(); - name: Parse agent logs for step summary if: always() - uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8 + uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 env: GH_AW_AGENT_OUTPUT: /tmp/gh-aw/sandbox/agent/logs/ with: script: | const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); - setupGlobals(core, github, context, exec, io); + setupGlobals(core, github, context, exec, io, getOctokit); const { main } = require('${{ runner.temp }}/gh-aw/actions/parse_copilot_log.cjs'); await main(); - name: Parse MCP Gateway logs for step summary if: always() - uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8 + id: parse-mcp-gateway + uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 with: script: | const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); - setupGlobals(core, github, context, exec, io); + setupGlobals(core, github, context, exec, io, getOctokit); const { main } = require('${{ runner.temp }}/gh-aw/actions/parse_mcp_gateway_log.cjs'); await main(); - name: Print firewall logs @@ -734,15 +860,35 @@ jobs: env: AWF_LOGS_DIR: /tmp/gh-aw/sandbox/firewall/logs run: | - # Fix permissions on firewall logs so they can be uploaded as artifacts + # Fix permissions on firewall logs/audit dirs so they can be uploaded as artifacts # AWF runs with sudo, creating files owned by root - sudo chmod -R a+r /tmp/gh-aw/sandbox/firewall/logs 2>/dev/null || true + sudo chmod -R a+r /tmp/gh-aw/sandbox/firewall 2>/dev/null || true # Only run awf logs summary if awf command exists (it may not be installed if workflow failed before install step) if command -v awf &> /dev/null; then awf logs summary | tee -a "$GITHUB_STEP_SUMMARY" else echo 'AWF binary not installed, skipping firewall log summary' fi + - name: Parse token usage for step summary + if: always() + continue-on-error: true + uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 + with: + script: | + const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); + setupGlobals(core, github, context, exec, io, getOctokit); + const { main } = require('${{ runner.temp }}/gh-aw/actions/parse_token_usage.cjs'); + await main(); + - name: Print AWF reflect summary + if: always() + continue-on-error: true + uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 + with: + script: | + const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); + setupGlobals(core, github, context, exec, io, getOctokit); + const { main } = require('${{ runner.temp }}/gh-aw/actions/awf_reflect_summary.cjs'); + await main(); - name: Write agent output placeholder if missing if: always() run: | @@ -752,7 +898,7 @@ jobs: - name: Upload agent artifacts if: always() continue-on-error: true - uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7 + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 with: name: agent path: | @@ -760,26 +906,221 @@ jobs: /tmp/gh-aw/sandbox/agent/logs/ /tmp/gh-aw/redacted-urls.log /tmp/gh-aw/mcp-logs/ + /tmp/gh-aw/agent_usage.json /tmp/gh-aw/agent-stdio.log + /tmp/gh-aw/pre-agent-audit.txt /tmp/gh-aw/agent/ + /tmp/gh-aw/github_rate_limits.jsonl /tmp/gh-aw/safeoutputs.jsonl /tmp/gh-aw/agent_output.json + /tmp/gh-aw/aw-*.patch + /tmp/gh-aw/aw-*.bundle + /tmp/gh-aw/awf-config.json + /tmp/gh-aw/sandbox/firewall/logs/ + /tmp/gh-aw/sandbox/firewall/audit/ + /tmp/gh-aw/sandbox/firewall/awf-reflect.json if-no-files-found: ignore - - name: Upload firewall audit logs + + conclusion: + needs: + - activation + - agent + - detection + - pat_pool + - safe_outputs + if: > + always() && (needs.agent.result != 'skipped' || needs.activation.outputs.lockdown_check_failed == 'true' || + needs.activation.outputs.stale_lock_file_failed == 'true') + runs-on: ubuntu-slim + permissions: + contents: read + pull-requests: write + concurrency: + group: "gh-aw-conclusion-code-review" + cancel-in-progress: false + outputs: + incomplete_count: ${{ steps.report_incomplete.outputs.incomplete_count }} + noop_message: ${{ steps.noop.outputs.noop_message }} + tools_reported: ${{ steps.missing_tool.outputs.tools_reported }} + total_count: ${{ steps.missing_tool.outputs.total_count }} + steps: + - name: Setup Scripts + id: setup + uses: github/gh-aw-actions/setup@b8068426813005612b960b5ab0b8bd2c27142323 # v0.71.5 + with: + destination: ${{ runner.temp }}/gh-aw/actions + job-name: ${{ github.job }} + trace-id: ${{ needs.activation.outputs.setup-trace-id }} + env: + GH_AW_SETUP_WORKFLOW_NAME: "Code Review" + GH_AW_CURRENT_WORKFLOW_REF: ${{ github.repository }}/.github/workflows/code-review.lock.yml@${{ github.ref }} + GH_AW_INFO_VERSION: "1.0.40" + - name: Download agent output artifact + id: download-agent-output + continue-on-error: true + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 + with: + name: agent + path: /tmp/gh-aw/ + - name: Setup agent output environment variable + id: setup-agent-output-env + if: steps.download-agent-output.outcome == 'success' + run: | + mkdir -p /tmp/gh-aw/ + find "/tmp/gh-aw/" -type f -print + echo "GH_AW_AGENT_OUTPUT=/tmp/gh-aw/agent_output.json" >> "$GITHUB_OUTPUT" + - name: Process no-op messages + id: noop + uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 + env: + GH_AW_AGENT_OUTPUT: ${{ steps.setup-agent-output-env.outputs.GH_AW_AGENT_OUTPUT }} + GH_AW_NOOP_MAX: "1" + GH_AW_WORKFLOW_NAME: "Code Review" + GH_AW_RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} + GH_AW_AGENT_CONCLUSION: ${{ needs.agent.result }} + GH_AW_NOOP_REPORT_AS_ISSUE: "true" + with: + github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} + script: | + const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); + setupGlobals(core, github, context, exec, io, getOctokit); + const { main } = require('${{ runner.temp }}/gh-aw/actions/handle_noop_message.cjs'); + await main(); + - name: Log detection run + id: detection_runs + uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 + env: + GH_AW_AGENT_OUTPUT: ${{ steps.setup-agent-output-env.outputs.GH_AW_AGENT_OUTPUT }} + GH_AW_WORKFLOW_NAME: "Code Review" + GH_AW_RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} + GH_AW_DETECTION_CONCLUSION: ${{ needs.detection.outputs.detection_conclusion }} + GH_AW_DETECTION_REASON: ${{ needs.detection.outputs.detection_reason }} + with: + github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} + script: | + const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); + setupGlobals(core, github, context, exec, io, getOctokit); + const { main } = require('${{ runner.temp }}/gh-aw/actions/handle_detection_runs.cjs'); + await main(); + - name: Record missing tool + id: missing_tool + uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 + env: + GH_AW_AGENT_OUTPUT: ${{ steps.setup-agent-output-env.outputs.GH_AW_AGENT_OUTPUT }} + GH_AW_MISSING_TOOL_CREATE_ISSUE: "true" + GH_AW_WORKFLOW_NAME: "Code Review" + with: + github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} + script: | + const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); + setupGlobals(core, github, context, exec, io, getOctokit); + const { main } = require('${{ runner.temp }}/gh-aw/actions/missing_tool.cjs'); + await main(); + - name: Record incomplete + id: report_incomplete + uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 + env: + GH_AW_AGENT_OUTPUT: ${{ steps.setup-agent-output-env.outputs.GH_AW_AGENT_OUTPUT }} + GH_AW_REPORT_INCOMPLETE_CREATE_ISSUE: "true" + GH_AW_WORKFLOW_NAME: "Code Review" + with: + github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} + script: | + const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); + setupGlobals(core, github, context, exec, io, getOctokit); + const { main } = require('${{ runner.temp }}/gh-aw/actions/report_incomplete_handler.cjs'); + await main(); + - name: Handle agent failure + id: handle_agent_failure if: always() + uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 + env: + GH_AW_AGENT_OUTPUT: ${{ steps.setup-agent-output-env.outputs.GH_AW_AGENT_OUTPUT }} + GH_AW_WORKFLOW_NAME: "Code Review" + GH_AW_RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} + GH_AW_AGENT_CONCLUSION: ${{ needs.agent.result }} + GH_AW_WORKFLOW_ID: "code-review" + GH_AW_ACTION_FAILURE_ISSUE_EXPIRES_HOURS: "168" + GH_AW_ENGINE_ID: "copilot" + GH_AW_SECRET_VERIFICATION_RESULT: ${{ needs.activation.outputs.secret_verification_result }} + GH_AW_CHECKOUT_PR_SUCCESS: ${{ needs.agent.outputs.checkout_pr_success }} + GH_AW_INFERENCE_ACCESS_ERROR: ${{ needs.agent.outputs.inference_access_error }} + GH_AW_MCP_POLICY_ERROR: ${{ needs.agent.outputs.mcp_policy_error }} + GH_AW_AGENTIC_ENGINE_TIMEOUT: ${{ needs.agent.outputs.agentic_engine_timeout }} + GH_AW_MODEL_NOT_SUPPORTED_ERROR: ${{ needs.agent.outputs.model_not_supported_error }} + GH_AW_ENGINE_API_HOSTS: "api.enterprise.githubcopilot.com,api.githubcopilot.com,api.business.githubcopilot.com,api.individual.githubcopilot.com" + GH_AW_LOCKDOWN_CHECK_FAILED: ${{ needs.activation.outputs.lockdown_check_failed }} + GH_AW_STALE_LOCK_FILE_FAILED: ${{ needs.activation.outputs.stale_lock_file_failed }} + GH_AW_GROUP_REPORTS: "false" + GH_AW_FAILURE_REPORT_AS_ISSUE: "true" + GH_AW_MISSING_TOOL_REPORT_AS_FAILURE: "true" + GH_AW_MISSING_DATA_REPORT_AS_FAILURE: "true" + GH_AW_TIMEOUT_MINUTES: "20" + with: + github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} + script: | + const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); + setupGlobals(core, github, context, exec, io, getOctokit); + const { main } = require('${{ runner.temp }}/gh-aw/actions/handle_agent_failure.cjs'); + await main(); + + detection: + needs: + - activation + - agent + if: > + always() && needs.agent.result != 'skipped' && (needs.agent.outputs.output_types != '' || needs.agent.outputs.has_patch == 'true') + runs-on: ubuntu-latest + permissions: + contents: read + outputs: + detection_conclusion: ${{ steps.detection_conclusion.outputs.conclusion }} + detection_reason: ${{ steps.detection_conclusion.outputs.reason }} + detection_success: ${{ steps.detection_conclusion.outputs.success }} + steps: + - name: Setup Scripts + id: setup + uses: github/gh-aw-actions/setup@b8068426813005612b960b5ab0b8bd2c27142323 # v0.71.5 + with: + destination: ${{ runner.temp }}/gh-aw/actions + job-name: ${{ github.job }} + trace-id: ${{ needs.activation.outputs.setup-trace-id }} + env: + GH_AW_SETUP_WORKFLOW_NAME: "Code Review" + GH_AW_CURRENT_WORKFLOW_REF: ${{ github.repository }}/.github/workflows/code-review.lock.yml@${{ github.ref }} + GH_AW_INFO_VERSION: "1.0.40" + - name: Download agent output artifact + id: download-agent-output continue-on-error: true - uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7 + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - name: firewall-audit-logs - path: /tmp/gh-aw/sandbox/firewall/logs/ - if-no-files-found: ignore - # --- Threat Detection (inline) --- + name: agent + path: /tmp/gh-aw/ + - name: Setup agent output environment variable + id: setup-agent-output-env + if: steps.download-agent-output.outcome == 'success' + run: | + mkdir -p /tmp/gh-aw/ + find "/tmp/gh-aw/" -type f -print + echo "GH_AW_AGENT_OUTPUT=/tmp/gh-aw/agent_output.json" >> "$GITHUB_OUTPUT" + - name: Checkout repository for patch context + if: needs.agent.outputs.has_patch == 'true' + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + persist-credentials: false + # --- Threat Detection --- + - name: Clean stale firewall files from agent artifact + run: | + rm -rf /tmp/gh-aw/sandbox/firewall/logs + rm -rf /tmp/gh-aw/sandbox/firewall/audit + - name: Download container images + run: bash "${RUNNER_TEMP}/gh-aw/actions/download_docker_images.sh" ghcr.io/github/gh-aw-firewall/agent:0.25.40@sha256:14ff567e8d9d4c2fbc5e55c973488381c71d7e0fdbe72d30ee7b8a738fd86504 ghcr.io/github/gh-aw-firewall/api-proxy:0.25.40@sha256:2883ca3e5ae9f330cafdd9345bfd4ae17fc8da36c96d4c9a1f76e922b4c45280 ghcr.io/github/gh-aw-firewall/squid:0.25.40@sha256:b084f4a2c771f584ee68084ced52fa6b3245197a1889645d817462d307d3ac51 - name: Check if detection needed id: detection_guard if: always() env: - OUTPUT_TYPES: ${{ steps.collect_output.outputs.output_types }} - HAS_PATCH: ${{ steps.collect_output.outputs.has_patch }} + OUTPUT_TYPES: ${{ needs.agent.outputs.output_types }} + HAS_PATCH: ${{ needs.agent.outputs.has_patch }} run: | if [[ -n "$OUTPUT_TYPES" || "$HAS_PATCH" == "true" ]]; then echo "run_detection=true" >> "$GITHUB_OUTPUT" @@ -788,10 +1129,10 @@ jobs: echo "run_detection=false" >> "$GITHUB_OUTPUT" echo "Detection skipped: no agent outputs or patches to analyze" fi - - name: Clear MCP configuration for detection + - name: Clear MCP Config for detection if: always() && steps.detection_guard.outputs.run_detection == 'true' run: | - rm -f /tmp/gh-aw/mcp-config/mcp-servers.json + rm -f "${RUNNER_TEMP}/gh-aw/mcp-config/mcp-servers.json" rm -f /home/runner/.copilot/mcp-config.json rm -f "$GITHUB_WORKSPACE/.gemini/settings.json" - name: Prepare threat detection files @@ -803,19 +1144,22 @@ jobs: for f in /tmp/gh-aw/aw-*.patch; do [ -f "$f" ] && cp "$f" /tmp/gh-aw/threat-detection/ 2>/dev/null || true done + for f in /tmp/gh-aw/aw-*.bundle; do + [ -f "$f" ] && cp "$f" /tmp/gh-aw/threat-detection/ 2>/dev/null || true + done echo "Prepared threat detection files:" ls -la /tmp/gh-aw/threat-detection/ 2>/dev/null || true - name: Setup threat detection if: always() && steps.detection_guard.outputs.run_detection == 'true' - uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8 + uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 env: WORKFLOW_NAME: "Code Review" WORKFLOW_DESCRIPTION: "Review pull request changes for correctness, performance, and consistency with project conventions" - HAS_PATCH: ${{ steps.collect_output.outputs.has_patch }} + HAS_PATCH: ${{ needs.agent.outputs.has_patch }} with: script: | const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); - setupGlobals(core, github, context, exec, io); + setupGlobals(core, github, context, exec, io, getOctokit); const { main } = require('${{ runner.temp }}/gh-aw/actions/setup_threat_detection.cjs'); await main(); - name: Ensure threat-detection directory and log @@ -823,33 +1167,44 @@ jobs: run: | mkdir -p /tmp/gh-aw/threat-detection touch /tmp/gh-aw/threat-detection/detection.log + - name: Setup Node.js + uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 + with: + node-version: '24' + package-manager-cache: false + - name: Install GitHub Copilot CLI + run: bash "${RUNNER_TEMP}/gh-aw/actions/install_copilot_cli.sh" 1.0.40 + env: + GH_HOST: github.com + - name: Install AWF binary + run: bash "${RUNNER_TEMP}/gh-aw/actions/install_awf_binary.sh" v0.25.40 - name: Execute GitHub Copilot CLI if: always() && steps.detection_guard.outputs.run_detection == 'true' + continue-on-error: true id: detection_agentic_execution # Copilot CLI tool arguments (sorted): - # --allow-tool shell(cat) - # --allow-tool shell(grep) - # --allow-tool shell(head) - # --allow-tool shell(jq) - # --allow-tool shell(ls) - # --allow-tool shell(tail) - # --allow-tool shell(wc) timeout-minutes: 20 run: | set -o pipefail touch /tmp/gh-aw/agent-step-summary.md + GH_AW_NODE_BIN=$(command -v node 2>/dev/null || true) + export GH_AW_NODE_BIN + (umask 177 && touch /tmp/gh-aw/threat-detection/detection.log) + printf '%s\n' '{"$schema":"https://github.com/github/gh-aw-firewall/releases/download/v0.25.40/awf-config.schema.json","network":{"allowDomains":["api.business.githubcopilot.com","api.enterprise.githubcopilot.com","api.github.com","api.githubcopilot.com","api.individual.githubcopilot.com","github.com","host.docker.internal","telemetry.enterprise.githubcopilot.com"]},"apiProxy":{"enabled":true},"container":{"imageTag":"0.25.40,squid=sha256:b084f4a2c771f584ee68084ced52fa6b3245197a1889645d817462d307d3ac51,agent=sha256:14ff567e8d9d4c2fbc5e55c973488381c71d7e0fdbe72d30ee7b8a738fd86504,api-proxy=sha256:2883ca3e5ae9f330cafdd9345bfd4ae17fc8da36c96d4c9a1f76e922b4c45280,cli-proxy=sha256:3e7152911d4b4b7b97beef9d3d7d924ff7902227e86001ef3838fb728d5d514c"}}' > "${RUNNER_TEMP}/gh-aw/awf-config.json" && cp "${RUNNER_TEMP}/gh-aw/awf-config.json" /tmp/gh-aw/awf-config.json # shellcheck disable=SC1003 - sudo -E awf --env-all --container-workdir "${GITHUB_WORKSPACE}" --mount "${RUNNER_TEMP}/gh-aw:${RUNNER_TEMP}/gh-aw:ro" --mount "${RUNNER_TEMP}/gh-aw:/host${RUNNER_TEMP}/gh-aw:ro" --allow-domains "api.business.githubcopilot.com,api.enterprise.githubcopilot.com,api.github.com,api.githubcopilot.com,api.individual.githubcopilot.com,github.com,host.docker.internal,raw.githubusercontent.com,registry.npmjs.org,telemetry.enterprise.githubcopilot.com" --log-level info --proxy-logs-dir /tmp/gh-aw/sandbox/firewall/logs --enable-host-access --image-tag 0.25.0 --skip-pull --enable-api-proxy \ - -- /bin/bash -c '/usr/local/bin/copilot --add-dir /tmp/gh-aw/ --log-level all --log-dir /tmp/gh-aw/sandbox/agent/logs/ --add-dir "${GITHUB_WORKSPACE}" --disable-builtin-mcps --allow-tool '\''shell(cat)'\'' --allow-tool '\''shell(grep)'\'' --allow-tool '\''shell(head)'\'' --allow-tool '\''shell(jq)'\'' --allow-tool '\''shell(ls)'\'' --allow-tool '\''shell(tail)'\'' --allow-tool '\''shell(wc)'\'' --prompt "$(cat /tmp/gh-aw/aw-prompts/prompt.txt)"' 2>&1 | tee -a /tmp/gh-aw/threat-detection/detection.log + sudo -E awf --config "${RUNNER_TEMP}/gh-aw/awf-config.json" --container-workdir "${GITHUB_WORKSPACE}" --mount "${RUNNER_TEMP}/gh-aw:${RUNNER_TEMP}/gh-aw:ro" --mount "${RUNNER_TEMP}/gh-aw:/host${RUNNER_TEMP}/gh-aw:ro" --env-all --exclude-env COPILOT_GITHUB_TOKEN --log-level info --proxy-logs-dir /tmp/gh-aw/sandbox/firewall/logs --audit-dir /tmp/gh-aw/sandbox/firewall/audit --enable-host-access --allow-host-ports 80,443,8080 --skip-pull \ + -- /bin/bash -c 'export PATH="$(find /opt/hostedtoolcache /home/runner/work/_tool -maxdepth 4 -type d -name bin 2>/dev/null | tr '\''\n'\'' '\'':'\'')$PATH"; [ -n "$GOROOT" ] && export PATH="$GOROOT/bin:$PATH" || true && GH_AW_NODE_EXEC="${GH_AW_NODE_BIN:-}"; if [ -z "$GH_AW_NODE_EXEC" ] || [ ! -x "$GH_AW_NODE_EXEC" ]; then GH_AW_NODE_EXEC="$(command -v node 2>/dev/null || echo node)"; fi; "$GH_AW_NODE_EXEC" ${RUNNER_TEMP}/gh-aw/actions/copilot_harness.cjs /usr/local/bin/copilot --add-dir /tmp/gh-aw/ --log-level all --log-dir /tmp/gh-aw/sandbox/agent/logs/ --disable-builtin-mcps --no-ask-user --allow-all-tools --add-dir "${GITHUB_WORKSPACE}" --prompt-file /tmp/gh-aw/aw-prompts/prompt.txt' 2>&1 | tee -a /tmp/gh-aw/threat-detection/detection.log env: COPILOT_AGENT_RUNNER_TYPE: STANDALONE - COPILOT_GITHUB_TOKEN: ${{ case(needs.pre_activation.outputs.copilot_pat_number == '0', secrets.COPILOT_PAT_0, needs.pre_activation.outputs.copilot_pat_number == '1', secrets.COPILOT_PAT_1, needs.pre_activation.outputs.copilot_pat_number == '2', secrets.COPILOT_PAT_2, needs.pre_activation.outputs.copilot_pat_number == '3', secrets.COPILOT_PAT_3, needs.pre_activation.outputs.copilot_pat_number == '4', secrets.COPILOT_PAT_4, needs.pre_activation.outputs.copilot_pat_number == '5', secrets.COPILOT_PAT_5, needs.pre_activation.outputs.copilot_pat_number == '6', secrets.COPILOT_PAT_6, needs.pre_activation.outputs.copilot_pat_number == '7', secrets.COPILOT_PAT_7, needs.pre_activation.outputs.copilot_pat_number == '8', secrets.COPILOT_PAT_8, needs.pre_activation.outputs.copilot_pat_number == '9', secrets.COPILOT_PAT_9, secrets.COPILOT_GITHUB_TOKEN) }} + COPILOT_API_KEY: dummy-byok-key-for-offline-mode + COPILOT_GITHUB_TOKEN: ${{ case(needs.pat_pool.outputs.pat_number == '0', secrets.COPILOT_PAT_0, needs.pat_pool.outputs.pat_number == '1', secrets.COPILOT_PAT_1, needs.pat_pool.outputs.pat_number == '2', secrets.COPILOT_PAT_2, needs.pat_pool.outputs.pat_number == '3', secrets.COPILOT_PAT_3, needs.pat_pool.outputs.pat_number == '4', secrets.COPILOT_PAT_4, needs.pat_pool.outputs.pat_number == '5', secrets.COPILOT_PAT_5, needs.pat_pool.outputs.pat_number == '6', secrets.COPILOT_PAT_6, needs.pat_pool.outputs.pat_number == '7', secrets.COPILOT_PAT_7, needs.pat_pool.outputs.pat_number == '8', secrets.COPILOT_PAT_8, needs.pat_pool.outputs.pat_number == '9', secrets.COPILOT_PAT_9, secrets.COPILOT_GITHUB_TOKEN) }} COPILOT_MODEL: claude-opus-4.6 GH_AW_PHASE: detection GH_AW_PROMPT: /tmp/gh-aw/aw-prompts/prompt.txt - GH_AW_VERSION: v0.63.1 + GH_AW_VERSION: v0.71.5 GITHUB_API_URL: ${{ github.api_url }} GITHUB_AW: true + GITHUB_COPILOT_INTEGRATION_ID: agentic-workflows GITHUB_HEAD_REF: ${{ github.head_ref }} GITHUB_REF_NAME: ${{ github.ref_name }} GITHUB_SERVER_URL: ${{ github.server_url }} @@ -860,199 +1215,155 @@ jobs: GIT_COMMITTER_EMAIL: github-actions[bot]@users.noreply.github.com GIT_COMMITTER_NAME: github-actions[bot] XDG_CONFIG_HOME: /home/runner - - name: Parse threat detection results - id: parse_detection_results - if: always() && steps.detection_guard.outputs.run_detection == 'true' - uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8 - with: - script: | - const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); - setupGlobals(core, github, context, exec, io); - const { main } = require('${{ runner.temp }}/gh-aw/actions/parse_threat_detection_results.cjs'); - await main(); - name: Upload threat detection log if: always() && steps.detection_guard.outputs.run_detection == 'true' - uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7 + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 with: name: detection path: /tmp/gh-aw/threat-detection/detection.log if-no-files-found: ignore - - name: Set detection conclusion + - name: Parse and conclude threat detection id: detection_conclusion if: always() + continue-on-error: true + uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 env: RUN_DETECTION: ${{ steps.detection_guard.outputs.run_detection }} - DETECTION_SUCCESS: ${{ steps.parse_detection_results.outputs.success }} - run: | - if [[ "$RUN_DETECTION" != "true" ]]; then - echo "conclusion=skipped" >> "$GITHUB_OUTPUT" - echo "success=true" >> "$GITHUB_OUTPUT" - echo "Detection was not needed, marking as skipped" - elif [[ "$DETECTION_SUCCESS" == "true" ]]; then - echo "conclusion=success" >> "$GITHUB_OUTPUT" - echo "success=true" >> "$GITHUB_OUTPUT" - echo "Detection passed successfully" - else - echo "conclusion=failure" >> "$GITHUB_OUTPUT" - echo "success=false" >> "$GITHUB_OUTPUT" - echo "Detection found issues" - fi + GH_AW_DETECTION_CONTINUE_ON_ERROR: "true" + with: + script: | + try { + const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); + setupGlobals(core, github, context, exec, io, getOctokit); + const { main } = require('${{ runner.temp }}/gh-aw/actions/parse_threat_detection_results.cjs'); + await main(); + } catch (loadErr) { + const continueOnError = process.env.GH_AW_DETECTION_CONTINUE_ON_ERROR !== 'false'; + const msg = 'ERR_SYSTEM: \u274C Unexpected error loading threat detection module: ' + (loadErr && loadErr.message ? loadErr.message : String(loadErr)); + core.error(msg); + core.setOutput('reason', 'parse_error'); + if (continueOnError) { + core.warning('\u26A0\uFE0F ' + msg); + core.setOutput('conclusion', 'warning'); + core.setOutput('success', 'false'); + } else { + core.setOutput('conclusion', 'failure'); + core.setOutput('success', 'false'); + core.setFailed(msg); + } + } - conclusion: - needs: - - activation - - agent - - safe_outputs - if: always() && (needs.agent.result != 'skipped' || needs.activation.outputs.lockdown_check_failed == 'true') + pat_pool: + needs: pre_activation runs-on: ubuntu-slim - permissions: - contents: read - pull-requests: write - concurrency: - group: "gh-aw-conclusion-code-review" - cancel-in-progress: false outputs: - noop_message: ${{ steps.noop.outputs.noop_message }} - tools_reported: ${{ steps.missing_tool.outputs.tools_reported }} - total_count: ${{ steps.missing_tool.outputs.total_count }} + pat_number: ${{ steps.select-pat-number.outputs.copilot_pat_number }} steps: - - name: Setup Scripts - uses: github/gh-aw-actions/setup@536ea1bad8c6715d098a9dc1afea8d403733acfe # v0.65.4 - with: - destination: ${{ runner.temp }}/gh-aw/actions - - name: Download agent output artifact - id: download-agent-output - continue-on-error: true - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 - with: - name: agent - path: /tmp/gh-aw/ - - name: Setup agent output environment variable - id: setup-agent-output-env - if: steps.download-agent-output.outcome == 'success' + - name: Configure GH_HOST for enterprise compatibility + id: ghes-host-config + shell: bash run: | - mkdir -p /tmp/gh-aw/ - find "/tmp/gh-aw/" -type f -print - echo "GH_AW_AGENT_OUTPUT=/tmp/gh-aw/agent_output.json" >> "$GITHUB_OUTPUT" - - name: Process No-Op Messages - id: noop - uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8 - env: - GH_AW_AGENT_OUTPUT: ${{ steps.setup-agent-output-env.outputs.GH_AW_AGENT_OUTPUT }} - GH_AW_NOOP_MAX: "1" - GH_AW_WORKFLOW_NAME: "Code Review" - with: - github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} - script: | - const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); - setupGlobals(core, github, context, exec, io); - const { main } = require('${{ runner.temp }}/gh-aw/actions/noop.cjs'); - await main(); - - name: Record Missing Tool - id: missing_tool - uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8 - env: - GH_AW_AGENT_OUTPUT: ${{ steps.setup-agent-output-env.outputs.GH_AW_AGENT_OUTPUT }} - GH_AW_WORKFLOW_NAME: "Code Review" - with: - github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} - script: | - const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); - setupGlobals(core, github, context, exec, io); - const { main } = require('${{ runner.temp }}/gh-aw/actions/missing_tool.cjs'); - await main(); - - name: Handle Agent Failure - id: handle_agent_failure - if: always() - uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8 - env: - GH_AW_AGENT_OUTPUT: ${{ steps.setup-agent-output-env.outputs.GH_AW_AGENT_OUTPUT }} - GH_AW_WORKFLOW_NAME: "Code Review" - GH_AW_RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} - GH_AW_AGENT_CONCLUSION: ${{ needs.agent.result }} - GH_AW_WORKFLOW_ID: "code-review" - GH_AW_SECRET_VERIFICATION_RESULT: ${{ needs.activation.outputs.secret_verification_result }} - GH_AW_CHECKOUT_PR_SUCCESS: ${{ needs.agent.outputs.checkout_pr_success }} - GH_AW_INFERENCE_ACCESS_ERROR: ${{ needs.agent.outputs.inference_access_error }} - GH_AW_LOCKDOWN_CHECK_FAILED: ${{ needs.activation.outputs.lockdown_check_failed }} - GH_AW_GROUP_REPORTS: "false" - GH_AW_FAILURE_REPORT_AS_ISSUE: "true" - GH_AW_TIMEOUT_MINUTES: "20" - with: - github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} - script: | - const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); - setupGlobals(core, github, context, exec, io); - const { main } = require('${{ runner.temp }}/gh-aw/actions/handle_agent_failure.cjs'); - await main(); - - name: Handle No-Op Message - id: handle_noop_message - uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8 + # Derive GH_HOST from GITHUB_SERVER_URL so the gh CLI targets the correct + # GitHub instance (GHES/GHEC). On github.com this is a harmless no-op. + GH_HOST="${GITHUB_SERVER_URL#https://}" + GH_HOST="${GH_HOST#http://}" + echo "GH_HOST=${GH_HOST}" >> "$GITHUB_ENV" + - name: Select Copilot token from pool + id: select-pat-number + run: | + # Collect pool entries with non-empty secrets from COPILOT_PAT_0..COPILOT_PAT_9. + PAT_NUMBERS=() + POOL_INDICATORS=(➖ ➖ ➖ ➖ ➖ ➖ ➖ ➖ ➖ ➖) + + for i in $(seq 0 9); do + var="COPILOT_PAT_${i}" + val="${!var}" + if [ -n "$val" ]; then + PAT_NUMBERS+=(${i}) + POOL_INDICATORS[${i}]="🟪" + fi + done + + # If none of the entries in the pool have values, emit a warning + # and do not set an output value. The consumer can fall back to + # using COPILOT_GITHUB_TOKEN. + if [ ${#PAT_NUMBERS[@]} -eq 0 ]; then + warning_message="::warning::None of the PAT pool entries had values " + warning_message+="(checked COPILOT_PAT_0 through COPILOT_PAT_9)" + echo "$warning_message" + exit 0 + fi + + # Select a random index using the seed if specified + if [ -n "$RANDOM_SEED" ]; then + RANDOM=$RANDOM_SEED + fi + + PAT_INDEX=$(( RANDOM % ${#PAT_NUMBERS[@]} )) + PAT_NUMBER="${PAT_NUMBERS[$PAT_INDEX]}" + POOL_INDICATORS[${PAT_NUMBER}]="✅" + + echo "Pool size: ${#PAT_NUMBERS[@]}" + echo "Selected PAT number ${PAT_NUMBER} (index: ${PAT_INDEX})" + + # Emit a markdown table of the pool entries to the step summary + echo "|0|1|2|3|4|5|6|7|8|9|" >> "$GITHUB_STEP_SUMMARY" + echo "|-|-|-|-|-|-|-|-|-|-|" >> "$GITHUB_STEP_SUMMARY" + (IFS='|'; printf '|%s' "${POOL_INDICATORS[@]}"; printf '|\n') >> "$GITHUB_STEP_SUMMARY" + + # Set the PAT number as the output + echo "copilot_pat_number=${PAT_NUMBER}" >> "$GITHUB_OUTPUT" env: - GH_AW_AGENT_OUTPUT: ${{ steps.setup-agent-output-env.outputs.GH_AW_AGENT_OUTPUT }} - GH_AW_WORKFLOW_NAME: "Code Review" - GH_AW_RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} - GH_AW_AGENT_CONCLUSION: ${{ needs.agent.result }} - GH_AW_NOOP_MESSAGE: ${{ steps.noop.outputs.noop_message }} - GH_AW_NOOP_REPORT_AS_ISSUE: "true" - with: - github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} - script: | - const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); - setupGlobals(core, github, context, exec, io); - const { main } = require('${{ runner.temp }}/gh-aw/actions/handle_noop_message.cjs'); - await main(); + COPILOT_PAT_0: ${{ secrets.COPILOT_PAT_0 }} + COPILOT_PAT_1: ${{ secrets.COPILOT_PAT_1 }} + COPILOT_PAT_2: ${{ secrets.COPILOT_PAT_2 }} + COPILOT_PAT_3: ${{ secrets.COPILOT_PAT_3 }} + COPILOT_PAT_4: ${{ secrets.COPILOT_PAT_4 }} + COPILOT_PAT_5: ${{ secrets.COPILOT_PAT_5 }} + COPILOT_PAT_6: ${{ secrets.COPILOT_PAT_6 }} + COPILOT_PAT_7: ${{ secrets.COPILOT_PAT_7 }} + COPILOT_PAT_8: ${{ secrets.COPILOT_PAT_8 }} + COPILOT_PAT_9: ${{ secrets.COPILOT_PAT_9 }} + RANDOM_SEED: ${{ github.aw.import-inputs.random_seed }} + shell: bash pre_activation: if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.id == github.repository_id runs-on: ubuntu-slim outputs: activated: ${{ steps.check_membership.outputs.is_team_member == 'true' }} - copilot_pat_number: ${{ steps.select-copilot-pat.outputs.copilot_pat_number }} matched_command: '' - select-copilot-pat_result: ${{ steps.select-copilot-pat.outcome }} + setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Setup Scripts - uses: github/gh-aw-actions/setup@536ea1bad8c6715d098a9dc1afea8d403733acfe # v0.65.4 + id: setup + uses: github/gh-aw-actions/setup@b8068426813005612b960b5ab0b8bd2c27142323 # v0.71.5 with: destination: ${{ runner.temp }}/gh-aw/actions + job-name: ${{ github.job }} + env: + GH_AW_SETUP_WORKFLOW_NAME: "Code Review" + GH_AW_CURRENT_WORKFLOW_REF: ${{ github.repository }}/.github/workflows/code-review.lock.yml@${{ github.ref }} + GH_AW_INFO_VERSION: "1.0.40" - name: Check team membership for workflow id: check_membership - uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8 + uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 env: - GH_AW_REQUIRED_ROLES: admin,maintainer,write + GH_AW_REQUIRED_ROLES: "admin,maintainer,write" with: github-token: ${{ secrets.GITHUB_TOKEN }} script: | const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); - setupGlobals(core, github, context, exec, io); + setupGlobals(core, github, context, exec, io, getOctokit); const { main } = require('${{ runner.temp }}/gh-aw/actions/check_membership.cjs'); await main(); - - name: Checkout the select-copilot-pat action folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - fetch-depth: 1 - persist-credentials: false - sparse-checkout: .github/actions/select-copilot-pat - sparse-checkout-cone-mode: true - - name: Select Copilot token from pool - id: select-copilot-pat - uses: ./.github/actions/select-copilot-pat - env: - SECRET_0: ${{ secrets.COPILOT_PAT_0 }} - SECRET_1: ${{ secrets.COPILOT_PAT_1 }} - SECRET_2: ${{ secrets.COPILOT_PAT_2 }} - SECRET_3: ${{ secrets.COPILOT_PAT_3 }} - SECRET_4: ${{ secrets.COPILOT_PAT_4 }} - SECRET_5: ${{ secrets.COPILOT_PAT_5 }} - SECRET_6: ${{ secrets.COPILOT_PAT_6 }} - SECRET_7: ${{ secrets.COPILOT_PAT_7 }} - SECRET_8: ${{ secrets.COPILOT_PAT_8 }} - SECRET_9: ${{ secrets.COPILOT_PAT_9 }} safe_outputs: - needs: agent - if: (!cancelled()) && needs.agent.result != 'skipped' && needs.agent.outputs.detection_success == 'true' + needs: + - activation + - agent + - detection + if: (!cancelled()) && needs.agent.result != 'skipped' && needs.detection.result == 'success' runs-on: ubuntu-slim permissions: contents: read @@ -1060,8 +1371,12 @@ jobs: timeout-minutes: 15 env: GH_AW_CALLER_WORKFLOW_ID: "${{ github.repository }}/code-review" + GH_AW_DETECTION_CONCLUSION: ${{ needs.detection.outputs.detection_conclusion }} + GH_AW_DETECTION_REASON: ${{ needs.detection.outputs.detection_reason }} + GH_AW_EFFECTIVE_TOKENS: ${{ needs.agent.outputs.effective_tokens }} GH_AW_ENGINE_ID: "copilot" GH_AW_ENGINE_MODEL: "claude-opus-4.6" + GH_AW_ENGINE_VERSION: "1.0.40" GH_AW_WORKFLOW_ID: "code-review" GH_AW_WORKFLOW_NAME: "Code Review" outputs: @@ -1075,9 +1390,16 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Setup Scripts - uses: github/gh-aw-actions/setup@536ea1bad8c6715d098a9dc1afea8d403733acfe # v0.65.4 + id: setup + uses: github/gh-aw-actions/setup@b8068426813005612b960b5ab0b8bd2c27142323 # v0.71.5 with: destination: ${{ runner.temp }}/gh-aw/actions + job-name: ${{ github.job }} + trace-id: ${{ needs.activation.outputs.setup-trace-id }} + env: + GH_AW_SETUP_WORKFLOW_NAME: "Code Review" + GH_AW_CURRENT_WORKFLOW_REF: ${{ github.repository }}/.github/workflows/code-review.lock.yml@${{ github.ref }} + GH_AW_INFO_VERSION: "1.0.40" - name: Download agent output artifact id: download-agent-output continue-on-error: true @@ -1100,28 +1422,30 @@ jobs: # GitHub instance (GHES/GHEC). On github.com this is a harmless no-op. GH_HOST="${GITHUB_SERVER_URL#https://}" GH_HOST="${GH_HOST#http://}" - echo "GH_HOST=${GH_HOST}" >> "$GITHUB_OUTPUT" + echo "GH_HOST=${GH_HOST}" >> "$GITHUB_ENV" - name: Process Safe Outputs id: process_safe_outputs - uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8 + uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 env: GH_AW_AGENT_OUTPUT: ${{ steps.setup-agent-output-env.outputs.GH_AW_AGENT_OUTPUT }} GH_AW_ALLOWED_DOMAINS: "api.business.githubcopilot.com,api.enterprise.githubcopilot.com,api.github.com,api.githubcopilot.com,api.individual.githubcopilot.com,api.snapcraft.io,archive.ubuntu.com,azure.archive.ubuntu.com,crl.geotrust.com,crl.globalsign.com,crl.identrust.com,crl.sectigo.com,crl.thawte.com,crl.usertrust.com,crl.verisign.com,crl3.digicert.com,crl4.digicert.com,crls.ssl.com,github.com,host.docker.internal,json-schema.org,json.schemastore.org,keyserver.ubuntu.com,ocsp.digicert.com,ocsp.geotrust.com,ocsp.globalsign.com,ocsp.identrust.com,ocsp.sectigo.com,ocsp.ssl.com,ocsp.thawte.com,ocsp.usertrust.com,ocsp.verisign.com,packagecloud.io,packages.cloud.google.com,packages.microsoft.com,ppa.launchpad.net,raw.githubusercontent.com,registry.npmjs.org,s.symcb.com,s.symcd.com,security.ubuntu.com,telemetry.enterprise.githubcopilot.com,ts-crl.ws.symantec.com,ts-ocsp.ws.symantec.com,www.googleapis.com" GITHUB_SERVER_URL: ${{ github.server_url }} GITHUB_API_URL: ${{ github.api_url }} - GH_AW_SAFE_OUTPUTS_HANDLER_CONFIG: "{\"add_comment\":{\"hide_older_comments\":true,\"max\":1,\"target\":\"triggering\"},\"missing_data\":{},\"missing_tool\":{},\"noop\":{\"max\":1,\"report-as-issue\":\"true\"}}" + GH_AW_SAFE_OUTPUTS_HANDLER_CONFIG: "{\"add_comment\":{\"hide_older_comments\":true,\"max\":1,\"target\":\"triggering\"},\"create_report_incomplete_issue\":{},\"missing_data\":{},\"missing_tool\":{},\"noop\":{\"max\":1,\"report-as-issue\":\"true\"},\"report_incomplete\":{}}" with: github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} script: | const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); - setupGlobals(core, github, context, exec, io); + setupGlobals(core, github, context, exec, io, getOctokit); const { main } = require('${{ runner.temp }}/gh-aw/actions/safe_output_handler_manager.cjs'); await main(); - - name: Upload Safe Output Items + - name: Upload Safe Outputs Items if: always() - uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7 + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 with: - name: safe-output-items - path: /tmp/gh-aw/safe-output-items.jsonl + name: safe-outputs-items + path: | + /tmp/gh-aw/safe-output-items.jsonl + /tmp/gh-aw/temporary-id-map.json if-no-files-found: ignore diff --git a/.github/workflows/code-review.md b/.github/workflows/code-review.md index 5f4f16d5de44a5..d93efdfbf49e75 100644 --- a/.github/workflows/code-review.md +++ b/.github/workflows/code-review.md @@ -32,56 +32,19 @@ on: pull_request: types: [opened, synchronize] - # ############################################################### - # Override the COPILOT_GITHUB_TOKEN secret usage for the workflow - # with a randomly-selected token from a pool of secrets. - # - # As soon as organization-level billing is offered for Agentic - # Workflows, this stop-gap approach will be removed. - # - # See: /.github/actions/select-copilot-pat/README.md - # ############################################################### +# ############################################################### +# Override COPILOT_GITHUB_TOKEN with a random PAT from the pool. +# This stop-gap will be removed when org billing is available. +# See: .github/workflows/shared/pat_pool.README.md for more info. +# ############################################################### +imports: + - shared/pat_pool.md - # Add the pre-activation step of selecting a random PAT from the supplied secrets - steps: - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - name: Checkout the select-copilot-pat action folder - with: - persist-credentials: false - sparse-checkout: .github/actions/select-copilot-pat - sparse-checkout-cone-mode: true - fetch-depth: 1 - - - id: select-copilot-pat - name: Select Copilot token from pool - uses: ./.github/actions/select-copilot-pat - env: - SECRET_0: ${{ secrets.COPILOT_PAT_0 }} - SECRET_1: ${{ secrets.COPILOT_PAT_1 }} - SECRET_2: ${{ secrets.COPILOT_PAT_2 }} - SECRET_3: ${{ secrets.COPILOT_PAT_3 }} - SECRET_4: ${{ secrets.COPILOT_PAT_4 }} - SECRET_5: ${{ secrets.COPILOT_PAT_5 }} - SECRET_6: ${{ secrets.COPILOT_PAT_6 }} - SECRET_7: ${{ secrets.COPILOT_PAT_7 }} - SECRET_8: ${{ secrets.COPILOT_PAT_8 }} - SECRET_9: ${{ secrets.COPILOT_PAT_9 }} - -# Add the pre-activation output of the randomly selected PAT -jobs: - pre-activation: - outputs: - copilot_pat_number: ${{ steps.select-copilot-pat.outputs.copilot_pat_number }} - -# Override the COPILOT_GITHUB_TOKEN expression used in the activation job -# Consume the PAT number from the pre-activation step and select the corresponding secret engine: id: copilot model: claude-opus-4.6 env: - # We cannot use line breaks in this expression as it leads to a syntax error in the compiled workflow - # If none of the `COPILOT_PAT_#` secrets were selected, then the default COPILOT_GITHUB_TOKEN is used - COPILOT_GITHUB_TOKEN: ${{ case(needs.pre_activation.outputs.copilot_pat_number == '0', secrets.COPILOT_PAT_0, needs.pre_activation.outputs.copilot_pat_number == '1', secrets.COPILOT_PAT_1, needs.pre_activation.outputs.copilot_pat_number == '2', secrets.COPILOT_PAT_2, needs.pre_activation.outputs.copilot_pat_number == '3', secrets.COPILOT_PAT_3, needs.pre_activation.outputs.copilot_pat_number == '4', secrets.COPILOT_PAT_4, needs.pre_activation.outputs.copilot_pat_number == '5', secrets.COPILOT_PAT_5, needs.pre_activation.outputs.copilot_pat_number == '6', secrets.COPILOT_PAT_6, needs.pre_activation.outputs.copilot_pat_number == '7', secrets.COPILOT_PAT_7, needs.pre_activation.outputs.copilot_pat_number == '8', secrets.COPILOT_PAT_8, needs.pre_activation.outputs.copilot_pat_number == '9', secrets.COPILOT_PAT_9, secrets.COPILOT_GITHUB_TOKEN) }} + COPILOT_GITHUB_TOKEN: ${{ case(needs.pat_pool.outputs.pat_number == '0', secrets.COPILOT_PAT_0, needs.pat_pool.outputs.pat_number == '1', secrets.COPILOT_PAT_1, needs.pat_pool.outputs.pat_number == '2', secrets.COPILOT_PAT_2, needs.pat_pool.outputs.pat_number == '3', secrets.COPILOT_PAT_3, needs.pat_pool.outputs.pat_number == '4', secrets.COPILOT_PAT_4, needs.pat_pool.outputs.pat_number == '5', secrets.COPILOT_PAT_5, needs.pat_pool.outputs.pat_number == '6', secrets.COPILOT_PAT_6, needs.pat_pool.outputs.pat_number == '7', secrets.COPILOT_PAT_7, needs.pat_pool.outputs.pat_number == '8', secrets.COPILOT_PAT_8, needs.pat_pool.outputs.pat_number == '9', secrets.COPILOT_PAT_9, secrets.COPILOT_GITHUB_TOKEN) }} --- # Code Review diff --git a/.github/workflows/copilot-echo.lock.yml b/.github/workflows/copilot-echo.lock.yml index 8fee66da4b665f..eee1e795506bc0 100644 --- a/.github/workflows/copilot-echo.lock.yml +++ b/.github/workflows/copilot-echo.lock.yml @@ -1,3 +1,5 @@ +# gh-aw-metadata: {"schema_version":"v3","frontmatter_hash":"c0ae5c27e5de8019e469faf9eca9e75024ceef447f1e5240eb3c53c8dedd0e7c","compiler_version":"v0.71.5","strict":true,"agent_id":"copilot"} +# gh-aw-manifest: {"version":1,"secrets":["COPILOT_GITHUB_TOKEN","COPILOT_PAT_0","COPILOT_PAT_1","COPILOT_PAT_2","COPILOT_PAT_3","COPILOT_PAT_4","COPILOT_PAT_5","COPILOT_PAT_6","COPILOT_PAT_7","COPILOT_PAT_8","COPILOT_PAT_9","GH_AW_GITHUB_MCP_SERVER_TOKEN","GH_AW_GITHUB_TOKEN","GITHUB_TOKEN"],"actions":[{"repo":"actions/checkout","sha":"de0fac2e4500dabe0009e67214ff5f5447ce83dd","version":"v6.0.2"},{"repo":"actions/download-artifact","sha":"3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c","version":"v8.0.1"},{"repo":"actions/github-script","sha":"373c709c69115d41ff229c7e5df9f8788daa9553","version":"v9"},{"repo":"actions/github-script","sha":"3a2844b7e9c422d3c10d287c895573f7108da1b3","version":"v9.0.0"},{"repo":"actions/setup-node","sha":"48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e","version":"v6.4.0"},{"repo":"actions/upload-artifact","sha":"043fb46d1a93c77aae656e7c1c64a875d1fc6a0a","version":"v7.0.1"},{"repo":"github/gh-aw-actions/setup","sha":"b8068426813005612b960b5ab0b8bd2c27142323","version":"v0.71.5"}],"containers":[{"image":"ghcr.io/github/gh-aw-firewall/agent:0.25.40","digest":"sha256:14ff567e8d9d4c2fbc5e55c973488381c71d7e0fdbe72d30ee7b8a738fd86504","pinned_image":"ghcr.io/github/gh-aw-firewall/agent:0.25.40@sha256:14ff567e8d9d4c2fbc5e55c973488381c71d7e0fdbe72d30ee7b8a738fd86504"},{"image":"ghcr.io/github/gh-aw-firewall/api-proxy:0.25.40","digest":"sha256:2883ca3e5ae9f330cafdd9345bfd4ae17fc8da36c96d4c9a1f76e922b4c45280","pinned_image":"ghcr.io/github/gh-aw-firewall/api-proxy:0.25.40@sha256:2883ca3e5ae9f330cafdd9345bfd4ae17fc8da36c96d4c9a1f76e922b4c45280"},{"image":"ghcr.io/github/gh-aw-firewall/squid:0.25.40","digest":"sha256:b084f4a2c771f584ee68084ced52fa6b3245197a1889645d817462d307d3ac51","pinned_image":"ghcr.io/github/gh-aw-firewall/squid:0.25.40@sha256:b084f4a2c771f584ee68084ced52fa6b3245197a1889645d817462d307d3ac51"},{"image":"ghcr.io/github/gh-aw-mcpg:v0.3.6","digest":"sha256:2bb8eef86006a4c5963c55616a9c51c32f27bfdecb023b8aa6f91f6718d9171c","pinned_image":"ghcr.io/github/gh-aw-mcpg:v0.3.6@sha256:2bb8eef86006a4c5963c55616a9c51c32f27bfdecb023b8aa6f91f6718d9171c"},{"image":"ghcr.io/github/github-mcp-server:v1.0.3","digest":"sha256:2ac27ef03461ef2b877031b838a7d1fd7f12b12d4ace7796d8cad91446d55959","pinned_image":"ghcr.io/github/github-mcp-server:v1.0.3@sha256:2ac27ef03461ef2b877031b838a7d1fd7f12b12d4ace7796d8cad91446d55959"},{"image":"node:lts-alpine","digest":"sha256:d1b3b4da11eefd5941e7f0b9cf17783fc99d9c6fc34884a665f40a06dbdfc94f","pinned_image":"node:lts-alpine@sha256:d1b3b4da11eefd5941e7f0b9cf17783fc99d9c6fc34884a665f40a06dbdfc94f"}]} # ___ _ _ # / _ \ | | (_) # | |_| | __ _ ___ _ __ | |_ _ ___ @@ -12,7 +14,7 @@ # \ /\ / (_) | | | | ( | | | | (_) \ V V /\__ \ # \/ \/ \___/|_| |_|\_\|_| |_|\___/ \_/\_/ |___/ # -# This file was automatically generated by gh-aw (v0.63.0). DO NOT EDIT. +# This file was automatically generated by gh-aw (v0.71.5). DO NOT EDIT. # # To update this file, edit the corresponding .md file and run: # gh aw compile @@ -21,37 +23,51 @@ # For more information: https://github.github.com/gh-aw/introduction/overview/ # # -# gh-aw-metadata: {"schema_version":"v3","frontmatter_hash":"3e01aa554f7981b207b0f9db5e4da695f42a1c34a3b84cf975a8369bff1edd06","compiler_version":"v0.63.0","strict":true,"agent_id":"copilot"} +# Resolved workflow manifest: +# Imports: +# - shared/pat_pool.md +# +# Secrets used: +# - COPILOT_GITHUB_TOKEN +# - COPILOT_PAT_0 +# - COPILOT_PAT_1 +# - COPILOT_PAT_2 +# - COPILOT_PAT_3 +# - COPILOT_PAT_4 +# - COPILOT_PAT_5 +# - COPILOT_PAT_6 +# - COPILOT_PAT_7 +# - COPILOT_PAT_8 +# - COPILOT_PAT_9 +# - GH_AW_GITHUB_MCP_SERVER_TOKEN +# - GH_AW_GITHUB_TOKEN +# - GITHUB_TOKEN +# +# Custom actions used: +# - actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 +# - actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 +# - actions/github-script@373c709c69115d41ff229c7e5df9f8788daa9553 # v9 +# - actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 +# - actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 +# - actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 +# - github/gh-aw-actions/setup@b8068426813005612b960b5ab0b8bd2c27142323 # v0.71.5 +# +# Container images used: +# - ghcr.io/github/gh-aw-firewall/agent:0.25.40@sha256:14ff567e8d9d4c2fbc5e55c973488381c71d7e0fdbe72d30ee7b8a738fd86504 +# - ghcr.io/github/gh-aw-firewall/api-proxy:0.25.40@sha256:2883ca3e5ae9f330cafdd9345bfd4ae17fc8da36c96d4c9a1f76e922b4c45280 +# - ghcr.io/github/gh-aw-firewall/squid:0.25.40@sha256:b084f4a2c771f584ee68084ced52fa6b3245197a1889645d817462d307d3ac51 +# - ghcr.io/github/gh-aw-mcpg:v0.3.6@sha256:2bb8eef86006a4c5963c55616a9c51c32f27bfdecb023b8aa6f91f6718d9171c +# - ghcr.io/github/github-mcp-server:v1.0.3@sha256:2ac27ef03461ef2b877031b838a7d1fd7f12b12d4ace7796d8cad91446d55959 +# - node:lts-alpine@sha256:d1b3b4da11eefd5941e7f0b9cf17783fc99d9c6fc34884a665f40a06dbdfc94f name: "Copilot Echo" "on": - # steps: # Steps injected into pre-activation job - # - name: Checkout the select-copilot-pat action folder - # uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd - # with: - # fetch-depth: 1 - # persist-credentials: false - # sparse-checkout: .github/actions/select-copilot-pat - # sparse-checkout-cone-mode: true - # - env: - # SECRET_0: ${{ secrets.COPILOT_PAT_0 }} - # SECRET_1: ${{ secrets.COPILOT_PAT_1 }} - # SECRET_2: ${{ secrets.COPILOT_PAT_2 }} - # SECRET_3: ${{ secrets.COPILOT_PAT_3 }} - # SECRET_4: ${{ secrets.COPILOT_PAT_4 }} - # SECRET_5: ${{ secrets.COPILOT_PAT_5 }} - # SECRET_6: ${{ secrets.COPILOT_PAT_6 }} - # SECRET_7: ${{ secrets.COPILOT_PAT_7 }} - # SECRET_8: ${{ secrets.COPILOT_PAT_8 }} - # SECRET_9: ${{ secrets.COPILOT_PAT_9 }} - # id: select-copilot-pat - # name: Select Copilot token from pool - # uses: ./.github/actions/select-copilot-pat + # permissions: {} # Permissions applied to pre-activation job workflow_dispatch: inputs: aw_context: default: "" - description: (Internal) JSON context injected by the calling agentic workflow. Not intended for direct user input. + description: Agent caller context (used internally by Agentic Workflows). required: false type: string message: @@ -68,53 +84,66 @@ run-name: "Copilot Echo" jobs: activation: - needs: pre_activation + needs: + - pat_pool + - pre_activation if: needs.pre_activation.outputs.activated == 'true' runs-on: ubuntu-slim permissions: + actions: read contents: read outputs: comment_id: "" comment_repo: "" + engine_id: ${{ steps.generate_aw_info.outputs.engine_id }} lockdown_check_failed: ${{ steps.generate_aw_info.outputs.lockdown_check_failed == 'true' }} model: ${{ steps.generate_aw_info.outputs.model }} secret_verification_result: ${{ steps.validate-secret.outputs.verification_result }} + setup-trace-id: ${{ steps.setup.outputs.trace-id }} + stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} steps: - name: Setup Scripts - uses: github/gh-aw-actions/setup@536ea1bad8c6715d098a9dc1afea8d403733acfe # v0.65.4 + id: setup + uses: github/gh-aw-actions/setup@b8068426813005612b960b5ab0b8bd2c27142323 # v0.71.5 with: destination: ${{ runner.temp }}/gh-aw/actions + job-name: ${{ github.job }} + trace-id: ${{ needs.pre_activation.outputs.setup-trace-id }} + env: + GH_AW_SETUP_WORKFLOW_NAME: "Copilot Echo" + GH_AW_CURRENT_WORKFLOW_REF: ${{ github.repository }}/.github/workflows/copilot-echo.lock.yml@${{ github.ref }} + GH_AW_INFO_VERSION: "1.0.40" - name: Generate agentic run info id: generate_aw_info env: GH_AW_INFO_ENGINE_ID: "copilot" GH_AW_INFO_ENGINE_NAME: "GitHub Copilot CLI" - GH_AW_INFO_MODEL: ${{ vars.GH_AW_MODEL_AGENT_COPILOT || 'auto' }} - GH_AW_INFO_VERSION: "latest" - GH_AW_INFO_AGENT_VERSION: "latest" - GH_AW_INFO_CLI_VERSION: "v0.63.0" + GH_AW_INFO_MODEL: ${{ vars.GH_AW_MODEL_AGENT_COPILOT || 'claude-sonnet-4.6' }} + GH_AW_INFO_VERSION: "1.0.40" + GH_AW_INFO_AGENT_VERSION: "1.0.40" + GH_AW_INFO_CLI_VERSION: "v0.71.5" GH_AW_INFO_WORKFLOW_NAME: "Copilot Echo" GH_AW_INFO_EXPERIMENTAL: "false" GH_AW_INFO_SUPPORTS_TOOLS_ALLOWLIST: "true" GH_AW_INFO_STAGED: "false" GH_AW_INFO_ALLOWED_DOMAINS: '["defaults"]' GH_AW_INFO_FIREWALL_ENABLED: "true" - GH_AW_INFO_AWF_VERSION: "v0.25.0" + GH_AW_INFO_AWF_VERSION: "v0.25.40" GH_AW_INFO_AWMG_VERSION: "" GH_AW_INFO_FIREWALL_TYPE: "squid" GH_AW_COMPILED_STRICT: "true" - uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8 + uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 with: script: | const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); - setupGlobals(core, github, context, exec, io); + setupGlobals(core, github, context, exec, io, getOctokit); const { main } = require('${{ runner.temp }}/gh-aw/actions/generate_aw_info.cjs'); await main(core, context); - name: Validate COPILOT_GITHUB_TOKEN secret id: validate-secret - run: ${RUNNER_TEMP}/gh-aw/actions/validate_multi_secret.sh COPILOT_GITHUB_TOKEN 'GitHub Copilot CLI' https://github.github.com/gh-aw/reference/engines/#github-copilot-default + run: bash "${RUNNER_TEMP}/gh-aw/actions/validate_multi_secret.sh" COPILOT_GITHUB_TOKEN 'GitHub Copilot CLI' https://github.github.com/gh-aw/reference/engines/#github-copilot-default env: - COPILOT_GITHUB_TOKEN: ${{ case(needs.pre_activation.outputs.copilot_pat_number == '0', secrets.COPILOT_PAT_0, needs.pre_activation.outputs.copilot_pat_number == '1', secrets.COPILOT_PAT_1, needs.pre_activation.outputs.copilot_pat_number == '2', secrets.COPILOT_PAT_2, needs.pre_activation.outputs.copilot_pat_number == '3', secrets.COPILOT_PAT_3, needs.pre_activation.outputs.copilot_pat_number == '4', secrets.COPILOT_PAT_4, needs.pre_activation.outputs.copilot_pat_number == '5', secrets.COPILOT_PAT_5, needs.pre_activation.outputs.copilot_pat_number == '6', secrets.COPILOT_PAT_6, needs.pre_activation.outputs.copilot_pat_number == '7', secrets.COPILOT_PAT_7, needs.pre_activation.outputs.copilot_pat_number == '8', secrets.COPILOT_PAT_8, needs.pre_activation.outputs.copilot_pat_number == '9', secrets.COPILOT_PAT_9, secrets.COPILOT_GITHUB_TOKEN) }} + COPILOT_GITHUB_TOKEN: ${{ case(needs.pat_pool.outputs.pat_number == '0', secrets.COPILOT_PAT_0, needs.pat_pool.outputs.pat_number == '1', secrets.COPILOT_PAT_1, needs.pat_pool.outputs.pat_number == '2', secrets.COPILOT_PAT_2, needs.pat_pool.outputs.pat_number == '3', secrets.COPILOT_PAT_3, needs.pat_pool.outputs.pat_number == '4', secrets.COPILOT_PAT_4, needs.pat_pool.outputs.pat_number == '5', secrets.COPILOT_PAT_5, needs.pat_pool.outputs.pat_number == '6', secrets.COPILOT_PAT_6, needs.pat_pool.outputs.pat_number == '7', secrets.COPILOT_PAT_7, needs.pat_pool.outputs.pat_number == '8', secrets.COPILOT_PAT_8, needs.pat_pool.outputs.pat_number == '9', secrets.COPILOT_PAT_9, secrets.COPILOT_GITHUB_TOKEN) }} - name: Checkout .github and .agents folders uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: @@ -122,18 +151,42 @@ jobs: sparse-checkout: | .github .agents + .claude + .codex + .crush + .gemini + .opencode + .pi sparse-checkout-cone-mode: true fetch-depth: 1 - - name: Check workflow file timestamps - uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8 + - name: Save agent config folders for base branch restoration + env: + GH_AW_AGENT_FOLDERS: ".agents .claude .codex .crush .gemini .github .opencode .pi" + GH_AW_AGENT_FILES: ".crush.json AGENTS.md CLAUDE.md GEMINI.md PI.md opencode.jsonc" + # poutine:ignore untrusted_checkout_exec + run: bash "${RUNNER_TEMP}/gh-aw/actions/save_base_github_folders.sh" + - name: Check workflow lock file + id: check-lock-file + uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 env: GH_AW_WORKFLOW_FILE: "copilot-echo.lock.yml" + GH_AW_CONTEXT_WORKFLOW_REF: "${{ github.workflow_ref }}" with: script: | const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); - setupGlobals(core, github, context, exec, io); + setupGlobals(core, github, context, exec, io, getOctokit); const { main } = require('${{ runner.temp }}/gh-aw/actions/check_workflow_timestamp_api.cjs'); await main(); + - name: Check compile-agentic version + uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 + env: + GH_AW_COMPILED_VERSION: "v0.71.5" + with: + script: | + const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); + setupGlobals(core, github, context, exec, io, getOctokit); + const { main } = require('${{ runner.temp }}/gh-aw/actions/check_version_updates.cjs'); + await main(); - name: Create prompt with built-in context env: GH_AW_PROMPT: /tmp/gh-aw/aw-prompts/prompt.txt @@ -147,23 +200,27 @@ jobs: GH_AW_GITHUB_REPOSITORY: ${{ github.repository }} GH_AW_GITHUB_RUN_ID: ${{ github.run_id }} GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }} + # poutine:ignore untrusted_checkout_exec run: | - bash ${RUNNER_TEMP}/gh-aw/actions/create_prompt_first.sh + bash "${RUNNER_TEMP}/gh-aw/actions/create_prompt_first.sh" { - cat << 'GH_AW_PROMPT_EOF' + cat << 'GH_AW_PROMPT_15bad247f73b555a_EOF' - GH_AW_PROMPT_EOF + GH_AW_PROMPT_15bad247f73b555a_EOF cat "${RUNNER_TEMP}/gh-aw/prompts/xpia.md" cat "${RUNNER_TEMP}/gh-aw/prompts/temp_folder_prompt.md" cat "${RUNNER_TEMP}/gh-aw/prompts/markdown.md" cat "${RUNNER_TEMP}/gh-aw/prompts/safe_outputs_prompt.md" - cat << 'GH_AW_PROMPT_EOF' + cat << 'GH_AW_PROMPT_15bad247f73b555a_EOF' Tools: create_issue, missing_tool, missing_data, noop - GH_AW_PROMPT_EOF + GH_AW_PROMPT_15bad247f73b555a_EOF cat "${RUNNER_TEMP}/gh-aw/prompts/safe_outputs_auto_create_issue.md" - cat << 'GH_AW_PROMPT_EOF' + cat << 'GH_AW_PROMPT_15bad247f73b555a_EOF' + GH_AW_PROMPT_15bad247f73b555a_EOF + cat "${RUNNER_TEMP}/gh-aw/prompts/mcp_cli_tools_prompt.md" + cat << 'GH_AW_PROMPT_15bad247f73b555a_EOF' The following GitHub context information is available for this workflow: {{#if __GH_AW_GITHUB_ACTOR__ }} @@ -192,28 +249,27 @@ jobs: {{/if}} - GH_AW_PROMPT_EOF + GH_AW_PROMPT_15bad247f73b555a_EOF cat "${RUNNER_TEMP}/gh-aw/prompts/github_mcp_tools_with_safeoutputs_prompt.md" - cat << 'GH_AW_PROMPT_EOF' + cat << 'GH_AW_PROMPT_15bad247f73b555a_EOF' - GH_AW_PROMPT_EOF - cat << 'GH_AW_PROMPT_EOF' {{#runtime-import .github/workflows/copilot-echo.md}} - GH_AW_PROMPT_EOF + GH_AW_PROMPT_15bad247f73b555a_EOF } > "$GH_AW_PROMPT" - name: Interpolate variables and render templates - uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8 + uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 env: GH_AW_PROMPT: /tmp/gh-aw/aw-prompts/prompt.txt + GH_AW_ENGINE_ID: "copilot" GH_AW_GITHUB_EVENT_INPUTS_MESSAGE: ${{ github.event.inputs.message }} with: script: | const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); - setupGlobals(core, github, context, exec, io); + setupGlobals(core, github, context, exec, io, getOctokit); const { main } = require('${{ runner.temp }}/gh-aw/actions/interpolate_prompt.cjs'); await main(); - name: Substitute placeholders - uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8 + uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 env: GH_AW_PROMPT: /tmp/gh-aw/aw-prompts/prompt.txt GH_AW_GITHUB_ACTOR: ${{ github.actor }} @@ -225,11 +281,12 @@ jobs: GH_AW_GITHUB_REPOSITORY: ${{ github.repository }} GH_AW_GITHUB_RUN_ID: ${{ github.run_id }} GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }} + GH_AW_MCP_CLI_SERVERS_LIST: '- `safeoutputs` — run `safeoutputs --help` to see available tools' GH_AW_NEEDS_PRE_ACTIVATION_OUTPUTS_ACTIVATED: ${{ needs.pre_activation.outputs.activated }} with: script: | const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); - setupGlobals(core, github, context, exec, io); + setupGlobals(core, github, context, exec, io, getOctokit); const substitutePlaceholders = require('${{ runner.temp }}/gh-aw/actions/substitute_placeholders.cjs'); @@ -246,29 +303,38 @@ jobs: GH_AW_GITHUB_REPOSITORY: process.env.GH_AW_GITHUB_REPOSITORY, GH_AW_GITHUB_RUN_ID: process.env.GH_AW_GITHUB_RUN_ID, GH_AW_GITHUB_WORKSPACE: process.env.GH_AW_GITHUB_WORKSPACE, + GH_AW_MCP_CLI_SERVERS_LIST: process.env.GH_AW_MCP_CLI_SERVERS_LIST, GH_AW_NEEDS_PRE_ACTIVATION_OUTPUTS_ACTIVATED: process.env.GH_AW_NEEDS_PRE_ACTIVATION_OUTPUTS_ACTIVATED } }); - name: Validate prompt placeholders env: GH_AW_PROMPT: /tmp/gh-aw/aw-prompts/prompt.txt - run: bash ${RUNNER_TEMP}/gh-aw/actions/validate_prompt_placeholders.sh + # poutine:ignore untrusted_checkout_exec + run: bash "${RUNNER_TEMP}/gh-aw/actions/validate_prompt_placeholders.sh" - name: Print prompt env: GH_AW_PROMPT: /tmp/gh-aw/aw-prompts/prompt.txt - run: bash ${RUNNER_TEMP}/gh-aw/actions/print_prompt_summary.sh + # poutine:ignore untrusted_checkout_exec + run: bash "${RUNNER_TEMP}/gh-aw/actions/print_prompt_summary.sh" - name: Upload activation artifact if: success() - uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7 + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 with: name: activation + include-hidden-files: true path: | /tmp/gh-aw/aw_info.json /tmp/gh-aw/aw-prompts/prompt.txt + /tmp/gh-aw/github_rate_limits.jsonl + /tmp/gh-aw/base + if-no-files-found: ignore retention-days: 1 agent: - needs: activation + needs: + - activation + - pat_pool runs-on: ubuntu-latest permissions: contents: read @@ -280,70 +346,83 @@ jobs: GH_AW_MCP_LOG_DIR: /tmp/gh-aw/mcp-logs/safeoutputs GH_AW_WORKFLOW_ID_SANITIZED: copilotecho outputs: + agentic_engine_timeout: ${{ steps.detect-copilot-errors.outputs.agentic_engine_timeout || 'false' }} checkout_pr_success: ${{ steps.checkout-pr.outputs.checkout_pr_success || 'true' }} - detection_conclusion: ${{ steps.detection_conclusion.outputs.conclusion }} - detection_success: ${{ steps.detection_conclusion.outputs.success }} + effective_tokens: ${{ steps.parse-mcp-gateway.outputs.effective_tokens }} has_patch: ${{ steps.collect_output.outputs.has_patch }} - inference_access_error: ${{ steps.detect-inference-error.outputs.inference_access_error || 'false' }} + inference_access_error: ${{ steps.detect-copilot-errors.outputs.inference_access_error || 'false' }} + mcp_policy_error: ${{ steps.detect-copilot-errors.outputs.mcp_policy_error || 'false' }} model: ${{ needs.activation.outputs.model }} + model_not_supported_error: ${{ steps.detect-copilot-errors.outputs.model_not_supported_error || 'false' }} output: ${{ steps.collect_output.outputs.output }} output_types: ${{ steps.collect_output.outputs.output_types }} + setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Setup Scripts - uses: github/gh-aw-actions/setup@536ea1bad8c6715d098a9dc1afea8d403733acfe # v0.65.4 + id: setup + uses: github/gh-aw-actions/setup@b8068426813005612b960b5ab0b8bd2c27142323 # v0.71.5 with: destination: ${{ runner.temp }}/gh-aw/actions + job-name: ${{ github.job }} + trace-id: ${{ needs.activation.outputs.setup-trace-id }} + env: + GH_AW_SETUP_WORKFLOW_NAME: "Copilot Echo" + GH_AW_CURRENT_WORKFLOW_REF: ${{ github.repository }}/.github/workflows/copilot-echo.lock.yml@${{ github.ref }} + GH_AW_INFO_VERSION: "1.0.40" - name: Set runtime paths id: set-runtime-paths run: | - echo "GH_AW_SAFE_OUTPUTS=${RUNNER_TEMP}/gh-aw/safeoutputs/outputs.jsonl" >> "$GITHUB_OUTPUT" - echo "GH_AW_SAFE_OUTPUTS_CONFIG_PATH=${RUNNER_TEMP}/gh-aw/safeoutputs/config.json" >> "$GITHUB_OUTPUT" - echo "GH_AW_SAFE_OUTPUTS_TOOLS_PATH=${RUNNER_TEMP}/gh-aw/safeoutputs/tools.json" >> "$GITHUB_OUTPUT" + { + echo "GH_AW_SAFE_OUTPUTS=${RUNNER_TEMP}/gh-aw/safeoutputs/outputs.jsonl" + echo "GH_AW_SAFE_OUTPUTS_CONFIG_PATH=${RUNNER_TEMP}/gh-aw/safeoutputs/config.json" + echo "GH_AW_SAFE_OUTPUTS_TOOLS_PATH=${RUNNER_TEMP}/gh-aw/safeoutputs/tools.json" + } >> "$GITHUB_OUTPUT" - name: Checkout repository uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: persist-credentials: false - name: Create gh-aw temp directory - run: bash ${RUNNER_TEMP}/gh-aw/actions/create_gh_aw_tmp_dir.sh + run: bash "${RUNNER_TEMP}/gh-aw/actions/create_gh_aw_tmp_dir.sh" - name: Configure gh CLI for GitHub Enterprise - run: bash ${RUNNER_TEMP}/gh-aw/actions/configure_gh_for_ghe.sh + run: bash "${RUNNER_TEMP}/gh-aw/actions/configure_gh_for_ghe.sh" env: GH_TOKEN: ${{ github.token }} - name: Configure Git credentials env: REPO_NAME: ${{ github.repository }} SERVER_URL: ${{ github.server_url }} + GITHUB_TOKEN: ${{ github.token }} run: | git config --global user.email "github-actions[bot]@users.noreply.github.com" git config --global user.name "github-actions[bot]" git config --global am.keepcr true # Re-authenticate git with GitHub token SERVER_URL_STRIPPED="${SERVER_URL#https://}" - git remote set-url origin "https://x-access-token:${{ github.token }}@${SERVER_URL_STRIPPED}/${REPO_NAME}.git" + git remote set-url origin "https://x-access-token:${GITHUB_TOKEN}@${SERVER_URL_STRIPPED}/${REPO_NAME}.git" echo "Git configured with standard GitHub Actions identity" - name: Checkout PR branch id: checkout-pr if: | github.event.pull_request || github.event.issue.pull_request - uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8 + uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 env: GH_TOKEN: ${{ secrets.GH_AW_GITHUB_MCP_SERVER_TOKEN || secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} with: github-token: ${{ secrets.GH_AW_GITHUB_MCP_SERVER_TOKEN || secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} script: | const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); - setupGlobals(core, github, context, exec, io); + setupGlobals(core, github, context, exec, io, getOctokit); const { main } = require('${{ runner.temp }}/gh-aw/actions/checkout_pr_branch.cjs'); await main(); - name: Install GitHub Copilot CLI - run: ${RUNNER_TEMP}/gh-aw/actions/install_copilot_cli.sh latest + run: bash "${RUNNER_TEMP}/gh-aw/actions/install_copilot_cli.sh" 1.0.40 env: GH_HOST: github.com - name: Install AWF binary - run: bash ${RUNNER_TEMP}/gh-aw/actions/install_awf_binary.sh v0.25.0 + run: bash "${RUNNER_TEMP}/gh-aw/actions/install_awf_binary.sh" v0.25.40 - name: Determine automatic lockdown mode for GitHub MCP Server id: determine-automatic-lockdown - uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8 + uses: actions/github-script@373c709c69115d41ff229c7e5df9f8788daa9553 # v9 env: GH_AW_GITHUB_TOKEN: ${{ secrets.GH_AW_GITHUB_TOKEN }} GH_AW_GITHUB_MCP_SERVER_TOKEN: ${{ secrets.GH_AW_GITHUB_MCP_SERVER_TOKEN }} @@ -351,122 +430,153 @@ jobs: script: | const determineAutomaticLockdown = require('${{ runner.temp }}/gh-aw/actions/determine_automatic_lockdown.cjs'); await determineAutomaticLockdown(github, context, core); + - name: Download activation artifact + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 + with: + name: activation + path: /tmp/gh-aw + - name: Restore agent config folders from base branch + if: steps.checkout-pr.outcome == 'success' + env: + GH_AW_AGENT_FOLDERS: ".agents .claude .codex .crush .gemini .github .opencode .pi" + GH_AW_AGENT_FILES: ".crush.json AGENTS.md CLAUDE.md GEMINI.md PI.md opencode.jsonc" + run: bash "${RUNNER_TEMP}/gh-aw/actions/restore_base_github_folders.sh" - name: Download container images - run: bash ${RUNNER_TEMP}/gh-aw/actions/download_docker_images.sh ghcr.io/github/gh-aw-firewall/agent:0.25.0 ghcr.io/github/gh-aw-firewall/api-proxy:0.25.0 ghcr.io/github/gh-aw-firewall/squid:0.25.0 ghcr.io/github/gh-aw-mcpg:v0.2.2 ghcr.io/github/github-mcp-server:v0.32.0 node:lts-alpine - - name: Write Safe Outputs Config + run: bash "${RUNNER_TEMP}/gh-aw/actions/download_docker_images.sh" ghcr.io/github/gh-aw-firewall/agent:0.25.40@sha256:14ff567e8d9d4c2fbc5e55c973488381c71d7e0fdbe72d30ee7b8a738fd86504 ghcr.io/github/gh-aw-firewall/api-proxy:0.25.40@sha256:2883ca3e5ae9f330cafdd9345bfd4ae17fc8da36c96d4c9a1f76e922b4c45280 ghcr.io/github/gh-aw-firewall/squid:0.25.40@sha256:b084f4a2c771f584ee68084ced52fa6b3245197a1889645d817462d307d3ac51 ghcr.io/github/gh-aw-mcpg:v0.3.6@sha256:2bb8eef86006a4c5963c55616a9c51c32f27bfdecb023b8aa6f91f6718d9171c ghcr.io/github/github-mcp-server:v1.0.3@sha256:2ac27ef03461ef2b877031b838a7d1fd7f12b12d4ace7796d8cad91446d55959 node:lts-alpine@sha256:d1b3b4da11eefd5941e7f0b9cf17783fc99d9c6fc34884a665f40a06dbdfc94f + - name: Generate Safe Outputs Config run: | - mkdir -p ${RUNNER_TEMP}/gh-aw/safeoutputs + mkdir -p "${RUNNER_TEMP}/gh-aw/safeoutputs" mkdir -p /tmp/gh-aw/safeoutputs mkdir -p /tmp/gh-aw/mcp-logs/safeoutputs - cat > ${RUNNER_TEMP}/gh-aw/safeoutputs/config.json << 'GH_AW_SAFE_OUTPUTS_CONFIG_EOF' - {"create_issue":{"max":1},"missing_data":{},"missing_tool":{},"noop":{"max":1}} - GH_AW_SAFE_OUTPUTS_CONFIG_EOF - - name: Write Safe Outputs Tools - run: | - cat > ${RUNNER_TEMP}/gh-aw/safeoutputs/tools_meta.json << 'GH_AW_SAFE_OUTPUTS_TOOLS_META_EOF' - { - "description_suffixes": { - "create_issue": " CONSTRAINTS: Maximum 1 issue(s) can be created. Title will be prefixed with \"[copilot-echo]\". Labels [\"copilot-echo\"] will be automatically added." - }, - "repo_params": {}, - "dynamic_tools": [] - } - GH_AW_SAFE_OUTPUTS_TOOLS_META_EOF - cat > ${RUNNER_TEMP}/gh-aw/safeoutputs/validation.json << 'GH_AW_SAFE_OUTPUTS_VALIDATION_EOF' - { - "create_issue": { - "defaultMax": 1, - "fields": { - "body": { - "required": true, - "type": "string", - "sanitize": true, - "maxLength": 65000 - }, - "labels": { - "type": "array", - "itemType": "string", - "itemSanitize": true, - "itemMaxLength": 128 - }, - "parent": { - "issueOrPRNumber": true - }, - "repo": { - "type": "string", - "maxLength": 256 - }, - "temporary_id": { - "type": "string" - }, - "title": { - "required": true, - "type": "string", - "sanitize": true, - "maxLength": 128 + cat > "${RUNNER_TEMP}/gh-aw/safeoutputs/config.json" << 'GH_AW_SAFE_OUTPUTS_CONFIG_311ca74d512ba193_EOF' + {"create_issue":{"labels":["copilot-echo"],"max":1,"title_prefix":"[copilot-echo]"},"create_report_incomplete_issue":{},"missing_data":{},"missing_tool":{},"noop":{"max":1,"report-as-issue":"false"},"report_incomplete":{}} + GH_AW_SAFE_OUTPUTS_CONFIG_311ca74d512ba193_EOF + - name: Generate Safe Outputs Tools + env: + GH_AW_TOOLS_META_JSON: | + { + "description_suffixes": { + "create_issue": " CONSTRAINTS: Maximum 1 issue(s) can be created. Title will be prefixed with \"[copilot-echo]\". Labels [\"copilot-echo\"] will be automatically added." + }, + "repo_params": {}, + "dynamic_tools": [] + } + GH_AW_VALIDATION_JSON: | + { + "create_issue": { + "defaultMax": 1, + "fields": { + "body": { + "required": true, + "type": "string", + "sanitize": true, + "maxLength": 65000 + }, + "labels": { + "type": "array", + "itemType": "string", + "itemSanitize": true, + "itemMaxLength": 128 + }, + "parent": { + "issueOrPRNumber": true + }, + "repo": { + "type": "string", + "maxLength": 256 + }, + "temporary_id": { + "type": "string" + }, + "title": { + "required": true, + "type": "string", + "sanitize": true, + "maxLength": 128 + } } - } - }, - "missing_data": { - "defaultMax": 20, - "fields": { - "alternatives": { - "type": "string", - "sanitize": true, - "maxLength": 256 - }, - "context": { - "type": "string", - "sanitize": true, - "maxLength": 256 - }, - "data_type": { - "type": "string", - "sanitize": true, - "maxLength": 128 - }, - "reason": { - "type": "string", - "sanitize": true, - "maxLength": 256 + }, + "missing_data": { + "defaultMax": 20, + "fields": { + "alternatives": { + "type": "string", + "sanitize": true, + "maxLength": 256 + }, + "context": { + "type": "string", + "sanitize": true, + "maxLength": 256 + }, + "data_type": { + "type": "string", + "sanitize": true, + "maxLength": 128 + }, + "reason": { + "type": "string", + "sanitize": true, + "maxLength": 256 + } } - } - }, - "missing_tool": { - "defaultMax": 20, - "fields": { - "alternatives": { - "type": "string", - "sanitize": true, - "maxLength": 512 - }, - "reason": { - "required": true, - "type": "string", - "sanitize": true, - "maxLength": 256 - }, - "tool": { - "type": "string", - "sanitize": true, - "maxLength": 128 + }, + "missing_tool": { + "defaultMax": 20, + "fields": { + "alternatives": { + "type": "string", + "sanitize": true, + "maxLength": 512 + }, + "reason": { + "required": true, + "type": "string", + "sanitize": true, + "maxLength": 256 + }, + "tool": { + "type": "string", + "sanitize": true, + "maxLength": 128 + } } - } - }, - "noop": { - "defaultMax": 1, - "fields": { - "message": { - "required": true, - "type": "string", - "sanitize": true, - "maxLength": 65000 + }, + "noop": { + "defaultMax": 1, + "fields": { + "message": { + "required": true, + "type": "string", + "sanitize": true, + "maxLength": 65000 + } + } + }, + "report_incomplete": { + "defaultMax": 5, + "fields": { + "details": { + "type": "string", + "sanitize": true, + "maxLength": 65000 + }, + "reason": { + "required": true, + "type": "string", + "sanitize": true, + "maxLength": 1024 + } } } } - } - GH_AW_SAFE_OUTPUTS_VALIDATION_EOF - node ${RUNNER_TEMP}/gh-aw/actions/generate_safe_outputs_tools.cjs + uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 + with: + script: | + const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); + setupGlobals(core, github, context, exec, io, getOctokit); + const { main } = require('${{ runner.temp }}/gh-aw/actions/generate_safe_outputs_tools.cjs'); + await main(); - name: Generate Safe Outputs MCP Server Config id: safe-outputs-config run: | @@ -489,6 +599,7 @@ jobs: id: safe-outputs-start env: DEBUG: '*' + GH_AW_SAFE_OUTPUTS: ${{ steps.set-runtime-paths.outputs.GH_AW_SAFE_OUTPUTS }} GH_AW_SAFE_OUTPUTS_PORT: ${{ steps.safe-outputs-config.outputs.safe_outputs_port }} GH_AW_SAFE_OUTPUTS_API_KEY: ${{ steps.safe-outputs-config.outputs.safe_outputs_api_key }} GH_AW_SAFE_OUTPUTS_TOOLS_PATH: ${{ runner.temp }}/gh-aw/safeoutputs/tools.json @@ -497,13 +608,14 @@ jobs: run: | # Environment variables are set above to prevent template injection export DEBUG + export GH_AW_SAFE_OUTPUTS export GH_AW_SAFE_OUTPUTS_PORT export GH_AW_SAFE_OUTPUTS_API_KEY export GH_AW_SAFE_OUTPUTS_TOOLS_PATH export GH_AW_SAFE_OUTPUTS_CONFIG_PATH export GH_AW_MCP_LOG_DIR - bash ${RUNNER_TEMP}/gh-aw/actions/start_safe_outputs_server.sh + bash "${RUNNER_TEMP}/gh-aw/actions/start_safe_outputs_server.sh" - name: Start MCP Gateway id: start-mcp-gateway @@ -516,11 +628,12 @@ jobs: GITHUB_MCP_SERVER_TOKEN: ${{ secrets.GH_AW_GITHUB_MCP_SERVER_TOKEN || secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} run: | set -eo pipefail - mkdir -p /tmp/gh-aw/mcp-config + mkdir -p "${RUNNER_TEMP}/gh-aw/mcp-config" # Export gateway environment variables for MCP config and gateway script - export MCP_GATEWAY_PORT="80" + export MCP_GATEWAY_PORT="8080" export MCP_GATEWAY_DOMAIN="host.docker.internal" + export MCP_GATEWAY_HOST_DOMAIN="localhost" MCP_GATEWAY_API_KEY=$(openssl rand -base64 45 | tr -d '/+=') echo "::add-mask::${MCP_GATEWAY_API_KEY}" export MCP_GATEWAY_API_KEY @@ -530,15 +643,19 @@ jobs: export DEBUG="*" export GH_AW_ENGINE="copilot" - export MCP_GATEWAY_DOCKER_COMMAND='docker run -i --rm --network host -v /var/run/docker.sock:/var/run/docker.sock -e MCP_GATEWAY_PORT -e MCP_GATEWAY_DOMAIN -e MCP_GATEWAY_API_KEY -e MCP_GATEWAY_PAYLOAD_DIR -e MCP_GATEWAY_PAYLOAD_SIZE_THRESHOLD -e DEBUG -e MCP_GATEWAY_LOG_DIR -e GH_AW_MCP_LOG_DIR -e GH_AW_SAFE_OUTPUTS -e GH_AW_SAFE_OUTPUTS_CONFIG_PATH -e GH_AW_SAFE_OUTPUTS_TOOLS_PATH -e GH_AW_ASSETS_BRANCH -e GH_AW_ASSETS_MAX_SIZE_KB -e GH_AW_ASSETS_ALLOWED_EXTS -e DEFAULT_BRANCH -e GITHUB_MCP_SERVER_TOKEN -e GITHUB_MCP_GUARD_MIN_INTEGRITY -e GITHUB_MCP_GUARD_REPOS -e GITHUB_REPOSITORY -e GITHUB_SERVER_URL -e GITHUB_SHA -e GITHUB_WORKSPACE -e GITHUB_TOKEN -e GITHUB_RUN_ID -e GITHUB_RUN_NUMBER -e GITHUB_RUN_ATTEMPT -e GITHUB_JOB -e GITHUB_ACTION -e GITHUB_EVENT_NAME -e GITHUB_EVENT_PATH -e GITHUB_ACTOR -e GITHUB_ACTOR_ID -e GITHUB_TRIGGERING_ACTOR -e GITHUB_WORKFLOW -e GITHUB_WORKFLOW_REF -e GITHUB_WORKFLOW_SHA -e GITHUB_REF -e GITHUB_REF_NAME -e GITHUB_REF_TYPE -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e GH_AW_SAFE_OUTPUTS_PORT -e GH_AW_SAFE_OUTPUTS_API_KEY -v /tmp/gh-aw/mcp-payloads:/tmp/gh-aw/mcp-payloads:rw -v /opt:/opt:ro -v /tmp:/tmp:rw -v '"${GITHUB_WORKSPACE}"':'"${GITHUB_WORKSPACE}"':rw ghcr.io/github/gh-aw-mcpg:v0.2.2' + MCP_GATEWAY_UID=$(id -u 2>/dev/null || echo '0') + MCP_GATEWAY_GID=$(id -g 2>/dev/null || echo '0') + DOCKER_SOCK_GID=$(stat -c '%g' /var/run/docker.sock 2>/dev/null || echo '0') + export MCP_GATEWAY_DOCKER_COMMAND='docker run -i --rm --network host --add-host host.docker.internal:127.0.0.1 --user '"${MCP_GATEWAY_UID}"':'"${MCP_GATEWAY_GID}"' --group-add '"${DOCKER_SOCK_GID}"' -v /var/run/docker.sock:/var/run/docker.sock -e MCP_GATEWAY_PORT -e MCP_GATEWAY_DOMAIN -e MCP_GATEWAY_API_KEY -e MCP_GATEWAY_PAYLOAD_DIR -e MCP_GATEWAY_PAYLOAD_SIZE_THRESHOLD -e DEBUG -e MCP_GATEWAY_LOG_DIR -e GH_AW_MCP_LOG_DIR -e GH_AW_SAFE_OUTPUTS -e GH_AW_SAFE_OUTPUTS_CONFIG_PATH -e GH_AW_SAFE_OUTPUTS_TOOLS_PATH -e GH_AW_ASSETS_BRANCH -e GH_AW_ASSETS_MAX_SIZE_KB -e GH_AW_ASSETS_ALLOWED_EXTS -e DEFAULT_BRANCH -e GITHUB_MCP_SERVER_TOKEN -e GITHUB_MCP_GUARD_MIN_INTEGRITY -e GITHUB_MCP_GUARD_REPOS -e GITHUB_REPOSITORY -e GITHUB_SERVER_URL -e GITHUB_SHA -e GITHUB_WORKSPACE -e GITHUB_TOKEN -e GITHUB_RUN_ID -e GITHUB_RUN_NUMBER -e GITHUB_RUN_ATTEMPT -e GITHUB_JOB -e GITHUB_ACTION -e GITHUB_EVENT_NAME -e GITHUB_EVENT_PATH -e GITHUB_ACTOR -e GITHUB_ACTOR_ID -e GITHUB_TRIGGERING_ACTOR -e GITHUB_WORKFLOW -e GITHUB_WORKFLOW_REF -e GITHUB_WORKFLOW_SHA -e GITHUB_REF -e GITHUB_REF_NAME -e GITHUB_REF_TYPE -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e GH_AW_SAFE_OUTPUTS_PORT -e GH_AW_SAFE_OUTPUTS_API_KEY -v /tmp/gh-aw/mcp-payloads:/tmp/gh-aw/mcp-payloads:rw -v /opt:/opt:ro -v /tmp:/tmp:rw -v '"${GITHUB_WORKSPACE}"':'"${GITHUB_WORKSPACE}"':rw ghcr.io/github/gh-aw-mcpg:v0.3.6' mkdir -p /home/runner/.copilot - cat << GH_AW_MCP_CONFIG_EOF | bash ${RUNNER_TEMP}/gh-aw/actions/start_mcp_gateway.sh + GH_AW_NODE=$(which node 2>/dev/null || command -v node 2>/dev/null || echo node) + cat << GH_AW_MCP_CONFIG_94b78bc4680211d8_EOF | "$GH_AW_NODE" "${RUNNER_TEMP}/gh-aw/actions/start_mcp_gateway.cjs" { "mcpServers": { "github": { "type": "stdio", - "container": "ghcr.io/github/github-mcp-server:v0.32.0", + "container": "ghcr.io/github/github-mcp-server:v1.0.3", "env": { "GITHUB_HOST": "\${GITHUB_SERVER_URL}", "GITHUB_PERSONAL_ACCESS_TOKEN": "\${GITHUB_MCP_SERVER_TOKEN}", @@ -574,15 +691,28 @@ jobs: "payloadDir": "${MCP_GATEWAY_PAYLOAD_DIR}" } } - GH_AW_MCP_CONFIG_EOF - - name: Download activation artifact - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 + GH_AW_MCP_CONFIG_94b78bc4680211d8_EOF + - name: Mount MCP servers as CLIs + id: mount-mcp-clis + continue-on-error: true + env: + MCP_GATEWAY_API_KEY: ${{ steps.start-mcp-gateway.outputs.gateway-api-key }} + MCP_GATEWAY_DOMAIN: ${{ steps.start-mcp-gateway.outputs.gateway-domain }} + MCP_GATEWAY_PORT: ${{ steps.start-mcp-gateway.outputs.gateway-port }} + uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 with: - name: activation - path: /tmp/gh-aw - - name: Clean git credentials + script: | + const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); + setupGlobals(core, github, context, exec, io); + const { main } = require('${{ runner.temp }}/gh-aw/actions/mount_mcp_as_cli.cjs'); + await main(); + - name: Clean credentials + continue-on-error: true + run: bash "${RUNNER_TEMP}/gh-aw/actions/clean_git_credentials.sh" + - name: Audit pre-agent workspace + id: pre_agent_audit continue-on-error: true - run: bash ${RUNNER_TEMP}/gh-aw/actions/clean_git_credentials.sh + run: bash "${RUNNER_TEMP}/gh-aw/actions/audit_pre_agent_workspace.sh" - name: Execute GitHub Copilot CLI id: agentic_execution # Copilot CLI tool arguments (sorted): @@ -590,20 +720,26 @@ jobs: run: | set -o pipefail touch /tmp/gh-aw/agent-step-summary.md + GH_AW_NODE_BIN=$(command -v node 2>/dev/null || true) + export GH_AW_NODE_BIN + (umask 177 && touch /tmp/gh-aw/agent-stdio.log) + printf '%s\n' '{"$schema":"https://github.com/github/gh-aw-firewall/releases/download/v0.25.40/awf-config.schema.json","network":{"allowDomains":["api.business.githubcopilot.com","api.enterprise.githubcopilot.com","api.github.com","api.githubcopilot.com","api.individual.githubcopilot.com","api.snapcraft.io","archive.ubuntu.com","azure.archive.ubuntu.com","crl.geotrust.com","crl.globalsign.com","crl.identrust.com","crl.sectigo.com","crl.thawte.com","crl.usertrust.com","crl.verisign.com","crl3.digicert.com","crl4.digicert.com","crls.ssl.com","github.com","host.docker.internal","json-schema.org","json.schemastore.org","keyserver.ubuntu.com","ocsp.digicert.com","ocsp.geotrust.com","ocsp.globalsign.com","ocsp.identrust.com","ocsp.sectigo.com","ocsp.ssl.com","ocsp.thawte.com","ocsp.usertrust.com","ocsp.verisign.com","packagecloud.io","packages.cloud.google.com","packages.microsoft.com","ppa.launchpad.net","raw.githubusercontent.com","registry.npmjs.org","s.symcb.com","s.symcd.com","security.ubuntu.com","telemetry.enterprise.githubcopilot.com","ts-crl.ws.symantec.com","ts-ocsp.ws.symantec.com","www.googleapis.com"]},"apiProxy":{"enabled":true,"models":{"auto":["large"],"deep-research":["copilot/deep-research*","google/deep-research*"],"gemini-flash":["copilot/gemini-*flash*","google/gemini-*flash*"],"gemini-pro":["copilot/gemini-*pro*","google/gemini-*pro*"],"gpt-4.1":["copilot/gpt-4.1*","openai/gpt-4.1*"],"gpt-5":["copilot/gpt-5*","openai/gpt-5*"],"gpt-5-codex":["copilot/gpt-5*codex*","openai/gpt-5*codex*"],"gpt-5-mini":["copilot/gpt-5*mini*","openai/gpt-5*mini*"],"gpt-5-nano":["copilot/gpt-5*nano*","openai/gpt-5*nano*"],"gpt-5-pro":["copilot/gpt-5*pro*","openai/gpt-5*pro*"],"haiku":["copilot/*haiku*","anthropic/*haiku*"],"large":["sonnet","gpt-5-pro","gpt-5","gemini-pro"],"mini":["haiku","gpt-5-mini","gpt-5-nano","gemini-flash"],"opus":["copilot/*opus*","anthropic/*opus*"],"reasoning":["copilot/o1*","copilot/o3*","copilot/o4*","openai/o1*","openai/o3*","openai/o4*"],"small":["mini"],"sonnet":["copilot/*sonnet*","anthropic/*sonnet*"]}},"container":{"imageTag":"0.25.40,squid=sha256:b084f4a2c771f584ee68084ced52fa6b3245197a1889645d817462d307d3ac51,agent=sha256:14ff567e8d9d4c2fbc5e55c973488381c71d7e0fdbe72d30ee7b8a738fd86504,api-proxy=sha256:2883ca3e5ae9f330cafdd9345bfd4ae17fc8da36c96d4c9a1f76e922b4c45280,cli-proxy=sha256:3e7152911d4b4b7b97beef9d3d7d924ff7902227e86001ef3838fb728d5d514c"}}' > "${RUNNER_TEMP}/gh-aw/awf-config.json" && cp "${RUNNER_TEMP}/gh-aw/awf-config.json" /tmp/gh-aw/awf-config.json # shellcheck disable=SC1003 - sudo -E awf --env-all --container-workdir "${GITHUB_WORKSPACE}" --mount "${RUNNER_TEMP}/gh-aw:${RUNNER_TEMP}/gh-aw:ro" --mount "${RUNNER_TEMP}/gh-aw:/host${RUNNER_TEMP}/gh-aw:ro" --allow-domains "api.business.githubcopilot.com,api.enterprise.githubcopilot.com,api.github.com,api.githubcopilot.com,api.individual.githubcopilot.com,api.snapcraft.io,archive.ubuntu.com,azure.archive.ubuntu.com,crl.geotrust.com,crl.globalsign.com,crl.identrust.com,crl.sectigo.com,crl.thawte.com,crl.usertrust.com,crl.verisign.com,crl3.digicert.com,crl4.digicert.com,crls.ssl.com,github.com,host.docker.internal,json-schema.org,json.schemastore.org,keyserver.ubuntu.com,ocsp.digicert.com,ocsp.geotrust.com,ocsp.globalsign.com,ocsp.identrust.com,ocsp.sectigo.com,ocsp.ssl.com,ocsp.thawte.com,ocsp.usertrust.com,ocsp.verisign.com,packagecloud.io,packages.cloud.google.com,packages.microsoft.com,ppa.launchpad.net,raw.githubusercontent.com,registry.npmjs.org,s.symcb.com,s.symcd.com,security.ubuntu.com,telemetry.enterprise.githubcopilot.com,ts-crl.ws.symantec.com,ts-ocsp.ws.symantec.com,www.googleapis.com" --log-level info --proxy-logs-dir /tmp/gh-aw/sandbox/firewall/logs --enable-host-access --image-tag 0.25.0 --skip-pull --enable-api-proxy \ - -- /bin/bash -c '/usr/local/bin/copilot --add-dir /tmp/gh-aw/ --log-level all --log-dir /tmp/gh-aw/sandbox/agent/logs/ --add-dir "${GITHUB_WORKSPACE}" --disable-builtin-mcps --allow-all-tools --allow-all-paths --prompt "$(cat /tmp/gh-aw/aw-prompts/prompt.txt)"' 2>&1 | tee -a /tmp/gh-aw/agent-stdio.log + sudo -E awf --config "${RUNNER_TEMP}/gh-aw/awf-config.json" --container-workdir "${GITHUB_WORKSPACE}" --mount "${RUNNER_TEMP}/gh-aw:${RUNNER_TEMP}/gh-aw:ro" --mount "${RUNNER_TEMP}/gh-aw:/host${RUNNER_TEMP}/gh-aw:ro" --env-all --exclude-env COPILOT_GITHUB_TOKEN --exclude-env GITHUB_MCP_SERVER_TOKEN --exclude-env MCP_GATEWAY_API_KEY --log-level info --proxy-logs-dir /tmp/gh-aw/sandbox/firewall/logs --audit-dir /tmp/gh-aw/sandbox/firewall/audit --enable-host-access --allow-host-ports 80,443,8080 --skip-pull \ + -- /bin/bash -c 'export PATH="${RUNNER_TEMP}/gh-aw/mcp-cli/bin:$PATH" && export PATH="$(find /opt/hostedtoolcache /home/runner/work/_tool -maxdepth 4 -type d -name bin 2>/dev/null | tr '\''\n'\'' '\'':'\'')$PATH"; [ -n "$GOROOT" ] && export PATH="$GOROOT/bin:$PATH" || true && GH_AW_NODE_EXEC="${GH_AW_NODE_BIN:-}"; if [ -z "$GH_AW_NODE_EXEC" ] || [ ! -x "$GH_AW_NODE_EXEC" ]; then GH_AW_NODE_EXEC="$(command -v node 2>/dev/null || echo node)"; fi; "$GH_AW_NODE_EXEC" ${RUNNER_TEMP}/gh-aw/actions/copilot_harness.cjs /usr/local/bin/copilot --add-dir /tmp/gh-aw/ --log-level all --log-dir /tmp/gh-aw/sandbox/agent/logs/ --disable-builtin-mcps --no-ask-user --allow-all-tools --allow-all-paths --add-dir "${GITHUB_WORKSPACE}" --prompt-file /tmp/gh-aw/aw-prompts/prompt.txt' 2>&1 | tee -a /tmp/gh-aw/agent-stdio.log env: COPILOT_AGENT_RUNNER_TYPE: STANDALONE - COPILOT_GITHUB_TOKEN: ${{ case(needs.pre_activation.outputs.copilot_pat_number == '0', secrets.COPILOT_PAT_0, needs.pre_activation.outputs.copilot_pat_number == '1', secrets.COPILOT_PAT_1, needs.pre_activation.outputs.copilot_pat_number == '2', secrets.COPILOT_PAT_2, needs.pre_activation.outputs.copilot_pat_number == '3', secrets.COPILOT_PAT_3, needs.pre_activation.outputs.copilot_pat_number == '4', secrets.COPILOT_PAT_4, needs.pre_activation.outputs.copilot_pat_number == '5', secrets.COPILOT_PAT_5, needs.pre_activation.outputs.copilot_pat_number == '6', secrets.COPILOT_PAT_6, needs.pre_activation.outputs.copilot_pat_number == '7', secrets.COPILOT_PAT_7, needs.pre_activation.outputs.copilot_pat_number == '8', secrets.COPILOT_PAT_8, needs.pre_activation.outputs.copilot_pat_number == '9', secrets.COPILOT_PAT_9, secrets.COPILOT_GITHUB_TOKEN) }} - COPILOT_MODEL: ${{ vars.GH_AW_MODEL_AGENT_COPILOT || '' }} + COPILOT_API_KEY: dummy-byok-key-for-offline-mode + COPILOT_GITHUB_TOKEN: ${{ case(needs.pat_pool.outputs.pat_number == '0', secrets.COPILOT_PAT_0, needs.pat_pool.outputs.pat_number == '1', secrets.COPILOT_PAT_1, needs.pat_pool.outputs.pat_number == '2', secrets.COPILOT_PAT_2, needs.pat_pool.outputs.pat_number == '3', secrets.COPILOT_PAT_3, needs.pat_pool.outputs.pat_number == '4', secrets.COPILOT_PAT_4, needs.pat_pool.outputs.pat_number == '5', secrets.COPILOT_PAT_5, needs.pat_pool.outputs.pat_number == '6', secrets.COPILOT_PAT_6, needs.pat_pool.outputs.pat_number == '7', secrets.COPILOT_PAT_7, needs.pat_pool.outputs.pat_number == '8', secrets.COPILOT_PAT_8, needs.pat_pool.outputs.pat_number == '9', secrets.COPILOT_PAT_9, secrets.COPILOT_GITHUB_TOKEN) }} + COPILOT_MODEL: ${{ vars.GH_AW_MODEL_AGENT_COPILOT || 'claude-sonnet-4.6' }} GH_AW_MCP_CONFIG: /home/runner/.copilot/mcp-config.json GH_AW_PHASE: agent GH_AW_PROMPT: /tmp/gh-aw/aw-prompts/prompt.txt GH_AW_SAFE_OUTPUTS: ${{ steps.set-runtime-paths.outputs.GH_AW_SAFE_OUTPUTS }} - GH_AW_VERSION: v0.63.0 + GH_AW_VERSION: v0.71.5 GITHUB_API_URL: ${{ github.api_url }} GITHUB_AW: true + GITHUB_COPILOT_INTEGRATION_ID: agentic-workflows GITHUB_HEAD_REF: ${{ github.head_ref }} GITHUB_MCP_SERVER_TOKEN: ${{ secrets.GH_AW_GITHUB_MCP_SERVER_TOKEN || secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} GITHUB_REF_NAME: ${{ github.ref_name }} @@ -615,40 +751,28 @@ jobs: GIT_COMMITTER_EMAIL: github-actions[bot]@users.noreply.github.com GIT_COMMITTER_NAME: github-actions[bot] XDG_CONFIG_HOME: /home/runner - - name: Detect inference access error - id: detect-inference-error + - name: Detect Copilot errors + id: detect-copilot-errors if: always() continue-on-error: true - run: bash ${RUNNER_TEMP}/gh-aw/actions/detect_inference_access_error.sh + run: node "${RUNNER_TEMP}/gh-aw/actions/detect_copilot_errors.cjs" - name: Configure Git credentials env: REPO_NAME: ${{ github.repository }} SERVER_URL: ${{ github.server_url }} + GITHUB_TOKEN: ${{ github.token }} run: | git config --global user.email "github-actions[bot]@users.noreply.github.com" git config --global user.name "github-actions[bot]" git config --global am.keepcr true # Re-authenticate git with GitHub token SERVER_URL_STRIPPED="${SERVER_URL#https://}" - git remote set-url origin "https://x-access-token:${{ github.token }}@${SERVER_URL_STRIPPED}/${REPO_NAME}.git" + git remote set-url origin "https://x-access-token:${GITHUB_TOKEN}@${SERVER_URL_STRIPPED}/${REPO_NAME}.git" echo "Git configured with standard GitHub Actions identity" - name: Copy Copilot session state files to logs if: always() continue-on-error: true - run: | - # Copy Copilot session state files to logs folder for artifact collection - # This ensures they are in /tmp/gh-aw/ where secret redaction can scan them - SESSION_STATE_DIR="$HOME/.copilot/session-state" - LOGS_DIR="/tmp/gh-aw/sandbox/agent/logs" - - if [ -d "$SESSION_STATE_DIR" ]; then - echo "Copying Copilot session state files from $SESSION_STATE_DIR to $LOGS_DIR" - mkdir -p "$LOGS_DIR" - cp -v "$SESSION_STATE_DIR"/*.jsonl "$LOGS_DIR/" 2>/dev/null || true - echo "Session state files copied successfully" - else - echo "No session-state directory found at $SESSION_STATE_DIR" - fi + run: bash "${RUNNER_TEMP}/gh-aw/actions/copy_copilot_session_state.sh" - name: Stop MCP Gateway if: always() continue-on-error: true @@ -657,14 +781,14 @@ jobs: MCP_GATEWAY_API_KEY: ${{ steps.start-mcp-gateway.outputs.gateway-api-key }} GATEWAY_PID: ${{ steps.start-mcp-gateway.outputs.gateway-pid }} run: | - bash ${RUNNER_TEMP}/gh-aw/actions/stop_mcp_gateway.sh "$GATEWAY_PID" + bash "${RUNNER_TEMP}/gh-aw/actions/stop_mcp_gateway.sh" "$GATEWAY_PID" - name: Redact secrets in logs if: always() - uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8 + uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 with: script: | const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); - setupGlobals(core, github, context, exec, io); + setupGlobals(core, github, context, exec, io, getOctokit); const { main } = require('${{ runner.temp }}/gh-aw/actions/redact_secrets.cjs'); await main(); env: @@ -685,7 +809,7 @@ jobs: SECRET_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Append agent step summary if: always() - run: bash ${RUNNER_TEMP}/gh-aw/actions/append_agent_step_summary.sh + run: bash "${RUNNER_TEMP}/gh-aw/actions/append_agent_step_summary.sh" - name: Copy Safe Outputs if: always() env: @@ -696,7 +820,7 @@ jobs: - name: Ingest agent output id: collect_output if: always() - uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8 + uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 env: GH_AW_SAFE_OUTPUTS: ${{ steps.set-runtime-paths.outputs.GH_AW_SAFE_OUTPUTS }} GH_AW_ALLOWED_DOMAINS: "api.business.githubcopilot.com,api.enterprise.githubcopilot.com,api.github.com,api.githubcopilot.com,api.individual.githubcopilot.com,api.snapcraft.io,archive.ubuntu.com,azure.archive.ubuntu.com,crl.geotrust.com,crl.globalsign.com,crl.identrust.com,crl.sectigo.com,crl.thawte.com,crl.usertrust.com,crl.verisign.com,crl3.digicert.com,crl4.digicert.com,crls.ssl.com,github.com,host.docker.internal,json-schema.org,json.schemastore.org,keyserver.ubuntu.com,ocsp.digicert.com,ocsp.geotrust.com,ocsp.globalsign.com,ocsp.identrust.com,ocsp.sectigo.com,ocsp.ssl.com,ocsp.thawte.com,ocsp.usertrust.com,ocsp.verisign.com,packagecloud.io,packages.cloud.google.com,packages.microsoft.com,ppa.launchpad.net,raw.githubusercontent.com,registry.npmjs.org,s.symcb.com,s.symcd.com,security.ubuntu.com,telemetry.enterprise.githubcopilot.com,ts-crl.ws.symantec.com,ts-ocsp.ws.symantec.com,www.googleapis.com" @@ -705,27 +829,28 @@ jobs: with: script: | const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); - setupGlobals(core, github, context, exec, io); + setupGlobals(core, github, context, exec, io, getOctokit); const { main } = require('${{ runner.temp }}/gh-aw/actions/collect_ndjson_output.cjs'); await main(); - name: Parse agent logs for step summary if: always() - uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8 + uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 env: GH_AW_AGENT_OUTPUT: /tmp/gh-aw/sandbox/agent/logs/ with: script: | const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); - setupGlobals(core, github, context, exec, io); + setupGlobals(core, github, context, exec, io, getOctokit); const { main } = require('${{ runner.temp }}/gh-aw/actions/parse_copilot_log.cjs'); await main(); - name: Parse MCP Gateway logs for step summary if: always() - uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8 + id: parse-mcp-gateway + uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 with: script: | const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); - setupGlobals(core, github, context, exec, io); + setupGlobals(core, github, context, exec, io, getOctokit); const { main } = require('${{ runner.temp }}/gh-aw/actions/parse_mcp_gateway_log.cjs'); await main(); - name: Print firewall logs @@ -734,19 +859,45 @@ jobs: env: AWF_LOGS_DIR: /tmp/gh-aw/sandbox/firewall/logs run: | - # Fix permissions on firewall logs so they can be uploaded as artifacts + # Fix permissions on firewall logs/audit dirs so they can be uploaded as artifacts # AWF runs with sudo, creating files owned by root - sudo chmod -R a+r /tmp/gh-aw/sandbox/firewall/logs 2>/dev/null || true + sudo chmod -R a+r /tmp/gh-aw/sandbox/firewall 2>/dev/null || true # Only run awf logs summary if awf command exists (it may not be installed if workflow failed before install step) if command -v awf &> /dev/null; then awf logs summary | tee -a "$GITHUB_STEP_SUMMARY" else echo 'AWF binary not installed, skipping firewall log summary' fi + - name: Parse token usage for step summary + if: always() + continue-on-error: true + uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 + with: + script: | + const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); + setupGlobals(core, github, context, exec, io, getOctokit); + const { main } = require('${{ runner.temp }}/gh-aw/actions/parse_token_usage.cjs'); + await main(); + - name: Print AWF reflect summary + if: always() + continue-on-error: true + uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 + with: + script: | + const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); + setupGlobals(core, github, context, exec, io, getOctokit); + const { main } = require('${{ runner.temp }}/gh-aw/actions/awf_reflect_summary.cjs'); + await main(); + - name: Write agent output placeholder if missing + if: always() + run: | + if [ ! -f /tmp/gh-aw/agent_output.json ]; then + echo '{"items":[]}' > /tmp/gh-aw/agent_output.json + fi - name: Upload agent artifacts if: always() continue-on-error: true - uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7 + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 with: name: agent path: | @@ -754,19 +905,221 @@ jobs: /tmp/gh-aw/sandbox/agent/logs/ /tmp/gh-aw/redacted-urls.log /tmp/gh-aw/mcp-logs/ - /tmp/gh-aw/sandbox/firewall/logs/ + /tmp/gh-aw/agent_usage.json /tmp/gh-aw/agent-stdio.log + /tmp/gh-aw/pre-agent-audit.txt /tmp/gh-aw/agent/ + /tmp/gh-aw/github_rate_limits.jsonl /tmp/gh-aw/safeoutputs.jsonl /tmp/gh-aw/agent_output.json + /tmp/gh-aw/aw-*.patch + /tmp/gh-aw/aw-*.bundle + /tmp/gh-aw/awf-config.json + /tmp/gh-aw/sandbox/firewall/logs/ + /tmp/gh-aw/sandbox/firewall/audit/ + /tmp/gh-aw/sandbox/firewall/awf-reflect.json if-no-files-found: ignore - # --- Threat Detection (inline) --- + + conclusion: + needs: + - activation + - agent + - detection + - pat_pool + - safe_outputs + if: > + always() && (needs.agent.result != 'skipped' || needs.activation.outputs.lockdown_check_failed == 'true' || + needs.activation.outputs.stale_lock_file_failed == 'true') + runs-on: ubuntu-slim + permissions: + contents: read + issues: write + concurrency: + group: "gh-aw-conclusion-copilot-echo" + cancel-in-progress: false + outputs: + incomplete_count: ${{ steps.report_incomplete.outputs.incomplete_count }} + noop_message: ${{ steps.noop.outputs.noop_message }} + tools_reported: ${{ steps.missing_tool.outputs.tools_reported }} + total_count: ${{ steps.missing_tool.outputs.total_count }} + steps: + - name: Setup Scripts + id: setup + uses: github/gh-aw-actions/setup@b8068426813005612b960b5ab0b8bd2c27142323 # v0.71.5 + with: + destination: ${{ runner.temp }}/gh-aw/actions + job-name: ${{ github.job }} + trace-id: ${{ needs.activation.outputs.setup-trace-id }} + env: + GH_AW_SETUP_WORKFLOW_NAME: "Copilot Echo" + GH_AW_CURRENT_WORKFLOW_REF: ${{ github.repository }}/.github/workflows/copilot-echo.lock.yml@${{ github.ref }} + GH_AW_INFO_VERSION: "1.0.40" + - name: Download agent output artifact + id: download-agent-output + continue-on-error: true + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 + with: + name: agent + path: /tmp/gh-aw/ + - name: Setup agent output environment variable + id: setup-agent-output-env + if: steps.download-agent-output.outcome == 'success' + run: | + mkdir -p /tmp/gh-aw/ + find "/tmp/gh-aw/" -type f -print + echo "GH_AW_AGENT_OUTPUT=/tmp/gh-aw/agent_output.json" >> "$GITHUB_OUTPUT" + - name: Process no-op messages + id: noop + uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 + env: + GH_AW_AGENT_OUTPUT: ${{ steps.setup-agent-output-env.outputs.GH_AW_AGENT_OUTPUT }} + GH_AW_NOOP_MAX: "1" + GH_AW_WORKFLOW_NAME: "Copilot Echo" + GH_AW_RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} + GH_AW_AGENT_CONCLUSION: ${{ needs.agent.result }} + GH_AW_NOOP_REPORT_AS_ISSUE: "false" + with: + github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} + script: | + const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); + setupGlobals(core, github, context, exec, io, getOctokit); + const { main } = require('${{ runner.temp }}/gh-aw/actions/handle_noop_message.cjs'); + await main(); + - name: Log detection run + id: detection_runs + uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 + env: + GH_AW_AGENT_OUTPUT: ${{ steps.setup-agent-output-env.outputs.GH_AW_AGENT_OUTPUT }} + GH_AW_WORKFLOW_NAME: "Copilot Echo" + GH_AW_RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} + GH_AW_DETECTION_CONCLUSION: ${{ needs.detection.outputs.detection_conclusion }} + GH_AW_DETECTION_REASON: ${{ needs.detection.outputs.detection_reason }} + with: + github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} + script: | + const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); + setupGlobals(core, github, context, exec, io, getOctokit); + const { main } = require('${{ runner.temp }}/gh-aw/actions/handle_detection_runs.cjs'); + await main(); + - name: Record missing tool + id: missing_tool + uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 + env: + GH_AW_AGENT_OUTPUT: ${{ steps.setup-agent-output-env.outputs.GH_AW_AGENT_OUTPUT }} + GH_AW_MISSING_TOOL_CREATE_ISSUE: "true" + GH_AW_WORKFLOW_NAME: "Copilot Echo" + with: + github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} + script: | + const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); + setupGlobals(core, github, context, exec, io, getOctokit); + const { main } = require('${{ runner.temp }}/gh-aw/actions/missing_tool.cjs'); + await main(); + - name: Record incomplete + id: report_incomplete + uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 + env: + GH_AW_AGENT_OUTPUT: ${{ steps.setup-agent-output-env.outputs.GH_AW_AGENT_OUTPUT }} + GH_AW_REPORT_INCOMPLETE_CREATE_ISSUE: "true" + GH_AW_WORKFLOW_NAME: "Copilot Echo" + with: + github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} + script: | + const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); + setupGlobals(core, github, context, exec, io, getOctokit); + const { main } = require('${{ runner.temp }}/gh-aw/actions/report_incomplete_handler.cjs'); + await main(); + - name: Handle agent failure + id: handle_agent_failure + if: always() + uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 + env: + GH_AW_AGENT_OUTPUT: ${{ steps.setup-agent-output-env.outputs.GH_AW_AGENT_OUTPUT }} + GH_AW_WORKFLOW_NAME: "Copilot Echo" + GH_AW_RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} + GH_AW_AGENT_CONCLUSION: ${{ needs.agent.result }} + GH_AW_WORKFLOW_ID: "copilot-echo" + GH_AW_ACTION_FAILURE_ISSUE_EXPIRES_HOURS: "168" + GH_AW_ENGINE_ID: "copilot" + GH_AW_SECRET_VERIFICATION_RESULT: ${{ needs.activation.outputs.secret_verification_result }} + GH_AW_CHECKOUT_PR_SUCCESS: ${{ needs.agent.outputs.checkout_pr_success }} + GH_AW_INFERENCE_ACCESS_ERROR: ${{ needs.agent.outputs.inference_access_error }} + GH_AW_MCP_POLICY_ERROR: ${{ needs.agent.outputs.mcp_policy_error }} + GH_AW_AGENTIC_ENGINE_TIMEOUT: ${{ needs.agent.outputs.agentic_engine_timeout }} + GH_AW_MODEL_NOT_SUPPORTED_ERROR: ${{ needs.agent.outputs.model_not_supported_error }} + GH_AW_ENGINE_API_HOSTS: "api.enterprise.githubcopilot.com,api.githubcopilot.com,api.business.githubcopilot.com,api.individual.githubcopilot.com" + GH_AW_LOCKDOWN_CHECK_FAILED: ${{ needs.activation.outputs.lockdown_check_failed }} + GH_AW_STALE_LOCK_FILE_FAILED: ${{ needs.activation.outputs.stale_lock_file_failed }} + GH_AW_GROUP_REPORTS: "false" + GH_AW_FAILURE_REPORT_AS_ISSUE: "true" + GH_AW_MISSING_TOOL_REPORT_AS_FAILURE: "true" + GH_AW_MISSING_DATA_REPORT_AS_FAILURE: "true" + GH_AW_TIMEOUT_MINUTES: "20" + with: + github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} + script: | + const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); + setupGlobals(core, github, context, exec, io, getOctokit); + const { main } = require('${{ runner.temp }}/gh-aw/actions/handle_agent_failure.cjs'); + await main(); + + detection: + needs: + - activation + - agent + if: > + always() && needs.agent.result != 'skipped' && (needs.agent.outputs.output_types != '' || needs.agent.outputs.has_patch == 'true') + runs-on: ubuntu-latest + permissions: + contents: read + outputs: + detection_conclusion: ${{ steps.detection_conclusion.outputs.conclusion }} + detection_reason: ${{ steps.detection_conclusion.outputs.reason }} + detection_success: ${{ steps.detection_conclusion.outputs.success }} + steps: + - name: Setup Scripts + id: setup + uses: github/gh-aw-actions/setup@b8068426813005612b960b5ab0b8bd2c27142323 # v0.71.5 + with: + destination: ${{ runner.temp }}/gh-aw/actions + job-name: ${{ github.job }} + trace-id: ${{ needs.activation.outputs.setup-trace-id }} + env: + GH_AW_SETUP_WORKFLOW_NAME: "Copilot Echo" + GH_AW_CURRENT_WORKFLOW_REF: ${{ github.repository }}/.github/workflows/copilot-echo.lock.yml@${{ github.ref }} + GH_AW_INFO_VERSION: "1.0.40" + - name: Download agent output artifact + id: download-agent-output + continue-on-error: true + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 + with: + name: agent + path: /tmp/gh-aw/ + - name: Setup agent output environment variable + id: setup-agent-output-env + if: steps.download-agent-output.outcome == 'success' + run: | + mkdir -p /tmp/gh-aw/ + find "/tmp/gh-aw/" -type f -print + echo "GH_AW_AGENT_OUTPUT=/tmp/gh-aw/agent_output.json" >> "$GITHUB_OUTPUT" + - name: Checkout repository for patch context + if: needs.agent.outputs.has_patch == 'true' + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + persist-credentials: false + # --- Threat Detection --- + - name: Clean stale firewall files from agent artifact + run: | + rm -rf /tmp/gh-aw/sandbox/firewall/logs + rm -rf /tmp/gh-aw/sandbox/firewall/audit + - name: Download container images + run: bash "${RUNNER_TEMP}/gh-aw/actions/download_docker_images.sh" ghcr.io/github/gh-aw-firewall/agent:0.25.40@sha256:14ff567e8d9d4c2fbc5e55c973488381c71d7e0fdbe72d30ee7b8a738fd86504 ghcr.io/github/gh-aw-firewall/api-proxy:0.25.40@sha256:2883ca3e5ae9f330cafdd9345bfd4ae17fc8da36c96d4c9a1f76e922b4c45280 ghcr.io/github/gh-aw-firewall/squid:0.25.40@sha256:b084f4a2c771f584ee68084ced52fa6b3245197a1889645d817462d307d3ac51 - name: Check if detection needed id: detection_guard if: always() env: - OUTPUT_TYPES: ${{ steps.collect_output.outputs.output_types }} - HAS_PATCH: ${{ steps.collect_output.outputs.has_patch }} + OUTPUT_TYPES: ${{ needs.agent.outputs.output_types }} + HAS_PATCH: ${{ needs.agent.outputs.has_patch }} run: | if [[ -n "$OUTPUT_TYPES" || "$HAS_PATCH" == "true" ]]; then echo "run_detection=true" >> "$GITHUB_OUTPUT" @@ -775,10 +1128,10 @@ jobs: echo "run_detection=false" >> "$GITHUB_OUTPUT" echo "Detection skipped: no agent outputs or patches to analyze" fi - - name: Clear MCP configuration for detection + - name: Clear MCP Config for detection if: always() && steps.detection_guard.outputs.run_detection == 'true' run: | - rm -f /tmp/gh-aw/mcp-config/mcp-servers.json + rm -f "${RUNNER_TEMP}/gh-aw/mcp-config/mcp-servers.json" rm -f /home/runner/.copilot/mcp-config.json rm -f "$GITHUB_WORKSPACE/.gemini/settings.json" - name: Prepare threat detection files @@ -790,19 +1143,22 @@ jobs: for f in /tmp/gh-aw/aw-*.patch; do [ -f "$f" ] && cp "$f" /tmp/gh-aw/threat-detection/ 2>/dev/null || true done + for f in /tmp/gh-aw/aw-*.bundle; do + [ -f "$f" ] && cp "$f" /tmp/gh-aw/threat-detection/ 2>/dev/null || true + done echo "Prepared threat detection files:" ls -la /tmp/gh-aw/threat-detection/ 2>/dev/null || true - name: Setup threat detection if: always() && steps.detection_guard.outputs.run_detection == 'true' - uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8 + uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 env: WORKFLOW_NAME: "Copilot Echo" WORKFLOW_DESCRIPTION: "No description provided" - HAS_PATCH: ${{ steps.collect_output.outputs.has_patch }} + HAS_PATCH: ${{ needs.agent.outputs.has_patch }} with: script: | const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); - setupGlobals(core, github, context, exec, io); + setupGlobals(core, github, context, exec, io, getOctokit); const { main } = require('${{ runner.temp }}/gh-aw/actions/setup_threat_detection.cjs'); await main(); - name: Ensure threat-detection directory and log @@ -810,33 +1166,44 @@ jobs: run: | mkdir -p /tmp/gh-aw/threat-detection touch /tmp/gh-aw/threat-detection/detection.log + - name: Setup Node.js + uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 + with: + node-version: '24' + package-manager-cache: false + - name: Install GitHub Copilot CLI + run: bash "${RUNNER_TEMP}/gh-aw/actions/install_copilot_cli.sh" 1.0.40 + env: + GH_HOST: github.com + - name: Install AWF binary + run: bash "${RUNNER_TEMP}/gh-aw/actions/install_awf_binary.sh" v0.25.40 - name: Execute GitHub Copilot CLI if: always() && steps.detection_guard.outputs.run_detection == 'true' + continue-on-error: true id: detection_agentic_execution # Copilot CLI tool arguments (sorted): - # --allow-tool shell(cat) - # --allow-tool shell(grep) - # --allow-tool shell(head) - # --allow-tool shell(jq) - # --allow-tool shell(ls) - # --allow-tool shell(tail) - # --allow-tool shell(wc) timeout-minutes: 20 run: | set -o pipefail touch /tmp/gh-aw/agent-step-summary.md + GH_AW_NODE_BIN=$(command -v node 2>/dev/null || true) + export GH_AW_NODE_BIN + (umask 177 && touch /tmp/gh-aw/threat-detection/detection.log) + printf '%s\n' '{"$schema":"https://github.com/github/gh-aw-firewall/releases/download/v0.25.40/awf-config.schema.json","network":{"allowDomains":["api.business.githubcopilot.com","api.enterprise.githubcopilot.com","api.github.com","api.githubcopilot.com","api.individual.githubcopilot.com","github.com","host.docker.internal","telemetry.enterprise.githubcopilot.com"]},"apiProxy":{"enabled":true},"container":{"imageTag":"0.25.40,squid=sha256:b084f4a2c771f584ee68084ced52fa6b3245197a1889645d817462d307d3ac51,agent=sha256:14ff567e8d9d4c2fbc5e55c973488381c71d7e0fdbe72d30ee7b8a738fd86504,api-proxy=sha256:2883ca3e5ae9f330cafdd9345bfd4ae17fc8da36c96d4c9a1f76e922b4c45280,cli-proxy=sha256:3e7152911d4b4b7b97beef9d3d7d924ff7902227e86001ef3838fb728d5d514c"}}' > "${RUNNER_TEMP}/gh-aw/awf-config.json" && cp "${RUNNER_TEMP}/gh-aw/awf-config.json" /tmp/gh-aw/awf-config.json # shellcheck disable=SC1003 - sudo -E awf --env-all --container-workdir "${GITHUB_WORKSPACE}" --mount "${RUNNER_TEMP}/gh-aw:${RUNNER_TEMP}/gh-aw:ro" --mount "${RUNNER_TEMP}/gh-aw:/host${RUNNER_TEMP}/gh-aw:ro" --allow-domains "api.business.githubcopilot.com,api.enterprise.githubcopilot.com,api.github.com,api.githubcopilot.com,api.individual.githubcopilot.com,github.com,host.docker.internal,raw.githubusercontent.com,registry.npmjs.org,telemetry.enterprise.githubcopilot.com" --log-level info --proxy-logs-dir /tmp/gh-aw/sandbox/firewall/logs --enable-host-access --image-tag 0.25.0 --skip-pull --enable-api-proxy \ - -- /bin/bash -c '/usr/local/bin/copilot --add-dir /tmp/gh-aw/ --log-level all --log-dir /tmp/gh-aw/sandbox/agent/logs/ --add-dir "${GITHUB_WORKSPACE}" --disable-builtin-mcps --allow-tool '\''shell(cat)'\'' --allow-tool '\''shell(grep)'\'' --allow-tool '\''shell(head)'\'' --allow-tool '\''shell(jq)'\'' --allow-tool '\''shell(ls)'\'' --allow-tool '\''shell(tail)'\'' --allow-tool '\''shell(wc)'\'' --prompt "$(cat /tmp/gh-aw/aw-prompts/prompt.txt)"' 2>&1 | tee -a /tmp/gh-aw/threat-detection/detection.log + sudo -E awf --config "${RUNNER_TEMP}/gh-aw/awf-config.json" --container-workdir "${GITHUB_WORKSPACE}" --mount "${RUNNER_TEMP}/gh-aw:${RUNNER_TEMP}/gh-aw:ro" --mount "${RUNNER_TEMP}/gh-aw:/host${RUNNER_TEMP}/gh-aw:ro" --env-all --exclude-env COPILOT_GITHUB_TOKEN --log-level info --proxy-logs-dir /tmp/gh-aw/sandbox/firewall/logs --audit-dir /tmp/gh-aw/sandbox/firewall/audit --enable-host-access --allow-host-ports 80,443,8080 --skip-pull \ + -- /bin/bash -c 'export PATH="$(find /opt/hostedtoolcache /home/runner/work/_tool -maxdepth 4 -type d -name bin 2>/dev/null | tr '\''\n'\'' '\'':'\'')$PATH"; [ -n "$GOROOT" ] && export PATH="$GOROOT/bin:$PATH" || true && GH_AW_NODE_EXEC="${GH_AW_NODE_BIN:-}"; if [ -z "$GH_AW_NODE_EXEC" ] || [ ! -x "$GH_AW_NODE_EXEC" ]; then GH_AW_NODE_EXEC="$(command -v node 2>/dev/null || echo node)"; fi; "$GH_AW_NODE_EXEC" ${RUNNER_TEMP}/gh-aw/actions/copilot_harness.cjs /usr/local/bin/copilot --add-dir /tmp/gh-aw/ --log-level all --log-dir /tmp/gh-aw/sandbox/agent/logs/ --disable-builtin-mcps --no-ask-user --allow-all-tools --add-dir "${GITHUB_WORKSPACE}" --prompt-file /tmp/gh-aw/aw-prompts/prompt.txt' 2>&1 | tee -a /tmp/gh-aw/threat-detection/detection.log env: COPILOT_AGENT_RUNNER_TYPE: STANDALONE - COPILOT_GITHUB_TOKEN: ${{ case(needs.pre_activation.outputs.copilot_pat_number == '0', secrets.COPILOT_PAT_0, needs.pre_activation.outputs.copilot_pat_number == '1', secrets.COPILOT_PAT_1, needs.pre_activation.outputs.copilot_pat_number == '2', secrets.COPILOT_PAT_2, needs.pre_activation.outputs.copilot_pat_number == '3', secrets.COPILOT_PAT_3, needs.pre_activation.outputs.copilot_pat_number == '4', secrets.COPILOT_PAT_4, needs.pre_activation.outputs.copilot_pat_number == '5', secrets.COPILOT_PAT_5, needs.pre_activation.outputs.copilot_pat_number == '6', secrets.COPILOT_PAT_6, needs.pre_activation.outputs.copilot_pat_number == '7', secrets.COPILOT_PAT_7, needs.pre_activation.outputs.copilot_pat_number == '8', secrets.COPILOT_PAT_8, needs.pre_activation.outputs.copilot_pat_number == '9', secrets.COPILOT_PAT_9, secrets.COPILOT_GITHUB_TOKEN) }} - COPILOT_MODEL: ${{ vars.GH_AW_MODEL_DETECTION_COPILOT || '' }} + COPILOT_API_KEY: dummy-byok-key-for-offline-mode + COPILOT_GITHUB_TOKEN: ${{ case(needs.pat_pool.outputs.pat_number == '0', secrets.COPILOT_PAT_0, needs.pat_pool.outputs.pat_number == '1', secrets.COPILOT_PAT_1, needs.pat_pool.outputs.pat_number == '2', secrets.COPILOT_PAT_2, needs.pat_pool.outputs.pat_number == '3', secrets.COPILOT_PAT_3, needs.pat_pool.outputs.pat_number == '4', secrets.COPILOT_PAT_4, needs.pat_pool.outputs.pat_number == '5', secrets.COPILOT_PAT_5, needs.pat_pool.outputs.pat_number == '6', secrets.COPILOT_PAT_6, needs.pat_pool.outputs.pat_number == '7', secrets.COPILOT_PAT_7, needs.pat_pool.outputs.pat_number == '8', secrets.COPILOT_PAT_8, needs.pat_pool.outputs.pat_number == '9', secrets.COPILOT_PAT_9, secrets.COPILOT_GITHUB_TOKEN) }} + COPILOT_MODEL: ${{ vars.GH_AW_MODEL_DETECTION_COPILOT || 'claude-sonnet-4.6' }} GH_AW_PHASE: detection GH_AW_PROMPT: /tmp/gh-aw/aw-prompts/prompt.txt - GH_AW_VERSION: v0.63.0 + GH_AW_VERSION: v0.71.5 GITHUB_API_URL: ${{ github.api_url }} GITHUB_AW: true + GITHUB_COPILOT_INTEGRATION_ID: agentic-workflows GITHUB_HEAD_REF: ${{ github.head_ref }} GITHUB_REF_NAME: ${{ github.ref_name }} GITHUB_SERVER_URL: ${{ github.server_url }} @@ -847,198 +1214,154 @@ jobs: GIT_COMMITTER_EMAIL: github-actions[bot]@users.noreply.github.com GIT_COMMITTER_NAME: github-actions[bot] XDG_CONFIG_HOME: /home/runner - - name: Parse threat detection results - id: parse_detection_results - if: always() && steps.detection_guard.outputs.run_detection == 'true' - uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8 - with: - script: | - const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); - setupGlobals(core, github, context, exec, io); - const { main } = require('${{ runner.temp }}/gh-aw/actions/parse_threat_detection_results.cjs'); - await main(); - name: Upload threat detection log if: always() && steps.detection_guard.outputs.run_detection == 'true' - uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7 + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 with: name: detection path: /tmp/gh-aw/threat-detection/detection.log if-no-files-found: ignore - - name: Set detection conclusion + - name: Parse and conclude threat detection id: detection_conclusion if: always() + continue-on-error: true + uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 env: RUN_DETECTION: ${{ steps.detection_guard.outputs.run_detection }} - DETECTION_SUCCESS: ${{ steps.parse_detection_results.outputs.success }} - run: | - if [[ "$RUN_DETECTION" != "true" ]]; then - echo "conclusion=skipped" >> "$GITHUB_OUTPUT" - echo "success=true" >> "$GITHUB_OUTPUT" - echo "Detection was not needed, marking as skipped" - elif [[ "$DETECTION_SUCCESS" == "true" ]]; then - echo "conclusion=success" >> "$GITHUB_OUTPUT" - echo "success=true" >> "$GITHUB_OUTPUT" - echo "Detection passed successfully" - else - echo "conclusion=failure" >> "$GITHUB_OUTPUT" - echo "success=false" >> "$GITHUB_OUTPUT" - echo "Detection found issues" - fi + GH_AW_DETECTION_CONTINUE_ON_ERROR: "true" + with: + script: | + try { + const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); + setupGlobals(core, github, context, exec, io, getOctokit); + const { main } = require('${{ runner.temp }}/gh-aw/actions/parse_threat_detection_results.cjs'); + await main(); + } catch (loadErr) { + const continueOnError = process.env.GH_AW_DETECTION_CONTINUE_ON_ERROR !== 'false'; + const msg = 'ERR_SYSTEM: \u274C Unexpected error loading threat detection module: ' + (loadErr && loadErr.message ? loadErr.message : String(loadErr)); + core.error(msg); + core.setOutput('reason', 'parse_error'); + if (continueOnError) { + core.warning('\u26A0\uFE0F ' + msg); + core.setOutput('conclusion', 'warning'); + core.setOutput('success', 'false'); + } else { + core.setOutput('conclusion', 'failure'); + core.setOutput('success', 'false'); + core.setFailed(msg); + } + } - conclusion: - needs: - - activation - - agent - - safe_outputs - if: always() && (needs.agent.result != 'skipped' || needs.activation.outputs.lockdown_check_failed == 'true') + pat_pool: + needs: pre_activation runs-on: ubuntu-slim - permissions: - contents: read - issues: write - concurrency: - group: "gh-aw-conclusion-copilot-echo" - cancel-in-progress: false outputs: - noop_message: ${{ steps.noop.outputs.noop_message }} - tools_reported: ${{ steps.missing_tool.outputs.tools_reported }} - total_count: ${{ steps.missing_tool.outputs.total_count }} + pat_number: ${{ steps.select-pat-number.outputs.copilot_pat_number }} steps: - - name: Setup Scripts - uses: github/gh-aw-actions/setup@536ea1bad8c6715d098a9dc1afea8d403733acfe # v0.65.4 - with: - destination: ${{ runner.temp }}/gh-aw/actions - - name: Download agent output artifact - id: download-agent-output - continue-on-error: true - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 - with: - name: agent - path: /tmp/gh-aw/ - - name: Setup agent output environment variable - id: setup-agent-output-env - if: steps.download-agent-output.outcome == 'success' + - name: Configure GH_HOST for enterprise compatibility + id: ghes-host-config + shell: bash run: | - mkdir -p /tmp/gh-aw/ - find "/tmp/gh-aw/" -type f -print - echo "GH_AW_AGENT_OUTPUT=/tmp/gh-aw/agent_output.json" >> "$GITHUB_OUTPUT" - - name: Process No-Op Messages - id: noop - uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8 - env: - GH_AW_AGENT_OUTPUT: ${{ steps.setup-agent-output-env.outputs.GH_AW_AGENT_OUTPUT }} - GH_AW_NOOP_MAX: "1" - GH_AW_WORKFLOW_NAME: "Copilot Echo" - with: - github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} - script: | - const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); - setupGlobals(core, github, context, exec, io); - const { main } = require('${{ runner.temp }}/gh-aw/actions/noop.cjs'); - await main(); - - name: Record Missing Tool - id: missing_tool - uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8 - env: - GH_AW_AGENT_OUTPUT: ${{ steps.setup-agent-output-env.outputs.GH_AW_AGENT_OUTPUT }} - GH_AW_WORKFLOW_NAME: "Copilot Echo" - with: - github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} - script: | - const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); - setupGlobals(core, github, context, exec, io); - const { main } = require('${{ runner.temp }}/gh-aw/actions/missing_tool.cjs'); - await main(); - - name: Handle Agent Failure - id: handle_agent_failure - if: always() - uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8 - env: - GH_AW_AGENT_OUTPUT: ${{ steps.setup-agent-output-env.outputs.GH_AW_AGENT_OUTPUT }} - GH_AW_WORKFLOW_NAME: "Copilot Echo" - GH_AW_RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} - GH_AW_AGENT_CONCLUSION: ${{ needs.agent.result }} - GH_AW_WORKFLOW_ID: "copilot-echo" - GH_AW_SECRET_VERIFICATION_RESULT: ${{ needs.activation.outputs.secret_verification_result }} - GH_AW_CHECKOUT_PR_SUCCESS: ${{ needs.agent.outputs.checkout_pr_success }} - GH_AW_INFERENCE_ACCESS_ERROR: ${{ needs.agent.outputs.inference_access_error }} - GH_AW_LOCKDOWN_CHECK_FAILED: ${{ needs.activation.outputs.lockdown_check_failed }} - GH_AW_GROUP_REPORTS: "false" - GH_AW_FAILURE_REPORT_AS_ISSUE: "true" - GH_AW_TIMEOUT_MINUTES: "20" - with: - github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} - script: | - const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); - setupGlobals(core, github, context, exec, io); - const { main } = require('${{ runner.temp }}/gh-aw/actions/handle_agent_failure.cjs'); - await main(); - - name: Handle No-Op Message - id: handle_noop_message - uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8 + # Derive GH_HOST from GITHUB_SERVER_URL so the gh CLI targets the correct + # GitHub instance (GHES/GHEC). On github.com this is a harmless no-op. + GH_HOST="${GITHUB_SERVER_URL#https://}" + GH_HOST="${GH_HOST#http://}" + echo "GH_HOST=${GH_HOST}" >> "$GITHUB_ENV" + - name: Select Copilot token from pool + id: select-pat-number + run: | + # Collect pool entries with non-empty secrets from COPILOT_PAT_0..COPILOT_PAT_9. + PAT_NUMBERS=() + POOL_INDICATORS=(➖ ➖ ➖ ➖ ➖ ➖ ➖ ➖ ➖ ➖) + + for i in $(seq 0 9); do + var="COPILOT_PAT_${i}" + val="${!var}" + if [ -n "$val" ]; then + PAT_NUMBERS+=(${i}) + POOL_INDICATORS[${i}]="🟪" + fi + done + + # If none of the entries in the pool have values, emit a warning + # and do not set an output value. The consumer can fall back to + # using COPILOT_GITHUB_TOKEN. + if [ ${#PAT_NUMBERS[@]} -eq 0 ]; then + warning_message="::warning::None of the PAT pool entries had values " + warning_message+="(checked COPILOT_PAT_0 through COPILOT_PAT_9)" + echo "$warning_message" + exit 0 + fi + + # Select a random index using the seed if specified + if [ -n "$RANDOM_SEED" ]; then + RANDOM=$RANDOM_SEED + fi + + PAT_INDEX=$(( RANDOM % ${#PAT_NUMBERS[@]} )) + PAT_NUMBER="${PAT_NUMBERS[$PAT_INDEX]}" + POOL_INDICATORS[${PAT_NUMBER}]="✅" + + echo "Pool size: ${#PAT_NUMBERS[@]}" + echo "Selected PAT number ${PAT_NUMBER} (index: ${PAT_INDEX})" + + # Emit a markdown table of the pool entries to the step summary + echo "|0|1|2|3|4|5|6|7|8|9|" >> "$GITHUB_STEP_SUMMARY" + echo "|-|-|-|-|-|-|-|-|-|-|" >> "$GITHUB_STEP_SUMMARY" + (IFS='|'; printf '|%s' "${POOL_INDICATORS[@]}"; printf '|\n') >> "$GITHUB_STEP_SUMMARY" + + # Set the PAT number as the output + echo "copilot_pat_number=${PAT_NUMBER}" >> "$GITHUB_OUTPUT" env: - GH_AW_AGENT_OUTPUT: ${{ steps.setup-agent-output-env.outputs.GH_AW_AGENT_OUTPUT }} - GH_AW_WORKFLOW_NAME: "Copilot Echo" - GH_AW_RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} - GH_AW_AGENT_CONCLUSION: ${{ needs.agent.result }} - GH_AW_NOOP_MESSAGE: ${{ steps.noop.outputs.noop_message }} - GH_AW_NOOP_REPORT_AS_ISSUE: "false" - with: - github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} - script: | - const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); - setupGlobals(core, github, context, exec, io); - const { main } = require('${{ runner.temp }}/gh-aw/actions/handle_noop_message.cjs'); - await main(); + COPILOT_PAT_0: ${{ secrets.COPILOT_PAT_0 }} + COPILOT_PAT_1: ${{ secrets.COPILOT_PAT_1 }} + COPILOT_PAT_2: ${{ secrets.COPILOT_PAT_2 }} + COPILOT_PAT_3: ${{ secrets.COPILOT_PAT_3 }} + COPILOT_PAT_4: ${{ secrets.COPILOT_PAT_4 }} + COPILOT_PAT_5: ${{ secrets.COPILOT_PAT_5 }} + COPILOT_PAT_6: ${{ secrets.COPILOT_PAT_6 }} + COPILOT_PAT_7: ${{ secrets.COPILOT_PAT_7 }} + COPILOT_PAT_8: ${{ secrets.COPILOT_PAT_8 }} + COPILOT_PAT_9: ${{ secrets.COPILOT_PAT_9 }} + RANDOM_SEED: ${{ github.aw.import-inputs.random_seed }} + shell: bash pre_activation: runs-on: ubuntu-slim outputs: activated: ${{ steps.check_membership.outputs.is_team_member == 'true' }} - copilot_pat_number: ${{ steps.select-copilot-pat.outputs.copilot_pat_number }} matched_command: '' - select-copilot-pat_result: ${{ steps.select-copilot-pat.outcome }} + setup-trace-id: ${{ steps.setup.outputs.trace-id }} steps: - name: Setup Scripts - uses: github/gh-aw-actions/setup@536ea1bad8c6715d098a9dc1afea8d403733acfe # v0.65.4 + id: setup + uses: github/gh-aw-actions/setup@b8068426813005612b960b5ab0b8bd2c27142323 # v0.71.5 with: destination: ${{ runner.temp }}/gh-aw/actions + job-name: ${{ github.job }} + env: + GH_AW_SETUP_WORKFLOW_NAME: "Copilot Echo" + GH_AW_CURRENT_WORKFLOW_REF: ${{ github.repository }}/.github/workflows/copilot-echo.lock.yml@${{ github.ref }} + GH_AW_INFO_VERSION: "1.0.40" - name: Check team membership for workflow id: check_membership - uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8 + uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 env: - GH_AW_REQUIRED_ROLES: admin,maintainer,write + GH_AW_REQUIRED_ROLES: "admin,maintainer,write" with: github-token: ${{ secrets.GITHUB_TOKEN }} script: | const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); - setupGlobals(core, github, context, exec, io); + setupGlobals(core, github, context, exec, io, getOctokit); const { main } = require('${{ runner.temp }}/gh-aw/actions/check_membership.cjs'); await main(); - - name: Checkout the select-copilot-pat action folder - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - fetch-depth: 1 - persist-credentials: false - sparse-checkout: .github/actions/select-copilot-pat - sparse-checkout-cone-mode: true - - name: Select Copilot token from pool - id: select-copilot-pat - uses: ./.github/actions/select-copilot-pat - env: - SECRET_0: ${{ secrets.COPILOT_PAT_0 }} - SECRET_1: ${{ secrets.COPILOT_PAT_1 }} - SECRET_2: ${{ secrets.COPILOT_PAT_2 }} - SECRET_3: ${{ secrets.COPILOT_PAT_3 }} - SECRET_4: ${{ secrets.COPILOT_PAT_4 }} - SECRET_5: ${{ secrets.COPILOT_PAT_5 }} - SECRET_6: ${{ secrets.COPILOT_PAT_6 }} - SECRET_7: ${{ secrets.COPILOT_PAT_7 }} - SECRET_8: ${{ secrets.COPILOT_PAT_8 }} - SECRET_9: ${{ secrets.COPILOT_PAT_9 }} safe_outputs: - needs: agent - if: (!cancelled()) && needs.agent.result != 'skipped' && needs.agent.outputs.detection_success == 'true' + needs: + - activation + - agent + - detection + if: (!cancelled()) && needs.agent.result != 'skipped' && needs.detection.result == 'success' runs-on: ubuntu-slim permissions: contents: read @@ -1046,8 +1369,12 @@ jobs: timeout-minutes: 15 env: GH_AW_CALLER_WORKFLOW_ID: "${{ github.repository }}/copilot-echo" + GH_AW_DETECTION_CONCLUSION: ${{ needs.detection.outputs.detection_conclusion }} + GH_AW_DETECTION_REASON: ${{ needs.detection.outputs.detection_reason }} + GH_AW_EFFECTIVE_TOKENS: ${{ needs.agent.outputs.effective_tokens }} GH_AW_ENGINE_ID: "copilot" GH_AW_ENGINE_MODEL: ${{ needs.agent.outputs.model }} + GH_AW_ENGINE_VERSION: "1.0.40" GH_AW_WORKFLOW_ID: "copilot-echo" GH_AW_WORKFLOW_NAME: "Copilot Echo" outputs: @@ -1061,9 +1388,16 @@ jobs: process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} steps: - name: Setup Scripts - uses: github/gh-aw-actions/setup@536ea1bad8c6715d098a9dc1afea8d403733acfe # v0.65.4 + id: setup + uses: github/gh-aw-actions/setup@b8068426813005612b960b5ab0b8bd2c27142323 # v0.71.5 with: destination: ${{ runner.temp }}/gh-aw/actions + job-name: ${{ github.job }} + trace-id: ${{ needs.activation.outputs.setup-trace-id }} + env: + GH_AW_SETUP_WORKFLOW_NAME: "Copilot Echo" + GH_AW_CURRENT_WORKFLOW_REF: ${{ github.repository }}/.github/workflows/copilot-echo.lock.yml@${{ github.ref }} + GH_AW_INFO_VERSION: "1.0.40" - name: Download agent output artifact id: download-agent-output continue-on-error: true @@ -1086,28 +1420,30 @@ jobs: # GitHub instance (GHES/GHEC). On github.com this is a harmless no-op. GH_HOST="${GITHUB_SERVER_URL#https://}" GH_HOST="${GH_HOST#http://}" - echo "GH_HOST=${GH_HOST}" >> "$GITHUB_OUTPUT" + echo "GH_HOST=${GH_HOST}" >> "$GITHUB_ENV" - name: Process Safe Outputs id: process_safe_outputs - uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8 + uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 env: GH_AW_AGENT_OUTPUT: ${{ steps.setup-agent-output-env.outputs.GH_AW_AGENT_OUTPUT }} GH_AW_ALLOWED_DOMAINS: "api.business.githubcopilot.com,api.enterprise.githubcopilot.com,api.github.com,api.githubcopilot.com,api.individual.githubcopilot.com,api.snapcraft.io,archive.ubuntu.com,azure.archive.ubuntu.com,crl.geotrust.com,crl.globalsign.com,crl.identrust.com,crl.sectigo.com,crl.thawte.com,crl.usertrust.com,crl.verisign.com,crl3.digicert.com,crl4.digicert.com,crls.ssl.com,github.com,host.docker.internal,json-schema.org,json.schemastore.org,keyserver.ubuntu.com,ocsp.digicert.com,ocsp.geotrust.com,ocsp.globalsign.com,ocsp.identrust.com,ocsp.sectigo.com,ocsp.ssl.com,ocsp.thawte.com,ocsp.usertrust.com,ocsp.verisign.com,packagecloud.io,packages.cloud.google.com,packages.microsoft.com,ppa.launchpad.net,raw.githubusercontent.com,registry.npmjs.org,s.symcb.com,s.symcd.com,security.ubuntu.com,telemetry.enterprise.githubcopilot.com,ts-crl.ws.symantec.com,ts-ocsp.ws.symantec.com,www.googleapis.com" GITHUB_SERVER_URL: ${{ github.server_url }} GITHUB_API_URL: ${{ github.api_url }} - GH_AW_SAFE_OUTPUTS_HANDLER_CONFIG: "{\"create_issue\":{\"labels\":[\"copilot-echo\"],\"max\":1,\"title_prefix\":\"[copilot-echo]\"},\"missing_data\":{},\"missing_tool\":{},\"noop\":{\"max\":1,\"report-as-issue\":\"false\"}}" + GH_AW_SAFE_OUTPUTS_HANDLER_CONFIG: "{\"create_issue\":{\"labels\":[\"copilot-echo\"],\"max\":1,\"title_prefix\":\"[copilot-echo]\"},\"create_report_incomplete_issue\":{},\"missing_data\":{},\"missing_tool\":{},\"noop\":{\"max\":1,\"report-as-issue\":\"false\"},\"report_incomplete\":{}}" with: github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} script: | const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); - setupGlobals(core, github, context, exec, io); + setupGlobals(core, github, context, exec, io, getOctokit); const { main } = require('${{ runner.temp }}/gh-aw/actions/safe_output_handler_manager.cjs'); await main(); - - name: Upload safe output items + - name: Upload Safe Outputs Items if: always() - uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7 + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 with: - name: safe-output-items - path: /tmp/gh-aw/safe-output-items.jsonl + name: safe-outputs-items + path: | + /tmp/gh-aw/safe-output-items.jsonl + /tmp/gh-aw/temporary-id-map.json if-no-files-found: ignore diff --git a/.github/workflows/copilot-echo.md b/.github/workflows/copilot-echo.md index cfc39099d26ce6..3fc11badfe33dd 100644 --- a/.github/workflows/copilot-echo.md +++ b/.github/workflows/copilot-echo.md @@ -17,56 +17,20 @@ on: description: 'Message to use for the echo test' required: true type: string + permissions: {} # ############################################################### -# Override the COPILOT_GITHUB_TOKEN secret usage for the workflow -# with a randomly-selected token from a pool of secrets. -# -# As soon as organization-level billing is offered for Agentic -# Workflows, this stop-gap approach will be removed. -# -# See: /.github/actions/select-copilot-pat/README.md +# Override COPILOT_GITHUB_TOKEN with a random PAT from the pool. +# This stop-gap will be removed when org billing is available. +# See: .github/workflows/shared/pat_pool.README.md for more info. # ############################################################### +imports: + - shared/pat_pool.md - # Add the pre-activation step of selecting a random PAT from the supplied secrets - steps: - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - name: Checkout the select-copilot-pat action folder - with: - persist-credentials: false - sparse-checkout: .github/actions/select-copilot-pat - sparse-checkout-cone-mode: true - fetch-depth: 1 - - - id: select-copilot-pat - name: Select Copilot token from pool - uses: ./.github/actions/select-copilot-pat - env: - SECRET_0: ${{ secrets.COPILOT_PAT_0 }} - SECRET_1: ${{ secrets.COPILOT_PAT_1 }} - SECRET_2: ${{ secrets.COPILOT_PAT_2 }} - SECRET_3: ${{ secrets.COPILOT_PAT_3 }} - SECRET_4: ${{ secrets.COPILOT_PAT_4 }} - SECRET_5: ${{ secrets.COPILOT_PAT_5 }} - SECRET_6: ${{ secrets.COPILOT_PAT_6 }} - SECRET_7: ${{ secrets.COPILOT_PAT_7 }} - SECRET_8: ${{ secrets.COPILOT_PAT_8 }} - SECRET_9: ${{ secrets.COPILOT_PAT_9 }} - -# Add the pre-activation output of the randomly selected PAT -jobs: - pre-activation: - outputs: - copilot_pat_number: ${{ steps.select-copilot-pat.outputs.copilot_pat_number }} - -# Override the COPILOT_GITHUB_TOKEN expression used in the activation job -# Consume the PAT number from the pre-activation step and select the corresponding secret engine: id: copilot env: - # We cannot use line breaks in this expression as it leads to a syntax error in the compiled workflow - # If none of the `COPILOT_PAT_#` secrets were selected, then the default COPILOT_GITHUB_TOKEN is used - COPILOT_GITHUB_TOKEN: ${{ case(needs.pre_activation.outputs.copilot_pat_number == '0', secrets.COPILOT_PAT_0, needs.pre_activation.outputs.copilot_pat_number == '1', secrets.COPILOT_PAT_1, needs.pre_activation.outputs.copilot_pat_number == '2', secrets.COPILOT_PAT_2, needs.pre_activation.outputs.copilot_pat_number == '3', secrets.COPILOT_PAT_3, needs.pre_activation.outputs.copilot_pat_number == '4', secrets.COPILOT_PAT_4, needs.pre_activation.outputs.copilot_pat_number == '5', secrets.COPILOT_PAT_5, needs.pre_activation.outputs.copilot_pat_number == '6', secrets.COPILOT_PAT_6, needs.pre_activation.outputs.copilot_pat_number == '7', secrets.COPILOT_PAT_7, needs.pre_activation.outputs.copilot_pat_number == '8', secrets.COPILOT_PAT_8, needs.pre_activation.outputs.copilot_pat_number == '9', secrets.COPILOT_PAT_9, secrets.COPILOT_GITHUB_TOKEN) }} + COPILOT_GITHUB_TOKEN: ${{ case(needs.pat_pool.outputs.pat_number == '0', secrets.COPILOT_PAT_0, needs.pat_pool.outputs.pat_number == '1', secrets.COPILOT_PAT_1, needs.pat_pool.outputs.pat_number == '2', secrets.COPILOT_PAT_2, needs.pat_pool.outputs.pat_number == '3', secrets.COPILOT_PAT_3, needs.pat_pool.outputs.pat_number == '4', secrets.COPILOT_PAT_4, needs.pat_pool.outputs.pat_number == '5', secrets.COPILOT_PAT_5, needs.pat_pool.outputs.pat_number == '6', secrets.COPILOT_PAT_6, needs.pat_pool.outputs.pat_number == '7', secrets.COPILOT_PAT_7, needs.pat_pool.outputs.pat_number == '8', secrets.COPILOT_PAT_8, needs.pat_pool.outputs.pat_number == '9', secrets.COPILOT_PAT_9, secrets.COPILOT_GITHUB_TOKEN) }} --- ## Copilot Echo diff --git a/.github/workflows/shared/pat_pool.README.md b/.github/workflows/shared/pat_pool.README.md new file mode 100644 index 00000000000000..3627a0c8f88f3c --- /dev/null +++ b/.github/workflows/shared/pat_pool.README.md @@ -0,0 +1,187 @@ +# PAT Pool + +Selects a random Copilot PAT from a numbered pool of secrets. This addresses limitations that arise from having a single PAT shared across all agentic workflows, such as rate-limiting. + +**This is a stop-gap workaround.** As soon as organization/enterprise billing is offered for agentic workflows, this approach will be removed from our workflows. + +## Repository Onboarding + +To use Agentic Workflows in a dotnet org repository: + +1. Follow the instructions for [Configuring Your Repository | Agentic Authoring | GitHub Agentic Workflows][configure-repo]. Use `gh aw` **v0.71.5 or newer**, which supports the agent job dependencies required for this implementation. +2. Copy the `pat_pool.md` and `pat_pool.README.md` files into the repository under `.github/workflows/shared`. +3. Merge those additions into the repository and then follow the instructions for the PAT Creation and Usage below. + +**Install or upgrade the `gh aw` CLI and check the version** + +```sh +gh extension install github/gh-aw --force +gh aw --version +``` + +## PAT Management + +Team members provide PATs into the pools for the repository by adding them as repository secrets with secret names matching the pattern of `_<0-9>`, such as `COPILOT_PAT_0`. + +[Use this link to prefill the PAT creation form with the required settings][create-pat]: + +1. **Resource owner** is your **user account**, not an organization. +2. **Copilot Requests (Read)** must be the only permission granted. +3. **8-day expiration** must be used, which enforces a weekly renewal. +4. **Repository access** set to **Public repositories** only. + +The **Token Name** _does not_ need to match the secret name and is only visible to the owner of the PAT. It's recommended to use a token name indicating the PAT is used for dotnet org agentic workflows. The **Description** is also only used for your own reference. + +Team members providing PATs for workflows should set weekly recurring reminders to regenerate and update their PATs in the repository secrets. With an 8-day expiration, renewal can be done on the same day each week. + +PATs are added to repositories through the **Settings > Secrets and variables > Actions** UI, saved as **Repository secrets** and matching the `_<0-9>` naming convention. This can also be done using the GitHub CLI. + +```sh +gh aw secrets set "_<0-9>" --value "" --repo / +``` + +## Workflow Output Attribution + +Team members' PATs are _only_ used for the Copilot requests from within the agentic portion of the workflow. All outputs from the workflow use the `github-actions[bot]` account token. Issues, PRs, comments, and all other content generated by the workflow will be attributed to `github-actions[bot]`--not the team member's account or token. + +## Usage + +The [`pat_pool.md`](./pat_pool.md) workflow import defines a custom job with a `pat_number` output. Consuming workflows need two additions to their frontmatter to import this job and use the PAT number to override the `COPILOT_GITHUB_TOKEN` passed to the workflow's agent job. + +```yml +# ############################################################### +# Select a PAT from the pool and override COPILOT_GITHUB_TOKEN. +# When org-level billing is available, this will be removed. +# See `shared/pat_pool.README.md` for more information. +# ############################################################### +imports: + - shared/pat_pool.md + +engine: + id: copilot + env: + COPILOT_GITHUB_TOKEN: | + ${{ case( + needs.pat_pool.outputs.pat_number == '0', secrets.COPILOT_PAT_0, + needs.pat_pool.outputs.pat_number == '1', secrets.COPILOT_PAT_1, + needs.pat_pool.outputs.pat_number == '2', secrets.COPILOT_PAT_2, + needs.pat_pool.outputs.pat_number == '3', secrets.COPILOT_PAT_3, + needs.pat_pool.outputs.pat_number == '4', secrets.COPILOT_PAT_4, + needs.pat_pool.outputs.pat_number == '5', secrets.COPILOT_PAT_5, + needs.pat_pool.outputs.pat_number == '6', secrets.COPILOT_PAT_6, + needs.pat_pool.outputs.pat_number == '7', secrets.COPILOT_PAT_7, + needs.pat_pool.outputs.pat_number == '8', secrets.COPILOT_PAT_8, + needs.pat_pool.outputs.pat_number == '9', secrets.COPILOT_PAT_9, + secrets.COPILOT_GITHUB_TOKEN) + }} +``` + +The expression can be collapsed onto a single line if desired. `gh-aw compile` automatically wires `pat_pool` into the activation and agent jobs' `needs:` graph because of the `needs.pat_pool.` references within the `engine.env` property. + +```sh +gh aw compile --schedule-seed / +``` + +### Customizing the pool + +The import declares 10 optional inputs (`COPILOT_PAT_0` through `COPILOT_PAT_9`), each defaulting to `secrets.COPILOT_PAT_#` of the matching number. To point a workflow at a different pool of repository secrets, use the parameterized `uses`/`with` form when importing and pass the substitute secrets as the `COPILOT_PAT_#` inputs: + +```yml +imports: + - uses: shared/pat_pool.md + with: + COPILOT_PAT_0: ${{ secrets.MY_TEAM_PAT_0 }} + COPILOT_PAT_1: ${{ secrets.MY_TEAM_PAT_1 }} + # Unspecified inputs default to `secrets.COPILOT_PAT_#` lookups +``` + +The secrets passed via `with:` must match the secrets referenced in the consuming workflow's `case` expression that overrides `COPILOT_GITHUB_TOKEN`--both sides need to agree on which secret backs each `COPILOT_PAT_#` slot. Update the `case` expression accordingly: + +```yml +engine: + id: copilot + env: + COPILOT_GITHUB_TOKEN: ${{ case(needs.pat_pool.outputs.pat_number == '0', secrets.MY_TEAM_PAT_0, needs.pat_pool.outputs.pat_number == '1', secrets.MY_TEAM_PAT_1, ..., secrets.COPILOT_GITHUB_TOKEN) }} +``` + +This approach aligns with GitHub's documented guidance for [passing secrets][passing-secrets] between workflows, where the `pat_pool` job returns a PAT number and the `case` statement acts as a secret store to look the PAT secret up based on the selected number. + +## Design / Security + +There are several details of this implementation that keep our workflows and repositories safe. + +1. **Secrets adhere to existing trust boundaries.** The pool of PAT secrets is + provided to a dedicated step within the `pat_pool` job. That job runs + after `pre_activation` and contains only the trusted checkout and action + steps--no untrusted context or input is within scope. The + `select-pat-number` action only references the secret values to determine + which are non-empty, filtering the secret numbers to those with values. +1. **The `pat_pool` job emits only a number, never a secret.** Its sole output, + `pat_number`, is the 0-9 index of the selected PAT (or empty when the pool + is empty). The actual secret materializes only later, in the activation + job's `engine.env` mapping, where the `case()` expression resolves the + number to the matching secret. This follows GitHub's guidance for + [passing secrets][passing-secrets] between jobs or workflows, with the + `case` statement acting as a very simple secret store. +1. **The `select-pat-number` action does not require any permissions.** It + reads only the `COPILOT_PAT_#` environment variables passed to it and writes + only to `GITHUB_OUTPUT`. The job that hosts it sets `permissions:` to the + workflow defaults (no elevated scopes). +1. **The implementation uses supported Agentic Workflow extensibility hooks.** + Defining a custom job inside an [imported workflow file][imports] is + supported by `gh aw compile`. gh-aw automatically + wires `pat_pool` into the activation job's `needs:` graph based on the + `needs.pat_pool.outputs.pat_number` references in `engine.env`. The + [secret override][secret-override] capability supplies the `COPILOT_GITHUB_TOKEN` + value via `engine.env` rather than the default secret of the same name. + +Each of the references below contributed to the design and implementation to ensure a secure and reliable design. + +## Known Issues + +The `pat_pool` import integration requires that the workflow's compilation results in a `pre_activation` job. If nothing in your workflow definition produces a `pre_activation` job, a compilation error will be received. + +```text +✗ Failed workflows: + ✗ .md + +.github\workflows\.md:1:1: error: failed to generate YAML: failed to build and validate jobs: job dependency validation failed: job 'pat_pool' depends on non-existent job 'pre_activation' +``` + +To work around this, add `on.permissions: {}` to your workflow, which forces a no-op `pre_activation` job to be generated. + +```yml +on: + permissions: {} +``` + +See: [Activation 'needs' does not incorporate jobs in engine.env expressions (github/gh-aw#30790)](https://github.com/github/gh-aw/issues/30790) + +## References + +- [Agentic Workflows CLI Extension][cli-setup] +- [Agentic Authoring][configure-repo] +- [Authentication][authentication] +- [Agentic Workflow Imports][imports] +- [Custom Steps][steps] +- [Custom Jobs][jobs] +- [Job Outputs][job-outputs] +- [Engine Configuration][engine] +- [Engine Environment Variables][engine-vars] +- [Update agentic engine token handling to use user-provided secrets (github/gh-aw#18017)][secret-override] +- [Case Function in Workflow Expressions][case-expression] +- [Passing a secret between jobs or workflows][passing-secrets] + +[cli-setup]: https://github.github.com/gh-aw/setup/cli/ +[configure-repo]: https://github.github.com/gh-aw/guides/agentic-authoring/#configuring-your-repository +[authentication]: https://github.github.com/gh-aw/reference/auth/ +[create-pat]: https://github.com/settings/personal-access-tokens/new?name=dotnet%20org%20agentic%20workflows&description=GitHub+Agentic+Workflows+-+Copilot+engine+authentication.++Used+for+dotnet+org+workflows.+MUST+be+configured+with+only+Copilot+Requests+permissions+and+user+account+as+resource+owner.+Weekly+expiration+and+required+renewal.&user_copilot_requests=read&expires_in=8 +[imports]: https://github.github.com/gh-aw/reference/imports/ +[steps]: https://github.github.com/gh-aw/reference/frontmatter/#custom-steps-steps +[jobs]: https://github.github.com/gh-aw/reference/frontmatter/#custom-jobs-jobs +[job-outputs]: https://github.github.com/gh-aw/reference/frontmatter/#job-outputs +[engine]: https://github.github.com/gh-aw/reference/frontmatter/#ai-engine-engine +[engine-vars]: https://github.github.com/gh-aw/reference/engines/#engine-environment-variables +[secret-override]: https://github.com/github/gh-aw/pull/18017 +[case-expression]: https://docs.github.com/actions/reference/workflows-and-actions/expressions#case +[passing-secrets]: https://docs.github.com/actions/reference/workflows-and-actions/workflow-commands#example-masking-and-passing-a-secret-between-jobs-or-workflows diff --git a/.github/workflows/shared/pat_pool.md b/.github/workflows/shared/pat_pool.md new file mode 100644 index 00000000000000..f79e07280c7351 --- /dev/null +++ b/.github/workflows/shared/pat_pool.md @@ -0,0 +1,117 @@ +--- +description: Agentic workflow import to integrate the Copilot PAT Pool + +jobs: + pat_pool: + needs: [pre_activation] + runs-on: ubuntu-slim + outputs: + pat_number: ${{ steps.select-pat-number.outputs.copilot_pat_number }} + steps: + - id: select-pat-number + name: Select Copilot token from pool + env: + COPILOT_PAT_0: ${{ github.aw.import-inputs.COPILOT_PAT_0 }} + COPILOT_PAT_1: ${{ github.aw.import-inputs.COPILOT_PAT_1 }} + COPILOT_PAT_2: ${{ github.aw.import-inputs.COPILOT_PAT_2 }} + COPILOT_PAT_3: ${{ github.aw.import-inputs.COPILOT_PAT_3 }} + COPILOT_PAT_4: ${{ github.aw.import-inputs.COPILOT_PAT_4 }} + COPILOT_PAT_5: ${{ github.aw.import-inputs.COPILOT_PAT_5 }} + COPILOT_PAT_6: ${{ github.aw.import-inputs.COPILOT_PAT_6 }} + COPILOT_PAT_7: ${{ github.aw.import-inputs.COPILOT_PAT_7 }} + COPILOT_PAT_8: ${{ github.aw.import-inputs.COPILOT_PAT_8 }} + COPILOT_PAT_9: ${{ github.aw.import-inputs.COPILOT_PAT_9 }} + RANDOM_SEED: ${{ github.aw.import-inputs.random_seed }} + shell: bash + run: | + # Collect pool entries with non-empty secrets from COPILOT_PAT_0..COPILOT_PAT_9. + PAT_NUMBERS=() + POOL_INDICATORS=(➖ ➖ ➖ ➖ ➖ ➖ ➖ ➖ ➖ ➖) + + for i in $(seq 0 9); do + var="COPILOT_PAT_${i}" + val="${!var}" + if [ -n "$val" ]; then + PAT_NUMBERS+=(${i}) + POOL_INDICATORS[${i}]="🟪" + fi + done + + # If none of the entries in the pool have values, emit a warning + # and do not set an output value. The consumer can fall back to + # using COPILOT_GITHUB_TOKEN. + if [ ${#PAT_NUMBERS[@]} -eq 0 ]; then + warning_message="::warning::None of the PAT pool entries had values " + warning_message+="(checked COPILOT_PAT_0 through COPILOT_PAT_9)" + echo "$warning_message" + exit 0 + fi + + # Select a random index using the seed if specified + if [ -n "$RANDOM_SEED" ]; then + RANDOM=$RANDOM_SEED + fi + + PAT_INDEX=$(( RANDOM % ${#PAT_NUMBERS[@]} )) + PAT_NUMBER="${PAT_NUMBERS[$PAT_INDEX]}" + POOL_INDICATORS[${PAT_NUMBER}]="✅" + + echo "Pool size: ${#PAT_NUMBERS[@]}" + echo "Selected PAT number ${PAT_NUMBER} (index: ${PAT_INDEX})" + + # Emit a markdown table of the pool entries to the step summary + echo "|0|1|2|3|4|5|6|7|8|9|" >> "$GITHUB_STEP_SUMMARY" + echo "|-|-|-|-|-|-|-|-|-|-|" >> "$GITHUB_STEP_SUMMARY" + (IFS='|'; printf '|%s' "${POOL_INDICATORS[@]}"; printf '|\n') >> "$GITHUB_STEP_SUMMARY" + + # Set the PAT number as the output + echo "copilot_pat_number=${PAT_NUMBER}" >> "$GITHUB_OUTPUT" + +import-schema: + COPILOT_PAT_0: + type: string + required: false + default: ${{ secrets.COPILOT_PAT_0 }} + COPILOT_PAT_1: + type: string + required: false + default: ${{ secrets.COPILOT_PAT_1 }} + COPILOT_PAT_2: + type: string + required: false + default: ${{ secrets.COPILOT_PAT_2 }} + COPILOT_PAT_3: + type: string + required: false + default: ${{ secrets.COPILOT_PAT_3 }} + COPILOT_PAT_4: + type: string + required: false + default: ${{ secrets.COPILOT_PAT_4 }} + COPILOT_PAT_5: + type: string + required: false + default: ${{ secrets.COPILOT_PAT_5 }} + COPILOT_PAT_6: + type: string + required: false + default: ${{ secrets.COPILOT_PAT_6 }} + COPILOT_PAT_7: + type: string + required: false + default: ${{ secrets.COPILOT_PAT_7 }} + COPILOT_PAT_8: + type: string + required: false + default: ${{ secrets.COPILOT_PAT_8 }} + COPILOT_PAT_9: + type: string + required: false + default: ${{ secrets.COPILOT_PAT_9 }} + random_seed: + type: number + required: false + description: >- + A seed number to use for the random PAT number selection, + for deterministic selection if needed. +--- diff --git a/.github/workflows/validate-pat-pool.yml b/.github/workflows/validate-pat-pool.yml new file mode 100644 index 00000000000000..6e0ad790abf001 --- /dev/null +++ b/.github/workflows/validate-pat-pool.yml @@ -0,0 +1,227 @@ +name: Validate PAT Pool + +on: + schedule: + - cron: '17 2 * * *' # Daily at ~2:17 AM UTC (off-round to reduce contention) + workflow_dispatch: + +# No GitHub API permissions needed +permissions: {} + +jobs: + validate: + name: Validate Copilot PAT Pool + if: ${{ github.event_name == 'workflow_dispatch' || !github.event.repository.fork }} + runs-on: ubuntu-latest + env: + VALIDATE_PAT: | + if [ -z "$COPILOT_GITHUB_TOKEN" ]; then echo "status=empty" >> "$GITHUB_OUTPUT"; exit 0; fi + set +e; timeout 30 copilot --prompt "Say OK" --available-tools="" --silent --effort=low; rc=$?; set -e + if [ $rc -eq 0 ]; then echo "status=valid" >> "$GITHUB_OUTPUT" + elif [ $rc -eq 124 ]; then echo "status=unknown" >> "$GITHUB_OUTPUT" + else echo "status=invalid" >> "$GITHUB_OUTPUT"; fi + steps: + - name: Setup gh-aw scripts + uses: github/gh-aw-actions/setup@b8068426813005612b960b5ab0b8bd2c27142323 # v0.71.5 + with: + destination: ${{ runner.temp }}/gh-aw/actions + + - name: Install Copilot CLI + run: bash "${RUNNER_TEMP}/gh-aw/actions/install_copilot_cli.sh" 1.0.21 + + # ----------------------------------------------------------- + # Make a Copilot CLI request with each PAT. + # Each step sets COPILOT_GITHUB_TOKEN directly from the secret + # via env: so the value never passes through shell variables. + # ----------------------------------------------------------- + + - name: Validate COPILOT_PAT_0 + id: pat0 + continue-on-error: true + env: + COPILOT_GITHUB_TOKEN: ${{ secrets.COPILOT_PAT_0 }} + shell: bash + run: | + # copilot --prompt "Say OK" + eval "$VALIDATE_PAT" + + - name: Validate COPILOT_PAT_1 + id: pat1 + continue-on-error: true + env: + COPILOT_GITHUB_TOKEN: ${{ secrets.COPILOT_PAT_1 }} + shell: bash + run: | + # copilot --prompt "Say OK" + eval "$VALIDATE_PAT" + + - name: Validate COPILOT_PAT_2 + id: pat2 + continue-on-error: true + env: + COPILOT_GITHUB_TOKEN: ${{ secrets.COPILOT_PAT_2 }} + shell: bash + run: | + # copilot --prompt "Say OK" + eval "$VALIDATE_PAT" + + - name: Validate COPILOT_PAT_3 + id: pat3 + continue-on-error: true + env: + COPILOT_GITHUB_TOKEN: ${{ secrets.COPILOT_PAT_3 }} + shell: bash + run: | + # copilot --prompt "Say OK" + eval "$VALIDATE_PAT" + + - name: Validate COPILOT_PAT_4 + id: pat4 + continue-on-error: true + env: + COPILOT_GITHUB_TOKEN: ${{ secrets.COPILOT_PAT_4 }} + shell: bash + run: | + # copilot --prompt "Say OK" + eval "$VALIDATE_PAT" + + - name: Validate COPILOT_PAT_5 + id: pat5 + continue-on-error: true + env: + COPILOT_GITHUB_TOKEN: ${{ secrets.COPILOT_PAT_5 }} + shell: bash + run: | + # copilot --prompt "Say OK" + eval "$VALIDATE_PAT" + + - name: Validate COPILOT_PAT_6 + id: pat6 + continue-on-error: true + env: + COPILOT_GITHUB_TOKEN: ${{ secrets.COPILOT_PAT_6 }} + shell: bash + run: | + # copilot --prompt "Say OK" + eval "$VALIDATE_PAT" + + - name: Validate COPILOT_PAT_7 + id: pat7 + continue-on-error: true + env: + COPILOT_GITHUB_TOKEN: ${{ secrets.COPILOT_PAT_7 }} + shell: bash + run: | + # copilot --prompt "Say OK" + eval "$VALIDATE_PAT" + + - name: Validate COPILOT_PAT_8 + id: pat8 + continue-on-error: true + env: + COPILOT_GITHUB_TOKEN: ${{ secrets.COPILOT_PAT_8 }} + shell: bash + run: | + # copilot --prompt "Say OK" + eval "$VALIDATE_PAT" + + - name: Validate COPILOT_PAT_9 + id: pat9 + continue-on-error: true + env: + COPILOT_GITHUB_TOKEN: ${{ secrets.COPILOT_PAT_9 }} + shell: bash + run: | + # copilot --prompt "Say OK" + eval "$VALIDATE_PAT" + + # ----------------------------------------------------------- + # Collect results and build the step summary + # ----------------------------------------------------------- + + - name: Build summary + if: always() + env: + S0: ${{ steps.pat0.outputs.status }} + S1: ${{ steps.pat1.outputs.status }} + S2: ${{ steps.pat2.outputs.status }} + S3: ${{ steps.pat3.outputs.status }} + S4: ${{ steps.pat4.outputs.status }} + S5: ${{ steps.pat5.outputs.status }} + S6: ${{ steps.pat6.outputs.status }} + S7: ${{ steps.pat7.outputs.status }} + S8: ${{ steps.pat8.outputs.status }} + S9: ${{ steps.pat9.outputs.status }} + shell: bash + run: | + # Build summary + statuses=("$S0" "$S1" "$S2" "$S3" "$S4" "$S5" "$S6" "$S7" "$S8" "$S9") + + valid=0; empty=0; invalid=0; unknown=0 + for s in "${statuses[@]}"; do + case "$s" in + valid) valid=$((valid + 1)) ;; + empty) empty=$((empty + 1)) ;; + invalid) invalid=$((invalid + 1)) ;; + *) unknown=$((unknown + 1)) ;; + esac + done + + { + if [ $invalid -eq 0 ] && [ $unknown -eq 0 ] && [ $valid -gt 0 ]; then + echo "> [!NOTE]" + echo "> **PAT pool is valid** — no action needed" + echo "" + fi + + if [ $invalid -eq 0 ] && [ $unknown -eq 0 ] && [ $valid -eq 0 ]; then + echo "> [!WARNING]" + echo "> **Empty PAT pool** — agentic workflows will fall back to the default \`COPILOT_GITHUB_TOKEN\`." + echo "" + fi + + if [ $invalid -gt 0 ]; then + echo "> [!CAUTION]" + echo "> **Invalid PAT pool** — agentic workflows selecting an invalid PAT will fail." + echo "" + fi + + if [ $unknown -gt 0 ]; then + echo "> [!WARNING]" + echo "> **PAT pool not verified** due to transient errors — re-run the workflow to retry." + echo "" + fi + + echo "☑️ Valid: ${valid} • ⏹️ Empty: ${empty} • ❌ Invalid: ${invalid} • ❓ Unknown: ${unknown}" + echo "" + + echo "| PAT Secret | Status |" + echo "|:-----------|:-------|" + + for i in $(seq 0 9); do + case "${statuses[$i]}" in + valid) symbol="☑️ Valid" ;; + empty) symbol="⏹️ Empty" ;; + invalid) symbol="❌ Invalid" ;; + *) symbol="❓ Unknown" ;; + esac + echo "| \`COPILOT_PAT_${i}\` | ${symbol} |" + done + } >> "$GITHUB_STEP_SUMMARY" + + if [ $invalid -gt 0 ]; then + echo "::error::${invalid} PAT(s) in the pool are invalid and need to be removed or replaced" + exit 1 + fi + + if [ $unknown -gt 0 ]; then + echo "::error::${unknown} PAT(s) could not be verified due to transient errors — re-run to retry" + exit 1 + fi + + if [ $valid -eq 0 ]; then + echo "::error::The PAT pool is empty — no PATs are available" + exit 1 + fi + + echo "PAT pool validation passed: ${valid} valid PAT(s)" From 41013c11bc7fee141aaedd87e5a04e81e85a10e4 Mon Sep 17 00:00:00 2001 From: Milos Kotlar Date: Fri, 8 May 2026 22:10:09 +0200 Subject: [PATCH 066/109] [ci-failure-scan] Tighten KBE filing rules and PR-search coverage (#127961) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Description Refines the `ci-failure-scan` agentic-workflow prompt to address failure modes seen in past runs: - Generic `ErrorMessage` signatures (bare test names, exception types, or truncated prefixes) that match `[PASS]` / `[SKIP]` lines for the same test and turn the KBE into a false-positive matcher against passing builds. - Malformed JSON fences (4-backtick opens, mismatched fence lengths, multiple skeletons in one body) that cause Build Analysis to silently skip the issue. - Issues filed under the `Known Build Error` label with no JSON block at all, so nothing matches future failures. - Muting PRs that link to a non-existent issue number or duplicate an in-flight fix authored by a maintainer (because the search was scoped too narrowly to `[ci-scan]` PRs). - Muting PRs opened against issues whose area owners had already provided a PR - Wrong-KBE links where the candidate KBE matched only on test name but was filed against a different architecture / failure signature. ## Changes The body of `.github/workflows/ci-failure-scan.md` is reorganized into a clear walk-through: 1. **Two-pass KBE → PR flow** is now a numbered six-step pre-flight walk (existing KBE / area tracker / muting PR / in-flight fix PR / issue resolves / mute is welcome) followed by an explicit action selection (file KBE, open muting PR, optionally open fix PR). 2. **KBE-match verification** — four questions (test, signature, OS, architecture) the agent must answer before linking an existing KBE. Wrong answers mean filing a fresh KBE rather than reusing the wrong one. 3. **Body checks** — eight explicit checks on the issue body covering the JSON fence, exact ```json opening, single-line/no-escapes signature, and a negative-match test against `[PASS]` / `[SKIP]` and build-time output. 4. **Bad → Good** examples for both signature shape (bare test name, truncated prefix, bare exception type) and platform/csproj scope (`linux-arm`-only, single-arch NativeAOT, single stress mode). 5. Coverage-discipline section trimmed to its unique contribution (pipeline ordering, per-pipeline tally, run summary). Redundant `Submit` section removed — its content is now covered by the numbered walk. ## Test run results Workflow run [25570821336](https://github.com/dotnet/runtime/actions/runs/25570821336) was dispatched against this branch (commit `3cd6399dd70`, pre-Copilot-fixup) and completed successfully (~28 min). Outputs: | # | Type | Title | Linked tracker | |---|---|---|---| | [#127963](https://github.com/dotnet/runtime/pull/127963) | PR (draft) | `[ci-scan] Skip AsyncProfilerTests on Android and tvOS` | #127951 | | [#127964](https://github.com/dotnet/runtime/pull/127964) | PR (draft) | `[ci-scan] Skip System.Net.Sockets IPv6 tests on Android` | #127565 | | [#127965](https://github.com/dotnet/runtime/issues/127965) | Issue (KBE) | `[ci-scan] Known Build Error: System.Net.NameResolution DnsGetHostAddresses_LocalhostSubdomainWithTrailingDot fails on Android` | new | | [#127966](https://github.com/dotnet/runtime/issues/127966) | Issue (regression) | `[ci-scan] Test failure: XslCompiledTransformApiTests (82 tests) on all NativeAOT legs — PlatformNotSupportedException (Reflection.Emit)` | new | | [#127967](https://github.com/dotnet/runtime/pull/127967) | PR (draft) | `[ci-scan] Exclude Vector3Interop from GC stress` | #127827 | --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .github/workflows/ci-failure-scan.md | 192 ++++++++++++++++++++++----- 1 file changed, 157 insertions(+), 35 deletions(-) diff --git a/.github/workflows/ci-failure-scan.md b/.github/workflows/ci-failure-scan.md index 66c022456bb640..1ca7541d977429 100644 --- a/.github/workflows/ci-failure-scan.md +++ b/.github/workflows/ci-failure-scan.md @@ -148,33 +148,84 @@ Same-run KBE + PR is not possible: gh-aw strict mode forbids `issues: write` on The agent must accept this constraint and produce KBEs in run N, then companion PRs in run N+1. The 12-hour cadence makes this acceptable: the KBE alone unblocks PR CI immediately (the moment the safe-outputs job processes it, ~1 min after the agent finishes), and the muting PR follows within 12h. -For each actionable failure, in this order: +For each actionable failure, walk through all six checks below before deciding the action — multiple can fire at once, and any one is reason to stop. -1. **Search for existing artifacts** before creating anything new: - - `search_issues` for an open KBE: `is:issue is:open label:"Known Build Error" in:body ""`. Try variations on the signature (full `[FAIL]` line, assertion text, exception type + test name). - - `search_pull_requests` for an open muting PR that already silences this test: `is:pr is:open in:title "" "[ci-scan]"` and `is:pr is:open "" ActiveIssue`. - - `search_pull_requests` for an open small-fix PR: `is:pr is:open in:title "" "[ci-scan]"`. - - If a KBE + muting PR already cover this failure, **skip** — record it in the coverage tally as `→ already-covered: KBE # + PR #` and move on. Do not duplicate. -2. **No existing KBE → file one via safe-outputs `create_issue`**. The only labels permitted on KBE issues are `Known Build Error` and `blocking-clean-ci` (see "Outputs: title and labels" below). Title prefix: `[ci-scan] `. Body: the KBE format described in "Known Build Error issue" below. The safe-outputs handler will create the issue ~1 minute after the agent finishes; the issue number is not available to the agent during this run. -3. **Existing KBE found AND failure still occurring AND no muting PR exists yet → open the muting PR via safe-outputs `create_pull_request`** with the existing KBE issue number hardcoded in the diff: `[ActiveIssue("https://github.com/dotnet/runtime/issues/", ...)]` for unit tests, `true` (with an inline `` comment) for stress-incompatible JIT csproj families. PR title prefix `[ci-scan] `; **the PR body MUST include a top-level "Linked KBE" line of the form `Linked KBE: #` so the link is unambiguous and machine-readable**, in addition to the prose "Linked KBE" section. This PR must change **only test annotations / csproj test-config flags** — no product code, no diagnosis, no logic. Aim for ≤ 5 lines of diff. -4. **(Optional, alongside step 3) Open a small-fix PR via safe-outputs `create_pull_request`** if the failure satisfies the "small product fix opportunity" criteria above. Separate PR, separate branch, separate diff. PR body must (a) cite the failing test as evidence, (b) explain the root cause, (c) state explicitly why the fix is safe, (d) include `Linked KBE: #` as a top-level line, and (e) note "If this lands before #, that PR can be closed". Do not bundle the fix into the muting PR — keep them separate so a maintainer can take one without the other. +#### Step 1 — Look for an existing KBE. -Caps: safe-outputs `create_issue` max 5/run, `create_pull_request` max 10/run. When a cap is hit, fall back to "skipped: cap reached" rather than silently dropping signatures — subsequent runs will pick them up. +Search `is:issue is:open label:"Known Build Error" in:body ""`. Try variations: the full `[FAIL]` line, the assertion text, the exception class plus the test name. On a hit, record the issue number as `existing-kbe` and continue — finding a KBE doesn't end the walk, it changes the final action. -After every run, you should be able to answer YES to **whichever of these applies to each failure**: +#### Step 2 — Look for an area-team tracker without the KBE label. -- **First-encounter failure (no existing KBE):** "Did I file the KBE?" Muting/fix PRs are deferred to the next run — they cannot reference an issue number that doesn't exist yet at agent runtime. -- **Existing KBE, no muting PR yet:** "Did I open the muting PR (and, if criteria met, the small-fix PR)?" -- **Existing KBE + existing muting PR:** "Did I confirm both, skip silently, and record `→ already-covered: KBE # + PR #` in the coverage tally?" +Some teams track recurring failures in plain issues. Search `is:issue is:open in:title ""` together with `in:body ""`. On a hit, record it as `linked-tracker` — but **do not** treat the tracker as a substitute for a KBE. Build Analysis only matches against issues that carry the `Known Build Error` label and a valid JSON body, so a plain tracker won't unblock PR CI on its own. File a new KBE for Build Analysis to match against, and cross-link the tracker (`Tracking: dotnet/runtime#`) inside the KBE body and the muting PR body. -If the answer is NO for any failure, you have not done the job. +#### Step 3 — Look for an existing muting PR. + +Search `is:pr is:open in:title "" "[ci-scan]"` and `is:pr is:open "" ActiveIssue`. On a hit, record `→ existing-PR #` (muting) and stop. + +#### Step 4 — Look for an in-flight fix PR by anyone. + +Search broadly — not only `[ci-scan]` PRs — by test name, file path, and assembly: `is:pr is:open ""`, `is:pr is:open ""`, `is:pr is:open "" in:title`. For each candidate, fetch the PR body; if it claims to fix this failure (or links the same KBE), stop and record `→ existing-PR #` (in-flight fix). + +#### Step 5 — Verify every issue number you're about to write actually exists. + +For every `` you plan to embed in source (`[ActiveIssue("...issues/")]`, `Linked KBE: #`, the inline `` comment), call the github tool `issue_read` with method `get` (`{"method": "get", "owner": "dotnet", "repo": "runtime", "issue_number": }`) and confirm it returns an open issue. If it doesn't, stop — a dead-link annotation in source requires a follow-up PR to remove. + +#### Step 6 — Confirm muting is welcome on this issue. + +Read the candidate KBE / tracker's body and its most recent area-owner comment. Skip muting (record `→ skipped: do-not-mute on issue #` and stop) if any of the following holds: + +- The body or a recent comment from an area owner explicitly says not to mute, disable, or skip — e.g. "please don't disable these tests", "do not mute", "keep failing", "investigation in progress". +- The issue is labeled with anything semantically equivalent (verify the label exists in `dotnet/runtime` before relying on it; do not invent labels). +- The most recent area-owner comment (within the last 14 days) actively opposes muting on procedural grounds — e.g. requesting a fix-forward, awaiting a JIT/GC repro. + +When in doubt, skip muting and let the next run revisit; over-muting against an active investigation is the failure mode this step exists to prevent. + +#### What action to take + +- **Step 1 found nothing** → file a new KBE via safe-outputs `create_issue` with the body template below, title prefix `[ci-scan] `, and only the labels `Known Build Error` and `blocking-clean-ci`. If Step 2 found a tracker, cross-link it as `Tracking: dotnet/runtime#` in the KBE body. The issue number isn't visible during this run, so the muting PR is deferred to the next run. +- **Step 1 found a valid KBE, AND steps 3–6 are clean** → open the muting PR via safe-outputs `create_pull_request`. Diff ≤ 5 lines, only test annotations or csproj flags. The body must include `Linked KBE: #` as a top-level line plus the four-question verification block below. If Step 2 also found a tracker, cite it as `Tracking: dotnet/runtime#` alongside `Linked KBE`. +- **Plus, if the failure satisfies the "small product fix opportunity" criteria above** → open a separate fix PR on its own branch. Body cites (a) the failing test as evidence, (b) the root cause, (c) why the fix is safe, (d) `Linked KBE: #`, and (e) "If this lands before #, that PR can be closed." Kept separate so a maintainer can take one without the other. + +#### Before you link a KBE, verify it actually matches + +Test-name overlap alone is not enough — common wrong-link patterns include reusing a KBE filed against a different architecture, or one about an exception class for a failure that's actually a work-item timeout. Answer all four before writing `Linked KBE: #` or `[ActiveIssue("...issues/")]`: + +1. Does the candidate KBE describe the **same test (or test family)** as the current `[FAIL]` line? +2. Does its `ErrorMessage` / quoted exception text describe the **same failure signature** (exception class, assertion message)? +3. Is the failing **OS** in the set the KBE says it impacts? +4. Is the failing **architecture** in the set the KBE says it impacts? + +If any answer is no, file a fresh KBE this run and defer the muting PR. Embed the four answers in the PR body's "Reasoning" section; PRs missing this, or with an unaddressed mismatch, will be closed. + +Optional fifth check when the candidate KBE is older than ~14 days: confirm Build Analysis is still actually matching it. The hit count appears in the issue body and is rewritten by Build Analysis on every match — a stale, never-edited body is a hint the signature went bad. `gh api graphql` over `userContentEdits` on the issue gives the edit timeline. + +#### Caps and end-of-run check + +Per-run caps: `create_issue` max 5, `create_pull_request` max 10. On cap, record `→ skipped: cap reached` — the next run picks them up. + +Before stopping, confirm each failure is handled: + +- **No existing KBE** → KBE filed? +- **Existing KBE, no muting PR yet** → muting PR opened (and the optional fix PR if criteria are met)? +- **Existing KBE plus existing muting PR or in-flight fix** → `→ existing-PR #` recorded? + +If the answer is no for any failure, the run is incomplete. ### Per-failure-class rules The two-pass flow above applies to all classes below. "KBE + muting PR" means: KBE in the run that first encounters the failure, muting PR in the next run that finds the KBE already exists. - **Recurring failure with a stable error signature** (≥ 2 occurrences on `main` in the scanned window) → KBE (run N) + muting PR (run N+1) + fix PR (optional, run N+1, only if criteria met). -- **Per-test platform / configuration incompatibility** (e.g., test fails only under `jitstress=2`, `gcstress=0xC`, on a single mobile arch, on browser, on NativeAOT) → KBE (run N) + muting PR (run N+1). Allowed muting PR mechanisms: +- **Per-test platform / configuration incompatibility** (e.g., test fails only under `jitstress=2`, `gcstress=0xC`, on a single mobile arch, on browser, on NativeAOT) → KBE (run N) + muting PR (run N+1). The muting PR's skip condition MUST be **as narrow as the observed failure scope** — only the OS / arch / config combinations that actually fail. + + | Observed failure scope | ❌ Bad (too broad) | ✅ Good (matches scope) | + |---|---|---| + | Only `linux-arm` fails | `[SkipOnPlatform(TestPlatforms.AnyUnix, ...)]` or muting on all NativeAOT | `true` | + | Only NativeAOT on a single arch | `true` (all arches) | `true` | + | Only one stress mode | `true` (all stress modes) | Add stress-mode predicate, e.g. gate via the existing `GCStressIncompatible` only for the failing variant | + + In the PR's "Reasoning" section, list the exact set of failing legs (definition + queue + stress mode) that justifies the chosen condition, so a reviewer can verify scope matches evidence. +- Allowed muting PR mechanisms: - `[SkipOnPlatform(TestPlatforms., "")]` for platform-specific failures. - `[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.))]` narrowed via existing helpers. - `[ActiveIssue("https://github.com/dotnet/runtime/issues/", TestPlatforms.)]` referencing the KBE. @@ -285,9 +336,32 @@ File one when **all** of the following hold: - No fix PR is currently open (verify via `search_pull_requests`). - The failure is **not** a build break or an infrastructure failure — only test failures or hangs are eligible for a KBE. Build breaks and infra failures (for example dead-letter, device-lost, or agent-disconnect issues) must use a regular tracking issue. -Required structure (Build Analysis is strict — match the headings exactly, and use **exactly three backticks** for the JSON code fence; never four. The opening and closing fence must be the same length, otherwise the fence is broken and Build Analysis silently skips the issue): +Required structure: match the headings exactly. The literal body MUST look like one of the two templates below — pick exactly one (literal substring is the default; regex only if no single literal line is specific enough). Do not emit both blocks. The outer fence in this prompt uses `~~~` (tildes) only so the inner ` ``` ` fences stay literal; in the issue you emit, do **not** use tildes anywhere — emit only the inner content between (but not including) the `~~~` lines for the template you chose. Walk the "Verify the body before submitting" checks below before committing to the issue body. + +**Template A — literal substring match (default).** Pick this when the failure log contains a stable, specific assertion or exception message line. + +~~~ +## Build Information +Build: +Build error leg or test failing: - +Pull request: +## Error Message + + + +```json +{ + "ErrorMessage": "", + "BuildRetry": false, + "ExcludeConsoleLog": false +} ``` +~~~ + +**Template B — regex match.** Pick this only when no single literal line is specific enough. Anchored, prefer `[^\\n]*` over `.*`, no catastrophic backtracking. The JSON value itself must be a single-line string with no real newlines, but you can match across log lines via the regex `\n` escape inside that string or via the array form. + +~~~ ## Build Information Build: Build error leg or test failing: - @@ -295,21 +369,73 @@ Pull request: + -(open three backticks, then `json` on the same line) +```json { - "ErrorMessage": "", - "ErrorPattern": "", + "ErrorPattern": "", "BuildRetry": false, "ExcludeConsoleLog": false } -(close three backticks) ``` +~~~ + +#### Verify the body before submitting + +Build Analysis is strict: a malformed JSON block or an over-broad signature means the issue is silently skipped or matches every passing run. Walk these checks; fix and re-check on any failure. Canonical upstream reference (worth reading in full before filing your first KBE): [`dotnet/arcade-skills/.../kbe-issue-creation.md`](https://github.com/dotnet/arcade-skills/blob/main/plugins/dotnet-dnceng/skills/ci-analysis/references/kbe-issue-creation.md). + +1. **The body contains a fenced JSON block.** Without it Build Analysis has nothing to parse. Prose `**Error Message:**` / `**Stack Trace:**` sections don't count. +2. **Exactly one fenced JSON block.** Multiple skeletons yield zero matches. +3. **The opening fence is exactly three backticks followed by `json`**, lowercase, with nothing else on the line. Four backticks, missing lang tag, or trailing whitespace causes the parser to skip the issue. +4. **The closing fence is exactly three backticks**, same length as the open. +5. **Exactly one of `ErrorMessage` or `ErrorPattern` is present and non-empty.** Populating both is undefined behavior — Build Analysis may apply only one and you don't control which. Do not leave the unused field as `""` either; delete it. Empty signatures match nothing. +6. **The signature is not a bare identifier.** A fully-qualified test name, a stack-frame line, or a bare exception type all appear in `[PASS]` and `[SKIP]` lines for the same test, so the signature would match every passing run going forward. This applies to BOTH `ErrorMessage` and `ErrorPattern` — a regex like `TestMethodName` or `Some\\.Class\\.TestMethod` is just as broken as the literal. +7. **Negative-match before submitting.** If you have the failing log on disk (Helix work-item console, AzDO step log), run a smoke test against it — eyeballing the signature catches roughly nothing. Build Analysis's `ErrorMessage` matcher is `String.Contains` ordinal case-sensitive, which `grep -F` reproduces exactly: + + ```bash + grep -Fc "" failure.log # > 0 = matches the failure + grep -F "" failure.log | grep -E '^\[(PASS|SKIP)\]' # MUST be empty + ``` + + For `ErrorPattern`, use `grep -E` — different regex flavor than .NET's `NonBacktracking`, but close enough to flag over-broad patterns: + + ```bash + grep -Ec '' failure.log + grep -E '' failure.log | grep -E '^\[(PASS|SKIP)\]' # MUST be empty + ``` + + If the second command in either pair prints anything, the signature also matches `[PASS]` / `[SKIP]` lines for this test and will mute future passing runs. Narrow it. Also mentally check whether the signature would match (a) other tests in the same assembly, or (b) build-time output (Crossgen2, ilasm, MSBuild). The canonical validator is [`Test-KnownIssuePattern.ps1`](https://github.com/dotnet/arcade-skills/blob/main/plugins/dotnet-dnceng/skills/ci-analysis/scripts/Test-KnownIssuePattern.ps1) (uses the exact regex flavor, emits a validated JSON block); pwsh isn't in this workflow's tool allowlist today, so the `grep -F` / `grep -E` smoke test above is the in-band substitute. +8. **Single-line, no escapes.** Build Analysis runs `String.Contains` (case-sensitive, ordinal) for `ErrorMessage` and `Regex` with `Singleline | IgnoreCase | NonBacktracking` and a 50ms-per-line timeout for `ErrorPattern`. Newlines, ANSI escapes (`\u001b[`), and time-prefixes (`[12:34:56.789]`) are not stripped from log lines before matching. Use the array form (below) for multi-line; use `[^\\n]*` instead of `.*` in regexes. +9. **JSON escaping is correct.** Inside the JSON string value: `"` → `\"`, `\` → `\\`, real newlines → `\n`. For regex patterns this means **double escape**: a literal dot is `\\.` in JSON (the JSON parser consumes one backslash, leaving `\.` for the regex engine). A `\d` you actually want regex to see has to be written `\\d` in JSON. GitHub's issue Preview tab will flag invalid JSON — use it. + +##### Multi-line signatures (array form) + +Both `ErrorMessage` and `ErrorPattern` accept an **array of strings**: each element matches a separate log line, in order, and lines may appear between matched elements. Use this when no single line on its own is unique enough — e.g., the test name on one line and the assertion text two lines down. + +```json +{ + "ErrorMessage": [ + "System.Net.Http.Tests.HttpClientHandlerTest.GetAsync_UnknownHost_Throws", + "System.Net.Http.HttpRequestException : Name or service not known" + ] +} +``` + +Rules: each element matches one line (the elements are NOT concatenated and matched as a single multi-line string). All elements must match in order. Don't mix `ErrorMessage` and `ErrorPattern` in the same array. Don't pad the array with generic tokens like `exitcode: 139` or `Crash` — they add no specificity and risk false negatives if the log format changes. + +#### Signature examples — Bad → Good + +`ErrorMessage` is matched as an exact literal substring — `...` in the value is matched as three literal dots, not "anything". Use the array form (above) when you need to span variable text between two anchors. The "Good" column below shows the form to use; values shown as plain strings go in `ErrorMessage`, values prefixed `ErrorPattern:` go in `ErrorPattern`, and values shown as a JSON array go in `ErrorMessage` array form. -The pseudo-instructions `(open three backticks, then ...)` and `(close three backticks)` above are **placeholders** in this prompt because nesting fenced code blocks in the prompt itself is fragile; in the actual issue body emit literal ```` ``` `` (three backticks) on each side of the JSON object. Verify the open and close fences both consist of exactly three backticks before submitting. If you are uncertain, count them. +| ❌ Bad | Why bad | ✅ Good | +|---|---|---| +| `"Some.Test.Class.TestMethodName"` | bare test name; matches `[PASS]` lines for the same test | array: `["Some.Test.Class.TestMethodName", "System.Net.Sockets.SocketException : Try again"]` | +| `"SomeTests.Prefix_"` (trailing `_`) | truncated prefix; trailing `_`/`*`/`.` is literal not glob | `ErrorPattern: "^SomeTests\\.Prefix_[A-Za-z]+\\b[^\\n]*Xunit\\.Sdk\\."` | +| `"Some.Type.Method"` (bare type/method) | matches stack scans of unrelated tests | `ErrorPattern: "^System\\.NullReferenceException\\b[^\\n]*\\n\\s+at Some\\.Type\\.Method\\b"` | +| `"BadImageFormatException"` | bare exception type; matches infra hiccups too | `"System.BadImageFormatException: Could not load file or assembly 'System.Private.CoreLib'"` | +| `"Operation timed out"` | matches transient network failures everywhere | array: `["xharness exec android test", "Operation timed out after 3600s"]` paired with `BuildRetry: false` | -Choose `ErrorMessage` (substring) by default. Use `ErrorPattern` only when a regex is genuinely needed and confirm it has no catastrophic backtracking. Set `BuildRetry: true` **only** for confirmed infra/queue-side flakes (dead-letter, device-lost, agent disconnect) where retrying is safe. +Choose `ErrorMessage` (literal substring) by default. Use `ErrorPattern` only when no single literal line is specific enough — and confirm the regex is anchored and has no catastrophic backtracking. **Populate exactly one of the two fields per JSON block; never both.** Pattern length doesn't matter; specificity does — don't shorten a unique multi-line signature into a pithy one-liner. Set `BuildRetry: true` **only** for confirmed infra/queue-side flakes (dead-letter, device-lost, agent disconnect) where retrying is safe. ### Signature specificity (mandatory) @@ -321,6 +447,8 @@ The `ErrorMessage` / `ErrorPattern` MUST uniquely identify **this specific failu - A generic tool name + failure verb: `Crossgen2 failed`, `ilasm failed`, `dotnet build failed`, `xharness exited`. - A bare exception type with no message: `BadImageFormatException`, `NullReferenceException`, `Fatal error. Invalid Program`, `Assertion failed`. - A bare `[FAIL]` line with only the test class name and no exception/assertion text. +- A bare fully-qualified test name (e.g. `"ErrorMessage": "Namespace.Class.TestName"`) without the assertion/exception text that follows it on the next line of the log. The test name alone matches every future regression of that test, including unrelated ones, and Build Analysis will mute legitimate new failures. +- A truncated test-name prefix ending in an underscore, dot, or wildcard glyph (e.g. `"SomeClass.SomeMethod_"`, `"Foo.Bar."`, `"Connect_*"`). `ErrorMessage` is a literal `String.Contains` match, not a glob — a trailing `_` or `*` is treated as a literal character and either over-matches every test whose name contains the prefix or never matches at all. If you need to cover multiple related test methods, instead set `ErrorPattern` to a properly anchored regex (e.g. `"SomeClass\\.SomeMethod_[A-Za-z]+ "`), or pick the exception/assertion message that is common to all of them. - Common infra strings: `Connection reset`, `Operation timed out`, `Resource temporarily unavailable`, `No space left on device`. **Prefer** signatures built from the most specific stable token in the log. In order of preference: @@ -357,16 +485,10 @@ These look like permission errors but are physical: ## Coverage discipline (avoid arbitrary selection) -Failure selection must be **systematic, not opportunistic**. Process pipelines in the order listed in the "Pipelines to scan" table. For each pipeline: - -1. List every failed signature in the latest scanned build (sorted by occurrence count in the window, descending). -2. For each signature, decide and record one of: `→ filed-issue #aw_`, `→ filed-PR #aw_`, `→ existing-issue #`, `→ existing-PR #`, `→ skipped: `. A skipped signature MUST have a reason (e.g., "build canceled, not a test failure", "less than 2 occurrences and not blocking", "owned by area-Infrastructure rota and already triaged"). -3. Keep a per-pipeline tally on disk under `/tmp/gh-aw/agent/coverage/.txt`. At the end, print a summary table to the agent log: `pipeline | total-signatures | issues-filed | prs-filed | reused-existing | skipped-with-reason`. - -Caps still apply (10 PRs / 5 issues / run); when the cap is hit, fall back to "skipped: cap reached" rather than dropping signatures silently. Subsequent runs will pick them up. - -Do not jump between pipelines mid-investigation. Finish all classifications for pipeline N before moving to pipeline N+1. +Process every failed signature in every pipeline — do not cherry-pick the obvious ones and skip the rest. Walk pipelines in the order listed in the "Pipelines to scan" table; finish all classifications for pipeline N before moving to pipeline N+1. -## Submit +For each pipeline: -Search existing issues and PRs (`search_issues`, `search_pull_requests`) before creating anything new — never duplicate. Cross-check against issues filed by the existing JIT failure-tracking bot (e.g. open issues authored by `JulieLeeMSFT` for JIT pipelines) and reference rather than re-file them. When using `search_pull_requests`, filter to `is:merged OR review:approved` so the integrity filter does not silently drop low-trust results. If an issue already tracks the failure, **prefer opening a PR that references it via `[ActiveIssue("https://github.com/dotnet/runtime/issues/")]`** rather than filing another issue. If `search_issues` returns no matches, proceed to file the issue. +1. List every failed signature in the latest scanned build, sorted by occurrence count in the window (descending). +2. For each signature, run the six-step walk in "Two-pass KBE → PR flow" and record the outcome (`→ filed-issue #aw_`, `→ filed-PR #aw_`, `→ existing-issue #`, `→ existing-PR #`, or `→ skipped: `). A skipped signature MUST have a reason (e.g., "build canceled, not a test failure", "less than 2 occurrences and not blocking", "owned by area-Infrastructure rota and already triaged"). +3. Keep a per-pipeline tally on disk under `/tmp/gh-aw/agent/coverage/.txt`. At the end of the run, print a summary table to the agent log: `pipeline | total-signatures | issues-filed | prs-filed | reused-existing | skipped-with-reason`. From 6e51f762bc4c98ea90ae6ca21c4e220b4b2e7a5c Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Sat, 9 May 2026 05:53:38 +0900 Subject: [PATCH 067/109] [main] Source code updates from dotnet/dotnet (#127944) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit > [!NOTE] > This is a codeflow update. It may contain both source code changes from > [the VMR](https://github.com/dotnet/dotnet) > as well as dependency updates. Learn more [here](https://github.com/dotnet/dotnet/tree/main/docs/Codeflow-PRs.md). This pull request brings the following source code changes [marker]: <> (Begin:f7901f87-9f24-40d6-9bc1-564863937237) ## From https://github.com/dotnet/dotnet - **Subscription**: [f7901f87-9f24-40d6-9bc1-564863937237](https://maestro.dot.net/subscriptions?search=f7901f87-9f24-40d6-9bc1-564863937237) - **Build**: [20260507.13](https://dev.azure.com/dnceng/internal/_build/results?buildId=2969659) ([313540](https://maestro.dot.net/channel/8298/github:dotnet:dotnet/build/313540)) - **Date Produced**: May 8, 2026 2:24:04 AM UTC - **Commit**: [0eae08ed2f094f44e0151e4815e7cdd1a334fcdf](https://github.com/dotnet/dotnet/commit/0eae08ed2f094f44e0151e4815e7cdd1a334fcdf) - **Commit Diff**: [36afe73...0eae08e](https://github.com/dotnet/dotnet/compare/36afe73557f5f93cd7bc827cb644a3ff018eca0b...0eae08ed2f094f44e0151e4815e7cdd1a334fcdf) - **Branch**: [main](https://github.com/dotnet/dotnet/tree/main) **Updated Dependencies** - From [5.7.0-1.26211.102 to 5.7.0-1.26257.113][1] - Microsoft.CodeAnalysis - Microsoft.CodeAnalysis.Analyzers - Microsoft.CodeAnalysis.CSharp - Microsoft.Net.Compilers.Toolset - From [11.0.100-preview.4.26211.102 to 11.0.100-preview.5.26257.113][1] - Microsoft.CodeAnalysis.NetAnalyzers - Microsoft.DotNet.ApiCompat.Task - Microsoft.NET.Workload.Emscripten.Current.Manifest-11.0.100.Transport - From [11.0.0-beta.26211.102 to 11.0.0-beta.26257.113][1] - Microsoft.DotNet.Arcade.Sdk - Microsoft.DotNet.Build.Tasks.Archives - Microsoft.DotNet.Build.Tasks.Feed - Microsoft.DotNet.Build.Tasks.Installers - Microsoft.DotNet.Build.Tasks.Packaging - Microsoft.DotNet.Build.Tasks.TargetFramework - Microsoft.DotNet.Build.Tasks.Templating - Microsoft.DotNet.Build.Tasks.Workloads - Microsoft.DotNet.CodeAnalysis - Microsoft.DotNet.GenAPI - Microsoft.DotNet.GenFacades - Microsoft.DotNet.Helix.Sdk - Microsoft.DotNet.PackageTesting - Microsoft.DotNet.RemoteExecutor - Microsoft.DotNet.SharedFramework.Sdk - Microsoft.DotNet.XliffTasks - Microsoft.DotNet.XUnitExtensions - From [0.11.5-preview.26211.102 to 0.11.5-preview.26257.113][1] - Microsoft.DotNet.Cecil - From [3.2.2-beta.26211.102 to 3.2.2-beta.26257.113][1] - Microsoft.DotNet.XUnitAssert - From [2.9.3-beta.26211.102 to 2.9.3-beta.26257.113][1] - Microsoft.DotNet.XUnitConsoleRunner - From [11.0.0-preview.4.26211.102 to 11.0.0-preview.5.26257.113][1] - Microsoft.NET.Sdk.IL - Microsoft.NETCore.App.Ref - Microsoft.NETCore.ILAsm - runtime.native.System.IO.Ports - System.Reflection.Metadata - System.Reflection.MetadataLoadContext - System.Text.Json - From [7.6.0-rc.21202 to 7.7.0-rc.25813][1] - NuGet.Frameworks - NuGet.Packaging - NuGet.ProjectModel - NuGet.Versioning - From [3.0.0-preview.4.26211.102 to 3.0.0-preview.5.26257.113][1] - System.CommandLine - From [19.1.0-alpha.1.26173.1 to 19.1.0-alpha.1.26208.2](https://github.com/dotnet/dotnet/compare/adb0185573...db9a80a3e2) - runtime.linux-arm64.Microsoft.NETCore.Runtime.JIT.Tools - runtime.linux-arm64.Microsoft.NETCore.Runtime.Mono.LLVM.Libclang - runtime.linux-arm64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk - runtime.linux-arm64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools - runtime.linux-musl-arm64.Microsoft.NETCore.Runtime.JIT.Tools - runtime.linux-musl-arm64.Microsoft.NETCore.Runtime.Mono.LLVM.Libclang - runtime.linux-musl-arm64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk - runtime.linux-musl-arm64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools - runtime.linux-musl-x64.Microsoft.NETCore.Runtime.JIT.Tools - runtime.linux-musl-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Libclang - runtime.linux-musl-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk - runtime.linux-musl-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools - runtime.linux-x64.Microsoft.NETCore.Runtime.JIT.Tools - runtime.linux-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Libclang - runtime.linux-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk - runtime.linux-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools - runtime.osx-arm64.Microsoft.NETCore.Runtime.JIT.Tools - runtime.osx-arm64.Microsoft.NETCore.Runtime.Mono.LLVM.Libclang - runtime.osx-arm64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk - runtime.osx-arm64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools - runtime.osx-x64.Microsoft.NETCore.Runtime.JIT.Tools - runtime.osx-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Libclang - runtime.osx-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk - runtime.osx-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools - runtime.win-arm64.Microsoft.NETCore.Runtime.JIT.Tools - runtime.win-x64.Microsoft.NETCore.Runtime.JIT.Tools - runtime.win-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Libclang - runtime.win-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk - runtime.win-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools - From [11.0.0-alpha.1.26173.2 to 11.0.0-alpha.1.26208.5](https://github.com/dotnet/dotnet/compare/0077cd1a0d...cfe285c85a) - runtime.linux-arm64.Microsoft.NETCore.Runtime.Wasm.Node.Transport - runtime.linux-musl-arm64.Microsoft.NETCore.Runtime.Wasm.Node.Transport - runtime.linux-musl-x64.Microsoft.NETCore.Runtime.Wasm.Node.Transport - runtime.linux-x64.Microsoft.NETCore.Runtime.Wasm.Node.Transport - runtime.osx-arm64.Microsoft.NETCore.Runtime.Wasm.Node.Transport - runtime.osx-x64.Microsoft.NETCore.Runtime.Wasm.Node.Transport - runtime.win-arm64.Microsoft.NETCore.Runtime.Wasm.Node.Transport - runtime.win-x64.Microsoft.NETCore.Runtime.Wasm.Node.Transport [marker]: <> (End:f7901f87-9f24-40d6-9bc1-564863937237) [1]: https://github.com/dotnet/dotnet/compare/36afe73557...0eae08ed2f [marker]: <> (Start:Footer:CodeFlow PR) ## Associated changes in source repos - https://github.com/dotnet/arcade/compare/30f8bf581e0e0d7e1de30898de8fa9c4008d2f5e...a08169b890573cfd7f949ea9062c86a4db1aab1b - https://github.com/dotnet/aspnetcore/compare/3b9acb9838c7ad8392cc5e0abd4db41916d73ba1...023ae68bbd84751a62819987ab9d7b8400e318d6 - https://github.com/dotnet/cecil/compare/82f47fc2ff84b3d94e910147d52f2e6795f6ae21...187393d39be7342146f96562f1e5ca9f7e2b1e24 - https://github.com/dotnet/command-line-api/compare/d3de878757ed2fb7a07c85f285764fa9755c65a0...99db1e31826f24ec672efe70b36074a59464c29a - https://github.com/dotnet/deployment-tools/compare/73e2836a5d7397d203c12809f1f9ee7a09beac8d...87b9cb458b22091afbb55e246d7851eb623e516a - https://github.com/dotnet/efcore/compare/ebc5a8710b0e3f29758ae5ac11e1dd18a200063d...35d954220a8d3d9c0e32b916a7612236ca6d247a - https://github.com/dotnet/emsdk/compare/4cdda38835c6a38a9c58e7cd9adc3dc4084e2d60...92398bdc55d3b500a085f29ef658a5c1fd6d4cd0 - https://github.com/dotnet/fsharp/compare/1f468868e78dbdec73a9a44938978dc297e4f890...ea3438ac40bc0104dbf47843390e0a1be1601509 - https://github.com/dotnet/msbuild/compare/8a330c4406f03bafa3006d1e1213ec5c62252640...fbf2ce701012307d26b95a6dbef45cf94f6de004 - https://github.com/nuget/nuget.client/compare/779eff1e73420573dd39dbbe54896ff8f08955e1...de3b92c2768037cceac21a7bcc53318d42554428 - https://github.com/dotnet/razor/compare/1eaf86c2f4791fe1694afab54ab87116f48f559f...0f6925db833176ee2df811cd2b2280144a378039 - https://github.com/dotnet/roslyn/compare/e3a102fb75ef112d064feebd2f9385385a445a06...2428f0c72de5d2eed863b9c420f840b78080f5cb - https://github.com/dotnet/runtime/compare/ce3e7165836e64efbfe6f7a874991715b40e28bf...06ca6751830996c1c815bfdd73a3fb4c8b53d77f - https://github.com/dotnet/scenario-tests/compare/5745f7404c4a3ae7f1b08117bc6092a96224a985...69ea163b4d04fec951117d883ba353e058b95c24 - https://github.com/dotnet/sdk/compare/a1f2e26244ad66e91094c523d0e9a87eac051cc4...6dc6b337ba082226f836da7585a07f58d781e7f1 - https://github.com/dotnet/sourcelink/compare/6ea6adb7b969c3d58c5aececc1df68e09288cbbf...29e6c941ac3b5879aa651eda2705ca2092d730c0 - https://github.com/dotnet/symreader/compare/e87544a2ca8f13d08c246c0a54db2d54960f2e48...5951f7085a5f25b429c4362a3a70a29f549b0e18 - https://github.com/microsoft/vstest/compare/5c5c4f1c8169984605ebd6802d6f0abb9e5122ac...72bb02e1b18de388244cefc718e669d9829a82d5 - https://github.com/dotnet/windowsdesktop/compare/8350252f689bc85aec91a47e3d7eff9333ef6569...c96077ee4e0eed712537d9e99f2f4a3aa75b3507 - https://github.com/dotnet/winforms/compare/9bff4e659a17bd9a0ba30b462a0ae8cb9a03774b...f8d16ffae955533c7f618a0b473ddea522709449 - https://github.com/dotnet/wpf/compare/7bb98f650deaba40fe9f6e35ae3b14cb74a4c177...f49ca1e5ece1a46a1fc71375109cdb28459f1389 - https://github.com/dotnet/xdt/compare/a37116d1c37e696cc70fc138c01d02dff7542d82...0d57d4bbae8518c836ac29bc4fcf9c79a246bf46
Diff the source with this PR branch ```bash darc vmr diff --name-only https://github.com/dotnet/dotnet:0eae08ed2f094f44e0151e4815e7cdd1a334fcdf..https://github.com/dotnet/runtime:darc-main-96ceab76-0faa-4bbf-ac23-95bb01f62240 ```
[marker]: <> (End:Footer:CodeFlow PR) --------- Co-authored-by: dotnet-maestro[bot] Co-authored-by: Larry Ewing Co-authored-by: MichalStrehovsky <13110571+MichalStrehovsky@users.noreply.github.com> Co-authored-by: Michal Strehovský Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> --- eng/Version.Details.props | 152 ++++---- eng/Version.Details.xml | 306 ++++++++-------- eng/Versions.props | 4 +- eng/common/core-templates/job/job.yml | 5 +- .../job/publish-build-assets.yml | 12 +- eng/common/core-templates/job/renovate.yml | 2 +- eng/common/core-templates/jobs/jobs.yml | 5 + .../post-build/common-variables.yml | 2 - .../core-templates/post-build/post-build.yml | 134 ++++--- .../post-build/setup-maestro-vars.yml | 5 +- .../steps/component-governance.yml | 16 - .../core-templates/steps/generate-sbom.yml | 60 +--- .../core-templates/steps/publish-logs.yml | 10 +- .../core-templates/steps/source-build.yml | 2 +- eng/common/cross/build-android-rootfs.sh | 2 +- eng/common/cross/toolchain.cmake | 12 +- eng/common/darc-init.ps1 | 8 +- eng/common/darc-init.sh | 4 +- eng/common/generate-sbom-prep.ps1 | 29 -- eng/common/generate-sbom-prep.sh | 39 --- eng/common/post-build/redact-logs.ps1 | 4 +- .../post-build/sourcelink-validation.ps1 | 327 ------------------ eng/common/sdk-task.ps1 | 15 +- eng/common/template-guidance.md | 2 - eng/common/templates-official/job/job.yml | 57 +-- .../steps/component-governance.yml | 7 - .../steps/publish-pipeline-artifacts.yml | 4 +- eng/common/templates/job/job.yml | 53 +-- .../templates/steps/component-governance.yml | 7 - eng/common/tools.ps1 | 103 ++---- eng/common/tools.sh | 23 +- global.json | 12 +- src/coreclr/clrdatadescriptors.cmake | 10 +- .../tools/ILTrim.Core/ILTrim.Core.csproj | 3 - src/coreclr/tools/ILTrim/ILTrim.csproj | 1 - .../tools/aot/ILCompiler/ILCompiler.props | 10 +- .../Common/src/Interop/Interop.Utils.cs | 4 +- .../Interop/Linux/cgroups/Interop.cgroups.cs | 4 +- .../Unix/System.Native/Interop.ReadLink.cs | 4 +- .../Interop.OpenSsl.cs | 4 +- .../Interop.Ssl.cs | 4 +- .../Kernel32/Interop.GetComputerName.cs | 4 +- .../NCrypt/Interop.NCryptDeriveKeyMaterial.cs | 4 +- .../Interop/Windows/SspiCli/SSPIWrapper.cs | 4 +- .../System/Diagnostics/DiagnosticsHelper.cs | 4 +- .../System/Drawing/ColorConverterCommon.cs | 4 +- .../Common/src/System/HexConverter.cs | 4 +- .../src/System/IO/PathInternal.Windows.cs | 4 +- .../Common/src/System/IO/PathInternal.cs | 4 +- .../aspnetcore/Http2/Hpack/HPackEncoder.cs | 8 +- .../Helpers/VariableLengthIntegerHelper.cs | 4 +- .../aspnetcore/Http3/QPack/QPackEncoder.cs | 12 +- .../src/System/Net/IPEndPointExtensions.cs | 8 +- .../System/Net/IPv4AddressHelper.Common.cs | 4 +- .../Common/src/System/Net/Security/MD4.cs | 6 +- .../src/System/Net/Security/SslKeyLogger.cs | 6 +- .../Common/src/System/Net/SocketAddress.cs | 6 +- .../Reflection/AssemblyNameFormatter.cs | 4 +- .../System/Reflection/AssemblyNameParser.cs | 6 +- .../Cryptography/Asn1/Pkcs12/PfxAsn.manual.cs | 4 +- .../System/Security/Cryptography/CngPkcs8.cs | 6 +- .../Security/Cryptography/DSAAndroid.cs | 6 +- .../Cryptography/DSACng.SignVerify.cs | 6 +- .../Security/Cryptography/DSAOpenSsl.cs | 6 +- .../ECDiffieHellmanAndroid.Derive.cs | 4 +- .../ECDiffieHellmanAppleCrypto.cs | 4 +- .../ECDiffieHellmanOpenSsl.Derive.cs | 4 +- .../Security/Cryptography/ECDsaAndroid.cs | 8 +- .../Security/Cryptography/ECDsaOpenSsl.cs | 8 +- .../Cryptography/KeyFormatHelper.Encrypted.cs | 4 +- .../Cryptography/PasswordBasedEncryption.cs | 6 +- .../Cryptography/Pkcs/Pkcs12Builder.cs | 4 +- .../Cryptography/Pkcs/Pkcs12SafeContents.cs | 4 +- .../System/Security/Cryptography/Pkcs12Kdf.cs | 4 +- .../Security/Cryptography/PqcBlobHelpers.cs | 4 +- .../Security/Cryptography/RSAAndroid.cs | 4 +- .../Security/Cryptography/RSAOpenSsl.cs | 4 +- .../Cryptography/RsaPaddingProcessor.cs | 10 +- ...SP800108HmacCounterKdfImplementationCng.cs | 6 +- .../System/Security/Cryptography/SlhDsa.cs | 6 +- .../Cryptography/SlhDsaImplementation.cs | 4 +- .../X509CertificateLoader.Pkcs12.cs | 8 +- .../X509Certificates/X509CertificateLoader.cs | 4 +- .../src/System/Sha1ForNonSecretPurposes.cs | 4 +- .../Microsoft.Extensions.Diagnostics.csproj | 1 + ...tensions.Hosting.Abstractions.Tests.csproj | 2 + ...soft.Extensions.Hosting.TrimmingTests.proj | 2 +- .../tests/EventSourceLoggerTest.cs | 2 + ...soft.Extensions.Options.TrimmingTests.proj | 1 - .../src/Microsoft/Win32/RegistryKey.cs | 2 +- .../System/Collections/Generic/SortedSet.cs | 2 +- .../ComponentModel/MaskedTextProvider.cs | 2 +- .../src/System/Drawing/PointConverter.cs | 2 +- .../src/System/Drawing/RectangleConverter.cs | 2 +- .../src/System/Drawing/SizeConverter.cs | 2 +- .../src/System/Drawing/SizeFConverter.cs | 2 +- .../src/System/ConsolePal.Unix.cs | 4 +- .../src/System/ConsolePal.Windows.cs | 4 +- .../src/System/IO/CachedConsoleStream.cs | 2 +- .../src/System/IO/StdInReader.cs | 4 +- .../src/System/TermInfo.DatabaseFactory.cs | 2 +- .../System.Console/src/System/TermInfo.cs | 2 +- .../src/System/Data/SQLTypes/SQLDecimal.cs | 8 +- .../src/System/Data/SQLTypes/SQLGuid.cs | 2 +- .../src/System/Data/XDRSchema.cs | 2 +- .../Activity.GenerateRootId.netcoreapp.cs | 2 +- .../src/System/Diagnostics/Activity.cs | 8 +- .../System/Diagnostics/DsesSamplerBuilder.cs | 2 +- ....Diagnostics.DiagnosticSource.Tests.csproj | 1 + .../Diagnostics/FileVersionInfo.Unix.cs | 2 +- .../src/System/Diagnostics/Process.Linux.cs | 2 +- .../Diagnostics/Process.Multiplexing.Unix.cs | 2 +- .../Diagnostics/XmlWriterTraceListener.cs | 6 +- .../src/System/Diagnostics/TraceListener.cs | 2 +- .../Asn1/AsnDecoder.GeneralizedTime.cs | 2 +- .../Formats/Asn1/AsnDecoder.NamedBitList.cs | 2 +- .../src/System/Formats/Asn1/AsnDecoder.Oid.cs | 2 +- .../System/Formats/Asn1/AsnDecoder.UtcTime.cs | 2 +- .../Formats/Asn1/AsnWriter.GeneralizedTime.cs | 2 +- .../Formats/Asn1/AsnWriter.NamedBitList.cs | 2 +- .../src/System/Formats/Tar/TarHeader.Read.cs | 2 +- .../src/System/Formats/Tar/TarHeader.Write.cs | 10 +- .../src/System/Formats/Tar/TarWriter.cs | 4 +- .../Compression/DeflateManaged/HuffmanTree.cs | 2 +- .../System/IO/Compression/ZipArchiveEntry.cs | 10 +- .../src/System/IO/Compression/ZipBlocks.cs | 20 +- .../Zstandard/ZstandardStream.Decompress.cs | 2 +- .../src/System/IO/FileSystemWatcher.Linux.cs | 2 +- .../MemoryMappedFile.Unix.cs | 2 +- .../src/System.IO.Pipelines.csproj | 1 + .../System/IO/Pipelines/PipeReaderStream.cs | 2 +- .../src/System.Linq.Expressions.csproj | 1 + .../System/Linq/Expressions/Compiler/ILGen.cs | 2 +- .../Headers/ContentDispositionHeaderValue.cs | 2 +- .../Net/Http/Headers/RangeItemHeaderValue.cs | 2 +- .../AuthenticationHelper.Digest.cs | 2 +- .../SocketsHttpHandler/Http3Connection.cs | 2 +- .../Http/SocketsHttpHandler/HttpConnection.cs | 2 +- .../HttpEnvironmentProxy.cs | 2 +- .../Managed/HttpListenerRequest.Managed.cs | 2 +- .../src/System/Net/Mime/MediaTypeMap.cs | 2 +- .../src/System/Net/Mime/MimeBasePart.cs | 2 +- .../System/Net/NameResolutionPal.Windows.cs | 2 +- .../StringParsingHelpers.Connections.cs | 2 +- .../StringParsingHelpers.Statistics.cs | 2 +- .../Net/NetworkInformation/Ping.RawSocket.cs | 2 +- .../src/System/Net/IPAddress.cs | 4 +- .../src/System/Net/IPAddressParser.cs | 2 +- .../src/System/Net/FtpControlStream.cs | 2 +- .../NegotiateAuthenticationPal.ManagedNtlm.cs | 6 +- .../Pal.Managed/SslProtocolsValidation.cs | 2 +- .../Net/Security/SslConnectionInfo.OSX.cs | 2 +- .../System/Net/Security/SslStream.Protocol.cs | 2 +- .../Net/Security/SslStreamPal.Windows.cs | 4 +- .../src/System/Net/Sockets/Socket.Unix.cs | 2 +- .../src/System/Net/Sockets/Socket.cs | 4 +- .../src/System/Net/Sockets/SocketPal.Unix.cs | 2 +- .../System/Net/Sockets/SocketPal.Windows.cs | 6 +- .../Net/WebSockets/WebSocketHandle.Managed.cs | 2 +- .../src/Internal/Win32/RegistryKey.cs | 4 +- .../src/System/AggregateException.cs | 4 +- .../src/System/ApplicationId.cs | 4 +- .../src/System/Buffers/Text/Base64Decoder.cs | 6 +- .../Text/Base64Helper/Base64DecoderHelper.cs | 6 +- .../Text/Base64Url/Base64UrlDecoder.cs | 4 +- .../Text/Utf8Formatter/FormattingHelpers.cs | 4 +- .../src/System/Collections/Generic/HashSet.cs | 8 +- .../src/System/Convert.cs | 4 +- .../System/Diagnostics/Tracing/EventSource.cs | 4 +- .../Diagnostics/Tracing/ManifestBuilder.cs | 4 +- .../Tracing/TraceLogging/XplatEventLogger.cs | 4 +- .../System.Private.CoreLib/src/System/Enum.cs | 4 +- .../src/System/Environment.UnixOrBrowser.cs | 4 +- .../System/Environment.Variables.Windows.cs | 6 +- .../src/System/Environment.Windows.cs | 14 +- .../System/Globalization/CalendarData.Icu.cs | 6 +- .../Globalization/CalendarData.Windows.cs | 4 +- .../src/System/Globalization/CompareInfo.cs | 6 +- .../System/Globalization/CultureData.Icu.cs | 6 +- .../src/System/Globalization/CultureData.cs | 4 +- .../System/Globalization/DateTimeFormat.cs | 6 +- .../src/System/Globalization/DateTimeParse.cs | 4 +- .../src/System/Globalization/IcuLocaleData.cs | 4 +- .../System/Globalization/IdnMapping.Icu.cs | 6 +- .../System/Globalization/IdnMapping.Nls.cs | 6 +- .../Globalization/JapaneseCalendar.Nls.cs | 4 +- .../src/System/Globalization/StringInfo.cs | 4 +- .../src/System/Globalization/TextInfo.cs | 8 +- .../System/Globalization/TimeSpanFormat.cs | 12 +- .../src/System/IO/BinaryReader.cs | 10 +- .../src/System/IO/BinaryWriter.cs | 26 +- .../System/IO/Enumeration/FileSystemName.cs | 8 +- .../src/System/IO/File.cs | 6 +- .../src/System/IO/FileSystem.Unix.cs | 6 +- .../src/System/IO/Path.Windows.cs | 6 +- .../src/System/IO/Path.cs | 8 +- .../src/System/IO/PathHelper.Windows.cs | 6 +- .../src/System/IO/StreamReader.cs | 4 +- .../src/System/IO/StreamWriter.cs | 6 +- .../src/System/IO/TextWriter.cs | 10 +- .../src/System/IO/UnmanagedMemoryAccessor.cs | 4 +- .../src/System/Index.cs | 4 +- .../src/System/Marvin.OrdinalIgnoreCase.cs | 4 +- .../src/System/MemoryExtensions.cs | 4 +- .../src/System/Net/WebUtility.cs | 10 +- .../src/System/Number.Formatting.cs | 6 +- .../src/System/Number.Parsing.cs | 8 +- .../src/System/Numerics/INumberBase.cs | 10 +- .../Numerics/TotalOrderIeee754Comparer.cs | 2 +- .../src/System/Numerics/Vector_1.cs | 4 +- .../src/System/OperatingSystem.cs | 4 +- .../src/System/PasteArguments.Unix.cs | 4 +- .../src/System/PasteArguments.Windows.cs | 4 +- .../src/System/Random.cs | 4 +- .../src/System/Range.cs | 4 +- .../src/System/Reflection/AssemblyName.cs | 6 +- .../AssemblyNameHelpers.StrongName.cs | 4 +- .../System/Reflection/CustomAttributeData.cs | 4 +- .../CustomAttributeTypedArgument.cs | 4 +- .../src/System/Resources/ResourceReader.cs | 4 +- .../RuntimeInformation.Windows.cs | 4 +- .../System/Runtime/Intrinsics/Vector128_1.cs | 2 +- .../System/Runtime/Intrinsics/Vector256_1.cs | 4 +- .../System/Runtime/Intrinsics/Vector512_1.cs | 4 +- .../System/Runtime/Intrinsics/Vector64_1.cs | 4 +- .../Runtime/Versioning/FrameworkName.cs | 4 +- .../src/System/SearchValues/BitVector256.cs | 4 +- .../src/System/SearchValues/SearchValues.cs | 2 +- .../Strings/Helpers/AhoCorasick.cs | 2 +- .../Strings/Helpers/AhoCorasickBuilder.cs | 2 +- .../SearchValues/Strings/Helpers/RabinKarp.cs | 2 +- .../Strings/Helpers/TeddyBucketizer.cs | 2 +- .../src/System/String.Comparison.cs | 6 +- .../src/System/String.Manipulation.cs | 38 +- .../src/System/String.Searching.cs | 6 +- .../src/System/Text/CompositeFormat.cs | 4 +- .../src/System/Text/DecoderNLS.cs | 6 +- .../src/System/Text/Encoding.Internal.cs | 4 +- .../src/System/Text/Rune.cs | 10 +- .../src/System/Text/StringBuilder.cs | 14 +- .../src/System/Text/Unicode/Utf8.cs | 6 +- .../src/System/Threading/WaitHandle.cs | 6 +- ...TimeZoneInfo.FullGlobalizationData.Unix.cs | 4 +- .../System/TimeZoneInfo.StringSerializer.cs | 6 +- .../src/System/TimeZoneInfo.Unix.Android.cs | 6 +- .../src/System/TimeZoneInfo.Unix.cs | 4 +- .../src/System/TimeZoneInfo.Windows.cs | 4 +- .../src/System/TimeZoneInfo.cs | 6 +- .../src/System/Version.cs | 4 +- .../Runtime/Serialization/DataContract.cs | 2 +- .../src/System/Xml/XmlBinaryWriter.cs | 4 +- .../src/System/DomainNameHelper.cs | 2 +- .../src/System/IPv4AddressHelper.cs | 2 +- .../src/System/IPv6AddressHelper.cs | 2 +- .../src/System/IriHelper.cs | 2 +- .../src/System/UriHelper.cs | 2 +- .../src/System/Xml/BinaryXml/SqlUtils.cs | 4 +- .../Xml/Cache/XPathDocumentNavigator.cs | 2 +- .../src/System/Xml/Schema/XsdDateTime.cs | 2 +- .../src/System/Xml/Schema/XsdDuration.cs | 4 +- .../System/Xml/Xsl/Runtime/NumberFormatter.cs | 2 +- .../src/System/Xml/Xsl/Xslt/XsltLoader.cs | 2 +- .../Internal/Utilities/DecimalUtilities.cs | 4 +- .../Metadata/Ecma335/MetadataBuilder.Heaps.cs | 2 +- .../Marshaling/JSMarshalerArgument.Func.cs | 16 +- .../Marshaling/JSMarshalerArgument.Task.cs | 6 +- .../src/System/Number.BigInteger.cs | 4 +- .../src/System/Numerics/BigInteger.cs | 2 +- .../src/System/Security/Cryptography/Aes.cs | 8 +- .../Cryptography/AesImplementation.cs | 2 +- .../Security/Cryptography/Base64Transforms.cs | 4 +- .../Cryptography/ChaCha20Poly1305.Android.cs | 2 +- .../Security/Cryptography/CngAlgorithmCore.cs | 2 +- .../System/Security/Cryptography/CngKey.EC.cs | 4 +- .../Cryptography/ConcurrentSafeKmac.cs | 4 +- .../Cryptography/CryptographicOperations.cs | 4 +- .../src/System/Security/Cryptography/DSA.cs | 8 +- .../src/System/Security/Cryptography/ECDsa.cs | 12 +- .../Cryptography/EccKeyFormatHelper.cs | 4 +- .../Cryptography/HKDFManagedImplementation.cs | 6 +- .../HMACHashProvider.Browser.Managed.cs | 4 +- .../Security/Cryptography/HMACStatic.cs | 4 +- .../Security/Cryptography/IncrementalHash.cs | 2 +- .../Security/Cryptography/KmacStatic.cs | 2 +- .../Security/Cryptography/LiteHash.Windows.cs | 2 +- .../Cryptography/MD5CryptoServiceProvider.cs | 2 +- .../Security/Cryptography/PemEncoding.cs | 2 +- .../Cryptography/RandomNumberGenerator.cs | 4 +- .../Cryptography/Rfc2898DeriveBytes.cs | 2 +- .../Cryptography/SHA1CryptoServiceProvider.cs | 2 +- .../SHA256CryptoServiceProvider.cs | 2 +- .../SHA384CryptoServiceProvider.cs | 2 +- .../SHA512CryptoServiceProvider.cs | 2 +- ...0108HmacCounterKdfImplementationManaged.cs | 2 +- .../Cryptography/X25519DiffieHellman.cs | 2 +- ...X25519DiffieHellmanImplementation.Apple.cs | 2 +- ...5519DiffieHellmanImplementation.OpenSsl.cs | 2 +- ...5519DiffieHellmanImplementation.Windows.cs | 4 +- .../X25519DiffieHellmanOpenSsl.OpenSsl.cs | 2 +- .../X509Certificates/CertificateRequest.cs | 2 +- .../ManagedCertificateFinder.cs | 2 +- .../X509Certificates/OpenSslCrlCache.cs | 2 +- .../OpenSslX509CertificateReader.cs | 2 +- .../OpenSslX509ChainProcessor.cs | 2 +- .../X509Certificates/UnixExportProvider.cs | 2 +- .../X500DistinguishedNameBuilder.cs | 2 +- .../X509Certificates/X509Certificate.cs | 2 +- .../X509Certificates/X509Certificate2.cs | 2 +- .../X509Certificate2Collection.cs | 2 +- .../X509SubjectKeyIdentifierExtension.cs | 4 +- .../Security/Cryptography/XmlKeyHelper.cs | 4 +- .../src/System/Security/Principal/SID.cs | 4 +- .../Web/OptimizedInboxTextEncoder.cs | 2 +- .../System/Text/Encodings/Web/TextEncoder.cs | 2 +- .../Document/JsonDocument.TryGetProperty.cs | 4 +- .../System/Text/Json/Document/JsonDocument.cs | 2 +- .../src/System/Text/Json/JsonEncodedText.cs | 2 +- .../System/Text/Json/JsonHelpers.Escaping.cs | 4 +- .../src/System/Text/Json/JsonHelpers.cs | 2 +- .../src/System/Text/Json/Nodes/JsonArray.cs | 2 +- .../src/System/Text/Json/Nodes/JsonNode.cs | 2 +- .../Reader/JsonReaderHelper.Unescaping.cs | 14 +- .../Text/Json/Reader/JsonReaderHelper.cs | 6 +- .../Reader/Utf8JsonReader.MultiSegment.cs | 2 +- .../Text/Json/Reader/Utf8JsonReader.TryGet.cs | 10 +- .../System/Text/Json/Reader/Utf8JsonReader.cs | 2 +- .../Converters/Value/CharConverter.cs | 2 +- .../Converters/Value/DateOnlyConverter.cs | 6 +- .../Converters/Value/EnumConverter.cs | 4 +- .../Converters/Value/HalfConverter.cs | 10 +- .../Converters/Value/Int128Converter.cs | 8 +- .../Converters/Value/TimeOnlyConverter.cs | 6 +- .../Converters/Value/TimeSpanConverter.cs | 6 +- .../Converters/Value/UInt128Converter.cs | 8 +- .../Converters/Value/VersionConverter.cs | 6 +- .../JsonSerializer.Read.String.cs | 4 +- .../Text/Json/ThrowHelper.Serialization.cs | 2 +- .../Text/Json/Writer/JsonWriterHelper.Date.cs | 4 +- .../Text/Json/Writer/JsonWriterHelper.cs | 2 +- .../Utf8JsonWriter.WriteProperties.Bytes.cs | 4 +- ...Utf8JsonWriter.WriteProperties.DateTime.cs | 6 +- ...onWriter.WriteProperties.DateTimeOffset.cs | 6 +- .../Utf8JsonWriter.WriteProperties.Decimal.cs | 6 +- .../Utf8JsonWriter.WriteProperties.Double.cs | 6 +- .../Utf8JsonWriter.WriteProperties.Float.cs | 6 +- ...nWriter.WriteProperties.FormattedNumber.cs | 4 +- .../Utf8JsonWriter.WriteProperties.Guid.cs | 6 +- .../Utf8JsonWriter.WriteProperties.Literal.cs | 6 +- ...JsonWriter.WriteProperties.SignedNumber.cs | 6 +- .../Utf8JsonWriter.WriteProperties.String.cs | 20 +- ...onWriter.WriteProperties.UnsignedNumber.cs | 6 +- .../Utf8JsonWriter.WriteValues.Decimal.cs | 2 +- .../Utf8JsonWriter.WriteValues.Double.cs | 2 +- .../Utf8JsonWriter.WriteValues.Float.cs | 2 +- .../Writer/Utf8JsonWriter.WriteValues.Raw.cs | 2 +- ...Utf8JsonWriter.WriteValues.SignedNumber.cs | 2 +- .../Utf8JsonWriter.WriteValues.String.cs | 4 +- ...tf8JsonWriter.WriteValues.StringSegment.cs | 10 +- ...f8JsonWriter.WriteValues.UnsignedNumber.cs | 2 +- .../System/Text/Json/Writer/Utf8JsonWriter.cs | 4 +- .../Text/RegularExpressions/RegexCharClass.cs | 10 +- .../Text/RegularExpressions/RegexCompiler.cs | 8 +- .../RegexFindOptimizations.cs | 4 +- .../Text/RegularExpressions/RegexNode.cs | 8 +- .../Text/RegularExpressions/RegexParser.cs | 10 +- .../RegularExpressions/RegexPrefixAnalyzer.cs | 8 +- .../RegularExpressions/RegexReplacement.cs | 2 +- .../Text/RegularExpressions/RegexWriter.cs | 2 +- .../Symbolic/RegexNodeConverter.cs | 2 +- .../src/System/Web/HttpUtility.cs | 2 +- .../src/System/Web/Util/HttpEncoder.cs | 2 +- .../coreclr/GitHub_87879/test87879.cs | 9 +- 372 files changed, 1220 insertions(+), 1727 deletions(-) delete mode 100644 eng/common/core-templates/steps/component-governance.yml delete mode 100644 eng/common/generate-sbom-prep.ps1 delete mode 100644 eng/common/generate-sbom-prep.sh delete mode 100644 eng/common/post-build/sourcelink-validation.ps1 delete mode 100644 eng/common/templates-official/steps/component-governance.yml delete mode 100644 eng/common/templates/steps/component-governance.yml diff --git a/eng/Version.Details.props b/eng/Version.Details.props index afdfd5818acf34..a35525c98f82e7 100644 --- a/eng/Version.Details.props +++ b/eng/Version.Details.props @@ -6,86 +6,86 @@ This file should be imported by eng/Versions.props - 5.7.0-1.26211.102 - 5.7.0-1.26211.102 - 5.7.0-1.26211.102 - 11.0.100-preview.4.26211.102 - 11.0.100-preview.4.26211.102 - 11.0.0-beta.26211.102 - 11.0.0-beta.26211.102 - 11.0.0-beta.26211.102 - 11.0.0-beta.26211.102 - 11.0.0-beta.26211.102 - 11.0.0-beta.26211.102 - 11.0.0-beta.26211.102 - 11.0.0-beta.26211.102 - 0.11.5-preview.26211.102 - 11.0.0-beta.26211.102 - 11.0.0-beta.26211.102 - 11.0.0-beta.26211.102 - 11.0.0-beta.26211.102 - 11.0.0-beta.26211.102 - 11.0.0-beta.26211.102 - 11.0.0-beta.26211.102 - 11.0.0-beta.26211.102 - 3.2.2-beta.26211.102 - 2.9.3-beta.26211.102 - 11.0.0-beta.26211.102 - 5.7.0-1.26211.102 - 11.0.0-preview.4.26211.102 - 11.0.100-preview.4.26211.102 - 11.0.0-preview.4.26211.102 - 11.0.0-preview.4.26211.102 - 7.6.0-rc.21202 - 7.6.0-rc.21202 - 7.6.0-rc.21202 - 7.6.0-rc.21202 - 11.0.0-preview.4.26211.102 - 3.0.0-preview.4.26211.102 - 11.0.0-preview.4.26211.102 - 11.0.0-preview.4.26211.102 - 11.0.0-preview.4.26211.102 + 5.7.0-1.26257.113 + 5.7.0-1.26257.113 + 5.7.0-1.26257.113 + 11.0.100-preview.5.26257.113 + 11.0.100-preview.5.26257.113 + 11.0.0-beta.26257.113 + 11.0.0-beta.26257.113 + 11.0.0-beta.26257.113 + 11.0.0-beta.26257.113 + 11.0.0-beta.26257.113 + 11.0.0-beta.26257.113 + 11.0.0-beta.26257.113 + 11.0.0-beta.26257.113 + 0.11.5-preview.26257.113 + 11.0.0-beta.26257.113 + 11.0.0-beta.26257.113 + 11.0.0-beta.26257.113 + 11.0.0-beta.26257.113 + 11.0.0-beta.26257.113 + 11.0.0-beta.26257.113 + 11.0.0-beta.26257.113 + 11.0.0-beta.26257.113 + 3.2.2-beta.26257.113 + 2.9.3-beta.26257.113 + 11.0.0-beta.26257.113 + 5.7.0-1.26257.113 + 11.0.0-preview.5.26257.113 + 11.0.100-preview.5.26257.113 + 11.0.0-preview.5.26257.113 + 11.0.0-preview.5.26257.113 + 7.7.0-rc.25813 + 7.7.0-rc.25813 + 7.7.0-rc.25813 + 7.7.0-rc.25813 + 11.0.0-preview.5.26257.113 + 3.0.0-preview.5.26257.113 + 11.0.0-preview.5.26257.113 + 11.0.0-preview.5.26257.113 + 11.0.0-preview.5.26257.113 11.0.0-alpha.1.26181.1 - 19.1.0-alpha.1.26173.1 - 19.1.0-alpha.1.26173.1 - 19.1.0-alpha.1.26173.1 - 19.1.0-alpha.1.26173.1 - 19.1.0-alpha.1.26173.1 - 19.1.0-alpha.1.26173.1 - 19.1.0-alpha.1.26173.1 - 19.1.0-alpha.1.26173.1 - 19.1.0-alpha.1.26173.1 - 19.1.0-alpha.1.26173.1 - 19.1.0-alpha.1.26173.1 - 19.1.0-alpha.1.26173.1 - 19.1.0-alpha.1.26173.1 - 19.1.0-alpha.1.26173.1 - 19.1.0-alpha.1.26173.1 - 19.1.0-alpha.1.26173.1 - 19.1.0-alpha.1.26173.1 - 19.1.0-alpha.1.26173.1 - 19.1.0-alpha.1.26173.1 - 19.1.0-alpha.1.26173.1 - 19.1.0-alpha.1.26173.1 - 19.1.0-alpha.1.26173.1 - 19.1.0-alpha.1.26173.1 - 19.1.0-alpha.1.26173.1 - 19.1.0-alpha.1.26173.1 - 19.1.0-alpha.1.26173.1 - 19.1.0-alpha.1.26173.1 - 19.1.0-alpha.1.26173.1 - 19.1.0-alpha.1.26173.1 + 19.1.0-alpha.1.26208.2 + 19.1.0-alpha.1.26208.2 + 19.1.0-alpha.1.26208.2 + 19.1.0-alpha.1.26208.2 + 19.1.0-alpha.1.26208.2 + 19.1.0-alpha.1.26208.2 + 19.1.0-alpha.1.26208.2 + 19.1.0-alpha.1.26208.2 + 19.1.0-alpha.1.26208.2 + 19.1.0-alpha.1.26208.2 + 19.1.0-alpha.1.26208.2 + 19.1.0-alpha.1.26208.2 + 19.1.0-alpha.1.26208.2 + 19.1.0-alpha.1.26208.2 + 19.1.0-alpha.1.26208.2 + 19.1.0-alpha.1.26208.2 + 19.1.0-alpha.1.26208.2 + 19.1.0-alpha.1.26208.2 + 19.1.0-alpha.1.26208.2 + 19.1.0-alpha.1.26208.2 + 19.1.0-alpha.1.26208.2 + 19.1.0-alpha.1.26208.2 + 19.1.0-alpha.1.26208.2 + 19.1.0-alpha.1.26208.2 + 19.1.0-alpha.1.26208.2 + 19.1.0-alpha.1.26208.2 + 19.1.0-alpha.1.26208.2 + 19.1.0-alpha.1.26208.2 + 19.1.0-alpha.1.26208.2 - 11.0.0-alpha.1.26173.2 - 11.0.0-alpha.1.26173.2 - 11.0.0-alpha.1.26173.2 - 11.0.0-alpha.1.26173.2 - 11.0.0-alpha.1.26173.2 - 11.0.0-alpha.1.26173.2 - 11.0.0-alpha.1.26173.2 - 11.0.0-alpha.1.26173.2 + 11.0.0-alpha.1.26208.5 + 11.0.0-alpha.1.26208.5 + 11.0.0-alpha.1.26208.5 + 11.0.0-alpha.1.26208.5 + 11.0.0-alpha.1.26208.5 + 11.0.0-alpha.1.26208.5 + 11.0.0-alpha.1.26208.5 + 11.0.0-alpha.1.26208.5 1.0.0-prerelease.26080.1 1.0.0-prerelease.26080.1 diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index ee7fa3d9101fb4..a357698eefc928 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -1,127 +1,127 @@ - + https://github.com/dotnet/icu 8fe317e707aaa0ab5afeafa926b03cb8deb22d09 - + https://github.com/dotnet/llvm-project - adb0185573ea50f6622e29860297b7a3213b1000 + db9a80a3e25e21268d55cf3385298dc03cfbed4d - + https://github.com/dotnet/llvm-project - adb0185573ea50f6622e29860297b7a3213b1000 + db9a80a3e25e21268d55cf3385298dc03cfbed4d - + https://github.com/dotnet/llvm-project - adb0185573ea50f6622e29860297b7a3213b1000 + db9a80a3e25e21268d55cf3385298dc03cfbed4d - + https://github.com/dotnet/llvm-project - adb0185573ea50f6622e29860297b7a3213b1000 + db9a80a3e25e21268d55cf3385298dc03cfbed4d - + https://github.com/dotnet/llvm-project - adb0185573ea50f6622e29860297b7a3213b1000 + db9a80a3e25e21268d55cf3385298dc03cfbed4d - + https://github.com/dotnet/llvm-project - adb0185573ea50f6622e29860297b7a3213b1000 + db9a80a3e25e21268d55cf3385298dc03cfbed4d - + https://github.com/dotnet/llvm-project - adb0185573ea50f6622e29860297b7a3213b1000 + db9a80a3e25e21268d55cf3385298dc03cfbed4d - + https://github.com/dotnet/llvm-project - adb0185573ea50f6622e29860297b7a3213b1000 + db9a80a3e25e21268d55cf3385298dc03cfbed4d - + https://github.com/dotnet/dotnet - 36afe73557f5f93cd7bc827cb644a3ff018eca0b + 0eae08ed2f094f44e0151e4815e7cdd1a334fcdf - + https://github.com/dotnet/dotnet - 36afe73557f5f93cd7bc827cb644a3ff018eca0b + 0eae08ed2f094f44e0151e4815e7cdd1a334fcdf - + https://github.com/dotnet/dotnet - 36afe73557f5f93cd7bc827cb644a3ff018eca0b + 0eae08ed2f094f44e0151e4815e7cdd1a334fcdf - + https://github.com/dotnet/dotnet - 36afe73557f5f93cd7bc827cb644a3ff018eca0b + 0eae08ed2f094f44e0151e4815e7cdd1a334fcdf - + https://github.com/dotnet/dotnet - 36afe73557f5f93cd7bc827cb644a3ff018eca0b + 0eae08ed2f094f44e0151e4815e7cdd1a334fcdf - + https://github.com/dotnet/dotnet - 36afe73557f5f93cd7bc827cb644a3ff018eca0b + 0eae08ed2f094f44e0151e4815e7cdd1a334fcdf - + https://github.com/dotnet/dotnet - 36afe73557f5f93cd7bc827cb644a3ff018eca0b + 0eae08ed2f094f44e0151e4815e7cdd1a334fcdf - + https://github.com/dotnet/dotnet - 36afe73557f5f93cd7bc827cb644a3ff018eca0b + 0eae08ed2f094f44e0151e4815e7cdd1a334fcdf - + https://github.com/dotnet/dotnet - 36afe73557f5f93cd7bc827cb644a3ff018eca0b + 0eae08ed2f094f44e0151e4815e7cdd1a334fcdf - + https://github.com/dotnet/dotnet - 36afe73557f5f93cd7bc827cb644a3ff018eca0b + 0eae08ed2f094f44e0151e4815e7cdd1a334fcdf - + https://github.com/dotnet/dotnet - 36afe73557f5f93cd7bc827cb644a3ff018eca0b + 0eae08ed2f094f44e0151e4815e7cdd1a334fcdf - + https://github.com/dotnet/dotnet - 36afe73557f5f93cd7bc827cb644a3ff018eca0b + 0eae08ed2f094f44e0151e4815e7cdd1a334fcdf - + https://github.com/dotnet/dotnet - 36afe73557f5f93cd7bc827cb644a3ff018eca0b + 0eae08ed2f094f44e0151e4815e7cdd1a334fcdf - + https://github.com/dotnet/dotnet - 36afe73557f5f93cd7bc827cb644a3ff018eca0b + 0eae08ed2f094f44e0151e4815e7cdd1a334fcdf - + https://github.com/dotnet/dotnet - 36afe73557f5f93cd7bc827cb644a3ff018eca0b + 0eae08ed2f094f44e0151e4815e7cdd1a334fcdf - + https://github.com/dotnet/dotnet - 36afe73557f5f93cd7bc827cb644a3ff018eca0b + 0eae08ed2f094f44e0151e4815e7cdd1a334fcdf - + https://github.com/dotnet/dotnet - 36afe73557f5f93cd7bc827cb644a3ff018eca0b + 0eae08ed2f094f44e0151e4815e7cdd1a334fcdf - + https://github.com/dotnet/dotnet - 36afe73557f5f93cd7bc827cb644a3ff018eca0b + 0eae08ed2f094f44e0151e4815e7cdd1a334fcdf - + https://github.com/dotnet/dotnet - 36afe73557f5f93cd7bc827cb644a3ff018eca0b + 0eae08ed2f094f44e0151e4815e7cdd1a334fcdf - + https://github.com/dotnet/dotnet - 36afe73557f5f93cd7bc827cb644a3ff018eca0b + 0eae08ed2f094f44e0151e4815e7cdd1a334fcdf - + https://github.com/dotnet/dotnet - 36afe73557f5f93cd7bc827cb644a3ff018eca0b + 0eae08ed2f094f44e0151e4815e7cdd1a334fcdf https://github.com/dotnet/runtime-assets @@ -175,117 +175,117 @@ https://github.com/dotnet/runtime-assets 509fb52c027cd46fab093f10c89691cda982edc4 - + https://github.com/dotnet/llvm-project - adb0185573ea50f6622e29860297b7a3213b1000 + db9a80a3e25e21268d55cf3385298dc03cfbed4d - + https://github.com/dotnet/llvm-project - adb0185573ea50f6622e29860297b7a3213b1000 + db9a80a3e25e21268d55cf3385298dc03cfbed4d - + https://github.com/dotnet/llvm-project - adb0185573ea50f6622e29860297b7a3213b1000 + db9a80a3e25e21268d55cf3385298dc03cfbed4d - + https://github.com/dotnet/llvm-project - adb0185573ea50f6622e29860297b7a3213b1000 + db9a80a3e25e21268d55cf3385298dc03cfbed4d - + https://github.com/dotnet/llvm-project - adb0185573ea50f6622e29860297b7a3213b1000 + db9a80a3e25e21268d55cf3385298dc03cfbed4d - + https://github.com/dotnet/llvm-project - adb0185573ea50f6622e29860297b7a3213b1000 + db9a80a3e25e21268d55cf3385298dc03cfbed4d - + https://github.com/dotnet/llvm-project - adb0185573ea50f6622e29860297b7a3213b1000 + db9a80a3e25e21268d55cf3385298dc03cfbed4d - + https://github.com/dotnet/llvm-project - adb0185573ea50f6622e29860297b7a3213b1000 + db9a80a3e25e21268d55cf3385298dc03cfbed4d - + https://github.com/dotnet/llvm-project - adb0185573ea50f6622e29860297b7a3213b1000 + db9a80a3e25e21268d55cf3385298dc03cfbed4d - + https://github.com/dotnet/llvm-project - adb0185573ea50f6622e29860297b7a3213b1000 + db9a80a3e25e21268d55cf3385298dc03cfbed4d - + https://github.com/dotnet/llvm-project - adb0185573ea50f6622e29860297b7a3213b1000 + db9a80a3e25e21268d55cf3385298dc03cfbed4d - + https://github.com/dotnet/llvm-project - adb0185573ea50f6622e29860297b7a3213b1000 + db9a80a3e25e21268d55cf3385298dc03cfbed4d - + https://github.com/dotnet/llvm-project - adb0185573ea50f6622e29860297b7a3213b1000 + db9a80a3e25e21268d55cf3385298dc03cfbed4d - + https://github.com/dotnet/llvm-project - adb0185573ea50f6622e29860297b7a3213b1000 + db9a80a3e25e21268d55cf3385298dc03cfbed4d - + https://github.com/dotnet/llvm-project - adb0185573ea50f6622e29860297b7a3213b1000 + db9a80a3e25e21268d55cf3385298dc03cfbed4d - + https://github.com/dotnet/llvm-project - adb0185573ea50f6622e29860297b7a3213b1000 + db9a80a3e25e21268d55cf3385298dc03cfbed4d - + https://github.com/dotnet/llvm-project - adb0185573ea50f6622e29860297b7a3213b1000 + db9a80a3e25e21268d55cf3385298dc03cfbed4d - + https://github.com/dotnet/llvm-project - adb0185573ea50f6622e29860297b7a3213b1000 + db9a80a3e25e21268d55cf3385298dc03cfbed4d - + https://github.com/dotnet/llvm-project - adb0185573ea50f6622e29860297b7a3213b1000 + db9a80a3e25e21268d55cf3385298dc03cfbed4d - + https://github.com/dotnet/llvm-project - adb0185573ea50f6622e29860297b7a3213b1000 + db9a80a3e25e21268d55cf3385298dc03cfbed4d - + https://github.com/dotnet/llvm-project - adb0185573ea50f6622e29860297b7a3213b1000 + db9a80a3e25e21268d55cf3385298dc03cfbed4d - + https://github.com/dotnet/dotnet - 36afe73557f5f93cd7bc827cb644a3ff018eca0b + 0eae08ed2f094f44e0151e4815e7cdd1a334fcdf - + https://github.com/dotnet/dotnet - 36afe73557f5f93cd7bc827cb644a3ff018eca0b + 0eae08ed2f094f44e0151e4815e7cdd1a334fcdf - + https://github.com/dotnet/dotnet - 36afe73557f5f93cd7bc827cb644a3ff018eca0b + 0eae08ed2f094f44e0151e4815e7cdd1a334fcdf - + https://github.com/dotnet/dotnet - 36afe73557f5f93cd7bc827cb644a3ff018eca0b + 0eae08ed2f094f44e0151e4815e7cdd1a334fcdf - + https://github.com/dotnet/dotnet - 36afe73557f5f93cd7bc827cb644a3ff018eca0b + 0eae08ed2f094f44e0151e4815e7cdd1a334fcdf - + https://github.com/dotnet/dotnet - 36afe73557f5f93cd7bc827cb644a3ff018eca0b + 0eae08ed2f094f44e0151e4815e7cdd1a334fcdf - + https://github.com/dotnet/dotnet - 36afe73557f5f93cd7bc827cb644a3ff018eca0b + 0eae08ed2f094f44e0151e4815e7cdd1a334fcdf https://github.com/dotnet/xharness @@ -299,9 +299,9 @@ https://github.com/dotnet/xharness 0668c80ec27851f3c7f1b3e4536110a1d39af587 - + https://github.com/dotnet/dotnet - 36afe73557f5f93cd7bc827cb644a3ff018eca0b + 0eae08ed2f094f44e0151e4815e7cdd1a334fcdf https://dev.azure.com/dnceng/internal/_git/dotnet-optimization @@ -323,29 +323,29 @@ https://github.com/dotnet/runtime-assets 509fb52c027cd46fab093f10c89691cda982edc4 - + https://github.com/dotnet/dotnet - 36afe73557f5f93cd7bc827cb644a3ff018eca0b + 0eae08ed2f094f44e0151e4815e7cdd1a334fcdf - + https://github.com/dotnet/dotnet - 36afe73557f5f93cd7bc827cb644a3ff018eca0b + 0eae08ed2f094f44e0151e4815e7cdd1a334fcdf - + https://github.com/dotnet/dotnet - 36afe73557f5f93cd7bc827cb644a3ff018eca0b + 0eae08ed2f094f44e0151e4815e7cdd1a334fcdf - + https://github.com/dotnet/dotnet - 36afe73557f5f93cd7bc827cb644a3ff018eca0b + 0eae08ed2f094f44e0151e4815e7cdd1a334fcdf - + https://github.com/dotnet/dotnet - 36afe73557f5f93cd7bc827cb644a3ff018eca0b + 0eae08ed2f094f44e0151e4815e7cdd1a334fcdf - + https://github.com/dotnet/dotnet - 36afe73557f5f93cd7bc827cb644a3ff018eca0b + 0eae08ed2f094f44e0151e4815e7cdd1a334fcdf https://dev.azure.com/dnceng/internal/_git/dotnet-optimization @@ -357,53 +357,53 @@ - + https://github.com/dotnet/dotnet - 36afe73557f5f93cd7bc827cb644a3ff018eca0b + 0eae08ed2f094f44e0151e4815e7cdd1a334fcdf - + https://github.com/dotnet/dotnet - 36afe73557f5f93cd7bc827cb644a3ff018eca0b + 0eae08ed2f094f44e0151e4815e7cdd1a334fcdf - + https://github.com/dotnet/dotnet - 36afe73557f5f93cd7bc827cb644a3ff018eca0b + 0eae08ed2f094f44e0151e4815e7cdd1a334fcdf - + https://github.com/dotnet/dotnet - 36afe73557f5f93cd7bc827cb644a3ff018eca0b + 0eae08ed2f094f44e0151e4815e7cdd1a334fcdf - + https://github.com/dotnet/node - 0077cd1a0d5bb524db161e5ec289496390c7f5d0 + cfe285c85ac61bde50792e8d516e31b302846f53 - + https://github.com/dotnet/node - 0077cd1a0d5bb524db161e5ec289496390c7f5d0 + cfe285c85ac61bde50792e8d516e31b302846f53 - + https://github.com/dotnet/node - 0077cd1a0d5bb524db161e5ec289496390c7f5d0 + cfe285c85ac61bde50792e8d516e31b302846f53 - + https://github.com/dotnet/node - 0077cd1a0d5bb524db161e5ec289496390c7f5d0 + cfe285c85ac61bde50792e8d516e31b302846f53 - + https://github.com/dotnet/node - 0077cd1a0d5bb524db161e5ec289496390c7f5d0 + cfe285c85ac61bde50792e8d516e31b302846f53 - + https://github.com/dotnet/node - 0077cd1a0d5bb524db161e5ec289496390c7f5d0 + cfe285c85ac61bde50792e8d516e31b302846f53 - + https://github.com/dotnet/node - 0077cd1a0d5bb524db161e5ec289496390c7f5d0 + cfe285c85ac61bde50792e8d516e31b302846f53 - + https://github.com/dotnet/node - 0077cd1a0d5bb524db161e5ec289496390c7f5d0 + cfe285c85ac61bde50792e8d516e31b302846f53 https://github.com/dotnet/runtime-assets diff --git a/eng/Versions.props b/eng/Versions.props index 6b58c62b178aa3..e327f7b502100a 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -15,7 +15,7 @@ 7.0.20 6.0.36 preview - 4 + 5 false release @@ -152,7 +152,7 @@ 6.0.4 5.0.0 7.0.2 - 13.0.3 + 13.0.4 1.0.2 4.18.4 4.0.722401 diff --git a/eng/common/core-templates/job/job.yml b/eng/common/core-templates/job/job.yml index 748c4f07a64d61..66c7988f222a65 100644 --- a/eng/common/core-templates/job/job.yml +++ b/eng/common/core-templates/job/job.yml @@ -26,12 +26,12 @@ parameters: enablePublishBuildArtifacts: false enablePublishBuildAssets: false enablePublishTestResults: false + enablePublishing: false enableBuildRetry: false mergeTestResults: false testRunTitle: '' testResultsFormat: '' name: '' - componentGovernanceSteps: [] preSteps: [] artifactPublishSteps: [] runAsPublic: false @@ -152,9 +152,6 @@ jobs: - ${{ each step in parameters.steps }}: - ${{ step }} - - ${{ each step in parameters.componentGovernanceSteps }}: - - ${{ step }} - - ${{ if and(eq(parameters.runAsPublic, 'false'), ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}: - template: /eng/common/core-templates/steps/cleanup-microbuild.yml parameters: diff --git a/eng/common/core-templates/job/publish-build-assets.yml b/eng/common/core-templates/job/publish-build-assets.yml index 9d7490518c48d9..700f7711465883 100644 --- a/eng/common/core-templates/job/publish-build-assets.yml +++ b/eng/common/core-templates/job/publish-build-assets.yml @@ -172,17 +172,18 @@ jobs: targetPath: '$(Build.ArtifactStagingDirectory)/MergedManifest.xml' artifactName: AssetManifests displayName: 'Publish Merged Manifest' - retryCountOnTaskFailure: 10 # for any logs being locked - sbomEnabled: false # we don't need SBOM for logs + retryCountOnTaskFailure: 10 # for any files being locked + isProduction: false # just metadata for publishing - - template: /eng/common/core-templates/steps/publish-build-artifacts.yml + - template: /eng/common/core-templates/steps/publish-pipeline-artifacts.yml parameters: is1ESPipeline: ${{ parameters.is1ESPipeline }} args: displayName: Publish ReleaseConfigs Artifact - pathToPublish: '$(Build.StagingDirectory)/ReleaseConfigs' - publishLocation: Container + targetPath: '$(Build.StagingDirectory)/ReleaseConfigs' artifactName: ReleaseConfigs + retryCountOnTaskFailure: 10 # for any files being locked + isProduction: false # just metadata for publishing - ${{ if or(eq(parameters.publishAssetsImmediately, 'true'), eq(parameters.isAssetlessBuild, 'true')) }}: - template: /eng/common/core-templates/post-build/setup-maestro-vars.yml @@ -218,4 +219,5 @@ jobs: - template: /eng/common/core-templates/steps/publish-logs.yml parameters: is1ESPipeline: ${{ parameters.is1ESPipeline }} + StageLabel: 'BuildAssetRegistry' JobLabel: 'Publish_Artifacts_Logs' diff --git a/eng/common/core-templates/job/renovate.yml b/eng/common/core-templates/job/renovate.yml index ab233539b5dc24..ff86c80b468902 100644 --- a/eng/common/core-templates/job/renovate.yml +++ b/eng/common/core-templates/job/renovate.yml @@ -135,7 +135,7 @@ jobs: condition: succeededOrFailed() targetPath: $(Build.ArtifactStagingDirectory) artifactName: $(Agent.JobName)_Logs_Attempt$(System.JobAttempt) - sbomEnabled: false + isProduction: false # logs are non-production artifacts steps: - checkout: self diff --git a/eng/common/core-templates/jobs/jobs.yml b/eng/common/core-templates/jobs/jobs.yml index 01ada747665145..cc8cce452786d4 100644 --- a/eng/common/core-templates/jobs/jobs.yml +++ b/eng/common/core-templates/jobs/jobs.yml @@ -43,6 +43,10 @@ parameters: artifacts: {} is1ESPipeline: '' + + # Publishing version w/default. + publishingVersion: 3 + repositoryAlias: self officialBuildId: '' @@ -102,6 +106,7 @@ jobs: parameters: is1ESPipeline: ${{ parameters.is1ESPipeline }} continueOnError: ${{ parameters.continueOnError }} + publishingVersion: ${{ parameters.publishingVersion }} dependsOn: - ${{ if ne(parameters.publishBuildAssetsDependsOn, '') }}: - ${{ each job in parameters.publishBuildAssetsDependsOn }}: diff --git a/eng/common/core-templates/post-build/common-variables.yml b/eng/common/core-templates/post-build/common-variables.yml index d5627a994ae58f..db298ae16bae64 100644 --- a/eng/common/core-templates/post-build/common-variables.yml +++ b/eng/common/core-templates/post-build/common-variables.yml @@ -11,8 +11,6 @@ variables: - name: MaestroApiVersion value: "2020-02-20" - - name: SourceLinkCLIVersion - value: 3.0.0 - name: SymbolToolVersion value: 1.0.1 - name: BinlogToolVersion diff --git a/eng/common/core-templates/post-build/post-build.yml b/eng/common/core-templates/post-build/post-build.yml index 0994189969f32d..8aa86e30491978 100644 --- a/eng/common/core-templates/post-build/post-build.yml +++ b/eng/common/core-templates/post-build/post-build.yml @@ -9,6 +9,7 @@ parameters: default: 3 values: - 3 + - 4 - name: BARBuildId displayName: BAR Build Id @@ -130,16 +131,30 @@ stages: PromoteToChannelIds: ${{ parameters.PromoteToChannelIds }} is1ESPipeline: ${{ parameters.is1ESPipeline }} - - task: DownloadBuildArtifacts@0 - displayName: Download Package Artifacts - inputs: - buildType: specific - buildVersionToDownload: specific - project: $(AzDOProjectName) - pipeline: $(AzDOPipelineId) - buildId: $(AzDOBuildId) - artifactName: PackageArtifacts - checkDownloadedFiles: true + - ${{ if ne(parameters.publishingInfraVersion, 4) }}: + - task: DownloadBuildArtifacts@0 + displayName: Download Package Artifacts + inputs: + buildType: specific + buildVersionToDownload: specific + project: $(AzDOProjectName) + pipeline: $(AzDOPipelineId) + buildId: $(AzDOBuildId) + artifactName: PackageArtifacts + checkDownloadedFiles: true + - ${{ if eq(parameters.publishingInfraVersion, 4) }}: + - task: DownloadPipelineArtifact@2 + displayName: Download Pipeline Artifacts (V4) + inputs: + itemPattern: '*/packages/**/*.nupkg' + targetPath: '$(Build.ArtifactStagingDirectory)/PipelineArtifactsDownload' + - task: CopyFiles@2 + displayName: Flatten packages to PackageArtifacts + inputs: + SourceFolder: '$(Build.ArtifactStagingDirectory)/PipelineArtifactsDownload' + Contents: '**/*.nupkg' + TargetFolder: '$(Build.ArtifactStagingDirectory)/PackageArtifacts' + flattenFolders: true - task: PowerShell@2 displayName: Validate @@ -173,16 +188,30 @@ stages: PromoteToChannelIds: ${{ parameters.PromoteToChannelIds }} is1ESPipeline: ${{ parameters.is1ESPipeline }} - - task: DownloadBuildArtifacts@0 - displayName: Download Package Artifacts - inputs: - buildType: specific - buildVersionToDownload: specific - project: $(AzDOProjectName) - pipeline: $(AzDOPipelineId) - buildId: $(AzDOBuildId) - artifactName: PackageArtifacts - checkDownloadedFiles: true + - ${{ if ne(parameters.publishingInfraVersion, 4) }}: + - task: DownloadBuildArtifacts@0 + displayName: Download Package Artifacts + inputs: + buildType: specific + buildVersionToDownload: specific + project: $(AzDOProjectName) + pipeline: $(AzDOPipelineId) + buildId: $(AzDOBuildId) + artifactName: PackageArtifacts + checkDownloadedFiles: true + - ${{ if eq(parameters.publishingInfraVersion, 4) }}: + - task: DownloadPipelineArtifact@2 + displayName: Download Pipeline Artifacts (V4) + inputs: + itemPattern: '*/packages/**/*.nupkg' + targetPath: '$(Build.ArtifactStagingDirectory)/PipelineArtifactsDownload' + - task: CopyFiles@2 + displayName: Flatten packages to PackageArtifacts + inputs: + SourceFolder: '$(Build.ArtifactStagingDirectory)/PipelineArtifactsDownload' + Contents: '**/*.nupkg' + TargetFolder: '$(Build.ArtifactStagingDirectory)/PackageArtifacts' + flattenFolders: true # This is necessary whenever we want to publish/restore to an AzDO private feed # Since sdk-task.ps1 tries to restore packages we need to do this authentication here @@ -196,7 +225,7 @@ stages: displayName: Validate inputs: filePath: eng\common\sdk-task.ps1 - arguments: -task SigningValidation -restore + arguments: -task SigningValidation -restore -msbuildEngine dotnet /p:PackageBasePath='$(Build.ArtifactStagingDirectory)/PackageArtifacts' /p:SignCheckExclusionsFile='$(System.DefaultWorkingDirectory)/eng/SignCheckExclusionsFile.txt' ${{ parameters.signingValidationAdditionalParameters }} @@ -208,53 +237,20 @@ stages: JobLabel: 'Signing' BinlogToolVersion: $(BinlogToolVersion) - - job: - displayName: SourceLink Validation - condition: eq( ${{ parameters.enableSourceLinkValidation }}, 'true') - pool: - # We don't use the collection uri here because it might vary (.visualstudio.com vs. dev.azure.com) - ${{ if eq(variables['System.TeamProject'], 'DevDiv') }}: - name: AzurePipelines-EO - image: 1ESPT-Windows2025 - demands: Cmd - os: windows - # If it's not devdiv, it's dnceng - ${{ else }}: - ${{ if eq(parameters.is1ESPipeline, true) }}: - name: $(DncEngInternalBuildPool) - image: windows.vs2026.amd64 - os: windows - ${{ else }}: - name: $(DncEngInternalBuildPool) - demands: ImageOverride -equals windows.vs2026.amd64 - steps: - - template: /eng/common/core-templates/post-build/setup-maestro-vars.yml - parameters: - BARBuildId: ${{ parameters.BARBuildId }} - PromoteToChannelIds: ${{ parameters.PromoteToChannelIds }} - is1ESPipeline: ${{ parameters.is1ESPipeline }} - - - task: DownloadBuildArtifacts@0 - displayName: Download Blob Artifacts - inputs: - buildType: specific - buildVersionToDownload: specific - project: $(AzDOProjectName) - pipeline: $(AzDOPipelineId) - buildId: $(AzDOBuildId) - artifactName: BlobArtifacts - checkDownloadedFiles: true - - - task: PowerShell@2 - displayName: Validate - inputs: - filePath: $(System.DefaultWorkingDirectory)/eng/common/post-build/sourcelink-validation.ps1 - arguments: -InputPath $(Build.ArtifactStagingDirectory)/BlobArtifacts/ - -ExtractPath $(Agent.BuildDirectory)/Extract/ - -GHRepoName $(Build.Repository.Name) - -GHCommit $(Build.SourceVersion) - -SourcelinkCliVersion $(SourceLinkCLIVersion) - continueOnError: true + # SourceLink validation has been removed — the underlying CLI tool + # (targeting netcoreapp2.1) has not functioned for years. + # The enableSourceLinkValidation parameter is kept but ignored so + # existing pipelines that pass it are not broken. + # See https://github.com/dotnet/arcade/issues/16647 + - ${{ if eq(parameters.enableSourceLinkValidation, 'true') }}: + - job: + displayName: 'SourceLink Validation Removed - please remove enableSourceLinkValidation from your pipeline' + pool: server + steps: + - task: Delay@1 + displayName: 'Warning: SourceLink validation removed (see https://github.com/dotnet/arcade/issues/16647)' + inputs: + delayForMinutes: '0' - ${{ if ne(parameters.publishAssetsImmediately, 'true') }}: - stage: publish_using_darc @@ -317,7 +313,7 @@ stages: scriptPath: $(System.DefaultWorkingDirectory)/eng/common/post-build/publish-using-darc.ps1 arguments: > -BuildId $(BARBuildId) - -PublishingInfraVersion ${{ parameters.publishingInfraVersion }} + -PublishingInfraVersion 3 -AzdoToken '$(System.AccessToken)' -WaitPublishingFinish true -RequireDefaultChannels ${{ parameters.requireDefaultChannels }} diff --git a/eng/common/core-templates/post-build/setup-maestro-vars.yml b/eng/common/core-templates/post-build/setup-maestro-vars.yml index a7abd58c4bb609..6dfa99ec5e37fb 100644 --- a/eng/common/core-templates/post-build/setup-maestro-vars.yml +++ b/eng/common/core-templates/post-build/setup-maestro-vars.yml @@ -8,12 +8,11 @@ steps: - 'Illegal entry point, is1ESPipeline is not defined. Repository yaml should not directly reference templates in core-templates folder.': error - ${{ if eq(coalesce(parameters.PromoteToChannelIds, 0), 0) }}: - - task: DownloadBuildArtifacts@0 + - task: DownloadPipelineArtifact@2 displayName: Download Release Configs inputs: - buildType: current artifactName: ReleaseConfigs - checkDownloadedFiles: true + targetPath: '$(Build.StagingDirectory)/ReleaseConfigs' - task: AzureCLI@2 name: setReleaseVars diff --git a/eng/common/core-templates/steps/component-governance.yml b/eng/common/core-templates/steps/component-governance.yml deleted file mode 100644 index cf0649aa95653f..00000000000000 --- a/eng/common/core-templates/steps/component-governance.yml +++ /dev/null @@ -1,16 +0,0 @@ -parameters: - disableComponentGovernance: false - componentGovernanceIgnoreDirectories: '' - is1ESPipeline: false - displayName: 'Component Detection' - -steps: -- ${{ if eq(parameters.disableComponentGovernance, 'true') }}: - - script: echo "##vso[task.setvariable variable=skipComponentGovernanceDetection]true" - displayName: Set skipComponentGovernanceDetection variable -- ${{ if ne(parameters.disableComponentGovernance, 'true') }}: - - task: ComponentGovernanceComponentDetection@0 - continueOnError: true - displayName: ${{ parameters.displayName }} - inputs: - ignoreDirectories: ${{ parameters.componentGovernanceIgnoreDirectories }} diff --git a/eng/common/core-templates/steps/generate-sbom.yml b/eng/common/core-templates/steps/generate-sbom.yml index 003f7eae0fa5c9..aad0a8aeda33d9 100644 --- a/eng/common/core-templates/steps/generate-sbom.yml +++ b/eng/common/core-templates/steps/generate-sbom.yml @@ -1,54 +1,14 @@ -# BuildDropPath - The root folder of the drop directory for which the manifest file will be generated. -# PackageName - The name of the package this SBOM represents. -# PackageVersion - The version of the package this SBOM represents. -# ManifestDirPath - The path of the directory where the generated manifest files will be placed -# IgnoreDirectories - Directories to ignore for SBOM generation. This will be passed through to the CG component detector. - parameters: - PackageVersion: 11.0.0 - BuildDropPath: '$(System.DefaultWorkingDirectory)/artifacts' - PackageName: '.NET' - ManifestDirPath: $(Build.ArtifactStagingDirectory)/sbom - IgnoreDirectories: '' - sbomContinueOnError: true - is1ESPipeline: false - # disable publishArtifacts if some other step is publishing the artifacts (like job.yml). - publishArtifacts: true + PackageVersion: unused + BuildDropPath: unused + PackageName: unused + ManifestDirPath: unused + IgnoreDirectories: unused + sbomContinueOnError: unused + is1ESPipeline: unused + publishArtifacts: unused steps: -- task: PowerShell@2 - displayName: Prep for SBOM generation in (Non-linux) - condition: or(eq(variables['Agent.Os'], 'Windows_NT'), eq(variables['Agent.Os'], 'Darwin')) - inputs: - filePath: ./eng/common/generate-sbom-prep.ps1 - arguments: ${{parameters.manifestDirPath}} - -# Chmodding is a workaround for https://github.com/dotnet/arcade/issues/8461 - script: | - chmod +x ./eng/common/generate-sbom-prep.sh - ./eng/common/generate-sbom-prep.sh ${{parameters.manifestDirPath}} - displayName: Prep for SBOM generation in (Linux) - condition: eq(variables['Agent.Os'], 'Linux') - continueOnError: ${{ parameters.sbomContinueOnError }} - -- task: AzureArtifacts.manifest-generator-task.manifest-generator-task.ManifestGeneratorTask@0 - displayName: 'Generate SBOM manifest' - continueOnError: ${{ parameters.sbomContinueOnError }} - inputs: - PackageName: ${{ parameters.packageName }} - BuildDropPath: ${{ parameters.buildDropPath }} - PackageVersion: ${{ parameters.packageVersion }} - ManifestDirPath: ${{ parameters.manifestDirPath }}/$(ARTIFACT_NAME) - ${{ if ne(parameters.IgnoreDirectories, '') }}: - AdditionalComponentDetectorArgs: '--IgnoreDirectories ${{ parameters.IgnoreDirectories }}' - -- ${{ if eq(parameters.publishArtifacts, 'true')}}: - - template: /eng/common/core-templates/steps/publish-pipeline-artifacts.yml - parameters: - is1ESPipeline: ${{ parameters.is1ESPipeline }} - args: - displayName: Publish SBOM manifest - continueOnError: ${{parameters.sbomContinueOnError}} - targetPath: '${{ parameters.manifestDirPath }}' - artifactName: $(ARTIFACT_NAME) - + echo "##vso[task.logissue type=warning]Including generate-sbom.yml is deprecated, SBOM generation is handled 1ES PT now. Remove this include." + displayName: Issue generate-sbom.yml deprecation warning diff --git a/eng/common/core-templates/steps/publish-logs.yml b/eng/common/core-templates/steps/publish-logs.yml index a9ea99ba6aaa5c..84a1922c73f392 100644 --- a/eng/common/core-templates/steps/publish-logs.yml +++ b/eng/common/core-templates/steps/publish-logs.yml @@ -50,13 +50,15 @@ steps: TargetFolder: '$(Build.ArtifactStagingDirectory)/PostBuildLogs' condition: always() -- template: /eng/common/core-templates/steps/publish-build-artifacts.yml +- template: /eng/common/core-templates/steps/publish-pipeline-artifacts.yml parameters: is1ESPipeline: ${{ parameters.is1ESPipeline }} args: displayName: Publish Logs - pathToPublish: '$(Build.ArtifactStagingDirectory)/PostBuildLogs' - publishLocation: Container - artifactName: PostBuildLogs + targetPath: '$(Build.ArtifactStagingDirectory)/PostBuildLogs' + artifactName: PostBuildLogs_${{ parameters.StageLabel }}_${{ parameters.JobLabel }}_Attempt$(System.JobAttempt) continueOnError: true condition: always() + retryCountOnTaskFailure: 10 # for any files being locked + isProduction: false # logs are non-production artifacts + diff --git a/eng/common/core-templates/steps/source-build.yml b/eng/common/core-templates/steps/source-build.yml index acf16ed34963fa..b75f59c428d410 100644 --- a/eng/common/core-templates/steps/source-build.yml +++ b/eng/common/core-templates/steps/source-build.yml @@ -62,4 +62,4 @@ steps: artifactName: BuildLogs_SourceBuild_${{ parameters.platform.name }}_Attempt$(System.JobAttempt) continueOnError: true condition: succeededOrFailed() - sbomEnabled: false # we don't need SBOM for logs + isProduction: false # logs are non-production artifacts diff --git a/eng/common/cross/build-android-rootfs.sh b/eng/common/cross/build-android-rootfs.sh index 09d65eaff91237..fbd8d80848a6ce 100755 --- a/eng/common/cross/build-android-rootfs.sh +++ b/eng/common/cross/build-android-rootfs.sh @@ -21,7 +21,7 @@ usage() exit 1 } -__ApiLevel=28 # The minimum platform for arm64 is API level 24 but the minimum version that supports glob(3) is 28. See $ANDROID_NDK/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/glob.h +__ApiLevel=28 # The minimum platform for arm64 is API level 21 but the minimum version that support glob(3) is 28. See $ANDROID_NDK/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/glob.h __BuildArch=arm64 __AndroidArch=aarch64 __AndroidToolchain=aarch64-linux-android diff --git a/eng/common/cross/toolchain.cmake b/eng/common/cross/toolchain.cmake index 99d6dfe82dde38..ff2dfdb4a5bf60 100644 --- a/eng/common/cross/toolchain.cmake +++ b/eng/common/cross/toolchain.cmake @@ -225,19 +225,13 @@ elseif(ILLUMOS) locate_toolchain_exec(g++ CMAKE_CXX_COMPILER) elseif(HAIKU) set(CMAKE_SYSROOT "${CROSS_ROOTFS}") + set(CMAKE_PROGRAM_PATH "${CMAKE_PROGRAM_PATH};${CROSS_ROOTFS}/cross-tools-x86_64/bin") set(CMAKE_SYSTEM_PREFIX_PATH "${CROSS_ROOTFS}") set(CMAKE_C_STANDARD_LIBRARIES "${CMAKE_C_STANDARD_LIBRARIES} -lssp") set(CMAKE_CXX_STANDARD_LIBRARIES "${CMAKE_CXX_STANDARD_LIBRARIES} -lssp") - if ($ENV{CCC_CC} MATCHES ".*gcc.*") - set(CMAKE_PROGRAM_PATH "${CMAKE_PROGRAM_PATH};${CROSS_ROOTFS}/cross-tools-x86_64/bin") - locate_toolchain_exec(gcc CMAKE_C_COMPILER) - locate_toolchain_exec(g++ CMAKE_CXX_COMPILER) - else() - set(CMAKE_C_COMPILER_EXTERNAL_TOOLCHAIN "${CROSS_ROOTFS}/cross-tools-x86_64") - set(CMAKE_CXX_COMPILER_EXTERNAL_TOOLCHAIN "${CROSS_ROOTFS}/cross-tools-x86_64") - set(CMAKE_ASM_COMPILER_EXTERNAL_TOOLCHAIN "${CROSS_ROOTFS}/cross-tools-x86_64") - endif() + locate_toolchain_exec(gcc CMAKE_C_COMPILER) + locate_toolchain_exec(g++ CMAKE_CXX_COMPILER) # let CMake set up the correct search paths include(Platform/Haiku) diff --git a/eng/common/darc-init.ps1 b/eng/common/darc-init.ps1 index e3374310563549..a5be41db6906ca 100644 --- a/eng/common/darc-init.ps1 +++ b/eng/common/darc-init.ps1 @@ -29,11 +29,11 @@ function InstallDarcCli ($darcVersion, $toolpath) { Write-Host "Installing Darc CLI version $darcVersion..." Write-Host 'You may need to restart your command window if this is the first dotnet tool you have installed.' if (-not $toolpath) { - Write-Host "'$dotnet' tool install $darcCliPackageName --version $darcVersion --add-source '$arcadeServicesSource' -v $verbosity -g" - & "$dotnet" tool install $darcCliPackageName --version $darcVersion --add-source "$arcadeServicesSource" -v $verbosity -g + Write-Host "'$dotnet' tool install $darcCliPackageName --version $darcVersion --source '$arcadeServicesSource' -v $verbosity -g" + & "$dotnet" tool install $darcCliPackageName --version $darcVersion --source "$arcadeServicesSource" -v $verbosity -g }else { - Write-Host "'$dotnet' tool install $darcCliPackageName --version $darcVersion --add-source '$arcadeServicesSource' -v $verbosity --tool-path '$toolpath'" - & "$dotnet" tool install $darcCliPackageName --version $darcVersion --add-source "$arcadeServicesSource" -v $verbosity --tool-path "$toolpath" + Write-Host "'$dotnet' tool install $darcCliPackageName --version $darcVersion --source '$arcadeServicesSource' -v $verbosity --tool-path '$toolpath'" + & "$dotnet" tool install $darcCliPackageName --version $darcVersion --source "$arcadeServicesSource" -v $verbosity --tool-path "$toolpath" } } diff --git a/eng/common/darc-init.sh b/eng/common/darc-init.sh index 9f5ad6b763b5df..b56d40e5706cc3 100755 --- a/eng/common/darc-init.sh +++ b/eng/common/darc-init.sh @@ -73,9 +73,9 @@ function InstallDarcCli { echo "Installing Darc CLI version $darcVersion..." echo "You may need to restart your command shell if this is the first dotnet tool you have installed." if [ -z "$toolpath" ]; then - echo $($dotnet_root/dotnet tool install $darc_cli_package_name --version $darcVersion --add-source "$arcadeServicesSource" -v $verbosity -g) + echo $($dotnet_root/dotnet tool install $darc_cli_package_name --version $darcVersion --source "$arcadeServicesSource" -v $verbosity -g) else - echo $($dotnet_root/dotnet tool install $darc_cli_package_name --version $darcVersion --add-source "$arcadeServicesSource" -v $verbosity --tool-path "$toolpath") + echo $($dotnet_root/dotnet tool install $darc_cli_package_name --version $darcVersion --source "$arcadeServicesSource" -v $verbosity --tool-path "$toolpath") fi } diff --git a/eng/common/generate-sbom-prep.ps1 b/eng/common/generate-sbom-prep.ps1 deleted file mode 100644 index a0c7d792a76fbe..00000000000000 --- a/eng/common/generate-sbom-prep.ps1 +++ /dev/null @@ -1,29 +0,0 @@ -Param( - [Parameter(Mandatory=$true)][string] $ManifestDirPath # Manifest directory where sbom will be placed -) - -. $PSScriptRoot\pipeline-logging-functions.ps1 - -# Normally - we'd listen to the manifest path given, but 1ES templates will overwrite if this level gets uploaded directly -# with their own overwriting ours. So we create it as a sub directory of the requested manifest path. -$ArtifactName = "${env:SYSTEM_STAGENAME}_${env:AGENT_JOBNAME}_SBOM" -$SafeArtifactName = $ArtifactName -replace '["/:<>\\|?@*"() ]', '_' -$SbomGenerationDir = Join-Path $ManifestDirPath $SafeArtifactName - -Write-Host "Artifact name before : $ArtifactName" -Write-Host "Artifact name after : $SafeArtifactName" - -Write-Host "Creating dir $ManifestDirPath" - -# create directory for sbom manifest to be placed -if (!(Test-Path -path $SbomGenerationDir)) -{ - New-Item -ItemType Directory -path $SbomGenerationDir - Write-Host "Successfully created directory $SbomGenerationDir" -} -else{ - Write-PipelineTelemetryError -category 'Build' "Unable to create sbom folder." -} - -Write-Host "Updating artifact name" -Write-Host "##vso[task.setvariable variable=ARTIFACT_NAME]$SafeArtifactName" diff --git a/eng/common/generate-sbom-prep.sh b/eng/common/generate-sbom-prep.sh deleted file mode 100644 index b8ecca72bbf506..00000000000000 --- a/eng/common/generate-sbom-prep.sh +++ /dev/null @@ -1,39 +0,0 @@ -#!/usr/bin/env bash - -source="${BASH_SOURCE[0]}" - -# resolve $SOURCE until the file is no longer a symlink -while [[ -h $source ]]; do - scriptroot="$( cd -P "$( dirname "$source" )" && pwd )" - source="$(readlink "$source")" - - # if $source was a relative symlink, we need to resolve it relative to the path where the - # symlink file was located - [[ $source != /* ]] && source="$scriptroot/$source" -done -scriptroot="$( cd -P "$( dirname "$source" )" && pwd )" -. $scriptroot/pipeline-logging-functions.sh - - -# replace all special characters with _, some builds use special characters like : in Agent.Jobname, that is not a permissible name while uploading artifacts. -artifact_name=$SYSTEM_STAGENAME"_"$AGENT_JOBNAME"_SBOM" -safe_artifact_name="${artifact_name//["/:<>\\|?@*$" ]/_}" -manifest_dir=$1 - -# Normally - we'd listen to the manifest path given, but 1ES templates will overwrite if this level gets uploaded directly -# with their own overwriting ours. So we create it as a sub directory of the requested manifest path. -sbom_generation_dir="$manifest_dir/$safe_artifact_name" - -if [ ! -d "$sbom_generation_dir" ] ; then - mkdir -p "$sbom_generation_dir" - echo "Sbom directory created." $sbom_generation_dir -else - Write-PipelineTelemetryError -category 'Build' "Unable to create sbom folder." -fi - -echo "Artifact name before : "$artifact_name -echo "Artifact name after : "$safe_artifact_name -export ARTIFACT_NAME=$safe_artifact_name -echo "##vso[task.setvariable variable=ARTIFACT_NAME]$safe_artifact_name" - -exit 0 diff --git a/eng/common/post-build/redact-logs.ps1 b/eng/common/post-build/redact-logs.ps1 index fc0218a013d16b..672f4e2652edb5 100644 --- a/eng/common/post-build/redact-logs.ps1 +++ b/eng/common/post-build/redact-logs.ps1 @@ -49,8 +49,8 @@ try { Write-Host "Installing Binlog redactor CLI..." Write-Host "'$dotnet' new tool-manifest" & "$dotnet" new tool-manifest - Write-Host "'$dotnet' tool install $packageName --local --add-source '$PackageFeed' -v $verbosity --version $BinlogToolVersion" - & "$dotnet" tool install $packageName --local --add-source "$PackageFeed" -v $verbosity --version $BinlogToolVersion + Write-Host "'$dotnet' tool install $packageName --local --source '$PackageFeed' -v $verbosity --version $BinlogToolVersion" + & "$dotnet" tool install $packageName --local --source "$PackageFeed" -v $verbosity --version $BinlogToolVersion if (Test-Path $TokensFilePath) { Write-Host "Adding additional sensitive data for redaction from file: " $TokensFilePath diff --git a/eng/common/post-build/sourcelink-validation.ps1 b/eng/common/post-build/sourcelink-validation.ps1 deleted file mode 100644 index 1976ef70fb8508..00000000000000 --- a/eng/common/post-build/sourcelink-validation.ps1 +++ /dev/null @@ -1,327 +0,0 @@ -param( - [Parameter(Mandatory=$true)][string] $InputPath, # Full path to directory where Symbols.NuGet packages to be checked are stored - [Parameter(Mandatory=$true)][string] $ExtractPath, # Full path to directory where the packages will be extracted during validation - [Parameter(Mandatory=$false)][string] $GHRepoName, # GitHub name of the repo including the Org. E.g., dotnet/arcade - [Parameter(Mandatory=$false)][string] $GHCommit, # GitHub commit SHA used to build the packages - [Parameter(Mandatory=$true)][string] $SourcelinkCliVersion # Version of SourceLink CLI to use -) - -$ErrorActionPreference = 'Stop' -Set-StrictMode -Version 2.0 - -# `tools.ps1` checks $ci to perform some actions. Since the post-build -# scripts don't necessarily execute in the same agent that run the -# build.ps1/sh script this variable isn't automatically set. -$ci = $true -$disableConfigureToolsetImport = $true -. $PSScriptRoot\..\tools.ps1 - -# Cache/HashMap (File -> Exist flag) used to consult whether a file exist -# in the repository at a specific commit point. This is populated by inserting -# all files present in the repo at a specific commit point. -$global:RepoFiles = @{} - -# Maximum number of jobs to run in parallel -$MaxParallelJobs = 16 - -$MaxRetries = 5 -$RetryWaitTimeInSeconds = 30 - -# Wait time between check for system load -$SecondsBetweenLoadChecks = 10 - -if (!$InputPath -or !(Test-Path $InputPath)){ - Write-Host "No files to validate." - ExitWithExitCode 0 -} - -$ValidatePackage = { - param( - [string] $PackagePath # Full path to a Symbols.NuGet package - ) - - . $using:PSScriptRoot\..\tools.ps1 - - # Ensure input file exist - if (!(Test-Path $PackagePath)) { - Write-Host "Input file does not exist: $PackagePath" - return [pscustomobject]@{ - result = 1 - packagePath = $PackagePath - } - } - - # Extensions for which we'll look for SourceLink information - # For now we'll only care about Portable & Embedded PDBs - $RelevantExtensions = @('.dll', '.exe', '.pdb') - - Write-Host -NoNewLine 'Validating ' ([System.IO.Path]::GetFileName($PackagePath)) '...' - - $PackageId = [System.IO.Path]::GetFileNameWithoutExtension($PackagePath) - $ExtractPath = Join-Path -Path $using:ExtractPath -ChildPath $PackageId - $FailedFiles = 0 - - Add-Type -AssemblyName System.IO.Compression.FileSystem - - [System.IO.Directory]::CreateDirectory($ExtractPath) | Out-Null - - try { - $zip = [System.IO.Compression.ZipFile]::OpenRead($PackagePath) - - $zip.Entries | - Where-Object {$RelevantExtensions -contains [System.IO.Path]::GetExtension($_.Name)} | - ForEach-Object { - $FileName = $_.FullName - $Extension = [System.IO.Path]::GetExtension($_.Name) - $FakeName = -Join((New-Guid), $Extension) - $TargetFile = Join-Path -Path $ExtractPath -ChildPath $FakeName - - # We ignore resource DLLs - if ($FileName.EndsWith('.resources.dll')) { - return [pscustomobject]@{ - result = 0 - packagePath = $PackagePath - } - } - - [System.IO.Compression.ZipFileExtensions]::ExtractToFile($_, $TargetFile, $true) - - $ValidateFile = { - param( - [string] $FullPath, # Full path to the module that has to be checked - [string] $RealPath, - [ref] $FailedFiles - ) - - $sourcelinkExe = "$env:USERPROFILE\.dotnet\tools" - $sourcelinkExe = Resolve-Path "$sourcelinkExe\sourcelink.exe" - $SourceLinkInfos = & $sourcelinkExe print-urls $FullPath | Out-String - - if ($LASTEXITCODE -eq 0 -and -not ([string]::IsNullOrEmpty($SourceLinkInfos))) { - $NumFailedLinks = 0 - - # We only care about Http addresses - $Matches = (Select-String '(http[s]?)(:\/\/)([^\s,]+)' -Input $SourceLinkInfos -AllMatches).Matches - - if ($Matches.Count -ne 0) { - $Matches.Value | - ForEach-Object { - $Link = $_ - $CommitUrl = "https://raw.githubusercontent.com/${using:GHRepoName}/${using:GHCommit}/" - - $FilePath = $Link.Replace($CommitUrl, "") - $Status = 200 - $Cache = $using:RepoFiles - - $attempts = 0 - - while ($attempts -lt $using:MaxRetries) { - if ( !($Cache.ContainsKey($FilePath)) ) { - try { - $Uri = $Link -as [System.URI] - - if ($Link -match "submodules") { - # Skip submodule links until sourcelink properly handles submodules - $Status = 200 - } - elseif ($Uri.AbsoluteURI -ne $null -and ($Uri.Host -match 'github' -or $Uri.Host -match 'githubusercontent')) { - # Only GitHub links are valid - $Status = (Invoke-WebRequest -Uri $Link -UseBasicParsing -Method HEAD -TimeoutSec 5).StatusCode - } - else { - # If it's not a github link, we want to break out of the loop and not retry. - $Status = 0 - $attempts = $using:MaxRetries - } - } - catch { - Write-Host $_ - $Status = 0 - } - } - - if ($Status -ne 200) { - $attempts++ - - if ($attempts -lt $using:MaxRetries) - { - $attemptsLeft = $using:MaxRetries - $attempts - Write-Warning "Download failed, $attemptsLeft attempts remaining, will retry in $using:RetryWaitTimeInSeconds seconds" - Start-Sleep -Seconds $using:RetryWaitTimeInSeconds - } - else { - if ($NumFailedLinks -eq 0) { - if ($FailedFiles.Value -eq 0) { - Write-Host - } - - Write-Host "`tFile $RealPath has broken links:" - } - - Write-Host "`t`tFailed to retrieve $Link" - - $NumFailedLinks++ - } - } - else { - break - } - } - } - } - - if ($NumFailedLinks -ne 0) { - $FailedFiles.value++ - $global:LASTEXITCODE = 1 - } - } - } - - &$ValidateFile $TargetFile $FileName ([ref]$FailedFiles) - } - } - catch { - Write-Host $_ - } - finally { - $zip.Dispose() - } - - if ($FailedFiles -eq 0) { - Write-Host 'Passed.' - return [pscustomobject]@{ - result = 0 - packagePath = $PackagePath - } - } - else { - Write-PipelineTelemetryError -Category 'SourceLink' -Message "$PackagePath has broken SourceLink links." - return [pscustomobject]@{ - result = 1 - packagePath = $PackagePath - } - } -} - -function CheckJobResult( - $result, - $packagePath, - [ref]$ValidationFailures, - [switch]$logErrors) { - if ($result -ne '0') { - if ($logErrors) { - Write-PipelineTelemetryError -Category 'SourceLink' -Message "$packagePath has broken SourceLink links." - } - $ValidationFailures.Value++ - } -} - -function ValidateSourceLinkLinks { - if ($GHRepoName -ne '' -and !($GHRepoName -Match '^[^\s\/]+/[^\s\/]+$')) { - if (!($GHRepoName -Match '^[^\s-]+-[^\s]+$')) { - Write-PipelineTelemetryError -Category 'SourceLink' -Message "GHRepoName should be in the format / or -. '$GHRepoName'" - ExitWithExitCode 1 - } - else { - $GHRepoName = $GHRepoName -replace '^([^\s-]+)-([^\s]+)$', '$1/$2'; - } - } - - if ($GHCommit -ne '' -and !($GHCommit -Match '^[0-9a-fA-F]{40}$')) { - Write-PipelineTelemetryError -Category 'SourceLink' -Message "GHCommit should be a 40 chars hexadecimal string. '$GHCommit'" - ExitWithExitCode 1 - } - - if ($GHRepoName -ne '' -and $GHCommit -ne '') { - $RepoTreeURL = -Join('http://api.github.com/repos/', $GHRepoName, '/git/trees/', $GHCommit, '?recursive=1') - $CodeExtensions = @('.cs', '.vb', '.fs', '.fsi', '.fsx', '.fsscript') - - try { - # Retrieve the list of files in the repo at that particular commit point and store them in the RepoFiles hash - $Data = Invoke-WebRequest $RepoTreeURL -UseBasicParsing | ConvertFrom-Json | Select-Object -ExpandProperty tree - - foreach ($file in $Data) { - $Extension = [System.IO.Path]::GetExtension($file.path) - - if ($CodeExtensions.Contains($Extension)) { - $RepoFiles[$file.path] = 1 - } - } - } - catch { - Write-Host "Problems downloading the list of files from the repo. Url used: $RepoTreeURL . Execution will proceed without caching." - } - } - elseif ($GHRepoName -ne '' -or $GHCommit -ne '') { - Write-Host 'For using the http caching mechanism both GHRepoName and GHCommit should be informed.' - } - - if (Test-Path $ExtractPath) { - Remove-Item $ExtractPath -Force -Recurse -ErrorAction SilentlyContinue - } - - $ValidationFailures = 0 - - # Process each NuGet package in parallel - Get-ChildItem "$InputPath\*.symbols.nupkg" | - ForEach-Object { - Write-Host "Starting $($_.FullName)" - Start-Job -ScriptBlock $ValidatePackage -ArgumentList $_.FullName | Out-Null - $NumJobs = @(Get-Job -State 'Running').Count - - while ($NumJobs -ge $MaxParallelJobs) { - Write-Host "There are $NumJobs validation jobs running right now. Waiting $SecondsBetweenLoadChecks seconds to check again." - sleep $SecondsBetweenLoadChecks - $NumJobs = @(Get-Job -State 'Running').Count - } - - foreach ($Job in @(Get-Job -State 'Completed')) { - $jobResult = Wait-Job -Id $Job.Id | Receive-Job - CheckJobResult $jobResult.result $jobResult.packagePath ([ref]$ValidationFailures) -LogErrors - Remove-Job -Id $Job.Id - } - } - - foreach ($Job in @(Get-Job)) { - $jobResult = Wait-Job -Id $Job.Id | Receive-Job - CheckJobResult $jobResult.result $jobResult.packagePath ([ref]$ValidationFailures) - Remove-Job -Id $Job.Id - } - if ($ValidationFailures -gt 0) { - Write-PipelineTelemetryError -Category 'SourceLink' -Message "$ValidationFailures package(s) failed validation." - ExitWithExitCode 1 - } -} - -function InstallSourcelinkCli { - $sourcelinkCliPackageName = 'sourcelink' - - $dotnetRoot = InitializeDotNetCli -install:$true - $dotnet = "$dotnetRoot\dotnet.exe" - $toolList = & "$dotnet" tool list --global - - if (($toolList -like "*$sourcelinkCliPackageName*") -and ($toolList -like "*$sourcelinkCliVersion*")) { - Write-Host "SourceLink CLI version $sourcelinkCliVersion is already installed." - } - else { - Write-Host "Installing SourceLink CLI version $sourcelinkCliVersion..." - Write-Host 'You may need to restart your command window if this is the first dotnet tool you have installed.' - & "$dotnet" tool install $sourcelinkCliPackageName --version $sourcelinkCliVersion --verbosity "minimal" --global - } -} - -try { - InstallSourcelinkCli - - foreach ($Job in @(Get-Job)) { - Remove-Job -Id $Job.Id - } - - ValidateSourceLinkLinks -} -catch { - Write-Host $_.Exception - Write-Host $_.ScriptStackTrace - Write-PipelineTelemetryError -Category 'SourceLink' -Message $_ - ExitWithExitCode 1 -} diff --git a/eng/common/sdk-task.ps1 b/eng/common/sdk-task.ps1 index 4017ff15ebf4b4..68119de603efe6 100644 --- a/eng/common/sdk-task.ps1 +++ b/eng/common/sdk-task.ps1 @@ -66,20 +66,7 @@ try { if( $msbuildEngine -eq "vs") { # Ensure desktop MSBuild is available for sdk tasks. - if( -not ($GlobalJson.tools.PSObject.Properties.Name -contains "vs" )) { - $GlobalJson.tools | Add-Member -Name "vs" -Value (ConvertFrom-Json "{ `"version`": `"16.5`" }") -MemberType NoteProperty - } - if( -not ($GlobalJson.tools.PSObject.Properties.Name -match "xcopy-msbuild" )) { - $GlobalJson.tools | Add-Member -Name "xcopy-msbuild" -Value "18.0.0" -MemberType NoteProperty - } - if ($GlobalJson.tools."xcopy-msbuild".Trim() -ine "none") { - $xcopyMSBuildToolsFolder = InitializeXCopyMSBuild $GlobalJson.tools."xcopy-msbuild" -install $true - } - if ($xcopyMSBuildToolsFolder -eq $null) { - throw 'Unable to get xcopy downloadable version of msbuild' - } - - $global:_MSBuildExe = "$($xcopyMSBuildToolsFolder)\MSBuild\Current\Bin\MSBuild.exe" + $global:_MSBuildExe = InitializeVisualStudioMSBuild } $taskProject = GetSdkTaskProject $task diff --git a/eng/common/template-guidance.md b/eng/common/template-guidance.md index cdc62e72b07772..f772aa3d78fa3e 100644 --- a/eng/common/template-guidance.md +++ b/eng/common/template-guidance.md @@ -81,7 +81,6 @@ eng\common\ publish-build-artifacts.yml (logic) publish-pipeline-artifacts.yml (logic) component-governance.yml (shim) - generate-sbom.yml (shim) publish-logs.yml (shim) retain-build.yml (shim) send-to-helix.yml (shim) @@ -104,7 +103,6 @@ eng\common\ setup-maestro-vars.yml (logic) steps\ component-governance.yml (logic) - generate-sbom.yml (logic) publish-build-artifacts.yml (redirect) publish-logs.yml (logic) publish-pipeline-artifacts.yml (redirect) diff --git a/eng/common/templates-official/job/job.yml b/eng/common/templates-official/job/job.yml index f70224eaa456f2..d68e9fbc2656dc 100644 --- a/eng/common/templates-official/job/job.yml +++ b/eng/common/templates-official/job/job.yml @@ -1,24 +1,15 @@ parameters: -# Sbom related params - enableSbom: true runAsPublic: false - PackageVersion: 9.0.0 - BuildDropPath: '$(System.DefaultWorkingDirectory)/artifacts' +# Sbom related params, unused now and can eventually be removed + enableSbom: unused + PackageVersion: unused + BuildDropPath: unused jobs: - template: /eng/common/core-templates/job/job.yml parameters: is1ESPipeline: true - componentGovernanceSteps: - - ${{ if and(eq(parameters.runAsPublic, 'false'), ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest'), eq(parameters.enableSbom, 'true')) }}: - - template: /eng/common/templates/steps/generate-sbom.yml - parameters: - PackageVersion: ${{ parameters.packageVersion }} - BuildDropPath: ${{ parameters.buildDropPath }} - ManifestDirPath: $(Build.ArtifactStagingDirectory)/sbom - publishArtifacts: false - # publish artifacts # for 1ES managed templates, use the templateContext.output to handle multiple outputs. templateContext: @@ -26,12 +17,19 @@ jobs: outputs: - ${{ if ne(parameters.artifacts.publish, '') }}: - ${{ if and(ne(parameters.artifacts.publish.artifacts, 'false'), ne(parameters.artifacts.publish.artifacts, '')) }}: - - output: buildArtifacts + - output: pipelineArtifact displayName: Publish pipeline artifacts - PathtoPublish: '$(Build.ArtifactStagingDirectory)/artifacts' - ArtifactName: ${{ coalesce(parameters.artifacts.publish.artifacts.name , 'Artifacts_$(Agent.Os)_$(_BuildConfig)') }} - condition: always() - retryCountOnTaskFailure: 10 # for any logs being locked + targetPath: '$(Build.ArtifactStagingDirectory)/artifacts' + artifactName: ${{ coalesce(parameters.artifacts.publish.artifacts.name , 'Artifacts_$(Agent.Os)_$(_BuildConfig)') }} + condition: succeeded() + retryCountOnTaskFailure: 10 # for any files being locked + continueOnError: true + - output: pipelineArtifact + displayName: Publish pipeline artifacts + targetPath: '$(Build.ArtifactStagingDirectory)/artifacts' + artifactName: ${{ coalesce(parameters.artifacts.publish.artifacts.name , 'Artifacts_$(Agent.Os)_$(_BuildConfig)') }}_Attempt$(System.JobAttempt) + condition: not(succeeded()) + retryCountOnTaskFailure: 10 # for any files being locked continueOnError: true - ${{ if and(ne(parameters.artifacts.publish.logs, 'false'), ne(parameters.artifacts.publish.logs, '')) }}: - output: pipelineArtifact @@ -40,8 +38,8 @@ jobs: displayName: 'Publish logs' continueOnError: true condition: always() - retryCountOnTaskFailure: 10 # for any logs being locked - sbomEnabled: false # we don't need SBOM for logs + retryCountOnTaskFailure: 10 # for any files being locked + isProduction: false # logs are non-production artifacts - ${{ if eq(parameters.enablePublishBuildArtifacts, true) }}: - output: pipelineArtifact @@ -50,7 +48,8 @@ jobs: artifactName: ${{ coalesce(parameters.enablePublishBuildArtifacts.artifactName, '$(Agent.Os)_$(Agent.JobName)_Attempt$(System.JobAttempt)' ) }} continueOnError: true condition: always() - sbomEnabled: false # we don't need SBOM for logs + retryCountOnTaskFailure: 10 # for any files being locked + isProduction: false # logs are non-production artifacts - ${{ if eq(parameters.enableBuildRetry, 'true') }}: - output: pipelineArtifact @@ -58,14 +57,20 @@ jobs: artifactName: 'BuildConfiguration' displayName: 'Publish build retry configuration' continueOnError: true - sbomEnabled: false # we don't need SBOM for BuildConfiguration + retryCountOnTaskFailure: 10 # for any files being locked + isProduction: false # BuildConfiguration is a non-production artifact - - ${{ if and(eq(parameters.runAsPublic, 'false'), ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest'), eq(parameters.enableSbom, 'true')) }}: + # V4 publishing: automatically publish staged artifacts as a pipeline artifact. + # The artifact name matches the SDK's FutureArtifactName ($(System.PhaseName)_Artifacts), + # which is encoded in the asset manifest for downstream publishing to discover. + # Jobs can opt in by setting enablePublishing: true. + - ${{ if and(eq(parameters.publishingVersion, 4), eq(parameters.enablePublishing, 'true')) }}: - output: pipelineArtifact - displayName: Publish SBOM manifest + displayName: 'Publish V4 pipeline artifacts' + targetPath: '$(Build.ArtifactStagingDirectory)/artifacts' + artifactName: '$(System.PhaseName)_Artifacts' continueOnError: true - targetPath: $(Build.ArtifactStagingDirectory)/sbom - artifactName: $(ARTIFACT_NAME) + retryCountOnTaskFailure: 10 # for any files being locked # add any outputs provided via root yaml - ${{ if ne(parameters.templateContext.outputs, '') }}: diff --git a/eng/common/templates-official/steps/component-governance.yml b/eng/common/templates-official/steps/component-governance.yml deleted file mode 100644 index 30bb3985ca2bf4..00000000000000 --- a/eng/common/templates-official/steps/component-governance.yml +++ /dev/null @@ -1,7 +0,0 @@ -steps: -- template: /eng/common/core-templates/steps/component-governance.yml - parameters: - is1ESPipeline: true - - ${{ each parameter in parameters }}: - ${{ parameter.key }}: ${{ parameter.value }} diff --git a/eng/common/templates-official/steps/publish-pipeline-artifacts.yml b/eng/common/templates-official/steps/publish-pipeline-artifacts.yml index 172f9f0fdc9701..9e5981365e5602 100644 --- a/eng/common/templates-official/steps/publish-pipeline-artifacts.yml +++ b/eng/common/templates-official/steps/publish-pipeline-artifacts.yml @@ -24,5 +24,7 @@ steps: artifactName: ${{ parameters.args.artifactName }} ${{ if parameters.args.properties }}: properties: ${{ parameters.args.properties }} - ${{ if parameters.args.sbomEnabled }}: + ${{ if ne(parameters.args.sbomEnabled, '') }}: sbomEnabled: ${{ parameters.args.sbomEnabled }} + ${{ if ne(parameters.args.isProduction, '') }}: + isProduction: ${{ parameters.args.isProduction }} diff --git a/eng/common/templates/job/job.yml b/eng/common/templates/job/job.yml index 7f1b5d97d1abd0..5e261f34db421b 100644 --- a/eng/common/templates/job/job.yml +++ b/eng/common/templates/job/job.yml @@ -1,12 +1,12 @@ parameters: enablePublishBuildArtifacts: false - disableComponentGovernance: '' - componentGovernanceIgnoreDirectories: '' -# Sbom related params - enableSbom: true runAsPublic: false - PackageVersion: 9.0.0 - BuildDropPath: '$(System.DefaultWorkingDirectory)/artifacts' +# CG related params, unused now and can eventually be removed + disableComponentGovernance: unused +# Sbom related params, unused now and can eventually be removed + enableSbom: unused + PackageVersion: unused + BuildDropPath: unused jobs: - template: /eng/common/core-templates/job/job.yml @@ -21,32 +21,34 @@ jobs: - ${{ each step in parameters.steps }}: - ${{ step }} - componentGovernanceSteps: - - template: /eng/common/templates/steps/component-governance.yml - parameters: - ${{ if eq(parameters.disableComponentGovernance, '') }}: - ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest'), eq(parameters.runAsPublic, 'false'), or(startsWith(variables['Build.SourceBranch'], 'refs/heads/release/'), startsWith(variables['Build.SourceBranch'], 'refs/heads/dotnet/'), startsWith(variables['Build.SourceBranch'], 'refs/heads/microsoft/'), eq(variables['Build.SourceBranch'], 'refs/heads/main'))) }}: - disableComponentGovernance: false - ${{ else }}: - disableComponentGovernance: true - ${{ else }}: - disableComponentGovernance: ${{ parameters.disableComponentGovernance }} - componentGovernanceIgnoreDirectories: ${{ parameters.componentGovernanceIgnoreDirectories }} + # we don't run CG in public + - ${{ if eq(variables['System.TeamProject'], 'public') }}: + - script: echo "##vso[task.setvariable variable=skipComponentGovernanceDetection]true" + displayName: Set skipComponentGovernanceDetection variable artifactPublishSteps: - ${{ if ne(parameters.artifacts.publish, '') }}: - ${{ if and(ne(parameters.artifacts.publish.artifacts, 'false'), ne(parameters.artifacts.publish.artifacts, '')) }}: - - template: /eng/common/core-templates/steps/publish-build-artifacts.yml + - template: /eng/common/core-templates/steps/publish-pipeline-artifacts.yml parameters: is1ESPipeline: false args: displayName: Publish pipeline artifacts - pathToPublish: '$(Build.ArtifactStagingDirectory)/artifacts' - publishLocation: Container + targetPath: '$(Build.ArtifactStagingDirectory)/artifacts' artifactName: ${{ coalesce(parameters.artifacts.publish.artifacts.name , 'Artifacts_$(Agent.Os)_$(_BuildConfig)') }} continueOnError: true - condition: always() - retryCountOnTaskFailure: 10 # for any logs being locked + condition: succeeded() + retryCountOnTaskFailure: 10 # for any files being locked + - template: /eng/common/core-templates/steps/publish-pipeline-artifacts.yml + parameters: + is1ESPipeline: false + args: + displayName: Publish pipeline artifacts + targetPath: '$(Build.ArtifactStagingDirectory)/artifacts' + artifactName: ${{ coalesce(parameters.artifacts.publish.artifacts.name , 'Artifacts_$(Agent.Os)_$(_BuildConfig)') }}_Attempt$(System.JobAttempt) + continueOnError: true + condition: not(succeeded()) + retryCountOnTaskFailure: 10 # for any files being locked - ${{ if and(ne(parameters.artifacts.publish.logs, 'false'), ne(parameters.artifacts.publish.logs, '')) }}: - template: /eng/common/core-templates/steps/publish-pipeline-artifacts.yml parameters: @@ -57,8 +59,7 @@ jobs: displayName: 'Publish logs' continueOnError: true condition: always() - retryCountOnTaskFailure: 10 # for any logs being locked - sbomEnabled: false # we don't need SBOM for logs + retryCountOnTaskFailure: 10 # for any files being locked - ${{ if ne(parameters.enablePublishBuildArtifacts, 'false') }}: - template: /eng/common/core-templates/steps/publish-pipeline-artifacts.yml @@ -70,7 +71,7 @@ jobs: artifactName: ${{ coalesce(parameters.enablePublishBuildArtifacts.artifactName, '$(Agent.Os)_$(Agent.JobName)_Attempt$(System.JobAttempt)' ) }} continueOnError: true condition: always() - sbomEnabled: false + retryCountOnTaskFailure: 10 # for any files being locked - ${{ if eq(parameters.enableBuildRetry, 'true') }}: - template: /eng/common/core-templates/steps/publish-pipeline-artifacts.yml @@ -81,4 +82,4 @@ jobs: artifactName: 'BuildConfiguration' displayName: 'Publish build retry configuration' continueOnError: true - sbomEnabled: false # we don't need SBOM for BuildConfiguration + retryCountOnTaskFailure: 10 # for any files being locked diff --git a/eng/common/templates/steps/component-governance.yml b/eng/common/templates/steps/component-governance.yml deleted file mode 100644 index c12a5f8d21d765..00000000000000 --- a/eng/common/templates/steps/component-governance.yml +++ /dev/null @@ -1,7 +0,0 @@ -steps: -- template: /eng/common/core-templates/steps/component-governance.yml - parameters: - is1ESPipeline: false - - ${{ each parameter in parameters }}: - ${{ parameter.key }}: ${{ parameter.value }} diff --git a/eng/common/tools.ps1 b/eng/common/tools.ps1 index 6710ffb884bb23..65adefc7f26871 100644 --- a/eng/common/tools.ps1 +++ b/eng/common/tools.ps1 @@ -185,7 +185,11 @@ function InitializeDotNetCli([bool]$install, [bool]$createSdkLocationFile) { if ((-not $globalJsonHasRuntimes) -and (-not [string]::IsNullOrEmpty($env:DOTNET_INSTALL_DIR)) -and (Test-Path(Join-Path $env:DOTNET_INSTALL_DIR "sdk\$dotnetSdkVersion"))) { $dotnetRoot = $env:DOTNET_INSTALL_DIR } else { - $dotnetRoot = Join-Path $RepoRoot '.dotnet' + if (-not [string]::IsNullOrEmpty($env:DOTNET_GLOBAL_INSTALL_DIR)) { + $dotnetRoot = $env:DOTNET_GLOBAL_INSTALL_DIR + } else { + $dotnetRoot = Join-Path $RepoRoot '.dotnet' + } if (-not (Test-Path(Join-Path $dotnetRoot "sdk\$dotnetSdkVersion"))) { if ($install) { @@ -375,12 +379,11 @@ function InstallDotNet([string] $dotnetRoot, # # 1. MSBuild from an active VS command prompt # 2. MSBuild from a compatible VS installation -# 3. MSBuild from the xcopy tool package # # Returns full path to msbuild.exe. # Throws on failure. # -function InitializeVisualStudioMSBuild([bool]$install, [object]$vsRequirements = $null) { +function InitializeVisualStudioMSBuild([object]$vsRequirements = $null) { if (-not (IsWindowsPlatform)) { throw "Cannot initialize Visual Studio on non-Windows" } @@ -390,13 +393,7 @@ function InitializeVisualStudioMSBuild([bool]$install, [object]$vsRequirements = } # Minimum VS version to require. - $vsMinVersionReqdStr = '17.7' - $vsMinVersionReqd = [Version]::new($vsMinVersionReqdStr) - - # If the version of msbuild is going to be xcopied, - # use this version. Version matches a package here: - # https://dev.azure.com/dnceng/public/_artifacts/feed/dotnet-eng/NuGet/Microsoft.DotNet.Arcade.MSBuild.Xcopy/versions/18.0.0 - $defaultXCopyMSBuildVersion = '18.0.0' + $vsMinVersionReqdStr = '18.0' if (!$vsRequirements) { if (Get-Member -InputObject $GlobalJson.tools -Name 'vs') { @@ -426,46 +423,16 @@ function InitializeVisualStudioMSBuild([bool]$install, [object]$vsRequirements = } } - # Locate Visual Studio installation or download x-copy msbuild. + # Locate Visual Studio installation. $vsInfo = LocateVisualStudio $vsRequirements - if ($vsInfo -ne $null -and $env:ForceUseXCopyMSBuild -eq $null) { + if ($vsInfo -ne $null) { # Ensure vsInstallDir has a trailing slash $vsInstallDir = Join-Path $vsInfo.installationPath "\" $vsMajorVersion = $vsInfo.installationVersion.Split('.')[0] InitializeVisualStudioEnvironmentVariables $vsInstallDir $vsMajorVersion } else { - if (Get-Member -InputObject $GlobalJson.tools -Name 'xcopy-msbuild') { - $xcopyMSBuildVersion = $GlobalJson.tools.'xcopy-msbuild' - $vsMajorVersion = $xcopyMSBuildVersion.Split('.')[0] - } else { - #if vs version provided in global.json is incompatible (too low) then use the default version for xcopy msbuild download - if($vsMinVersion -lt $vsMinVersionReqd){ - Write-Host "Using xcopy-msbuild version of $defaultXCopyMSBuildVersion since VS version $vsMinVersionStr provided in global.json is not compatible" - $xcopyMSBuildVersion = $defaultXCopyMSBuildVersion - $vsMajorVersion = $xcopyMSBuildVersion.Split('.')[0] - } - else{ - # If the VS version IS compatible, look for an xcopy msbuild package - # with a version matching VS. - # Note: If this version does not exist, then an explicit version of xcopy msbuild - # can be specified in global.json. This will be required for pre-release versions of msbuild. - $vsMajorVersion = $vsMinVersion.Major - $vsMinorVersion = $vsMinVersion.Minor - $xcopyMSBuildVersion = "$vsMajorVersion.$vsMinorVersion.0" - } - } - - $vsInstallDir = $null - if ($xcopyMSBuildVersion.Trim() -ine "none") { - $vsInstallDir = InitializeXCopyMSBuild $xcopyMSBuildVersion $install - if ($vsInstallDir -eq $null) { - throw "Could not xcopy msbuild. Please check that package 'Microsoft.DotNet.Arcade.MSBuild.Xcopy @ $xcopyMSBuildVersion' exists on feed 'dotnet-eng'." - } - } - if ($vsInstallDir -eq $null) { - throw 'Unable to find Visual Studio that has required version and components installed' - } + throw 'Unable to find Visual Studio that has required version and components installed' } $msbuildVersionDir = if ([int]$vsMajorVersion -lt 16) { "$vsMajorVersion.0" } else { "Current" } @@ -492,38 +459,6 @@ function InitializeVisualStudioEnvironmentVariables([string] $vsInstallDir, [str } } -function InstallXCopyMSBuild([string]$packageVersion) { - return InitializeXCopyMSBuild $packageVersion -install $true -} - -function InitializeXCopyMSBuild([string]$packageVersion, [bool]$install) { - $packageName = 'Microsoft.DotNet.Arcade.MSBuild.Xcopy' - $packageDir = Join-Path $ToolsDir "msbuild\$packageVersion" - $packagePath = Join-Path $packageDir "$packageName.$packageVersion.nupkg" - - if (!(Test-Path $packageDir)) { - if (!$install) { - return $null - } - - Create-Directory $packageDir - - Write-Host "Downloading $packageName $packageVersion" - $ProgressPreference = 'SilentlyContinue' # Don't display the console progress UI - it's a huge perf hit - Retry({ - Invoke-WebRequest "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/flat2/$packageName/$packageVersion/$packageName.$packageVersion.nupkg" -UseBasicParsing -OutFile $packagePath - }) - - if (!(Test-Path $packagePath)) { - Write-PipelineTelemetryError -Category 'InitializeToolset' -Message "See https://dev.azure.com/dnceng/internal/_wiki/wikis/DNCEng%20Services%20Wiki/1074/Updating-Microsoft.DotNet.Arcade.MSBuild.Xcopy-WAS-RoslynTools.MSBuild-(xcopy-msbuild)-generation?anchor=troubleshooting for help troubleshooting issues with XCopy MSBuild" - throw - } - Unzip $packagePath $packageDir - } - - return Join-Path $packageDir 'tools' -} - # # Locates Visual Studio instance that meets the minimal requirements specified by tools.vs object in global.json. # @@ -632,7 +567,7 @@ function InitializeBuildTool() { $buildTool = @{ Path = $dotnetPath; Command = 'msbuild'; Tool = 'dotnet'; Framework = 'net' } } elseif ($msbuildEngine -eq "vs") { try { - $msbuildPath = InitializeVisualStudioMSBuild -install:$restore + $msbuildPath = InitializeVisualStudioMSBuild } catch { Write-PipelineTelemetryError -Category 'InitializeToolset' -Message $_ ExitWithExitCode 1 @@ -745,10 +680,20 @@ function InitializeToolset() { ExitWithExitCode 1 } - $downloadArgs = @("package", "download", "Microsoft.DotNet.Arcade.Sdk@$toolsetVersion", "--prerelease", "--output", "$nugetCache") - if ($env:NUGET_CONFIG) { + $downloadArgs = @("package", "download", "Microsoft.DotNet.Arcade.Sdk@$toolsetVersion", "--verbosity", "minimal", "--prerelease", "--output", "$nugetCache") + $nugetConfig = $env:NUGET_CONFIG + if (-not $nugetConfig) { + # Search for any variation of nuget.config in the RepoRoot + $configFile = Get-ChildItem -Path $RepoRoot -File | Where-Object { $_.Name -ieq "nuget.config" } | Select-Object -First 1 + + if ($configFile) { + $nugetConfig = $configFile.FullName + } + } + + if ($nugetConfig) { $downloadArgs += "--configfile" - $downloadArgs += $env:NUGET_CONFIG + $downloadArgs += $nugetConfig } DotNet @downloadArgs diff --git a/eng/common/tools.sh b/eng/common/tools.sh index d2339eb21d5945..95c55ce9b4d914 100755 --- a/eng/common/tools.sh +++ b/eng/common/tools.sh @@ -148,7 +148,11 @@ function InitializeDotNetCli { if [[ $global_json_has_runtimes == false && -n "${DOTNET_INSTALL_DIR:-}" && -d "$DOTNET_INSTALL_DIR/sdk/$dotnet_sdk_version" ]]; then dotnet_root="$DOTNET_INSTALL_DIR" else - dotnet_root="${repo_root}.dotnet" + if [[ -n "${DOTNET_GLOBAL_INSTALL_DIR:-}" ]]; then + dotnet_root="$DOTNET_GLOBAL_INSTALL_DIR" + else + dotnet_root="${repo_root}.dotnet" + fi export DOTNET_INSTALL_DIR="$dotnet_root" @@ -426,9 +430,20 @@ function InitializeToolset { ExitWithExitCode 2 fi - local download_args=("package" "download" "Microsoft.DotNet.Arcade.Sdk@$toolset_version" "--prerelease" "--output" "$_GetNuGetPackageCachePath") - if [[ -n "${NUGET_CONFIG:-}" ]]; then - download_args+=("--configfile" "$NUGET_CONFIG") + local download_args=("package" "download" "Microsoft.DotNet.Arcade.Sdk@$toolset_version" "--verbosity" "minimal" "--prerelease" "--output" "$_GetNuGetPackageCachePath") + local nuget_config="${NUGET_CONFIG:-}" + if [[ -z "$nuget_config" ]]; then + # Search for any variation of nuget.config in the RepoRoot + local found_config + found_config=$(find "$repo_root" -maxdepth 1 -type f -iname "nuget.config" -print -quit) + + if [[ -n "$found_config" ]]; then + nuget_config="$found_config" + fi + fi + + if [[ -n "$nuget_config" ]]; then + download_args+=("--configfile" "$nuget_config") fi DotNet "${download_args[@]}" diff --git a/global.json b/global.json index 2a02cd5952b45b..01f9d078a1fb65 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "11.0.100-preview.3.26170.106", + "version": "11.0.100-preview.5.26227.104", "allowPrerelease": true, "rollForward": "major", "paths": [ @@ -10,14 +10,14 @@ "errorMessage": "The required .NET SDK wasn't found. Please run ./eng/common/dotnet.sh (Unix) or eng\\common\\dotnet.cmd (Windows) to install it." }, "tools": { - "dotnet": "11.0.100-preview.3.26170.106" + "dotnet": "11.0.100-preview.5.26227.104" }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "11.0.0-beta.26211.102", - "Microsoft.DotNet.Helix.Sdk": "11.0.0-beta.26211.102", - "Microsoft.DotNet.SharedFramework.Sdk": "11.0.0-beta.26211.102", + "Microsoft.DotNet.Arcade.Sdk": "11.0.0-beta.26257.113", + "Microsoft.DotNet.Helix.Sdk": "11.0.0-beta.26257.113", + "Microsoft.DotNet.SharedFramework.Sdk": "11.0.0-beta.26257.113", "Microsoft.Build.NoTargets": "3.7.0", "Microsoft.Build.Traversal": "3.4.0", - "Microsoft.NET.Sdk.IL": "11.0.0-preview.4.26211.102" + "Microsoft.NET.Sdk.IL": "11.0.0-preview.5.26257.113" } } diff --git a/src/coreclr/clrdatadescriptors.cmake b/src/coreclr/clrdatadescriptors.cmake index 86b1b7defbebcb..3a40c12dcc0840 100644 --- a/src/coreclr/clrdatadescriptors.cmake +++ b/src/coreclr/clrdatadescriptors.cmake @@ -94,10 +94,16 @@ function(generate_data_descriptors) # MSVC writes debug info to the default `vc140.pdb`, which does not travel with # the .obj files when they are archived into a static library (e.g. # Runtime.ServerGC.lib). Downstream linkers - notably the NativeAOT publish - # of ILCompiler/crossgen2/ilasm - then emit LNK4099 ("PDB 'vc140.pdb' was not - # found"), which is fatal under /WX. + # of ILCompiler/crossgen2/ilasm/mscordaccore_universal - then emit LNK4099 + # ("PDB ... was not found"), which is fatal under /WX in the VMR build. set_target_properties(${LIBRARY} PROPERTIES COMPILE_PDB_NAME "${LIBRARY}" COMPILE_PDB_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/$") + # Even with a per-target PDB name, the external PDB stays in the producer's + # binary dir and is not visible to downstream linkers consuming the static lib. + # Embed CodeView debug info directly into each .obj (/Z7) so the debug data + # travels with the object when it is archived into the static library, removing + # the need for the linker to find a separate PDB and silencing LNK4099. + target_compile_options(${LIBRARY} PRIVATE /Z7) endif() endfunction(generate_data_descriptors) diff --git a/src/coreclr/tools/ILTrim.Core/ILTrim.Core.csproj b/src/coreclr/tools/ILTrim.Core/ILTrim.Core.csproj index 95f9c6fd4230be..ff92d4a3df930c 100644 --- a/src/coreclr/tools/ILTrim.Core/ILTrim.Core.csproj +++ b/src/coreclr/tools/ILTrim.Core/ILTrim.Core.csproj @@ -10,9 +10,6 @@ $(ToolsCommonPath)TypeSystem\ $(DefineConstants);ILTRIM - - - diff --git a/src/coreclr/tools/ILTrim/ILTrim.csproj b/src/coreclr/tools/ILTrim/ILTrim.csproj index 252aae8d9b7b79..f767c56001a093 100644 --- a/src/coreclr/tools/ILTrim/ILTrim.csproj +++ b/src/coreclr/tools/ILTrim/ILTrim.csproj @@ -9,7 +9,6 @@ - diff --git a/src/coreclr/tools/aot/ILCompiler/ILCompiler.props b/src/coreclr/tools/aot/ILCompiler/ILCompiler.props index c4882ea694bff8..e3e6d02212c298 100644 --- a/src/coreclr/tools/aot/ILCompiler/ILCompiler.props +++ b/src/coreclr/tools/aot/ILCompiler/ILCompiler.props @@ -25,9 +25,11 @@ - - PreserveNewest - + @@ -66,6 +68,7 @@ @@ -73,6 +76,7 @@ diff --git a/src/libraries/Common/src/Interop/Interop.Utils.cs b/src/libraries/Common/src/Interop/Interop.Utils.cs index 498236c4ac4608..6d83fde5eeee35 100644 --- a/src/libraries/Common/src/Interop/Interop.Utils.cs +++ b/src/libraries/Common/src/Interop/Interop.Utils.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System; @@ -11,7 +11,7 @@ internal static partial class Interop /// the correct size of buffer to make. So invoke the interop call with an /// increasing buffer until the size is big enough. /// - internal static bool CallStringMethod( + internal static unsafe bool CallStringMethod( SpanFunc interopCall, TArg1 arg1, TArg2 arg2, TArg3 arg3, out string? result) diff --git a/src/libraries/Common/src/Interop/Linux/cgroups/Interop.cgroups.cs b/src/libraries/Common/src/Interop/Linux/cgroups/Interop.cgroups.cs index d967b2375aaa23..88aafae7c4ecd7 100644 --- a/src/libraries/Common/src/Interop/Linux/cgroups/Interop.cgroups.cs +++ b/src/libraries/Common/src/Interop/Linux/cgroups/Interop.cgroups.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System; @@ -379,7 +379,7 @@ private static bool TryFindCGroupPathForSubsystem(CGroupVersion cgroupVersion, s /// The subsystem, e.g. "memory". /// The found path, or null if it couldn't be found. /// true if a cgroup path for the subsystem is found. - internal static bool TryFindCGroupPathForSubsystem(CGroupVersion cgroupVersion, string procCGroupFilePath, string subsystem, [NotNullWhen(true)] out string? path) + internal static unsafe bool TryFindCGroupPathForSubsystem(CGroupVersion cgroupVersion, string procCGroupFilePath, string subsystem, [NotNullWhen(true)] out string? path) { if (File.Exists(procCGroupFilePath)) { diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.ReadLink.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.ReadLink.cs index 3b14a4076caaac..2c169132f4e844 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.ReadLink.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.ReadLink.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System; @@ -29,7 +29,7 @@ internal static partial class Sys /// /// The path to the symlink. /// Returns the link to the target path on success; and null otherwise. - internal static string? ReadLink(ReadOnlySpan path) + internal static unsafe string? ReadLink(ReadOnlySpan path) { const int StackBufferSize = 256; diff --git a/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.OpenSsl.cs b/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.OpenSsl.cs index a7fa684d3ceda1..9c95ab07365ad4 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.OpenSsl.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.OpenSsl.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System; @@ -349,7 +349,7 @@ internal static void UpdateClientCertificate(SafeSslHandle ssl, SslAuthenticatio } // This essentially wraps SSL* SSL_new() - internal static SafeSslHandle AllocateSslHandle(SslAuthenticationOptions sslAuthenticationOptions) + internal static unsafe SafeSslHandle AllocateSslHandle(SslAuthenticationOptions sslAuthenticationOptions) { SafeSslHandle? sslHandle = null; bool cacheSslContext = sslAuthenticationOptions.AllowTlsResume && !LocalAppContextSwitches.DisableTlsResume && sslAuthenticationOptions.EncryptionPolicy == EncryptionPolicy.RequireEncryption && sslAuthenticationOptions.CipherSuitesPolicy == null; diff --git a/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Ssl.cs b/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Ssl.cs index af4eb0f78a8b01..fd5f3608bbd9df 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Ssl.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Ssl.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System; @@ -86,7 +86,7 @@ internal static unsafe ReadOnlySpan SslGetAlpnSelected(SafeSslHandle ssl) [LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetDefaultSignatureAlgorithms")] private static unsafe partial int GetDefaultSignatureAlgorithms(Span algorithms, ref int algorithmCount); - internal static ushort[] GetDefaultSignatureAlgorithms() + internal static unsafe ushort[] GetDefaultSignatureAlgorithms() { // 256 algorithms should be more than enough for any use case. Span algorithms = stackalloc ushort[256]; diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetComputerName.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetComputerName.cs index 8d43a18a7c331a..d8d67227817e64 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetComputerName.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetComputerName.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System; @@ -14,7 +14,7 @@ internal static partial class Kernel32 // maximum length of the NETBIOS name (not including NULL) private const int MAX_COMPUTERNAME_LENGTH = 15; - internal static string? GetComputerName() + internal static unsafe string? GetComputerName() { Span buffer = stackalloc char[MAX_COMPUTERNAME_LENGTH + 1]; uint length = (uint)buffer.Length; diff --git a/src/libraries/Common/src/Interop/Windows/NCrypt/Interop.NCryptDeriveKeyMaterial.cs b/src/libraries/Common/src/Interop/Windows/NCrypt/Interop.NCryptDeriveKeyMaterial.cs index 61635c50767301..9806713fcf1ff8 100644 --- a/src/libraries/Common/src/Interop/Windows/NCrypt/Interop.NCryptDeriveKeyMaterial.cs +++ b/src/libraries/Common/src/Interop/Windows/NCrypt/Interop.NCryptDeriveKeyMaterial.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System; @@ -29,7 +29,7 @@ private static partial ErrorCode NCryptDeriveKey( /// Derive key material from a hash or HMAC KDF /// /// - private static byte[] DeriveKeyMaterial( + private static unsafe byte[] DeriveKeyMaterial( SafeNCryptSecretHandle secretAgreement, string kdf, string hashAlgorithm, diff --git a/src/libraries/Common/src/Interop/Windows/SspiCli/SSPIWrapper.cs b/src/libraries/Common/src/Interop/Windows/SspiCli/SSPIWrapper.cs index 5a0123c4bf561b..b7228335881595 100644 --- a/src/libraries/Common/src/Interop/Windows/SspiCli/SSPIWrapper.cs +++ b/src/libraries/Common/src/Interop/Windows/SspiCli/SSPIWrapper.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System.ComponentModel; @@ -239,7 +239,7 @@ public static bool QueryBlittableContextAttributes(ISSPIInterface secModule, return true; } - public static string? QueryStringContextAttributes(ISSPIInterface secModule, SafeDeleteContext securityContext, Interop.SspiCli.ContextAttribute contextAttribute) + public static unsafe string? QueryStringContextAttributes(ISSPIInterface secModule, SafeDeleteContext securityContext, Interop.SspiCli.ContextAttribute contextAttribute) { Debug.Assert( contextAttribute == Interop.SspiCli.ContextAttribute.SECPKG_ATTR_NAMES || diff --git a/src/libraries/Common/src/System/Diagnostics/DiagnosticsHelper.cs b/src/libraries/Common/src/System/Diagnostics/DiagnosticsHelper.cs index eb29b39698cd5a..c668523fdfe6d0 100644 --- a/src/libraries/Common/src/System/Diagnostics/DiagnosticsHelper.cs +++ b/src/libraries/Common/src/System/Diagnostics/DiagnosticsHelper.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System.Collections.Generic; @@ -19,7 +19,7 @@ internal static class DiagnosticsHelper /// we avoid the allocation of a new array by using the second collection as is and not converting it to an array. the reason /// is we call this every time we try to create a meter or instrument and we don't want to allocate a new array every time. ///
- internal static bool CompareTags(IList>? sortedTags, IEnumerable>? tags2) + internal static unsafe bool CompareTags(IList>? sortedTags, IEnumerable>? tags2) { if (sortedTags == tags2) { diff --git a/src/libraries/Common/src/System/Drawing/ColorConverterCommon.cs b/src/libraries/Common/src/System/Drawing/ColorConverterCommon.cs index bf69d5cc5fe3b5..729b368fc6d781 100644 --- a/src/libraries/Common/src/System/Drawing/ColorConverterCommon.cs +++ b/src/libraries/Common/src/System/Drawing/ColorConverterCommon.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System.Diagnostics; @@ -9,7 +9,7 @@ namespace System.Drawing // Minimal color conversion functionality, without a dependency on TypeConverter itself. internal static class ColorConverterCommon { - public static Color ConvertFromString(string strValue, CultureInfo culture) + public static unsafe Color ConvertFromString(string strValue, CultureInfo culture) { Debug.Assert(culture != null); diff --git a/src/libraries/Common/src/System/HexConverter.cs b/src/libraries/Common/src/System/HexConverter.cs index 0ff09f1bc94fe0..10316e0c610325 100644 --- a/src/libraries/Common/src/System/HexConverter.cs +++ b/src/libraries/Common/src/System/HexConverter.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System.Diagnostics; @@ -216,7 +216,7 @@ public static void EncodeToUtf16(ReadOnlySpan source, Span destinati } } - public static string ToString(ReadOnlySpan bytes, Casing casing = Casing.Upper) + public static unsafe string ToString(ReadOnlySpan bytes, Casing casing = Casing.Upper) { #if NET SpanCasingPair args = new() { Bytes = bytes, Casing = casing }; diff --git a/src/libraries/Common/src/System/IO/PathInternal.Windows.cs b/src/libraries/Common/src/System/IO/PathInternal.Windows.cs index e0aff52855590c..25e4182a645907 100644 --- a/src/libraries/Common/src/System/IO/PathInternal.Windows.cs +++ b/src/libraries/Common/src/System/IO/PathInternal.Windows.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System.Diagnostics.CodeAnalysis; @@ -315,7 +315,7 @@ internal static bool IsDirectorySeparator(char c) /// 4. Isn't a cross-plat friendly concept/behavior /// [return: NotNullIfNotNull(nameof(path))] - internal static string? NormalizeDirectorySeparators(string? path) + internal static unsafe string? NormalizeDirectorySeparators(string? path) { if (string.IsNullOrEmpty(path)) return path; diff --git a/src/libraries/Common/src/System/IO/PathInternal.cs b/src/libraries/Common/src/System/IO/PathInternal.cs index 1cd11d94204202..897f7c7d2b9816 100644 --- a/src/libraries/Common/src/System/IO/PathInternal.cs +++ b/src/libraries/Common/src/System/IO/PathInternal.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System.Diagnostics; @@ -95,7 +95,7 @@ internal static bool AreRootsEqual(string? first, string? second, StringComparis /// /// Input path /// The length of the root of the given path - internal static string RemoveRelativeSegments(string path, int rootLength) + internal static unsafe string RemoveRelativeSegments(string path, int rootLength) { var sb = new ValueStringBuilder(stackalloc char[260 /* PathInternal.MaxShortPath */]); diff --git a/src/libraries/Common/src/System/Net/Http/aspnetcore/Http2/Hpack/HPackEncoder.cs b/src/libraries/Common/src/System/Net/Http/aspnetcore/Http2/Hpack/HPackEncoder.cs index dab588146dc2af..45bb2a6b106c18 100644 --- a/src/libraries/Common/src/System/Net/Http/aspnetcore/Http2/Hpack/HPackEncoder.cs +++ b/src/libraries/Common/src/System/Net/Http/aspnetcore/Http2/Hpack/HPackEncoder.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. #nullable enable @@ -596,7 +596,7 @@ public static bool EncodeStringLiterals(ReadOnlySpan values, byte[]? sep /// Encodes a "Literal Header Field without Indexing" to a new array, but only the index portion; /// a subsequent call to EncodeStringLiteral must be used to encode the associated value. /// - public static byte[] EncodeLiteralHeaderFieldWithoutIndexingToAllocatedArray(int index) + public static unsafe byte[] EncodeLiteralHeaderFieldWithoutIndexingToAllocatedArray(int index) { Span span = stackalloc byte[256]; bool success = EncodeLiteralHeaderFieldWithoutIndexing(index, span, out int length); @@ -608,7 +608,7 @@ public static byte[] EncodeLiteralHeaderFieldWithoutIndexingToAllocatedArray(int /// Encodes a "Literal Header Field without Indexing - New Name" to a new array, but only the name portion; /// a subsequent call to EncodeStringLiteral must be used to encode the associated value. /// - public static byte[] EncodeLiteralHeaderFieldWithoutIndexingNewNameToAllocatedArray(string name) + public static unsafe byte[] EncodeLiteralHeaderFieldWithoutIndexingNewNameToAllocatedArray(string name) { Span span = stackalloc byte[256]; bool success = EncodeLiteralHeaderFieldWithoutIndexingNewName(name, span, out int length); @@ -617,7 +617,7 @@ public static byte[] EncodeLiteralHeaderFieldWithoutIndexingNewNameToAllocatedAr } /// Encodes a "Literal Header Field without Indexing" to a new array. - public static byte[] EncodeLiteralHeaderFieldWithoutIndexingToAllocatedArray(int index, string value) + public static unsafe byte[] EncodeLiteralHeaderFieldWithoutIndexingToAllocatedArray(int index, string value) { Span span = #if DEBUG diff --git a/src/libraries/Common/src/System/Net/Http/aspnetcore/Http3/Helpers/VariableLengthIntegerHelper.cs b/src/libraries/Common/src/System/Net/Http/aspnetcore/Http3/Helpers/VariableLengthIntegerHelper.cs index c7f1ec908d0f45..f1f6890511c4e0 100644 --- a/src/libraries/Common/src/System/Net/Http/aspnetcore/Http3/Helpers/VariableLengthIntegerHelper.cs +++ b/src/libraries/Common/src/System/Net/Http/aspnetcore/Http3/Helpers/VariableLengthIntegerHelper.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System.Buffers; @@ -96,7 +96,7 @@ public static bool TryRead(ref SequenceReader reader, out long value) // Cold path: copy to a temporary buffer before calling span-based read. return TryReadSlow(ref reader, out value); - static bool TryReadSlow(ref SequenceReader reader, out long value) + static unsafe bool TryReadSlow(ref SequenceReader reader, out long value) { ReadOnlySpan span = reader.CurrentSpan; diff --git a/src/libraries/Common/src/System/Net/Http/aspnetcore/Http3/QPack/QPackEncoder.cs b/src/libraries/Common/src/System/Net/Http/aspnetcore/Http3/QPack/QPackEncoder.cs index 5d96530b457d0c..07ff802959a2ae 100644 --- a/src/libraries/Common/src/System/Net/Http/aspnetcore/Http3/QPack/QPackEncoder.cs +++ b/src/libraries/Common/src/System/Net/Http/aspnetcore/Http3/QPack/QPackEncoder.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. #nullable enable @@ -34,7 +34,7 @@ public static bool EncodeStaticIndexedHeaderField(int index, Span destinat } } - public static byte[] EncodeStaticIndexedHeaderFieldToArray(int index) + public static unsafe byte[] EncodeStaticIndexedHeaderFieldToArray(int index) { Span buffer = stackalloc byte[IntegerEncoder.MaxInt32EncodedLength]; @@ -88,7 +88,7 @@ public static bool EncodeLiteralHeaderFieldWithStaticNameReference(int index, st /// /// Encodes just the name part of a Literal Header Field With Static Name Reference. Must call after to encode the header's value. /// - public static byte[] EncodeLiteralHeaderFieldWithStaticNameReferenceToArray(int index) + public static unsafe byte[] EncodeLiteralHeaderFieldWithStaticNameReferenceToArray(int index) { Span temp = stackalloc byte[IntegerEncoder.MaxInt32EncodedLength]; @@ -99,7 +99,7 @@ public static byte[] EncodeLiteralHeaderFieldWithStaticNameReferenceToArray(int return temp.Slice(0, headerBytesWritten).ToArray(); } - public static byte[] EncodeLiteralHeaderFieldWithStaticNameReferenceToArray(int index, string value) + public static unsafe byte[] EncodeLiteralHeaderFieldWithStaticNameReferenceToArray(int index, string value) { Span temp = value.Length < 256 ? stackalloc byte[256 + IntegerEncoder.MaxInt32EncodedLength * 2] : new byte[value.Length + IntegerEncoder.MaxInt32EncodedLength * 2]; bool res = EncodeLiteralHeaderFieldWithStaticNameReference(index, value, temp, out int bytesWritten); @@ -159,7 +159,7 @@ public static bool EncodeLiteralHeaderFieldWithoutNameReference(string name, Rea /// /// Encodes just the value part of a Literawl Header Field Without Static Name Reference. Must call after to encode the header's value. /// - public static byte[] EncodeLiteralHeaderFieldWithoutNameReferenceToArray(string name) + public static unsafe byte[] EncodeLiteralHeaderFieldWithoutNameReferenceToArray(string name) { Span temp = name.Length < 256 ? stackalloc byte[256 + IntegerEncoder.MaxInt32EncodedLength] : new byte[name.Length + IntegerEncoder.MaxInt32EncodedLength]; @@ -169,7 +169,7 @@ public static byte[] EncodeLiteralHeaderFieldWithoutNameReferenceToArray(string return temp.Slice(0, nameLength).ToArray(); } - public static byte[] EncodeLiteralHeaderFieldWithoutNameReferenceToArray(string name, string value) + public static unsafe byte[] EncodeLiteralHeaderFieldWithoutNameReferenceToArray(string name, string value) { Span temp = (name.Length + value.Length) < 256 ? stackalloc byte[256 + IntegerEncoder.MaxInt32EncodedLength * 2] : new byte[name.Length + value.Length + IntegerEncoder.MaxInt32EncodedLength * 2]; diff --git a/src/libraries/Common/src/System/Net/IPEndPointExtensions.cs b/src/libraries/Common/src/System/Net/IPEndPointExtensions.cs index 87a66da4637d4c..a1dfdf2eb63a8a 100644 --- a/src/libraries/Common/src/System/Net/IPEndPointExtensions.cs +++ b/src/libraries/Common/src/System/Net/IPEndPointExtensions.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System.Diagnostics; @@ -8,7 +8,7 @@ namespace System.Net.Sockets { internal static partial class IPEndPointExtensions { - public static IPAddress GetIPAddress(ReadOnlySpan socketAddressBuffer) + public static unsafe IPAddress GetIPAddress(ReadOnlySpan socketAddressBuffer) { AddressFamily family = SocketAddressPal.GetAddressFamily(socketAddressBuffer); @@ -29,7 +29,7 @@ public static IPAddress GetIPAddress(ReadOnlySpan socketAddressBuffer) throw new SocketException((int)SocketError.AddressFamilyNotSupported); } - public static void SetIPAddress(Span socketAddressBuffer, IPAddress address) + public static unsafe void SetIPAddress(Span socketAddressBuffer, IPAddress address) { SocketAddressPal.SetAddressFamily(socketAddressBuffer, address.AddressFamily); SocketAddressPal.SetPort(socketAddressBuffer, 0); @@ -61,7 +61,7 @@ public static void Serialize(this IPEndPoint endPoint, Span destination) SocketAddressPal.SetPort(destination, (ushort)endPoint.Port); } - public static bool Equals(this IPEndPoint endPoint, ReadOnlySpan socketAddressBuffer) + public static unsafe bool Equals(this IPEndPoint endPoint, ReadOnlySpan socketAddressBuffer) { if (socketAddressBuffer.Length >= SocketAddress.GetMaximumAddressSize(endPoint.AddressFamily) && endPoint.AddressFamily == SocketAddressPal.GetAddressFamily(socketAddressBuffer) && diff --git a/src/libraries/Common/src/System/Net/IPv4AddressHelper.Common.cs b/src/libraries/Common/src/System/Net/IPv4AddressHelper.Common.cs index 575d7ed2ec7d6d..7b3a6916b015c9 100644 --- a/src/libraries/Common/src/System/Net/IPv4AddressHelper.Common.cs +++ b/src/libraries/Common/src/System/Net/IPv4AddressHelper.Common.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System.Buffers.Binary; @@ -31,7 +31,7 @@ internal static ushort ToUShort(TChar value) } // Only called from the IPv6Helper, only parse the canonical format - internal static int ParseHostNumber(ReadOnlySpan str, int start, int end) + internal static unsafe int ParseHostNumber(ReadOnlySpan str, int start, int end) where TChar : unmanaged, IBinaryInteger { Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); diff --git a/src/libraries/Common/src/System/Net/Security/MD4.cs b/src/libraries/Common/src/System/Net/Security/MD4.cs index 6b7acd98f2f8a0..cba52297c7b1cd 100644 --- a/src/libraries/Common/src/System/Net/Security/MD4.cs +++ b/src/libraries/Common/src/System/Net/Security/MD4.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // @@ -60,7 +60,7 @@ internal sealed class MD4 private const int S33 = 11; private const int S34 = 15; - internal static void HashData(ReadOnlySpan source, Span destination) + internal static unsafe void HashData(ReadOnlySpan source, Span destination) { Debug.Assert(destination.Length == 128 >> 3); @@ -186,7 +186,7 @@ private static void Decode(Span output, ReadOnlySpan input) } } - private static void MD4Transform(Span state, ReadOnlySpan block) + private static unsafe void MD4Transform(Span state, ReadOnlySpan block) { uint a = state[0]; uint b = state[1]; diff --git a/src/libraries/Common/src/System/Net/Security/SslKeyLogger.cs b/src/libraries/Common/src/System/Net/Security/SslKeyLogger.cs index aa7885420c9ef8..30381c287b093b 100644 --- a/src/libraries/Common/src/System/Net/Security/SslKeyLogger.cs +++ b/src/libraries/Common/src/System/Net/Security/SslKeyLogger.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System; @@ -56,7 +56,7 @@ public static void WriteLineRaw(ReadOnlySpan data) } } - public static void WriteSecrets( + public static unsafe void WriteSecrets( ReadOnlySpan clientRandom, ReadOnlySpan clientHandshakeTrafficSecret, ReadOnlySpan serverHandshakeTrafficSecret, @@ -95,7 +95,7 @@ public static void WriteSecrets( } } - private static void WriteSecretCore(ReadOnlySpan labelUtf8, ReadOnlySpan clientRandomUtf8, ReadOnlySpan secret) + private static unsafe void WriteSecretCore(ReadOnlySpan labelUtf8, ReadOnlySpan clientRandomUtf8, ReadOnlySpan secret) { if (secret.Length == 0) { diff --git a/src/libraries/Common/src/System/Net/SocketAddress.cs b/src/libraries/Common/src/System/Net/SocketAddress.cs index bd4172ace9b106..e64670a6704457 100644 --- a/src/libraries/Common/src/System/Net/SocketAddress.cs +++ b/src/libraries/Common/src/System/Net/SocketAddress.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System.Diagnostics; @@ -92,7 +92,7 @@ public SocketAddress(AddressFamily family, int size) SocketAddressPal.SetAddressFamily(_buffer, family); } - internal SocketAddress(IPAddress ipAddress) + internal unsafe SocketAddress(IPAddress ipAddress) : this(ipAddress.AddressFamily, ((ipAddress.AddressFamily == AddressFamily.InterNetwork) ? IPv4AddressSize : IPv6AddressSize)) { @@ -150,7 +150,7 @@ public override int GetHashCode() return hash.ToHashCode(); } - public override string ToString() + public override unsafe string ToString() { // Get the address family string. In almost all cases, this should be a cached string // from the enum and won't actually allocate. diff --git a/src/libraries/Common/src/System/Reflection/AssemblyNameFormatter.cs b/src/libraries/Common/src/System/Reflection/AssemblyNameFormatter.cs index 5b066c81926bc4..090c864a3dfe5e 100644 --- a/src/libraries/Common/src/System/Reflection/AssemblyNameFormatter.cs +++ b/src/libraries/Common/src/System/Reflection/AssemblyNameFormatter.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System.Collections.Generic; @@ -10,7 +10,7 @@ namespace System.Reflection { internal static class AssemblyNameFormatter { - public static string ComputeDisplayName(string name, Version? version, string? cultureName, byte[]? pkt, AssemblyNameFlags flags = 0, AssemblyContentType contentType = 0, byte[]? pk = null) + public static unsafe string ComputeDisplayName(string name, Version? version, string? cultureName, byte[]? pkt, AssemblyNameFlags flags = 0, AssemblyContentType contentType = 0, byte[]? pk = null) { ValueStringBuilder vsb = new(stackalloc char[256]); AppendDisplayName(ref vsb, name, version, cultureName, pkt, flags, contentType, pk); diff --git a/src/libraries/Common/src/System/Reflection/AssemblyNameParser.cs b/src/libraries/Common/src/System/Reflection/AssemblyNameParser.cs index 3638ab05166344..246d3f75fd0f7c 100644 --- a/src/libraries/Common/src/System/Reflection/AssemblyNameParser.cs +++ b/src/libraries/Common/src/System/Reflection/AssemblyNameParser.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System.Diagnostics; @@ -244,7 +244,7 @@ private bool TryParse(ref AssemblyNameParts result) private static bool IsAttribute(string candidate, string attributeKind) => candidate.Equals(attributeKind, StringComparison.OrdinalIgnoreCase); - private static bool TryParseVersion(string attributeValue, ref Version? version) + private static unsafe bool TryParseVersion(string attributeValue, ref Version? version) { #if NET ReadOnlySpan attributeValueSpan = attributeValue; @@ -364,7 +364,7 @@ private bool TryGetNextChar(out char ch) // Return the next token in assembly name. If the result is Token.String, // sets "tokenString" to the tokenized string. // - private bool TryGetNextToken(out string tokenString, out Token token) + private unsafe bool TryGetNextToken(out string tokenString, out Token token) { tokenString = string.Empty; char c; diff --git a/src/libraries/Common/src/System/Security/Cryptography/Asn1/Pkcs12/PfxAsn.manual.cs b/src/libraries/Common/src/System/Security/Cryptography/Asn1/Pkcs12/PfxAsn.manual.cs index 6503281168a310..41926fd84a6736 100644 --- a/src/libraries/Common/src/System/Security/Cryptography/Asn1/Pkcs12/PfxAsn.manual.cs +++ b/src/libraries/Common/src/System/Security/Cryptography/Asn1/Pkcs12/PfxAsn.manual.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System.Diagnostics; @@ -12,7 +12,7 @@ namespace System.Security.Cryptography.Asn1.Pkcs12 { internal partial struct PfxAsn { - internal bool VerifyMac( + internal unsafe bool VerifyMac( ReadOnlySpan macPassword, ReadOnlySpan authSafeContents) { diff --git a/src/libraries/Common/src/System/Security/Cryptography/CngPkcs8.cs b/src/libraries/Common/src/System/Security/Cryptography/CngPkcs8.cs index fd6347176e7c69..91d400654e0233 100644 --- a/src/libraries/Common/src/System/Security/Cryptography/CngPkcs8.cs +++ b/src/libraries/Common/src/System/Security/Cryptography/CngPkcs8.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System.Buffers; @@ -268,7 +268,7 @@ internal static Pkcs8Response ImportEncryptedPkcs8PrivateKey( } } - private static AsnWriter RewriteEncryptedPkcs8PrivateKey( + private static unsafe AsnWriter RewriteEncryptedPkcs8PrivateKey( AsymmetricAlgorithm key, ReadOnlySpan passwordBytes, PbeParameters pbeParameters) @@ -407,7 +407,7 @@ private static AsnWriter RewriteEncryptedPkcs8PrivateKey( } } - private static void FillRandomAsciiString(Span destination) + private static unsafe void FillRandomAsciiString(Span destination) { Debug.Assert(destination.Length < 128); Span randomKey = stackalloc byte[destination.Length]; diff --git a/src/libraries/Common/src/System/Security/Cryptography/DSAAndroid.cs b/src/libraries/Common/src/System/Security/Cryptography/DSAAndroid.cs index 3207cd0df937b4..63fda373c0e851 100644 --- a/src/libraries/Common/src/System/Security/Cryptography/DSAAndroid.cs +++ b/src/libraries/Common/src/System/Security/Cryptography/DSAAndroid.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System.Diagnostics; @@ -202,7 +202,7 @@ protected override byte[] HashData(Stream data, HashAlgorithmName hashAlgorithm) protected override bool TryHashData(ReadOnlySpan data, Span destination, HashAlgorithmName hashAlgorithm, out int bytesWritten) => CryptographicOperations.TryHashData(hashAlgorithm, data, destination, out bytesWritten); - public override byte[] CreateSignature(byte[] rgbHash) + public override unsafe byte[] CreateSignature(byte[] rgbHash) { ArgumentNullException.ThrowIfNull(rgbHash); @@ -227,7 +227,7 @@ public override bool TryCreateSignature( out bytesWritten); } - protected override bool TryCreateSignatureCore( + protected override unsafe bool TryCreateSignatureCore( ReadOnlySpan hash, Span destination, DSASignatureFormat signatureFormat, diff --git a/src/libraries/Common/src/System/Security/Cryptography/DSACng.SignVerify.cs b/src/libraries/Common/src/System/Security/Cryptography/DSACng.SignVerify.cs index b2ec1a976fa6d5..26d1cf353a8b49 100644 --- a/src/libraries/Common/src/System/Security/Cryptography/DSACng.SignVerify.cs +++ b/src/libraries/Common/src/System/Security/Cryptography/DSACng.SignVerify.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System.Diagnostics; @@ -17,7 +17,7 @@ public sealed partial class DSACng : DSA // https://learn.microsoft.com/windows/desktop/api/bcrypt/ns-bcrypt-_bcrypt_dsa_key_blob_v2 private const int WindowsMaxQSize = 32; - public override byte[] CreateSignature(byte[] rgbHash) + public override unsafe byte[] CreateSignature(byte[] rgbHash) { ArgumentNullException.ThrowIfNull(rgbHash); @@ -78,7 +78,7 @@ public override bool VerifySignature(byte[] rgbHash, byte[] rgbSignature) return VerifySignatureCore(rgbHash, rgbSignature, DSASignatureFormat.IeeeP1363FixedFieldConcatenation); } - protected override bool VerifySignatureCore( + protected override unsafe bool VerifySignatureCore( ReadOnlySpan hash, ReadOnlySpan signature, DSASignatureFormat signatureFormat) diff --git a/src/libraries/Common/src/System/Security/Cryptography/DSAOpenSsl.cs b/src/libraries/Common/src/System/Security/Cryptography/DSAOpenSsl.cs index 699d9faa1af235..2077a7c886ef56 100644 --- a/src/libraries/Common/src/System/Security/Cryptography/DSAOpenSsl.cs +++ b/src/libraries/Common/src/System/Security/Cryptography/DSAOpenSsl.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System.Diagnostics; @@ -193,7 +193,7 @@ private SafeDsaHandle GenerateKey() return key; } - public override byte[] CreateSignature(byte[] rgbHash) + public override unsafe byte[] CreateSignature(byte[] rgbHash) { ArgumentNullException.ThrowIfNull(rgbHash); @@ -218,7 +218,7 @@ public override bool TryCreateSignature( out bytesWritten); } - protected override bool TryCreateSignatureCore( + protected override unsafe bool TryCreateSignatureCore( ReadOnlySpan hash, Span destination, DSASignatureFormat signatureFormat, diff --git a/src/libraries/Common/src/System/Security/Cryptography/ECDiffieHellmanAndroid.Derive.cs b/src/libraries/Common/src/System/Security/Cryptography/ECDiffieHellmanAndroid.Derive.cs index b284584acf2b9c..555ed51df0177f 100644 --- a/src/libraries/Common/src/System/Security/Cryptography/ECDiffieHellmanAndroid.Derive.cs +++ b/src/libraries/Common/src/System/Security/Cryptography/ECDiffieHellmanAndroid.Derive.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System.Diagnostics; @@ -85,7 +85,7 @@ public override byte[] DeriveRawSecretAgreement(ECDiffieHellmanPublicKey otherPa /// /// Get the secret agreement generated between two parties /// - private byte[]? DeriveSecretAgreement(ECDiffieHellmanPublicKey otherPartyPublicKey, IncrementalHash? hasher) + private unsafe byte[]? DeriveSecretAgreement(ECDiffieHellmanPublicKey otherPartyPublicKey, IncrementalHash? hasher) { Debug.Assert(otherPartyPublicKey != null); Debug.Assert(_key is not null); // Callers should have checked for null diff --git a/src/libraries/Common/src/System/Security/Cryptography/ECDiffieHellmanAppleCrypto.cs b/src/libraries/Common/src/System/Security/Cryptography/ECDiffieHellmanAppleCrypto.cs index 6b27d84f3a30b2..abc66f212aeaba 100644 --- a/src/libraries/Common/src/System/Security/Cryptography/ECDiffieHellmanAppleCrypto.cs +++ b/src/libraries/Common/src/System/Security/Cryptography/ECDiffieHellmanAppleCrypto.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System.Diagnostics; @@ -175,7 +175,7 @@ public override byte[] DeriveRawSecretAgreement(ECDiffieHellmanPublicKey otherPa return secretAgreement; } - private byte[]? DeriveSecretAgreement(ECDiffieHellmanPublicKey otherPartyPublicKey, IncrementalHash? hasher) + private unsafe byte[]? DeriveSecretAgreement(ECDiffieHellmanPublicKey otherPartyPublicKey, IncrementalHash? hasher) { if (!(otherPartyPublicKey is ECDiffieHellmanAppleCryptoPublicKey secTransPubKey)) { diff --git a/src/libraries/Common/src/System/Security/Cryptography/ECDiffieHellmanOpenSsl.Derive.cs b/src/libraries/Common/src/System/Security/Cryptography/ECDiffieHellmanOpenSsl.Derive.cs index a064f682ca65c6..1f65d98a5bfa92 100644 --- a/src/libraries/Common/src/System/Security/Cryptography/ECDiffieHellmanOpenSsl.Derive.cs +++ b/src/libraries/Common/src/System/Security/Cryptography/ECDiffieHellmanOpenSsl.Derive.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System.Diagnostics; @@ -83,7 +83,7 @@ public override byte[] DeriveRawSecretAgreement(ECDiffieHellmanPublicKey otherPa /// /// Get the secret agreement generated between two parties /// - private byte[]? DeriveSecretAgreement(ECDiffieHellmanPublicKey otherPartyPublicKey, IncrementalHash? hasher) + private unsafe byte[]? DeriveSecretAgreement(ECDiffieHellmanPublicKey otherPartyPublicKey, IncrementalHash? hasher) { Debug.Assert(otherPartyPublicKey != null); Debug.Assert(_key is not null); // Callers should validate prior. diff --git a/src/libraries/Common/src/System/Security/Cryptography/ECDsaAndroid.cs b/src/libraries/Common/src/System/Security/Cryptography/ECDsaAndroid.cs index 5061cbba1ed6ae..53730c2c7ca431 100644 --- a/src/libraries/Common/src/System/Security/Cryptography/ECDsaAndroid.cs +++ b/src/libraries/Common/src/System/Security/Cryptography/ECDsaAndroid.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System.Diagnostics; @@ -71,7 +71,7 @@ private void ForceSetKeySize(int newKeySize) // Return the three sizes that can be explicitly set (for backwards compatibility) public override KeySizes[] LegalKeySizes => s_defaultKeySizes.CloneKeySizesArray(); - public override byte[] SignHash(byte[] hash) + public override unsafe byte[] SignHash(byte[] hash) { ArgumentNullException.ThrowIfNull(hash); @@ -95,7 +95,7 @@ public override bool TrySignHash(ReadOnlySpan hash, Span destination out bytesWritten); } - protected override bool TrySignHashCore( + protected override unsafe bool TrySignHashCore( ReadOnlySpan hash, Span destination, DSASignatureFormat signatureFormat, @@ -189,7 +189,7 @@ public override bool VerifyHash(byte[] hash, byte[] signature) public override bool VerifyHash(ReadOnlySpan hash, ReadOnlySpan signature) => VerifyHashCore(hash, signature, DSASignatureFormat.IeeeP1363FixedFieldConcatenation); - protected override bool VerifyHashCore( + protected override unsafe bool VerifyHashCore( ReadOnlySpan hash, ReadOnlySpan signature, DSASignatureFormat signatureFormat) diff --git a/src/libraries/Common/src/System/Security/Cryptography/ECDsaOpenSsl.cs b/src/libraries/Common/src/System/Security/Cryptography/ECDsaOpenSsl.cs index f399895d490f57..9c247641886752 100644 --- a/src/libraries/Common/src/System/Security/Cryptography/ECDsaOpenSsl.cs +++ b/src/libraries/Common/src/System/Security/Cryptography/ECDsaOpenSsl.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System.Diagnostics; @@ -79,7 +79,7 @@ private void ForceSetKeySize(int newKeySize) // Return the three sizes that can be explicitly set (for backwards compatibility) public override KeySizes[] LegalKeySizes => s_defaultKeySizes.CloneKeySizesArray(); - public override byte[] SignHash(byte[] hash) + public override unsafe byte[] SignHash(byte[] hash) { ArgumentNullException.ThrowIfNull(hash); ThrowIfDisposed(); @@ -103,7 +103,7 @@ public override bool TrySignHash(ReadOnlySpan hash, Span destination out bytesWritten); } - protected override bool TrySignHashCore( + protected override unsafe bool TrySignHashCore( ReadOnlySpan hash, Span destination, DSASignatureFormat signatureFormat, @@ -163,7 +163,7 @@ public override bool VerifyHash(byte[] hash, byte[] signature) public override bool VerifyHash(ReadOnlySpan hash, ReadOnlySpan signature) => VerifyHashCore(hash, signature, DSASignatureFormat.IeeeP1363FixedFieldConcatenation); - protected override bool VerifyHashCore( + protected override unsafe bool VerifyHashCore( ReadOnlySpan hash, ReadOnlySpan signature, DSASignatureFormat signatureFormat) diff --git a/src/libraries/Common/src/System/Security/Cryptography/KeyFormatHelper.Encrypted.cs b/src/libraries/Common/src/System/Security/Cryptography/KeyFormatHelper.Encrypted.cs index 01ae208960261d..629a13ac803fcd 100644 --- a/src/libraries/Common/src/System/Security/Cryptography/KeyFormatHelper.Encrypted.cs +++ b/src/libraries/Common/src/System/Security/Cryptography/KeyFormatHelper.Encrypted.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System.Buffers; @@ -139,7 +139,7 @@ internal static AsnWriter WriteEncryptedPkcs8( pbeParameters); } - private static AsnWriter WriteEncryptedPkcs8( + private static unsafe AsnWriter WriteEncryptedPkcs8( ReadOnlySpan password, ReadOnlySpan passwordBytes, AsnWriter pkcs8Writer, diff --git a/src/libraries/Common/src/System/Security/Cryptography/PasswordBasedEncryption.cs b/src/libraries/Common/src/System/Security/Cryptography/PasswordBasedEncryption.cs index 0ede657ed960f5..f9d87a1ce19947 100644 --- a/src/libraries/Common/src/System/Security/Cryptography/PasswordBasedEncryption.cs +++ b/src/libraries/Common/src/System/Security/Cryptography/PasswordBasedEncryption.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System.Diagnostics; @@ -841,7 +841,7 @@ private static unsafe Rfc2898DeriveBytes OpenPbkdf2( } } - private static int Pbes1Decrypt( + private static unsafe int Pbes1Decrypt( OptionalReadOnlySpan algorithmParameters, ReadOnlySpan password, IncrementalHash hasher, @@ -1015,7 +1015,7 @@ private static unsafe int Decrypt( } } - private static void Pbkdf1( + private static unsafe void Pbkdf1( IncrementalHash hasher, ReadOnlySpan password, ReadOnlySpan salt, diff --git a/src/libraries/Common/src/System/Security/Cryptography/Pkcs/Pkcs12Builder.cs b/src/libraries/Common/src/System/Security/Cryptography/Pkcs/Pkcs12Builder.cs index c8dc35a5980910..44580c87521742 100644 --- a/src/libraries/Common/src/System/Security/Cryptography/Pkcs/Pkcs12Builder.cs +++ b/src/libraries/Common/src/System/Security/Cryptography/Pkcs/Pkcs12Builder.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System.Buffers; @@ -145,7 +145,7 @@ public void SealWithMac( iterationCount); } - public void SealWithMac( + public unsafe void SealWithMac( ReadOnlySpan password, HashAlgorithmName hashAlgorithm, int iterationCount) diff --git a/src/libraries/Common/src/System/Security/Cryptography/Pkcs/Pkcs12SafeContents.cs b/src/libraries/Common/src/System/Security/Cryptography/Pkcs/Pkcs12SafeContents.cs index c6c4b225a845a7..f9b1fbd1b42b8f 100644 --- a/src/libraries/Common/src/System/Security/Cryptography/Pkcs/Pkcs12SafeContents.cs +++ b/src/libraries/Common/src/System/Security/Cryptography/Pkcs/Pkcs12SafeContents.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System.Collections.Generic; @@ -411,7 +411,7 @@ private static List ReadBagsCore( return bags; } - internal byte[] Encrypt( + internal unsafe byte[] Encrypt( ReadOnlySpan password, ReadOnlySpan passwordBytes, PbeParameters pbeParameters) diff --git a/src/libraries/Common/src/System/Security/Cryptography/Pkcs12Kdf.cs b/src/libraries/Common/src/System/Security/Cryptography/Pkcs12Kdf.cs index cfda2b57cad316..e8af4553efa4b1 100644 --- a/src/libraries/Common/src/System/Security/Cryptography/Pkcs12Kdf.cs +++ b/src/libraries/Common/src/System/Security/Cryptography/Pkcs12Kdf.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System.Collections.Generic; @@ -74,7 +74,7 @@ internal static void DeriveMacKey( destination); } - private static void Derive( + private static unsafe void Derive( ReadOnlySpan password, HashAlgorithmName hashAlgorithm, int iterationCount, diff --git a/src/libraries/Common/src/System/Security/Cryptography/PqcBlobHelpers.cs b/src/libraries/Common/src/System/Security/Cryptography/PqcBlobHelpers.cs index 21d2e00a78a6c6..6ebd7ef45d4560 100644 --- a/src/libraries/Common/src/System/Security/Cryptography/PqcBlobHelpers.cs +++ b/src/libraries/Common/src/System/Security/Cryptography/PqcBlobHelpers.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System.Diagnostics; @@ -96,7 +96,7 @@ internal static ReadOnlySpan DecodeMLDsaBlob( return data; } - private static TResult EncodePQDsaBlob( + private static unsafe TResult EncodePQDsaBlob( KeyBlobMagicNumber magic, ReadOnlySpan parameterSet, ReadOnlySpan data, diff --git a/src/libraries/Common/src/System/Security/Cryptography/RSAAndroid.cs b/src/libraries/Common/src/System/Security/Cryptography/RSAAndroid.cs index 6c0a8da998dc42..98cf22419b7dd2 100644 --- a/src/libraries/Common/src/System/Security/Cryptography/RSAAndroid.cs +++ b/src/libraries/Common/src/System/Security/Cryptography/RSAAndroid.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System.Buffers; @@ -105,7 +105,7 @@ public override byte[] Decrypt(byte[] data, RSAEncryptionPadding padding) } } - public override bool TryDecrypt( + public override unsafe bool TryDecrypt( ReadOnlySpan data, Span destination, RSAEncryptionPadding padding, diff --git a/src/libraries/Common/src/System/Security/Cryptography/RSAOpenSsl.cs b/src/libraries/Common/src/System/Security/Cryptography/RSAOpenSsl.cs index 060f002ebb527f..767c0ac160d582 100644 --- a/src/libraries/Common/src/System/Security/Cryptography/RSAOpenSsl.cs +++ b/src/libraries/Common/src/System/Security/Cryptography/RSAOpenSsl.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System.Buffers; @@ -104,7 +104,7 @@ public override byte[] Decrypt(byte[] data, RSAEncryptionPadding padding) } } - public override bool TryDecrypt( + public override unsafe bool TryDecrypt( ReadOnlySpan data, Span destination, RSAEncryptionPadding padding, diff --git a/src/libraries/Common/src/System/Security/Cryptography/RsaPaddingProcessor.cs b/src/libraries/Common/src/System/Security/Cryptography/RsaPaddingProcessor.cs index d4d493f3daca54..e40fcf54ac1c7c 100644 --- a/src/libraries/Common/src/System/Security/Cryptography/RsaPaddingProcessor.cs +++ b/src/libraries/Common/src/System/Security/Cryptography/RsaPaddingProcessor.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System.Buffers; @@ -285,7 +285,7 @@ internal static void PadPkcs1Signature( source.CopyTo(destination.Slice(paddingLength + 3 + digestInfoPrefix.Length)); } - internal static void PadOaep( + internal static unsafe void PadOaep( HashAlgorithmName hashAlgorithmName, ReadOnlySpan source, Span destination) @@ -380,7 +380,7 @@ internal static void PadOaep( } } - internal static void EncodePss(HashAlgorithmName hashAlgorithmName, ReadOnlySpan mHash, Span destination, int keySize) + internal static unsafe void EncodePss(HashAlgorithmName hashAlgorithmName, ReadOnlySpan mHash, Span destination, int keySize) { int hLen = HashLength(hashAlgorithmName); @@ -469,7 +469,7 @@ internal static void EncodePss(HashAlgorithmName hashAlgorithmName, ReadOnlySpan CryptoPool.Return(dbMaskRented, clearSize: 0); } - internal static bool VerifyPss(HashAlgorithmName hashAlgorithmName, ReadOnlySpan mHash, ReadOnlySpan em, int keySize) + internal static unsafe bool VerifyPss(HashAlgorithmName hashAlgorithmName, ReadOnlySpan mHash, ReadOnlySpan em, int keySize) { int hLen = HashLength(hashAlgorithmName); @@ -585,7 +585,7 @@ internal static bool VerifyPss(HashAlgorithmName hashAlgorithmName, ReadOnlySpan } // https://tools.ietf.org/html/rfc3447#appendix-B.2.1 - private static void Mgf1(IncrementalHash hasher, ReadOnlySpan mgfSeed, Span mask) + private static unsafe void Mgf1(IncrementalHash hasher, ReadOnlySpan mgfSeed, Span mask) { int hLen = hasher.HashLengthInBytes; Span writePtr = mask; diff --git a/src/libraries/Common/src/System/Security/Cryptography/SP800108HmacCounterKdfImplementationCng.cs b/src/libraries/Common/src/System/Security/Cryptography/SP800108HmacCounterKdfImplementationCng.cs index e02a47a072ada2..f6d8d7cb889b1b 100644 --- a/src/libraries/Common/src/System/Security/Cryptography/SP800108HmacCounterKdfImplementationCng.cs +++ b/src/libraries/Common/src/System/Security/Cryptography/SP800108HmacCounterKdfImplementationCng.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System.Diagnostics; @@ -85,7 +85,7 @@ internal override unsafe void DeriveBytes(ReadOnlySpan label, ReadOnlySpan } } - internal override void DeriveBytes(ReadOnlySpan label, ReadOnlySpan context, Span destination) + internal override unsafe void DeriveBytes(ReadOnlySpan label, ReadOnlySpan context, Span destination) { using (Utf8DataEncoding labelData = new Utf8DataEncoding(label, stackalloc byte[CharToBytesStackBufferSize])) using (Utf8DataEncoding contextData = new Utf8DataEncoding(context, stackalloc byte[CharToBytesStackBufferSize])) @@ -109,7 +109,7 @@ internal static void DeriveBytesOneShot( } } - internal static void DeriveBytesOneShot( + internal static unsafe void DeriveBytesOneShot( ReadOnlySpan key, HashAlgorithmName hashAlgorithm, ReadOnlySpan label, diff --git a/src/libraries/Common/src/System/Security/Cryptography/SlhDsa.cs b/src/libraries/Common/src/System/Security/Cryptography/SlhDsa.cs index d8ed8f1aaaf7f0..9d3892fc926521 100644 --- a/src/libraries/Common/src/System/Security/Cryptography/SlhDsa.cs +++ b/src/libraries/Common/src/System/Security/Cryptography/SlhDsa.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System.Buffers; @@ -648,7 +648,7 @@ public bool TryExportPkcs8PrivateKey(Span destination, out int bytesWritte /// /// An error occurred while exporting the key. /// - protected virtual bool TryExportPkcs8PrivateKeyCore(Span destination, out int bytesWritten) + protected virtual unsafe bool TryExportPkcs8PrivateKeyCore(Span destination, out int bytesWritten) { // Private key size for SLH-DSA is at most 128 bytes so we can stack allocate it. int privateKeySizeInBytes = Algorithm.PrivateKeySizeInBytes; @@ -1862,7 +1862,7 @@ protected virtual void Dispose(bool disposing) /// protected abstract void ExportSlhDsaPrivateKeyCore(Span destination); - private AsnWriter ExportSubjectPublicKeyInfoCore() + private unsafe AsnWriter ExportSubjectPublicKeyInfoCore() { // Public key size for SLH-DSA is at most 64 bytes so we can stack allocate it. int publicKeySizeInBytes = Algorithm.PublicKeySizeInBytes; diff --git a/src/libraries/Common/src/System/Security/Cryptography/SlhDsaImplementation.cs b/src/libraries/Common/src/System/Security/Cryptography/SlhDsaImplementation.cs index 80b5c95ce9f1c8..b5405fc7e05f58 100644 --- a/src/libraries/Common/src/System/Security/Cryptography/SlhDsaImplementation.cs +++ b/src/libraries/Common/src/System/Security/Cryptography/SlhDsaImplementation.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System.Diagnostics; @@ -20,7 +20,7 @@ internal sealed partial class SlhDsaImplementation : SlhDsa /// Duplicates an SLH-DSA private key by export/import. /// Only intended to be used when the key type is unknown. /// - internal static SlhDsaImplementation DuplicatePrivateKey(SlhDsa key) + internal static unsafe SlhDsaImplementation DuplicatePrivateKey(SlhDsa key) { Debug.Assert(key is not SlhDsaImplementation); Debug.Assert(key.Algorithm.PrivateKeySizeInBytes <= 128); diff --git a/src/libraries/Common/src/System/Security/Cryptography/X509Certificates/X509CertificateLoader.Pkcs12.cs b/src/libraries/Common/src/System/Security/Cryptography/X509Certificates/X509CertificateLoader.Pkcs12.cs index edc52dc82367ca..a4aebb41952028 100644 --- a/src/libraries/Common/src/System/Security/Cryptography/X509Certificates/X509CertificateLoader.Pkcs12.cs +++ b/src/libraries/Common/src/System/Security/Cryptography/X509Certificates/X509CertificateLoader.Pkcs12.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System.Buffers; @@ -1192,11 +1192,7 @@ internal void UnshroudKeys(ref ReadOnlySpan password) } } - internal -#if !NET - unsafe -#endif - ArraySegment ToPfx(ReadOnlySpan password) + internal unsafe ArraySegment ToPfx(ReadOnlySpan password) { Debug.Assert(_certBags is not null); Debug.Assert(_keyBags is not null); diff --git a/src/libraries/Common/src/System/Security/Cryptography/X509Certificates/X509CertificateLoader.cs b/src/libraries/Common/src/System/Security/Cryptography/X509Certificates/X509CertificateLoader.cs index 4f801a56862bb6..58a4a96f36be3d 100644 --- a/src/libraries/Common/src/System/Security/Cryptography/X509Certificates/X509CertificateLoader.cs +++ b/src/libraries/Common/src/System/Security/Cryptography/X509Certificates/X509CertificateLoader.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System.Buffers; @@ -580,7 +580,7 @@ private static T LoadFromFile( } } - private static (byte[]?, int, MemoryManager?) ReadAllBytesIfBerSequence(string path) + private static unsafe (byte[]?, int, MemoryManager?) ReadAllBytesIfBerSequence(string path) { // The expected header in a PFX is 30 82 XX XX, but since it's BER-encoded // it could be up to 30 FE 00 00 00 .. XX YY ZZ AA and still be within the diff --git a/src/libraries/Common/src/System/Sha1ForNonSecretPurposes.cs b/src/libraries/Common/src/System/Sha1ForNonSecretPurposes.cs index fa42ba627247e4..eda3f3552ae0e5 100644 --- a/src/libraries/Common/src/System/Sha1ForNonSecretPurposes.cs +++ b/src/libraries/Common/src/System/Sha1ForNonSecretPurposes.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System.Buffers.Binary; @@ -24,7 +24,7 @@ internal struct Sha1ForNonSecretPurposes /// /// The data to hash. /// The buffer to receive the hash value. - public static void HashData(ReadOnlySpan source, Span destination) + public static unsafe void HashData(ReadOnlySpan source, Span destination) { Debug.Assert(destination.Length == 20); diff --git a/src/libraries/Microsoft.Extensions.Diagnostics/src/Microsoft.Extensions.Diagnostics.csproj b/src/libraries/Microsoft.Extensions.Diagnostics/src/Microsoft.Extensions.Diagnostics.csproj index d56673fdeda709..7d2267b7d4fe34 100644 --- a/src/libraries/Microsoft.Extensions.Diagnostics/src/Microsoft.Extensions.Diagnostics.csproj +++ b/src/libraries/Microsoft.Extensions.Diagnostics/src/Microsoft.Extensions.Diagnostics.csproj @@ -2,6 +2,7 @@ $(NetCoreAppCurrent);$(NetCoreAppPrevious);$(NetCoreAppMinimum);netstandard2.0;$(NetFrameworkMinimum) + true true true This package includes the default implementation of IMeterFactory and additional extension methods to easily register it with the Dependency Injection framework. diff --git a/src/libraries/Microsoft.Extensions.Hosting.Abstractions/tests/Microsoft.Extensions.Hosting.Abstractions.Tests.csproj b/src/libraries/Microsoft.Extensions.Hosting.Abstractions/tests/Microsoft.Extensions.Hosting.Abstractions.Tests.csproj index 6e3037bad5e40a..86468f5456b163 100644 --- a/src/libraries/Microsoft.Extensions.Hosting.Abstractions/tests/Microsoft.Extensions.Hosting.Abstractions.Tests.csproj +++ b/src/libraries/Microsoft.Extensions.Hosting.Abstractions/tests/Microsoft.Extensions.Hosting.Abstractions.Tests.csproj @@ -3,6 +3,8 @@ $(NetCoreAppCurrent);$(NetFrameworkCurrent) true + + $(NoWarn);NU1511 diff --git a/src/libraries/Microsoft.Extensions.Hosting/tests/TrimmingTests/Microsoft.Extensions.Hosting.TrimmingTests.proj b/src/libraries/Microsoft.Extensions.Hosting/tests/TrimmingTests/Microsoft.Extensions.Hosting.TrimmingTests.proj index 61e8e1a7596653..3f609b484f1a01 100644 --- a/src/libraries/Microsoft.Extensions.Hosting/tests/TrimmingTests/Microsoft.Extensions.Hosting.TrimmingTests.proj +++ b/src/libraries/Microsoft.Extensions.Hosting/tests/TrimmingTests/Microsoft.Extensions.Hosting.TrimmingTests.proj @@ -2,7 +2,7 @@ - Microsoft.Extensions.Hosting.Abstractions;Microsoft.Extensions.DependencyInjection + Microsoft.Extensions.DependencyInjection diff --git a/src/libraries/Microsoft.Extensions.Logging.EventSource/tests/EventSourceLoggerTest.cs b/src/libraries/Microsoft.Extensions.Logging.EventSource/tests/EventSourceLoggerTest.cs index e80953f33b84ee..0991b45ea6b2bf 100644 --- a/src/libraries/Microsoft.Extensions.Logging.EventSource/tests/EventSourceLoggerTest.cs +++ b/src/libraries/Microsoft.Extensions.Logging.EventSource/tests/EventSourceLoggerTest.cs @@ -925,7 +925,9 @@ protected override void OnEventWritten(EventWrittenEventArgs eventWrittenArgs) } else { +#pragma warning disable IL2026 // https://github.com/dotnet/runtime/issues/126862 string serializedComplexValue = JsonConvert.SerializeObject(eventWrittenArgs.Payload[i]); +#pragma warning restore IL2026 writer.WriteRawValue(serializedComplexValue); } } diff --git a/src/libraries/Microsoft.Extensions.Options/tests/TrimmingTests/Microsoft.Extensions.Options.TrimmingTests.proj b/src/libraries/Microsoft.Extensions.Options/tests/TrimmingTests/Microsoft.Extensions.Options.TrimmingTests.proj index 15b6dc0a6ea0e2..db94e9ac4d54bd 100644 --- a/src/libraries/Microsoft.Extensions.Options/tests/TrimmingTests/Microsoft.Extensions.Options.TrimmingTests.proj +++ b/src/libraries/Microsoft.Extensions.Options/tests/TrimmingTests/Microsoft.Extensions.Options.TrimmingTests.proj @@ -3,7 +3,6 @@ - Microsoft.Extensions.Options; Microsoft.Extensions.DependencyInjection diff --git a/src/libraries/Microsoft.Win32.Registry/src/Microsoft/Win32/RegistryKey.cs b/src/libraries/Microsoft.Win32.Registry/src/Microsoft/Win32/RegistryKey.cs index 5da1144cd2e94a..6f77b489ebe2cb 100644 --- a/src/libraries/Microsoft.Win32.Registry/src/Microsoft/Win32/RegistryKey.cs +++ b/src/libraries/Microsoft.Win32.Registry/src/Microsoft/Win32/RegistryKey.cs @@ -755,7 +755,7 @@ public static RegistryKey FromHandle(SafeRegistryHandle handle, RegistryView vie /// Retrieves an array of strings containing all the subkey names. /// All subkey names. - public string[] GetSubKeyNames() + public unsafe string[] GetSubKeyNames() { int subkeys = SubKeyCount; diff --git a/src/libraries/System.Collections/src/System/Collections/Generic/SortedSet.cs b/src/libraries/System.Collections/src/System/Collections/Generic/SortedSet.cs index 8af41f5b5b5079..33f34d7552a6e3 100644 --- a/src/libraries/System.Collections/src/System/Collections/Generic/SortedSet.cs +++ b/src/libraries/System.Collections/src/System/Collections/Generic/SortedSet.cs @@ -1363,7 +1363,7 @@ public bool Overlaps(IEnumerable other) /// An earlier implementation used delegates to perform these checks rather than returning /// an ElementCount struct; however this was changed due to the perf overhead of delegates. /// - private ElementCount CheckUniqueAndUnfoundElements(IEnumerable other, bool returnIfUnfound) + private unsafe ElementCount CheckUniqueAndUnfoundElements(IEnumerable other, bool returnIfUnfound) { ElementCount result; diff --git a/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/MaskedTextProvider.cs b/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/MaskedTextProvider.cs index 3bf597d297aa65..6d371bf88819ac 100644 --- a/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/MaskedTextProvider.cs +++ b/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/MaskedTextProvider.cs @@ -88,7 +88,7 @@ public CharDescriptor(int maskPos, CharType charType) CharType = charType; } - public override string ToString() => + public override unsafe string ToString() => string.Create( CultureInfo.InvariantCulture, stackalloc char[256], diff --git a/src/libraries/System.ComponentModel.TypeConverter/src/System/Drawing/PointConverter.cs b/src/libraries/System.ComponentModel.TypeConverter/src/System/Drawing/PointConverter.cs index 2eb67b204463eb..bf69e52414a17e 100644 --- a/src/libraries/System.ComponentModel.TypeConverter/src/System/Drawing/PointConverter.cs +++ b/src/libraries/System.ComponentModel.TypeConverter/src/System/Drawing/PointConverter.cs @@ -22,7 +22,7 @@ public override bool CanConvertTo(ITypeDescriptorContext? context, [NotNullWhen( return destinationType == typeof(InstanceDescriptor) || base.CanConvertTo(context, destinationType); } - public override object? ConvertFrom(ITypeDescriptorContext? context, CultureInfo? culture, object value) + public override unsafe object? ConvertFrom(ITypeDescriptorContext? context, CultureInfo? culture, object value) { if (value is string strValue) { diff --git a/src/libraries/System.ComponentModel.TypeConverter/src/System/Drawing/RectangleConverter.cs b/src/libraries/System.ComponentModel.TypeConverter/src/System/Drawing/RectangleConverter.cs index a4f1b489e43ec7..4a27a012b1d309 100644 --- a/src/libraries/System.ComponentModel.TypeConverter/src/System/Drawing/RectangleConverter.cs +++ b/src/libraries/System.ComponentModel.TypeConverter/src/System/Drawing/RectangleConverter.cs @@ -22,7 +22,7 @@ public override bool CanConvertTo(ITypeDescriptorContext? context, [NotNullWhen( return destinationType == typeof(InstanceDescriptor) || base.CanConvertTo(context, destinationType); } - public override object? ConvertFrom(ITypeDescriptorContext? context, CultureInfo? culture, object value) + public override unsafe object? ConvertFrom(ITypeDescriptorContext? context, CultureInfo? culture, object value) { if (value is string strValue) { diff --git a/src/libraries/System.ComponentModel.TypeConverter/src/System/Drawing/SizeConverter.cs b/src/libraries/System.ComponentModel.TypeConverter/src/System/Drawing/SizeConverter.cs index 24b8cec971c98e..74d189c26bf902 100644 --- a/src/libraries/System.ComponentModel.TypeConverter/src/System/Drawing/SizeConverter.cs +++ b/src/libraries/System.ComponentModel.TypeConverter/src/System/Drawing/SizeConverter.cs @@ -22,7 +22,7 @@ public override bool CanConvertTo(ITypeDescriptorContext? context, [NotNullWhen( return destinationType == typeof(InstanceDescriptor) || base.CanConvertTo(context, destinationType); } - public override object? ConvertFrom(ITypeDescriptorContext? context, CultureInfo? culture, object value) + public override unsafe object? ConvertFrom(ITypeDescriptorContext? context, CultureInfo? culture, object value) { if (value is string strValue) { diff --git a/src/libraries/System.ComponentModel.TypeConverter/src/System/Drawing/SizeFConverter.cs b/src/libraries/System.ComponentModel.TypeConverter/src/System/Drawing/SizeFConverter.cs index 27e9935194bf95..c53054b30fe73c 100644 --- a/src/libraries/System.ComponentModel.TypeConverter/src/System/Drawing/SizeFConverter.cs +++ b/src/libraries/System.ComponentModel.TypeConverter/src/System/Drawing/SizeFConverter.cs @@ -22,7 +22,7 @@ public override bool CanConvertTo(ITypeDescriptorContext? context, [NotNullWhen( return destinationType == typeof(InstanceDescriptor) || base.CanConvertTo(context, destinationType); } - public override object? ConvertFrom(ITypeDescriptorContext? context, CultureInfo? culture, object value) + public override unsafe object? ConvertFrom(ITypeDescriptorContext? context, CultureInfo? culture, object value) { if (value is string strValue) { diff --git a/src/libraries/System.Console/src/System/ConsolePal.Unix.cs b/src/libraries/System.Console/src/System/ConsolePal.Unix.cs index 5ddf6b1e737353..a0f7d10e728577 100644 --- a/src/libraries/System.Console/src/System/ConsolePal.Unix.cs +++ b/src/libraries/System.Console/src/System/ConsolePal.Unix.cs @@ -436,7 +436,7 @@ public static (int Left, int Top) GetCursorPosition() /// Cursor column. /// Cursor row. /// Indicates whether this method is called as part of a on-going Read operation. - internal static bool TryGetCursorPosition(out int left, out int top, bool reinitializeForRead = false) + internal static unsafe bool TryGetCursorPosition(out int left, out int top, bool reinitializeForRead = false) { Debug.Assert(!Console.IsInputRedirected); @@ -1122,7 +1122,7 @@ internal static void WriteTerminalAnsiColorString(string? value) /// The string to write. /// Handle to use instead of s_terminalHandle. /// Writing this value may change the cursor position. - internal static void WriteTerminalAnsiString(string? value, SafeFileHandle? handle = null, bool mayChangeCursorPosition = true) + internal static unsafe void WriteTerminalAnsiString(string? value, SafeFileHandle? handle = null, bool mayChangeCursorPosition = true) { if (string.IsNullOrEmpty(value)) return; diff --git a/src/libraries/System.Console/src/System/ConsolePal.Windows.cs b/src/libraries/System.Console/src/System/ConsolePal.Windows.cs index 64b1acc8e83966..c1e813cd1f697d 100644 --- a/src/libraries/System.Console/src/System/ConsolePal.Windows.cs +++ b/src/libraries/System.Console/src/System/ConsolePal.Windows.cs @@ -621,7 +621,7 @@ public static bool CursorVisible } } - public static (int Left, int Top) GetCursorPosition() + public static unsafe (int Left, int Top) GetCursorPosition() { Interop.Kernel32.CONSOLE_SCREEN_BUFFER_INFO csbi = GetBufferInfo(); return (csbi.dwCursorPosition.X, csbi.dwCursorPosition.Y); @@ -683,7 +683,7 @@ public static unsafe string Title } } - public static void Beep() + public static unsafe void Beep() { if (!Console.IsOutputRedirected) { diff --git a/src/libraries/System.Console/src/System/IO/CachedConsoleStream.cs b/src/libraries/System.Console/src/System/IO/CachedConsoleStream.cs index d59bd2057c2c32..642a7c744e9c93 100644 --- a/src/libraries/System.Console/src/System/IO/CachedConsoleStream.cs +++ b/src/libraries/System.Console/src/System/IO/CachedConsoleStream.cs @@ -22,7 +22,7 @@ public CachedConsoleStream(Encoding encoding) : base(FileAccess.Write) public override int Read(Span buffer) => throw Error.GetReadNotSupported(); - public override void Write(ReadOnlySpan buffer) + public override unsafe void Write(ReadOnlySpan buffer) { int maxCharCount = _encoding.GetMaxCharCount(buffer.Length); char[]? pooledBuffer = null; diff --git a/src/libraries/System.Console/src/System/IO/StdInReader.cs b/src/libraries/System.Console/src/System/IO/StdInReader.cs index 97b3d35cd06732..b2aabb5fc74a6d 100644 --- a/src/libraries/System.Console/src/System/IO/StdInReader.cs +++ b/src/libraries/System.Console/src/System/IO/StdInReader.cs @@ -51,7 +51,7 @@ internal bool IsUnprocessedBufferEmpty() return _startIndex >= _endIndex; // Everything has been processed; } - internal void AppendExtraBuffer(ReadOnlySpan buffer) + internal unsafe void AppendExtraBuffer(ReadOnlySpan buffer) { // Most inputs to this will have a buffer length of one. // The cases where it is larger than one only occur in ReadKey @@ -376,7 +376,7 @@ private unsafe ConsoleKeyInfo ReadKey() /// Gets whether there's input waiting on stdin. internal static bool StdinReady => Interop.Sys.StdinReady(); - private void EchoToTerminal(char c) + private unsafe void EchoToTerminal(char c) { Span bytes = stackalloc byte[32]; // 32 bytes seems ample int bytesWritten = 1; diff --git a/src/libraries/System.Console/src/System/TermInfo.DatabaseFactory.cs b/src/libraries/System.Console/src/System/TermInfo.DatabaseFactory.cs index 7ae7cc51e76de3..8ece8748073d93 100644 --- a/src/libraries/System.Console/src/System/TermInfo.DatabaseFactory.cs +++ b/src/libraries/System.Console/src/System/TermInfo.DatabaseFactory.cs @@ -100,7 +100,7 @@ private static bool TryOpen(string filePath, [NotNullWhen(true)] out SafeFileHan /// The identifier for the terminal. /// The path to the directory containing terminfo database files. /// The database, or null if it could not be found. - internal static Database? ReadDatabase(string? term, string? directoryPath) + internal static unsafe Database? ReadDatabase(string? term, string? directoryPath) { if (string.IsNullOrEmpty(term) || string.IsNullOrEmpty(directoryPath)) { diff --git a/src/libraries/System.Console/src/System/TermInfo.cs b/src/libraries/System.Console/src/System/TermInfo.cs index 32e4aa1cbfcab5..3dfbc92672ca60 100644 --- a/src/libraries/System.Console/src/System/TermInfo.cs +++ b/src/libraries/System.Console/src/System/TermInfo.cs @@ -97,7 +97,7 @@ public static string Evaluate(string format, params FormatParam[] args) /// The evaluation stack will have a 1 at the top if all processing was completed at invoked level /// of recursion, and a 0 at the top if we're still inside of a conditional that requires more processing. /// - private static string EvaluateInternal( + private static unsafe string EvaluateInternal( string format, ref int pos, FormatParam[] args, Stack stack, ref FormatParam[]? dynamicVars, ref FormatParam[]? staticVars) { diff --git a/src/libraries/System.Data.Common/src/System/Data/SQLTypes/SQLDecimal.cs b/src/libraries/System.Data.Common/src/System/Data/SQLTypes/SQLDecimal.cs index b985e7ce88a186..66d5b5d4b19e0e 100644 --- a/src/libraries/System.Data.Common/src/System/Data/SQLTypes/SQLDecimal.cs +++ b/src/libraries/System.Data.Common/src/System/Data/SQLTypes/SQLDecimal.cs @@ -477,7 +477,7 @@ private SqlDecimal(bool _) _data4 = s_uiZero; } - public SqlDecimal(decimal value) + public unsafe SqlDecimal(decimal value) { // set the null bit _bStatus = s_bNotNull; @@ -920,7 +920,7 @@ public byte[] BinData } } - public override string ToString() + public override unsafe string ToString() { if (IsNull) return SQLResource.NullString; @@ -1418,7 +1418,7 @@ public static explicit operator decimal(SqlDecimal x) // add to the next multiplicand UI4. Until the end of the multiplier data // array is reached. // - public static SqlDecimal operator *(SqlDecimal x, SqlDecimal y) + public static unsafe SqlDecimal operator *(SqlDecimal x, SqlDecimal y) { x.AssertValid(); y.AssertValid(); @@ -1657,7 +1657,7 @@ public static explicit operator decimal(SqlDecimal x) // Call general purpose arbitrary precision division routine with scale = 0. // Scale,prec adjusted later. // - public static SqlDecimal operator /(SqlDecimal x, SqlDecimal y) + public static unsafe SqlDecimal operator /(SqlDecimal x, SqlDecimal y) { if (x.IsNull || y.IsNull) return Null; diff --git a/src/libraries/System.Data.Common/src/System/Data/SQLTypes/SQLGuid.cs b/src/libraries/System.Data.Common/src/System/Data/SQLTypes/SQLGuid.cs index 712300038479c8..08e5c72973fa43 100644 --- a/src/libraries/System.Data.Common/src/System/Data/SQLTypes/SQLGuid.cs +++ b/src/libraries/System.Data.Common/src/System/Data/SQLTypes/SQLGuid.cs @@ -110,7 +110,7 @@ public static SqlGuid Parse(string s) } // Comparison operators - private static EComparison Compare(SqlGuid x, SqlGuid y) + private static unsafe EComparison Compare(SqlGuid x, SqlGuid y) { // Comparison orders. ReadOnlySpan rgiGuidOrder = [10, 11, 12, 13, 14, 15, 8, 9, 6, 7, 4, 5, 0, 1, 2, 3]; diff --git a/src/libraries/System.Data.Common/src/System/Data/XDRSchema.cs b/src/libraries/System.Data.Common/src/System/Data/XDRSchema.cs index 3b8dc4033611ca..f4f2c3549eaece 100644 --- a/src/libraries/System.Data.Common/src/System/Data/XDRSchema.cs +++ b/src/libraries/System.Data.Common/src/System/Data/XDRSchema.cs @@ -294,7 +294,7 @@ private static NameType FindNameType(string name) private static readonly NameType s_enumerationNameType = FindNameType("enumeration"); [return: DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicProperties)] - private static Type ParseDataType(string dt, string dtValues) + private static unsafe Type ParseDataType(string dt, string dtValues) { string strType = dt; diff --git a/src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/Activity.GenerateRootId.netcoreapp.cs b/src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/Activity.GenerateRootId.netcoreapp.cs index 80d282e1988359..9cdfd8be578eed 100644 --- a/src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/Activity.GenerateRootId.netcoreapp.cs +++ b/src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/Activity.GenerateRootId.netcoreapp.cs @@ -8,7 +8,7 @@ namespace System.Diagnostics { partial class Activity { - private static string GenerateRootId() + private static unsafe string GenerateRootId() { // It is important that the part that changes frequently be first, because // some sampling functions don't sample from the high entropy part of their hash function. diff --git a/src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/Activity.cs b/src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/Activity.cs index 850670ce83bb05..2978ccfa4e7e1e 100644 --- a/src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/Activity.cs +++ b/src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/Activity.cs @@ -234,7 +234,7 @@ public string DisplayName /// - '|a000b421-5d183ab6.1.8e2d4c28_' - Id of the grand child activity. It was started in another process and ends with '_' /// 'a000b421-5d183ab6' is a for the first Activity and all its children /// - public string? Id + public unsafe string? Id { get { @@ -266,7 +266,7 @@ public string? Id /// /// See for more details /// - public string? ParentId + public unsafe string? ParentId { get { @@ -1952,7 +1952,7 @@ public enum ActivityIdFormat /// /// Create a new TraceId with at random number in it (very likely to be unique) /// - public static ActivityTraceId CreateRandom() + public static unsafe ActivityTraceId CreateRandom() { Span span = stackalloc byte[sizeof(ulong) * 2]; SetToRandomBytes(span); @@ -2019,7 +2019,7 @@ public override int GetHashCode() /// This is exposed as CreateFromUtf8String, but we are modifying fields, so the code needs to be in a constructor. /// /// - private ActivityTraceId(ReadOnlySpan idData) + private unsafe ActivityTraceId(ReadOnlySpan idData) { if (idData.Length != 32) throw new ArgumentOutOfRangeException(nameof(idData)); diff --git a/src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/DsesSamplerBuilder.cs b/src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/DsesSamplerBuilder.cs index e10016a02c1026..3f224062ba3056 100644 --- a/src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/DsesSamplerBuilder.cs +++ b/src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/DsesSamplerBuilder.cs @@ -36,7 +36,7 @@ public static DsesSampleActivityFunc CreateParentRatioSampler(double ratio) }; } - public static ActivitySamplingResult ParentRatioSampler(long idUpperBound, in ActivityContext parentContext, ActivityTraceId traceId) + public static unsafe ActivitySamplingResult ParentRatioSampler(long idUpperBound, in ActivityContext parentContext, ActivityTraceId traceId) { if (parentContext.TraceId != default) { diff --git a/src/libraries/System.Diagnostics.DiagnosticSource/tests/System.Diagnostics.DiagnosticSource.Tests.csproj b/src/libraries/System.Diagnostics.DiagnosticSource/tests/System.Diagnostics.DiagnosticSource.Tests.csproj index a7b648278a2a18..6aaa4ad2e062aa 100644 --- a/src/libraries/System.Diagnostics.DiagnosticSource/tests/System.Diagnostics.DiagnosticSource.Tests.csproj +++ b/src/libraries/System.Diagnostics.DiagnosticSource/tests/System.Diagnostics.DiagnosticSource.Tests.csproj @@ -2,6 +2,7 @@ $(NetCoreAppCurrent);$(NetCoreAppCurrent)-browser;$(NetFrameworkCurrent) + true true NU1511 true diff --git a/src/libraries/System.Diagnostics.FileVersionInfo/src/System/Diagnostics/FileVersionInfo.Unix.cs b/src/libraries/System.Diagnostics.FileVersionInfo/src/System/Diagnostics/FileVersionInfo.Unix.cs index 7e6078c0c8a04f..87733d2985d5dd 100644 --- a/src/libraries/System.Diagnostics.FileVersionInfo/src/System/Diagnostics/FileVersionInfo.Unix.cs +++ b/src/libraries/System.Diagnostics.FileVersionInfo/src/System/Diagnostics/FileVersionInfo.Unix.cs @@ -188,7 +188,7 @@ private void LoadManagedAssemblyMetadata(MetadataReader metadataReader, bool isE } /// Parses the version into its constituent parts. - private static void ParseVersion(string? versionString, out int major, out int minor, out int build, out int priv) + private static unsafe void ParseVersion(string? versionString, out int major, out int minor, out int build, out int priv) { // Relatively-forgiving parsing of a version: // - If there are more than four parts (separated by periods), all results are deemed 0 diff --git a/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/Process.Linux.cs b/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/Process.Linux.cs index 74715a03aaa9e6..4b22d5bbd8e088 100644 --- a/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/Process.Linux.cs +++ b/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/Process.Linux.cs @@ -231,7 +231,7 @@ private void SetWorkingSetLimitsCore(IntPtr? newMin, IntPtr? newMax, out IntPtr /// Gets the name that was used to start the process, or null if it could not be retrieved. /// The pid for the target process. /// The stat for the target process. - internal static string GetUntruncatedProcessName(Interop.procfs.ProcPid procPid, ref Interop.procfs.ParsedStat stat) + internal static unsafe string GetUntruncatedProcessName(Interop.procfs.ProcPid procPid, ref Interop.procfs.ParsedStat stat) { string cmdLineFilePath = Interop.procfs.GetCmdLinePathForProcess(procPid); diff --git a/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/Process.Multiplexing.Unix.cs b/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/Process.Multiplexing.Unix.cs index d48cc914a766b6..4b4354c45bf6ec 100644 --- a/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/Process.Multiplexing.Unix.cs +++ b/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/Process.Multiplexing.Unix.cs @@ -261,7 +261,7 @@ private static void HandlePipeLineRead( /// Reads from both standard output and standard error pipes using Unix poll-based multiplexing /// with non-blocking reads. /// - private static void ReadPipes( + private static unsafe void ReadPipes( SafePipeHandle outputHandle, SafePipeHandle errorHandle, int timeoutMs, diff --git a/src/libraries/System.Diagnostics.TextWriterTraceListener/src/System/Diagnostics/XmlWriterTraceListener.cs b/src/libraries/System.Diagnostics.TextWriterTraceListener/src/System/Diagnostics/XmlWriterTraceListener.cs index 068d68e36563db..87f4ac0d864e8e 100644 --- a/src/libraries/System.Diagnostics.TextWriterTraceListener/src/System/Diagnostics/XmlWriterTraceListener.cs +++ b/src/libraries/System.Diagnostics.TextWriterTraceListener/src/System/Diagnostics/XmlWriterTraceListener.cs @@ -387,7 +387,7 @@ private void InternalWrite(ReadOnlySpan message) _writer?.Write(message); } - private void InternalWrite(T message) where T : ISpanFormattable + private unsafe void InternalWrite(T message) where T : ISpanFormattable { Debug.Assert(typeof(T) == typeof(int) || typeof(T) == typeof(uint) || typeof(T) == typeof(long), "We only currently stackalloc enough space for these types."); @@ -401,7 +401,7 @@ private void InternalWrite(T message) where T : ISpanFormattable } } - private void InternalWrite(Guid message) + private unsafe void InternalWrite(Guid message) { EnsureWriter(); if (_writer is TextWriter writer) @@ -413,7 +413,7 @@ private void InternalWrite(Guid message) } } - private void InternalWrite(DateTime message) + private unsafe void InternalWrite(DateTime message) { EnsureWriter(); if (_writer is TextWriter writer) diff --git a/src/libraries/System.Diagnostics.TraceSource/src/System/Diagnostics/TraceListener.cs b/src/libraries/System.Diagnostics.TraceSource/src/System/Diagnostics/TraceListener.cs index a23cab3659aa3f..8615808c8aa1d1 100644 --- a/src/libraries/System.Diagnostics.TraceSource/src/System/Diagnostics/TraceListener.cs +++ b/src/libraries/System.Diagnostics.TraceSource/src/System/Diagnostics/TraceListener.cs @@ -383,7 +383,7 @@ private void WriteHeader(string source, TraceEventType eventType, int id) Write(string.Create(CultureInfo.InvariantCulture, stackalloc char[256], $"{source} {eventType}: {id} : ")); } - private void WriteFooter(TraceEventCache? eventCache) + private unsafe void WriteFooter(TraceEventCache? eventCache) { if (eventCache == null) return; diff --git a/src/libraries/System.Formats.Asn1/src/System/Formats/Asn1/AsnDecoder.GeneralizedTime.cs b/src/libraries/System.Formats.Asn1/src/System/Formats/Asn1/AsnDecoder.GeneralizedTime.cs index f5d8ed869dd55f..a2e6f0d7896e46 100644 --- a/src/libraries/System.Formats.Asn1/src/System/Formats/Asn1/AsnDecoder.GeneralizedTime.cs +++ b/src/libraries/System.Formats.Asn1/src/System/Formats/Asn1/AsnDecoder.GeneralizedTime.cs @@ -45,7 +45,7 @@ public static partial class AsnDecoder /// . is not correct for /// the method. /// - public static DateTimeOffset ReadGeneralizedTime( + public static unsafe DateTimeOffset ReadGeneralizedTime( ReadOnlySpan source, AsnEncodingRules ruleSet, out int bytesConsumed, diff --git a/src/libraries/System.Formats.Asn1/src/System/Formats/Asn1/AsnDecoder.NamedBitList.cs b/src/libraries/System.Formats.Asn1/src/System/Formats/Asn1/AsnDecoder.NamedBitList.cs index 613d589d05e6ee..43f67d2f080388 100644 --- a/src/libraries/System.Formats.Asn1/src/System/Formats/Asn1/AsnDecoder.NamedBitList.cs +++ b/src/libraries/System.Formats.Asn1/src/System/Formats/Asn1/AsnDecoder.NamedBitList.cs @@ -174,7 +174,7 @@ public static TFlagsEnum ReadNamedBitListValue( /// is /// /// - public static Enum ReadNamedBitListValue( + public static unsafe Enum ReadNamedBitListValue( ReadOnlySpan source, AsnEncodingRules ruleSet, Type flagsEnumType, diff --git a/src/libraries/System.Formats.Asn1/src/System/Formats/Asn1/AsnDecoder.Oid.cs b/src/libraries/System.Formats.Asn1/src/System/Formats/Asn1/AsnDecoder.Oid.cs index da03e2ccfab3dc..3708d9f6561583 100644 --- a/src/libraries/System.Formats.Asn1/src/System/Formats/Asn1/AsnDecoder.Oid.cs +++ b/src/libraries/System.Formats.Asn1/src/System/Formats/Asn1/AsnDecoder.Oid.cs @@ -76,7 +76,7 @@ public static string ReadObjectIdentifier( return ret; } - private static void ReadSubIdentifier( + private static unsafe void ReadSubIdentifier( ReadOnlySpan source, out int bytesRead, out long? smallValue, diff --git a/src/libraries/System.Formats.Asn1/src/System/Formats/Asn1/AsnDecoder.UtcTime.cs b/src/libraries/System.Formats.Asn1/src/System/Formats/Asn1/AsnDecoder.UtcTime.cs index dc8b67fefc1261..a2b8b582f8399a 100644 --- a/src/libraries/System.Formats.Asn1/src/System/Formats/Asn1/AsnDecoder.UtcTime.cs +++ b/src/libraries/System.Formats.Asn1/src/System/Formats/Asn1/AsnDecoder.UtcTime.cs @@ -53,7 +53,7 @@ public static partial class AsnDecoder /// the method. /// /// - public static DateTimeOffset ReadUtcTime( + public static unsafe DateTimeOffset ReadUtcTime( ReadOnlySpan source, AsnEncodingRules ruleSet, out int bytesConsumed, diff --git a/src/libraries/System.Formats.Asn1/src/System/Formats/Asn1/AsnWriter.GeneralizedTime.cs b/src/libraries/System.Formats.Asn1/src/System/Formats/Asn1/AsnWriter.GeneralizedTime.cs index 96d9d36571a002..195742965d3473 100644 --- a/src/libraries/System.Formats.Asn1/src/System/Formats/Asn1/AsnWriter.GeneralizedTime.cs +++ b/src/libraries/System.Formats.Asn1/src/System/Formats/Asn1/AsnWriter.GeneralizedTime.cs @@ -41,7 +41,7 @@ public void WriteGeneralizedTime( // T-REC-X.680-201508 sec 46 // T-REC-X.690-201508 sec 11.7 - private void WriteGeneralizedTimeCore( + private unsafe void WriteGeneralizedTimeCore( Asn1Tag tag, DateTimeOffset value, bool omitFractionalSeconds) diff --git a/src/libraries/System.Formats.Asn1/src/System/Formats/Asn1/AsnWriter.NamedBitList.cs b/src/libraries/System.Formats.Asn1/src/System/Formats/Asn1/AsnWriter.NamedBitList.cs index 9dbe389f5d1df5..3af7ac487a2626 100644 --- a/src/libraries/System.Formats.Asn1/src/System/Formats/Asn1/AsnWriter.NamedBitList.cs +++ b/src/libraries/System.Formats.Asn1/src/System/Formats/Asn1/AsnWriter.NamedBitList.cs @@ -144,7 +144,7 @@ private void WriteNamedBitList(Asn1Tag? tag, Type tEnum, Enum value) // T-REC-X.680-201508 sec 22 // T-REC-X.690-201508 sec 8.6, 11.2.2 - private void WriteNamedBitList(Asn1Tag? tag, ulong integralValue) + private unsafe void WriteNamedBitList(Asn1Tag? tag, ulong integralValue) { Span temp = stackalloc byte[sizeof(ulong)]; // Reset to all zeros, since we're just going to or-in bits we need. diff --git a/src/libraries/System.Formats.Tar/src/System/Formats/Tar/TarHeader.Read.cs b/src/libraries/System.Formats.Tar/src/System/Formats/Tar/TarHeader.Read.cs index 25d90ba867faff..22dc8a01235977 100644 --- a/src/libraries/System.Formats.Tar/src/System/Formats/Tar/TarHeader.Read.cs +++ b/src/libraries/System.Formats.Tar/src/System/Formats/Tar/TarHeader.Read.cs @@ -19,7 +19,7 @@ internal sealed partial class TarHeader // Attempts to retrieve the next header from the specified tar archive stream. // Throws if end of stream is reached or if any data type conversion fails. // Returns a valid TarHeader object if the attributes were read successfully, null otherwise. - internal static TarHeader? TryGetNextHeader(Stream archiveStream, bool copyData, TarEntryFormat initialFormat, bool processDataBlock) + internal static unsafe TarHeader? TryGetNextHeader(Stream archiveStream, bool copyData, TarEntryFormat initialFormat, bool processDataBlock) { // The four supported formats have a header that fits in the default record size Span buffer = stackalloc byte[TarHelpers.RecordSize]; diff --git a/src/libraries/System.Formats.Tar/src/System/Formats/Tar/TarHeader.Write.cs b/src/libraries/System.Formats.Tar/src/System/Formats/Tar/TarHeader.Write.cs index 06c9d8ea52a459..c3d166da29389f 100644 --- a/src/libraries/System.Formats.Tar/src/System/Formats/Tar/TarHeader.Write.cs +++ b/src/libraries/System.Formats.Tar/src/System/Formats/Tar/TarHeader.Write.cs @@ -576,7 +576,7 @@ private int WriteName(Span buffer) // 'https://www.freebsd.org/cgi/man.cgi?tar(5)' // If the path name is too long to fit in the 100 bytes provided by the standard format, // it can be split at any / character with the first portion going into the prefix field. - private int WriteUstarName(Span buffer) + private unsafe int WriteUstarName(Span buffer) { // We can have a path name as big as 256, prefix + '/' + name, // the separator in between can be neglected as the reader will append it when it joins both fields. @@ -807,7 +807,7 @@ private void WriteData(Stream archiveStream, Stream dataStream) } // Calculates the padding for the current entry and writes it after the data. - private void WriteEmptyPadding(Stream archiveStream) + private unsafe void WriteEmptyPadding(Stream archiveStream) { int paddingAfterData = TarHelpers.CalculatePadding(_size); if (paddingAfterData != 0) @@ -861,7 +861,7 @@ private async Task WriteDataAsync(Stream archiveStream, Stream dataStream, Cance // Generates a data stream (seekable) containing the extended attribute metadata of the entry it precedes. // Returns a null stream if the extended attributes dictionary is empty. - private static MemoryStream? GenerateExtendedAttributesDataStream(Dictionary extendedAttributes) + private static unsafe MemoryStream? GenerateExtendedAttributesDataStream(Dictionary extendedAttributes) { MemoryStream? dataStream = null; @@ -955,7 +955,7 @@ private void CollectExtendedAttributesFromStandardFieldsIfNeeded(Dictionary buffer) + private static unsafe int WriteChecksum(int checksum, Span buffer) { // The checksum field is also counted towards the total sum // but as an array filled with spaces @@ -1117,7 +1117,7 @@ private int FormatNumeric(long value, Span destination) } // Writes the specified decimal number as a right-aligned octal number and returns its checksum. - private static int FormatOctal(long value, Span destination) + private static unsafe int FormatOctal(long value, Span destination) { ulong remaining = (ulong)value; Span digits = stackalloc byte[32]; // longer than any possible octal formatting of a ulong diff --git a/src/libraries/System.Formats.Tar/src/System/Formats/Tar/TarWriter.cs b/src/libraries/System.Formats.Tar/src/System/Formats/Tar/TarWriter.cs index 209bbc0c1e7bdb..31a860cd993a26 100644 --- a/src/libraries/System.Formats.Tar/src/System/Formats/Tar/TarWriter.cs +++ b/src/libraries/System.Formats.Tar/src/System/Formats/Tar/TarWriter.cs @@ -314,7 +314,7 @@ public Task WriteEntryAsync(TarEntry entry, CancellationToken cancellationToken } // Portion of the WriteEntry(entry) method that rents a buffer and writes to the archive. - private void WriteEntryInternal(TarEntry entry) + private unsafe void WriteEntryInternal(TarEntry entry) { Span buffer = stackalloc byte[TarHelpers.RecordSize]; buffer.Clear(); @@ -379,7 +379,7 @@ private async Task WriteEntryAsyncInternal(TarEntry entry, CancellationToken can // The spec indicates that the end of the archive is indicated // by two records consisting entirely of zero bytes. - private void WriteFinalRecords() + private unsafe void WriteFinalRecords() { Span emptyRecord = stackalloc byte[TarHelpers.RecordSize]; emptyRecord.Clear(); diff --git a/src/libraries/System.IO.Compression/src/System/IO/Compression/DeflateManaged/HuffmanTree.cs b/src/libraries/System.IO.Compression/src/System/IO/Compression/DeflateManaged/HuffmanTree.cs index a4f1f621df37ee..10b903b6918c4b 100644 --- a/src/libraries/System.IO.Compression/src/System/IO/Compression/DeflateManaged/HuffmanTree.cs +++ b/src/libraries/System.IO.Compression/src/System/IO/Compression/DeflateManaged/HuffmanTree.cs @@ -112,7 +112,7 @@ private static uint BitReverse(uint code, int length) // Calculate the huffman code for each character based on the code length for each character. // This algorithm is described in standard RFC 1951 - private uint[] CalculateHuffmanCode() + private unsafe uint[] CalculateHuffmanCode() { Span bitLengthCount = stackalloc uint[17]; bitLengthCount.Clear(); diff --git a/src/libraries/System.IO.Compression/src/System/IO/Compression/ZipArchiveEntry.cs b/src/libraries/System.IO.Compression/src/System/IO/Compression/ZipArchiveEntry.cs index 9140a200898d95..e84666144c9379 100644 --- a/src/libraries/System.IO.Compression/src/System/IO/Compression/ZipArchiveEntry.cs +++ b/src/libraries/System.IO.Compression/src/System/IO/Compression/ZipArchiveEntry.cs @@ -667,7 +667,7 @@ private void WriteCentralDirectoryFileHeaderPrepare(Span cdStaticHeader, u } // should only throw an exception in extremely exceptional cases because it is called from dispose - internal void WriteCentralDirectoryFileHeader(bool forceWrite) + internal unsafe void WriteCentralDirectoryFileHeader(bool forceWrite) { if (WriteCentralDirectoryFileHeaderInitialize(forceWrite, out Zip64ExtraField? zip64ExtraField, out uint compressedSizeTruncated, out uint uncompressedSizeTruncated, out ushort extraFieldLength, out uint offsetOfLocalHeaderTruncated)) { @@ -1062,7 +1062,7 @@ private static BitFlagValues MapDeflateCompressionOption(BitFlagValues generalPu private bool ShouldUseZIP64 => AreSizesTooLarge || IsOffsetTooLarge; - private bool WriteLocalFileHeaderInitialize(bool isEmptyFile, bool forceWrite, bool preserveDataDescriptor, out Zip64ExtraField? zip64ExtraField, out uint compressedSizeTruncated, out uint uncompressedSizeTruncated, out ushort extraFieldLength, out uint crc32ToWrite) + private unsafe bool WriteLocalFileHeaderInitialize(bool isEmptyFile, bool forceWrite, bool preserveDataDescriptor, out Zip64ExtraField? zip64ExtraField, out uint compressedSizeTruncated, out uint uncompressedSizeTruncated, out ushort extraFieldLength, out uint crc32ToWrite) { // _entryname only gets set when we read in or call moveTo. MoveTo does a check, and // reading in should not be able to produce an entryname longer than ushort.MaxValue @@ -1200,7 +1200,7 @@ private void WriteLocalFileHeaderPrepare(Span lfStaticHeader, uint crc32, } // return value is true if we allocated an extra field for 64 bit headers, un/compressed size - private bool WriteLocalFileHeader(bool isEmptyFile, bool forceWrite, bool preserveDataDescriptor = false) + private unsafe bool WriteLocalFileHeader(bool isEmptyFile, bool forceWrite, bool preserveDataDescriptor = false) { if (WriteLocalFileHeaderInitialize(isEmptyFile, forceWrite, preserveDataDescriptor, out Zip64ExtraField? zip64ExtraField, out uint compressedSizeTruncated, out uint uncompressedSizeTruncated, out ushort extraFieldLength, out uint crc32ToWrite)) { @@ -1304,7 +1304,7 @@ private void WriteLocalFileHeaderAndDataIfNeeded(bool forceWrite) // Using _offsetOfLocalHeader, seeks back to where CRC and sizes should be in the header, // writes them, then seeks back to where you started // Assumes that the stream is currently at the end of the data - private void WriteCrcAndSizesInLocalHeader(bool zip64HeaderUsed) + private unsafe void WriteCrcAndSizesInLocalHeader(bool zip64HeaderUsed) { // Buffer has been sized to the largest data payload required: the 64-bit data descriptor. Span writeBuffer = stackalloc byte[Zip64DataDescriptorCrcAndSizesBufferLength]; @@ -1428,7 +1428,7 @@ private void WriteCrcAndSizesInLocalHeaderPrepareForWritingDataDescriptor(Span dataDescriptor = stackalloc byte[MaxSizeOfDataDescriptor]; int bytesToWrite = PrepareToWriteDataDescriptor(dataDescriptor); diff --git a/src/libraries/System.IO.Compression/src/System/IO/Compression/ZipBlocks.cs b/src/libraries/System.IO.Compression/src/System/IO/Compression/ZipBlocks.cs index 5e70cf29fc5eaa..ee5bd67e21f65c 100644 --- a/src/libraries/System.IO.Compression/src/System/IO/Compression/ZipBlocks.cs +++ b/src/libraries/System.IO.Compression/src/System/IO/Compression/ZipBlocks.cs @@ -27,7 +27,7 @@ internal sealed partial class ZipGenericExtraField public ushort Size => _size; public byte[] Data => _data ??= []; - public void WriteBlock(Stream stream) + public unsafe void WriteBlock(Stream stream) { Span extraFieldHeader = stackalloc byte[SizeOfHeader]; WriteBlockCore(extraFieldHeader); @@ -395,7 +395,7 @@ public void WriteBlockCore(Span extraFieldData) } } - public void WriteBlock(Stream stream) + public unsafe void WriteBlock(Stream stream) { Span extraFieldData = stackalloc byte[TotalSize]; WriteBlockCore(extraFieldData); @@ -434,7 +434,7 @@ private static bool TryReadBlockCore(Span blockContents, int bytesRead, [N return true; } - public static Zip64EndOfCentralDirectoryLocator TryReadBlock(Stream stream) + public static unsafe Zip64EndOfCentralDirectoryLocator TryReadBlock(Stream stream) { Span blockContents = stackalloc byte[TotalSize]; int bytesRead = stream.ReadAtLeast(blockContents, blockContents.Length, throwOnEndOfStream: false); @@ -456,7 +456,7 @@ private static void WriteBlockCore(Span blockContents, long zip64EOCDRecor } - public static void WriteBlock(Stream stream, long zip64EOCDRecordStart) + public static unsafe void WriteBlock(Stream stream, long zip64EOCDRecordStart) { Span blockContents = stackalloc byte[TotalSize]; WriteBlockCore(blockContents, zip64EOCDRecordStart); @@ -513,7 +513,7 @@ private static bool TryReadBlockCore(Span blockContents, int bytesRead, [N return true; } - public static Zip64EndOfCentralDirectoryRecord TryReadBlock(Stream stream) + public static unsafe Zip64EndOfCentralDirectoryRecord TryReadBlock(Stream stream) { Span blockContents = stackalloc byte[BlockConstantSectionSize]; int bytesRead = stream.ReadAtLeast(blockContents, blockContents.Length, throwOnEndOfStream: false); @@ -545,7 +545,7 @@ private static void WriteBlockCore(Span blockContents, long numberOfEntrie BinaryPrimitives.WriteInt64LittleEndian(blockContents[FieldLocations.OffsetOfCentralDirectory..], startOfCentralDirectory); } - public static void WriteBlock(Stream stream, long numberOfEntries, long startOfCentralDirectory, long sizeOfCentralDirectory) + public static unsafe void WriteBlock(Stream stream, long numberOfEntries, long startOfCentralDirectory, long sizeOfCentralDirectory) { Span blockContents = stackalloc byte[BlockConstantSectionSize]; WriteBlockCore(blockContents, numberOfEntries, startOfCentralDirectory, sizeOfCentralDirectory); @@ -583,7 +583,7 @@ private static List GetExtraFieldPostReadWork(Span e return list; } - public static List GetExtraFields(Stream stream, out byte[] trailingData) + public static unsafe List GetExtraFields(Stream stream, out byte[] trailingData) { // assumes that TrySkipBlock has already been called, so we don't have to validate twice @@ -658,7 +658,7 @@ private static bool TrySkipBlockFinalize(Stream stream, Span blockBytes, i } // will not throw end of stream exception - public static bool TrySkipBlock(Stream stream) + public static unsafe bool TrySkipBlock(Stream stream) { Span blockBytes = stackalloc byte[FieldLengths.Signature]; long currPosition = stream.Position; @@ -897,7 +897,7 @@ private static void WriteBlockInitialize(Span blockContents, long numberOf BinaryPrimitives.WriteUInt16LittleEndian(blockContents[FieldLocations.ArchiveCommentLength..], (ushort)archiveComment.Length); } - public static void WriteBlock(Stream stream, long numberOfEntries, long startOfCentralDirectory, long sizeOfCentralDirectory, byte[] archiveComment) + public static unsafe void WriteBlock(Stream stream, long numberOfEntries, long startOfCentralDirectory, long sizeOfCentralDirectory, byte[] archiveComment) { Span blockContents = stackalloc byte[TotalSize]; @@ -956,7 +956,7 @@ private static bool TryReadBlockInitialize(Stream stream, Span blockConten return true; } - public static ZipEndOfCentralDirectoryBlock ReadBlock(Stream stream) + public static unsafe ZipEndOfCentralDirectoryBlock ReadBlock(Stream stream) { Span blockContents = stackalloc byte[TotalSize]; int bytesRead = stream.ReadAtLeast(blockContents, blockContents.Length, throwOnEndOfStream: false); diff --git a/src/libraries/System.IO.Compression/src/System/IO/Compression/Zstandard/ZstandardStream.Decompress.cs b/src/libraries/System.IO.Compression/src/System/IO/Compression/Zstandard/ZstandardStream.Decompress.cs index 12f53f0ecf3ee8..092d7f413e2906 100644 --- a/src/libraries/System.IO.Compression/src/System/IO/Compression/Zstandard/ZstandardStream.Decompress.cs +++ b/src/libraries/System.IO.Compression/src/System/IO/Compression/Zstandard/ZstandardStream.Decompress.cs @@ -261,7 +261,7 @@ public override int EndRead(IAsyncResult asyncResult) /// The data is in an invalid format. /// The stream is disposed. /// Failed to decompress data from the underlying stream. - public override int ReadByte() + public override unsafe int ReadByte() { Span singleByte = stackalloc byte[1]; int bytesRead = Read(singleByte); diff --git a/src/libraries/System.IO.FileSystem.Watcher/src/System/IO/FileSystemWatcher.Linux.cs b/src/libraries/System.IO.FileSystem.Watcher/src/System/IO/FileSystemWatcher.Linux.cs index 07edfcf2e2a2d0..90cff17d868040 100644 --- a/src/libraries/System.IO.FileSystem.Watcher/src/System/IO/FileSystemWatcher.Linux.cs +++ b/src/libraries/System.IO.FileSystem.Watcher/src/System/IO/FileSystemWatcher.Linux.cs @@ -513,7 +513,7 @@ private void ProcessEvents() } } - private bool ProcessEvent(NotifyEvent nextEvent, ref int movedFromWatchCount, ref string movedFromName, ref uint movedFromCookie, ref bool movedFromIsDir) + private unsafe bool ProcessEvent(NotifyEvent nextEvent, ref int movedFromWatchCount, ref string movedFromName, ref uint movedFromCookie, ref bool movedFromIsDir) { // Subset of EventMask that are emitted conditionally based on NotifyFilters.DirectoryName/FileName. const Interop.Sys.NotifyEvents FileDirEvents = diff --git a/src/libraries/System.IO.MemoryMappedFiles/src/System/IO/MemoryMappedFiles/MemoryMappedFile.Unix.cs b/src/libraries/System.IO.MemoryMappedFiles/src/System/IO/MemoryMappedFiles/MemoryMappedFile.Unix.cs index 43f05c94272a8e..3bdb95dc70ec69 100644 --- a/src/libraries/System.IO.MemoryMappedFiles/src/System/IO/MemoryMappedFiles/MemoryMappedFile.Unix.cs +++ b/src/libraries/System.IO.MemoryMappedFiles/src/System/IO/MemoryMappedFiles/MemoryMappedFile.Unix.cs @@ -242,7 +242,7 @@ private static SafeFileHandle CreateSharedBackingObject(Interop.Sys.MemoryMapped } } - private static string GenerateMapName() + private static unsafe string GenerateMapName() { // macOS shm_open documentation says that the sys-call can fail with ENAMETOOLONG if the name exceeds SHM_NAME_MAX characters. // The problem is that SHM_NAME_MAX is not defined anywhere and is not consistent amongst macOS versions (arm64 vs x64 for example). diff --git a/src/libraries/System.IO.Pipelines/src/System.IO.Pipelines.csproj b/src/libraries/System.IO.Pipelines/src/System.IO.Pipelines.csproj index 92d5773be1dc15..0153a1de4f8437 100644 --- a/src/libraries/System.IO.Pipelines/src/System.IO.Pipelines.csproj +++ b/src/libraries/System.IO.Pipelines/src/System.IO.Pipelines.csproj @@ -2,6 +2,7 @@ $(NetCoreAppCurrent);$(NetCoreAppPrevious);$(NetCoreAppMinimum);netstandard2.0;$(NetFrameworkMinimum) + true false true Single producer single consumer byte buffer management. diff --git a/src/libraries/System.IO.Pipelines/src/System/IO/Pipelines/PipeReaderStream.cs b/src/libraries/System.IO.Pipelines/src/System/IO/Pipelines/PipeReaderStream.cs index 798defa268f313..e6b451feeac1ca 100644 --- a/src/libraries/System.IO.Pipelines/src/System/IO/Pipelines/PipeReaderStream.cs +++ b/src/libraries/System.IO.Pipelines/src/System/IO/Pipelines/PipeReaderStream.cs @@ -55,7 +55,7 @@ public override int Read(byte[] buffer, int offset, int count) return ReadInternal(new Span(buffer, offset, count)); } - public override int ReadByte() + public override unsafe int ReadByte() { Span oneByte = stackalloc byte[1]; return ReadInternal(oneByte) == 0 ? -1 : oneByte[0]; diff --git a/src/libraries/System.Linq.Expressions/src/System.Linq.Expressions.csproj b/src/libraries/System.Linq.Expressions/src/System.Linq.Expressions.csproj index 3a26aaa9d4aa3d..3823ac7617da78 100644 --- a/src/libraries/System.Linq.Expressions/src/System.Linq.Expressions.csproj +++ b/src/libraries/System.Linq.Expressions/src/System.Linq.Expressions.csproj @@ -2,6 +2,7 @@ $(NetCoreAppCurrent) + true $(DefineConstants);FEATURE_FAST_CREATE $(NoWarn);CA1859 - 134217728 + 33554432 2147483648 - 5MB + 2MB false <_WasmCompileOutputMessageImportance Condition="'$(EmccVerbose)' == 'true'">Normal diff --git a/src/native/corehost/browserhost/CMakeLists.txt b/src/native/corehost/browserhost/CMakeLists.txt index 2249627f393f8d..e9f155678b3f69 100644 --- a/src/native/corehost/browserhost/CMakeLists.txt +++ b/src/native/corehost/browserhost/CMakeLists.txt @@ -107,10 +107,10 @@ if (UPPERCASE_CMAKE_BUILD_TYPE STREQUAL DEBUG) endif () target_link_options(browserhost PRIVATE - -sINITIAL_MEMORY=134217728 + -sINITIAL_MEMORY=33554432 -sMAXIMUM_MEMORY=2147483648 -sALLOW_MEMORY_GROWTH=1 - -sSTACK_SIZE=5MB + -sSTACK_SIZE=2MB -sWASM_BIGINT=1 -sMODULARIZE=1 -sEXPORT_ES6=1 From 231343a7403a07992565757eda0b7d49291a2117 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20Strehovsk=C3=BD?= Date: Sun, 10 May 2026 00:03:36 +0900 Subject: [PATCH 071/109] Support typeof(T).Assembly.GetType(string) in ILLink dataflow analysis (#127319) Teach the trimmer, NativeAOT compiler, and Roslyn analyzer to understand the pattern typeof(SomeType).Assembly.GetType("OtherType"). This allows the analysis to resolve the target type and avoid false warnings. This is an extremely common pattern in the libraries tests despite me fixing many instances up into `Type.GetType`. It is somewhat nice to be able to do this though. So I've let copilot do it. We could also use this to implement https://github.com/dotnet/linker/issues/1947 later. - Add AssemblyValue (SingleValue holding assembly simple name) - Add IntrinsicId.Type_get_Assembly and IntrinsicId.Assembly_GetType - Handle Type_get_Assembly: SystemTypeValue -> AssemblyValue - Handle Assembly_GetType: resolve type name within the known assembly - Implement partials in all three consumers (ILLinker, NativeAOT, Roslyn) - Add test coverage in AssemblyGetTypeDataFlow.cs --- .../CustomAttributeTypeNameParser.cs | 14 +- .../Compiler/Dataflow/HandleCallAction.cs | 34 +++- .../Compiler/Dataflow/ReflectionMarker.cs | 6 +- .../TestCasesRunner/AssemblyChecker.cs | 2 +- .../TrimAnalysis/HandleCallAction.cs | 35 ++++ .../TrimAnalysis/TypeNameResolver.cs | 20 +++ .../TrimAnalysis/AssemblyValue.cs | 25 +++ .../TrimAnalysis/HandleCallAction.cs | 91 ++++++++++ .../ILLink.Shared/TrimAnalysis/IntrinsicId.cs | 12 ++ .../ILLink.Shared/TrimAnalysis/Intrinsics.cs | 10 ++ .../Linker.Dataflow/HandleCallAction.cs | 38 +++- .../Linker.Dataflow/ReflectionMarker.cs | 4 +- .../Linker.Steps/UnsafeAccessorMarker.cs | 4 +- .../illink/src/linker/Linker/LinkContext.cs | 2 +- .../TypeNameResolver.WithDiagnostics.cs | 2 +- .../src/linker/Linker/TypeNameResolver.cs | 22 ++- .../DataFlowTests.cs | 6 + .../DataFlow/AssemblyGetTypeDataFlow.cs | 165 ++++++++++++++++++ .../TestCasesRunner/ResultChecker.cs | 2 +- 19 files changed, 473 insertions(+), 21 deletions(-) create mode 100644 src/tools/illink/src/ILLink.Shared/TrimAnalysis/AssemblyValue.cs create mode 100644 src/tools/illink/test/Mono.Linker.Tests.Cases/DataFlow/AssemblyGetTypeDataFlow.cs diff --git a/src/coreclr/tools/Common/TypeSystem/Common/Utilities/CustomAttributeTypeNameParser.cs b/src/coreclr/tools/Common/TypeSystem/Common/Utilities/CustomAttributeTypeNameParser.cs index 4bf50321703329..931a95bb4b177f 100644 --- a/src/coreclr/tools/Common/TypeSystem/Common/Utilities/CustomAttributeTypeNameParser.cs +++ b/src/coreclr/tools/Common/TypeSystem/Common/Utilities/CustomAttributeTypeNameParser.cs @@ -31,12 +31,13 @@ public static TypeDesc GetTypeByCustomAttributeTypeName(this ModuleDesc module, _context = module.Context, _module = module, _throwIfNotFound = throwIfNotFound, + _fallbackToCoreLib = true, _canonGenericResolver = canonGenericResolver }.Resolve(parsed); } public static TypeDesc GetTypeByCustomAttributeTypeNameForDataFlow(string name, ModuleDesc callingModule, - TypeSystemContext context, List referencedModules, bool needsAssemblyName, out bool failedBecauseNotFullyQualified) + TypeSystemContext context, List referencedModules, bool needsAssemblyName, bool fallbackToCoreLib, out bool failedBecauseNotFullyQualified) { failedBecauseNotFullyQualified = false; if (!TypeName.TryParse(name.AsSpan(), out TypeName parsed, s_typeNameParseOptions)) @@ -48,11 +49,17 @@ public static TypeDesc GetTypeByCustomAttributeTypeNameForDataFlow(string name, return null; } + // Assembly.GetType (signaled by !fallbackToCoreLib) rejects top-level assembly-qualified + // names at runtime (Argument_AssemblyGetTypeCannotSpecifyAssembly). + if (!fallbackToCoreLib && parsed.AssemblyName is not null) + return null; + TypeNameResolver resolver = new() { _context = context, _module = callingModule, - _referencedModules = referencedModules + _referencedModules = referencedModules, + _fallbackToCoreLib = fallbackToCoreLib, }; TypeDesc type = resolver.Resolve(parsed); @@ -91,6 +98,7 @@ private struct TypeNameResolver internal TypeSystemContext _context; internal ModuleDesc _module; internal bool _throwIfNotFound; + internal bool _fallbackToCoreLib; internal Func _canonGenericResolver; internal List _referencedModules; @@ -153,7 +161,7 @@ private TypeDesc GetSimpleType(TypeName typeName) } } - if (topLevelTypeName.AssemblyName == null) + if (_fallbackToCoreLib && topLevelTypeName.AssemblyName == null) { // If it didn't resolve and wasn't assembly-qualified, we also try core library if (module != _context.SystemModule) diff --git a/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/Dataflow/HandleCallAction.cs b/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/Dataflow/HandleCallAction.cs index eb0c0397c42d1f..49e16e4317a641 100644 --- a/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/Dataflow/HandleCallAction.cs +++ b/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/Dataflow/HandleCallAction.cs @@ -705,7 +705,7 @@ private partial bool TryResolveTypeNameForCreateInstanceAndMark(in MethodProxy c return false; } - if (!_reflectionMarker.TryResolveTypeNameAndMark(resolvedAssembly, typeName, _diagnosticContext, "Reflection", out TypeDesc? foundType)) + if (!_reflectionMarker.TryResolveTypeNameAndMark(resolvedAssembly, typeName, _diagnosticContext, "Reflection", fallbackToCoreLib: true, out TypeDesc? foundType)) { // It's not wrong to have a reference to non-existing type - the code may well expect to get an exception in this case // Note that we did find the assembly, so it's not a ILLink config problem, it's either intentional, or wrong versions of assemblies @@ -719,9 +719,41 @@ private partial bool TryResolveTypeNameForCreateInstanceAndMark(in MethodProxy c return true; } + private partial string? GetAssemblyName(TypeProxy type) + // Only named types are supported. Reject array/pointer/byref (ParameterizedType), + // function pointer, signature variables, and System.Array itself. Rejecting System.Array + // covers the case where Cecil's IL scanner lowers typeof(SomeType[]) to System.Array, + // which would otherwise produce wrong analysis (System.Array.Assembly is CoreLib at + // runtime, but typeof(SomeType[]).Assembly is SomeType's assembly). + => type.Type is MetadataType metadataType && !metadataType.IsWellKnownType(Internal.TypeSystem.WellKnownType.Array) + ? metadataType.Module.Assembly.GetName().Name + : null; + + private partial bool TryResolveTypeNameInAssemblyAndMark(string assemblyName, string typeName, out TypeProxy resolvedType) + { + if (!System.Reflection.Metadata.AssemblyNameInfo.TryParse(assemblyName, out var an) + || _callingMethod.Context.ResolveAssembly(an) is not ModuleDesc resolvedAssembly) + { + resolvedType = default; + return false; + } + + if (!_reflectionMarker.TryResolveTypeNameAndMark(resolvedAssembly, typeName, _diagnosticContext, "Reflection", fallbackToCoreLib: false, out TypeDesc? foundType)) + { + resolvedType = default; + return false; + } + + resolvedType = new TypeProxy(foundType); + return true; + } + private partial void MarkStaticConstructor(TypeProxy type) => _reflectionMarker.MarkStaticConstructor(_diagnosticContext.Origin, type.Type, _reason); + private partial void ReportRequiresUnreferencedCode(MethodProxy calledMethod) + => ReflectionMethodBodyScanner.CheckAndReportRequires(_diagnosticContext, calledMethod.Method, DiagnosticUtilities.RequiresUnreferencedCodeAttribute); + private partial void MarkEventsOnTypeHierarchy(TypeProxy type, string name, BindingFlags? bindingFlags) => _reflectionMarker.MarkEventsOnTypeHierarchy(_diagnosticContext.Origin, type.Type, e => e.Name == name, _reason, bindingFlags); diff --git a/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/Dataflow/ReflectionMarker.cs b/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/Dataflow/ReflectionMarker.cs index eefe7999dcb9a4..b322fce9d82ac2 100644 --- a/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/Dataflow/ReflectionMarker.cs +++ b/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/Dataflow/ReflectionMarker.cs @@ -90,7 +90,7 @@ internal bool TryResolveTypeNameAndMark(string typeName, in DiagnosticContext di List referencedModules = new(); TypeDesc foundType = CustomAttributeTypeNameParser.GetTypeByCustomAttributeTypeNameForDataFlow(typeName, callingModule, diagnosticContext.Origin.MemberDefinition!.Context, - referencedModules, needsAssemblyName, out bool failedBecauseNotFullyQualified); + referencedModules, needsAssemblyName, fallbackToCoreLib: true, out bool failedBecauseNotFullyQualified); if (foundType == null) { if (failedBecauseNotFullyQualified) @@ -121,11 +121,11 @@ internal bool TryResolveTypeNameAndMark(string typeName, in DiagnosticContext di return true; } - internal bool TryResolveTypeNameAndMark(ModuleDesc assembly, string typeName, in DiagnosticContext diagnosticContext, string reason, [NotNullWhen(true)] out TypeDesc? type) + internal bool TryResolveTypeNameAndMark(ModuleDesc assembly, string typeName, in DiagnosticContext diagnosticContext, string reason, bool fallbackToCoreLib, [NotNullWhen(true)] out TypeDesc? type) { List referencedModules = new(); TypeDesc foundType = CustomAttributeTypeNameParser.GetTypeByCustomAttributeTypeNameForDataFlow(typeName, assembly, assembly.Context, - referencedModules, needsAssemblyName: false, out _); + referencedModules, needsAssemblyName: false, fallbackToCoreLib, out _); if (foundType == null) { type = default; diff --git a/src/coreclr/tools/aot/ILCompiler.Trimming.Tests/TestCasesRunner/AssemblyChecker.cs b/src/coreclr/tools/aot/ILCompiler.Trimming.Tests/TestCasesRunner/AssemblyChecker.cs index c2a72782b08448..d1f33ca2af7529 100644 --- a/src/coreclr/tools/aot/ILCompiler.Trimming.Tests/TestCasesRunner/AssemblyChecker.cs +++ b/src/coreclr/tools/aot/ILCompiler.Trimming.Tests/TestCasesRunner/AssemblyChecker.cs @@ -1574,7 +1574,7 @@ internal IEnumerable VerifyLinkingOfOtherAssemblies(AssemblyDefinition o } var expectedTypeName = checkAttrInAssembly.ConstructorArguments[1].Value.ToString()!; - if (!originalsTypeNameResolver.TryResolveTypeName(originalTargetAssembly, expectedTypeName, out TypeReference? expectedTypeRef, out _)) + if (!originalsTypeNameResolver.TryResolveTypeName(originalTargetAssembly, expectedTypeName, fallbackToCoreLib: true, out TypeReference? expectedTypeRef, out _)) Assert.Fail($"Could not resolve original type `{expectedTypeName}' in assembly {assemblyName}"); TypeDefinition expectedType = expectedTypeRef.Resolve(); linkedMembersInAssembly.TryGetValue(new AssemblyQualifiedToken(expectedType), out LinkedEntity? linkedTypeEntity); diff --git a/src/tools/illink/src/ILLink.RoslynAnalyzer/TrimAnalysis/HandleCallAction.cs b/src/tools/illink/src/ILLink.RoslynAnalyzer/TrimAnalysis/HandleCallAction.cs index 02045b840fdedf..3c691e00b3af0a 100644 --- a/src/tools/illink/src/ILLink.RoslynAnalyzer/TrimAnalysis/HandleCallAction.cs +++ b/src/tools/illink/src/ILLink.RoslynAnalyzer/TrimAnalysis/HandleCallAction.cs @@ -25,6 +25,7 @@ internal partial struct HandleCallAction private readonly ISymbol _owningSymbol; private readonly IOperation _operation; private readonly ReflectionAccessAnalyzer _reflectionAccessAnalyzer; + private readonly TypeNameResolver _typeNameResolver; private ValueSetLattice _multiValueLattice; public HandleCallAction( @@ -43,6 +44,7 @@ public HandleCallAction( _diagnosticContext = new DiagnosticContext(location, reportDiagnostic); _annotations = FlowAnnotations.Instance; _reflectionAccessAnalyzer = new(reportDiagnostic, typeNameResolver, typeHierarchyType: null); + _typeNameResolver = typeNameResolver; _requireDynamicallyAccessedMembersAction = new(trimAnalyzer, featureContext, typeNameResolver, location, reportDiagnostic, _reflectionAccessAnalyzer, _owningSymbol); _multiValueLattice = multiValueLattice; } @@ -286,9 +288,42 @@ private partial bool TryResolveTypeNameForCreateInstanceAndMark(in MethodProxy c return false; } + private partial string? GetAssemblyName(TypeProxy type) + => type.Type switch + { + IArrayTypeSymbol or IPointerTypeSymbol or IFunctionPointerTypeSymbol or ITypeParameterSymbol => null, + // typeof(System.Array).Assembly is rejected for parity with the Cecil-based linker, + // where typeof(SomeType[]) lowers to System.Array and otherwise produces wrong + // analysis (System.Array.Assembly is CoreLib at runtime). + _ when type.Type.IsTypeOf(WellKnownType.System_Array) => null, + _ => type.Type.ContainingAssembly?.Name, + }; + + private partial bool TryResolveTypeNameInAssemblyAndMark(string assemblyName, string typeName, out TypeProxy resolvedType) + { + if (_typeNameResolver.TryResolveTypeNameInAssembly(assemblyName, typeName, out ITypeSymbol? foundType)) + { + resolvedType = new TypeProxy(foundType); + return true; + } + + resolvedType = default; + return false; + } + private partial void MarkStaticConstructor(TypeProxy type) => _reflectionAccessAnalyzer.GetReflectionAccessDiagnosticsForConstructorsOnType(_diagnosticContext.Location, type.Type, BindingFlags.Static, parameterCount: 0); + private partial void ReportRequiresUnreferencedCode(MethodProxy calledMethod) + { + if (calledMethod.Method.TryGetRequiresUnreferencedCodeAttribute(out var requiresAttribute)) + { + var message = RequiresUnreferencedCodeUtils.GetMessageFromAttribute(requiresAttribute); + var url = RequiresAnalyzerBase.GetUrlFromAttribute(requiresAttribute); + _diagnosticContext.AddDiagnostic(DiagnosticId.RequiresUnreferencedCode, calledMethod.GetDisplayName(), message, url); + } + } + private partial void MarkEventsOnTypeHierarchy(TypeProxy type, string name, BindingFlags? bindingFlags) => _reflectionAccessAnalyzer.GetReflectionAccessDiagnosticsForEventsOnTypeHierarchy(_diagnosticContext.Location, type.Type, name, bindingFlags); diff --git a/src/tools/illink/src/ILLink.RoslynAnalyzer/TrimAnalysis/TypeNameResolver.cs b/src/tools/illink/src/ILLink.RoslynAnalyzer/TrimAnalysis/TypeNameResolver.cs index 49209efa6a695f..9c9dfd48537b96 100644 --- a/src/tools/illink/src/ILLink.RoslynAnalyzer/TrimAnalysis/TypeNameResolver.cs +++ b/src/tools/illink/src/ILLink.RoslynAnalyzer/TrimAnalysis/TypeNameResolver.cs @@ -150,5 +150,25 @@ static bool IsFullyQualified(TypeName typeName) } return null; } + + public bool TryResolveTypeNameInAssembly(string assemblySimpleName, string typeNameString, [NotNullWhen(true)] out ITypeSymbol? type) + { + type = null; + + IAssemblySymbol? assembly = ResolveAssembly(new AssemblyNameInfo(assemblySimpleName)); + if (assembly is null) + return false; + + if (!TypeName.TryParse(typeNameString.AsSpan(), out TypeName? parsedTypeName, s_typeNameParseOptions)) + return false; + + // Assembly.GetType rejects top-level assembly-qualified names at runtime + // (Argument_AssemblyGetTypeCannotSpecifyAssembly). + if (parsedTypeName.AssemblyName is not null) + return false; + + type = ResolveTypeName(assembly, parsedTypeName); + return type is not null; + } } } diff --git a/src/tools/illink/src/ILLink.Shared/TrimAnalysis/AssemblyValue.cs b/src/tools/illink/src/ILLink.Shared/TrimAnalysis/AssemblyValue.cs new file mode 100644 index 00000000000000..e5af7109ef431a --- /dev/null +++ b/src/tools/illink/src/ILLink.Shared/TrimAnalysis/AssemblyValue.cs @@ -0,0 +1,25 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using ILLink.Shared.DataFlow; + +// This is needed due to NativeAOT which doesn't enable nullable globally yet +#nullable enable + +namespace ILLink.Shared.TrimAnalysis +{ + /// + /// A known Assembly value, represented by its simple name. + /// For example, the result of typeof(SomeType).Assembly. + /// + internal sealed record AssemblyValue : SingleValue + { + public AssemblyValue(string assemblyName) => AssemblyName = assemblyName; + + public readonly string AssemblyName; + + public override SingleValue DeepCopy() => this; // This value is immutable + + public override string ToString() => this.ValueToString(AssemblyName); + } +} diff --git a/src/tools/illink/src/ILLink.Shared/TrimAnalysis/HandleCallAction.cs b/src/tools/illink/src/ILLink.Shared/TrimAnalysis/HandleCallAction.cs index 7dc3c5698b9f3a..deffcb2cba9c8a 100644 --- a/src/tools/illink/src/ILLink.Shared/TrimAnalysis/HandleCallAction.cs +++ b/src/tools/illink/src/ILLink.Shared/TrimAnalysis/HandleCallAction.cs @@ -184,6 +184,28 @@ ValueWithDynamicallyAccessedMembers valueWithDynamicallyAccessedMembers } break; + case IntrinsicId.Type_get_Assembly: + if (instanceValue.IsEmpty()) + { + returnValue = MultiValueLattice.Top; + break; + } + + foreach (var value in instanceValue.AsEnumerable()) + { + string? assemblyName; + if (value is SystemTypeValue systemType + && (assemblyName = GetAssemblyName(systemType.RepresentedType)) is not null) + { + AddReturnValue(new AssemblyValue(assemblyName)); + } + else + { + AddReturnValue(annotatedMethodReturnValue); + } + } + break; + // System.Reflection.MethodBase.GetMethodFromHandle(RuntimeMethodHandle handle) // System.Reflection.MethodBase.GetMethodFromHandle(RuntimeMethodHandle handle, RuntimeTypeHandle declaringType) case IntrinsicId.MethodBase_GetMethodFromHandle: @@ -1521,6 +1543,69 @@ ValueWithDynamicallyAccessedMembers valueWithDynamicallyAccessedMembers _diagnosticContext.AddDiagnostic(DiagnosticId.ParametersOfAssemblyCreateInstanceCannotBeAnalyzed, calledMethod.GetDisplayName()); break; + // + // System.Reflection.Assembly + // + // GetType(string name) + // GetType(string name, bool throwOnError) + // GetType(string name, bool throwOnError, bool ignoreCase) + // + case IntrinsicId.Assembly_GetType: + { + if (instanceValue.IsEmpty() || argumentValues[0].IsEmpty()) + { + returnValue = MultiValueLattice.Top; + break; + } + + bool triggersWarning = + calledMethod.HasMetadataParametersCount(3) && calledMethod.HasParameterOfType((ParameterIndex)3, "System.Boolean") && argumentValues[2].AsConstInt() != 0; + + if (!triggersWarning) + { + foreach (var assemblyValue in instanceValue.AsEnumerable()) + { + if (assemblyValue is not AssemblyValue knownAssembly) + { + triggersWarning = true; + continue; + } + + foreach (var typeNameValue in argumentValues[0].AsEnumerable()) + { + if (typeNameValue is KnownStringValue knownStringValue) + { + if (!TryResolveTypeNameInAssemblyAndMark(knownAssembly.AssemblyName, knownStringValue.Contents, out TypeProxy foundType)) + { + // Intentionally ignore - it's not wrong for code to call Assembly.GetType on non-existing name, the code might expect null/exception back. + AddReturnValue(MultiValueLattice.Top); + } + else + { + AddReturnValue(new SystemTypeValue(foundType)); + } + } + else if (typeNameValue == NullValue.Instance) + { + // Nothing to do - this throws at runtime + AddReturnValue(MultiValueLattice.Top); + } + else + { + // Unlike Type.GetType, we can't propagate DAM annotations from the string parameter because + // Assembly.GetType resolves within a specific assembly, while DAM enforcement at the call site + // uses global (Type.GetType-like) resolution. These can resolve to different types. + triggersWarning = true; + } + } + } + } + + if (triggersWarning) + ReportRequiresUnreferencedCode(calledMethod); + } + break; + case IntrinsicId.None: // Verify the argument values match the annotations on the parameter definition if (requiresDataFlowAnalysis) @@ -1813,6 +1898,12 @@ internal static DynamicallyAccessedMemberTypes GetDynamicallyAccessedMemberTypes private partial bool TryResolveTypeNameForCreateInstanceAndMark(in MethodProxy calledMethod, string assemblyName, string typeName, out TypeProxy resolvedType); + private partial string? GetAssemblyName(TypeProxy type); + + private partial bool TryResolveTypeNameInAssemblyAndMark(string assemblyName, string typeName, out TypeProxy resolvedType); + + private partial void ReportRequiresUnreferencedCode(MethodProxy calledMethod); + private partial void MarkStaticConstructor(TypeProxy type); private partial void MarkEventsOnTypeHierarchy(TypeProxy type, string name, BindingFlags? bindingFlags); diff --git a/src/tools/illink/src/ILLink.Shared/TrimAnalysis/IntrinsicId.cs b/src/tools/illink/src/ILLink.Shared/TrimAnalysis/IntrinsicId.cs index e3bad11eaabf9f..19fedb6996ab83 100644 --- a/src/tools/illink/src/ILLink.Shared/TrimAnalysis/IntrinsicId.cs +++ b/src/tools/illink/src/ILLink.Shared/TrimAnalysis/IntrinsicId.cs @@ -49,6 +49,10 @@ internal enum IntrinsicId /// /// MethodBase_get_MethodHandle, + /// + /// + /// + Type_get_Assembly, // Anything above this marker will require the method to be run through // the reflection body scanner. @@ -300,6 +304,14 @@ internal enum IntrinsicId /// Assembly_CreateInstance, /// + /// + /// + /// + /// + /// + /// + Assembly_GetType, + /// /// /// Assembly_get_Location, diff --git a/src/tools/illink/src/ILLink.Shared/TrimAnalysis/Intrinsics.cs b/src/tools/illink/src/ILLink.Shared/TrimAnalysis/Intrinsics.cs index 773ebe28896068..daba4db617cd9a 100644 --- a/src/tools/illink/src/ILLink.Shared/TrimAnalysis/Intrinsics.cs +++ b/src/tools/illink/src/ILLink.Shared/TrimAnalysis/Intrinsics.cs @@ -26,6 +26,9 @@ public static IntrinsicId GetIntrinsicIdForMethod(MethodProxy calledMethod) // System.Type.TypeHandle getter "get_TypeHandle" when calledMethod.IsDeclaredOnType("System.Type") => IntrinsicId.Type_get_TypeHandle, + // System.Type.Assembly getter + "get_Assembly" when calledMethod.IsDeclaredOnType("System.Type") => IntrinsicId.Type_get_Assembly, + // static System.Reflection.MethodBase.GetMethodFromHandle(RuntimeMethodHandle handle) // static System.Reflection.MethodBase.GetMethodFromHandle(RuntimeMethodHandle handle, RuntimeTypeHandle declaringType) "GetMethodFromHandle" when calledMethod.IsDeclaredOnType("System.Reflection.MethodBase") @@ -373,6 +376,13 @@ public static IntrinsicId GetIntrinsicIdForMethod(MethodProxy calledMethod) && calledMethod.HasParameterOfType((ParameterIndex)1, "System.String") => IntrinsicId.Assembly_CreateInstance, + // System.Reflection.Assembly.GetType(string) + // System.Reflection.Assembly.GetType(string, bool) + // System.Reflection.Assembly.GetType(string, bool, bool) + "GetType" when calledMethod.IsDeclaredOnType("System.Reflection.Assembly") + && calledMethod.HasParameterOfType((ParameterIndex)1, "System.String") + => IntrinsicId.Assembly_GetType, + // System.Reflection.Assembly.Location getter "get_Location" when calledMethod.IsDeclaredOnType("System.Reflection.Assembly") => IntrinsicId.Assembly_get_Location, diff --git a/src/tools/illink/src/linker/Linker.Dataflow/HandleCallAction.cs b/src/tools/illink/src/linker/Linker.Dataflow/HandleCallAction.cs index 0b283623e047cc..aecffe147f94a7 100644 --- a/src/tools/illink/src/linker/Linker.Dataflow/HandleCallAction.cs +++ b/src/tools/illink/src/linker/Linker.Dataflow/HandleCallAction.cs @@ -290,7 +290,7 @@ private partial bool TryResolveTypeNameForCreateInstanceAndMark(in MethodProxy c return false; } - if (!_reflectionMarker.TryResolveTypeNameAndMark(resolvedAssembly, typeName, _diagnosticContext, out TypeReference? foundType)) + if (!_reflectionMarker.TryResolveTypeNameAndMark(resolvedAssembly, typeName, _diagnosticContext, fallbackToCoreLib: true, out TypeReference? foundType)) { // It's not wrong to have a reference to non-existing type - the code may well expect to get an exception in this case // Note that we did find the assembly, so it's not a ILLink config problem, it's either intentional, or wrong versions of assemblies @@ -304,9 +304,45 @@ private partial bool TryResolveTypeNameForCreateInstanceAndMark(in MethodProxy c return true; } + private partial string? GetAssemblyName(TypeProxy type) + => type.Type switch + { + ArrayType or PointerType or ByReferenceType or FunctionPointerType or GenericParameter => null, + // typeof(System.Array).Assembly is rejected because Cecil's ldtoken handling lowers + // typeof(SomeType[]) to System.Array, which would otherwise produce wrong analysis + // for non-CoreLib element types (System.Array.Assembly returns CoreLib at runtime). + _ when type.Type.IsTypeOf(WellKnownType.System_Array) => null, + _ => type.Type.Module?.Assembly.Name.Name, + }; + + private partial bool TryResolveTypeNameInAssemblyAndMark(string assemblyName, string typeName, out TypeProxy resolvedType) + { + var resolvedAssembly = _context.TryResolve(assemblyName); + if (resolvedAssembly is null) + { + resolvedType = default; + return false; + } + + if (!_reflectionMarker.TryResolveTypeNameAndMark(resolvedAssembly, typeName, _diagnosticContext, fallbackToCoreLib: false, out TypeReference? foundType)) + { + resolvedType = default; + return false; + } + + resolvedType = new TypeProxy(foundType, _context); + return true; + } + private partial void MarkStaticConstructor(TypeProxy type) => _reflectionMarker.MarkStaticConstructor(_diagnosticContext.Origin, type.Type); + private partial void ReportRequiresUnreferencedCode(MethodProxy calledMethod) + { + if (_context.Annotations.DoesMethodRequireUnreferencedCode(calledMethod.Definition, out RequiresUnreferencedCodeAttribute? requiresUnreferencedCode)) + MarkStep.ReportRequiresUnreferencedCode(calledMethod.GetDisplayName(), requiresUnreferencedCode, _diagnosticContext); + } + private partial void MarkEventsOnTypeHierarchy(TypeProxy type, string name, BindingFlags? bindingFlags) => _reflectionMarker.MarkEventsOnTypeHierarchy(_diagnosticContext.Origin, type.Type, e => e.Name == name, bindingFlags); diff --git a/src/tools/illink/src/linker/Linker.Dataflow/ReflectionMarker.cs b/src/tools/illink/src/linker/Linker.Dataflow/ReflectionMarker.cs index 6f6e634b2907c6..75d444d5cb8eaa 100644 --- a/src/tools/illink/src/linker/Linker.Dataflow/ReflectionMarker.cs +++ b/src/tools/illink/src/linker/Linker.Dataflow/ReflectionMarker.cs @@ -73,9 +73,9 @@ internal bool TryResolveTypeNameAndMark(string typeName, in DiagnosticContext di } // Resolve a type from the specified assembly and mark it for reflection. - internal bool TryResolveTypeNameAndMark(AssemblyDefinition assembly, string typeName, in DiagnosticContext diagnosticContext, [NotNullWhen(true)] out TypeReference? type) + internal bool TryResolveTypeNameAndMark(AssemblyDefinition assembly, string typeName, in DiagnosticContext diagnosticContext, bool fallbackToCoreLib, [NotNullWhen(true)] out TypeReference? type) { - if (!Context.TypeNameResolver.TryResolveTypeName(assembly, typeName, out type, out var typeResolutionRecords)) + if (!Context.TypeNameResolver.TryResolveTypeName(assembly, typeName, fallbackToCoreLib, out type, out var typeResolutionRecords)) { type = default; return false; diff --git a/src/tools/illink/src/linker/Linker.Steps/UnsafeAccessorMarker.cs b/src/tools/illink/src/linker/Linker.Steps/UnsafeAccessorMarker.cs index 0ceb3dd3b37941..85588f3f95df1c 100644 --- a/src/tools/illink/src/linker/Linker.Steps/UnsafeAccessorMarker.cs +++ b/src/tools/illink/src/linker/Linker.Steps/UnsafeAccessorMarker.cs @@ -89,7 +89,7 @@ void ProcessUnsafeAccessorTypeAttributes(MethodDefinition method) { if (attr.HasConstructorArguments && attr.ConstructorArguments[0].Value is string typeName) { - if (!_context.TypeNameResolver.TryResolveTypeName(method.Module.Assembly, typeName, out _, out System.Collections.Generic.List? records)) + if (!_context.TypeNameResolver.TryResolveTypeName(method.Module.Assembly, typeName, fallbackToCoreLib: true, out _, out System.Collections.Generic.List? records)) return; // We can't find the target type, so there's nothing to rewrite. foreach (var typeResolutionRecord in records) @@ -106,7 +106,7 @@ void ProcessUnsafeAccessorTypeAttributes(MethodDefinition method) { if (attr.HasConstructorArguments && attr.ConstructorArguments[0].Value is string typeName) { - if (!_context.TypeNameResolver.TryResolveTypeName(method.Module.Assembly, typeName, out _, out System.Collections.Generic.List? records)) + if (!_context.TypeNameResolver.TryResolveTypeName(method.Module.Assembly, typeName, fallbackToCoreLib: true, out _, out System.Collections.Generic.List? records)) return; // We can't find the target type, so there's nothing to rewrite. foreach (var typeResolutionRecord in records) diff --git a/src/tools/illink/src/linker/Linker/LinkContext.cs b/src/tools/illink/src/linker/Linker/LinkContext.cs index 8552b027e1c02d..376d9fcf7e2b31 100644 --- a/src/tools/illink/src/linker/Linker/LinkContext.cs +++ b/src/tools/illink/src/linker/Linker/LinkContext.cs @@ -1043,7 +1043,7 @@ public int GetTargetRuntimeVersion() public TypeDefinition? TryResolve(AssemblyDefinition assembly, string typeNameString) { // It could be cached if it shows up on fast path - return TypeNameResolver.TryResolveTypeName(assembly, typeNameString, out TypeReference? typeReference, out _) + return TypeNameResolver.TryResolveTypeName(assembly, typeNameString, fallbackToCoreLib: true, out TypeReference? typeReference, out _) ? TryResolve(typeReference) : null; } diff --git a/src/tools/illink/src/linker/Linker/TypeNameResolver.WithDiagnostics.cs b/src/tools/illink/src/linker/Linker/TypeNameResolver.WithDiagnostics.cs index 8369bbc64a4130..7c48bd37860490 100644 --- a/src/tools/illink/src/linker/Linker/TypeNameResolver.WithDiagnostics.cs +++ b/src/tools/illink/src/linker/Linker/TypeNameResolver.WithDiagnostics.cs @@ -52,7 +52,7 @@ public bool TryResolveTypeName( return false; typeResolutionRecords = new List(); - typeReference = ResolveTypeName(referencingAssembly, parsedTypeName, typeResolutionRecords); + typeReference = ResolveTypeName(referencingAssembly, parsedTypeName, typeResolutionRecords, fallbackToCoreLib: true); return typeReference != null; static bool IsFullyQualified(TypeName typeName) diff --git a/src/tools/illink/src/linker/Linker/TypeNameResolver.cs b/src/tools/illink/src/linker/Linker/TypeNameResolver.cs index af0e1a27c58226..5f2200394f9339 100644 --- a/src/tools/illink/src/linker/Linker/TypeNameResolver.cs +++ b/src/tools/illink/src/linker/Linker/TypeNameResolver.cs @@ -31,6 +31,7 @@ public TypeNameResolver(ITryResolveMetadata metadataResolver, ITryResolveAssembl public bool TryResolveTypeName( AssemblyDefinition assembly, string typeNameString, + bool fallbackToCoreLib, [NotNullWhen(true)] out TypeReference? typeReference, [NotNullWhen(true)] out List? typeResolutionRecords) { @@ -40,7 +41,15 @@ public bool TryResolveTypeName( typeReference = null; return false; } - typeReference = ResolveTypeName(assembly, parsedTypeName, typeResolutionRecords); + // Assembly.GetType (signaled by !fallbackToCoreLib) rejects top-level assembly-qualified + // names at runtime (Argument_AssemblyGetTypeCannotSpecifyAssembly). + if (!fallbackToCoreLib && parsedTypeName.AssemblyName is not null) + { + typeReference = null; + typeResolutionRecords = null; + return false; + } + typeReference = ResolveTypeName(assembly, parsedTypeName, typeResolutionRecords, fallbackToCoreLib); if (typeReference == null) typeResolutionRecords = null; @@ -48,7 +57,7 @@ public bool TryResolveTypeName( return typeReference != null; } - TypeReference? ResolveTypeName(AssemblyDefinition originalAssembly, TypeName? typeName, List typeResolutionRecords) + TypeReference? ResolveTypeName(AssemblyDefinition originalAssembly, TypeName? typeName, List typeResolutionRecords, bool fallbackToCoreLib) { if (typeName == null) return null; @@ -63,7 +72,7 @@ public bool TryResolveTypeName( if (typeName.IsConstructedGenericType) { - var genericTypeRef = ResolveTypeName(assembly, typeName.GetGenericTypeDefinition(), typeResolutionRecords); + var genericTypeRef = ResolveTypeName(assembly, typeName.GetGenericTypeDefinition(), typeResolutionRecords, fallbackToCoreLib); if (genericTypeRef == null) return null; @@ -71,7 +80,7 @@ public bool TryResolveTypeName( var genericInstanceType = new GenericInstanceType(genericTypeRef); foreach (var arg in typeName.GetGenericArguments()) { - var genericArgument = ResolveTypeName(assembly, arg, typeResolutionRecords); + var genericArgument = ResolveTypeName(assembly, arg, typeResolutionRecords, fallbackToCoreLib); if (genericArgument == null) return null; @@ -82,7 +91,7 @@ public bool TryResolveTypeName( } else if (typeName.IsArray || typeName.IsPointer || typeName.IsByRef) { - var elementType = ResolveTypeName(assembly, typeName.GetElementType(), typeResolutionRecords); + var elementType = ResolveTypeName(assembly, typeName.GetElementType(), typeResolutionRecords, fallbackToCoreLib); if (elementType == null) return null; @@ -111,6 +120,9 @@ public bool TryResolveTypeName( return resolvedType; } + if (!fallbackToCoreLib) + return null; + // If it didn't resolve and wasn't assembly-qualified, we also try core library var coreLibrary = _metadataResolver.TryResolve(originalAssembly.MainModule.TypeSystem.Object)?.Module.Assembly; if (coreLibrary is null) diff --git a/src/tools/illink/test/ILLink.RoslynAnalyzer.Tests/DataFlowTests.cs b/src/tools/illink/test/ILLink.RoslynAnalyzer.Tests/DataFlowTests.cs index 5176759021de4e..1056cfa822ead8 100644 --- a/src/tools/illink/test/ILLink.RoslynAnalyzer.Tests/DataFlowTests.cs +++ b/src/tools/illink/test/ILLink.RoslynAnalyzer.Tests/DataFlowTests.cs @@ -28,6 +28,12 @@ public Task ApplyTypeAnnotations() return RunTest(); } + [Fact] + public Task AssemblyGetTypeDataFlow() + { + return RunTest(); + } + [Fact] public Task AssemblyQualifiedNameDataflow() { diff --git a/src/tools/illink/test/Mono.Linker.Tests.Cases/DataFlow/AssemblyGetTypeDataFlow.cs b/src/tools/illink/test/Mono.Linker.Tests.Cases/DataFlow/AssemblyGetTypeDataFlow.cs new file mode 100644 index 00000000000000..a6dcdbce6778c7 --- /dev/null +++ b/src/tools/illink/test/Mono.Linker.Tests.Cases/DataFlow/AssemblyGetTypeDataFlow.cs @@ -0,0 +1,165 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using System; +using System.Reflection; +using Mono.Linker.Tests.Cases.Expectations.Assertions; +using Mono.Linker.Tests.Cases.Expectations.Helpers; +using Mono.Linker.Tests.Cases.Expectations.Metadata; + +namespace Mono.Linker.Tests.Cases.DataFlow +{ + [SkipKeptItemsValidation] + [ExpectedNoWarnings] + [SetupCompileArgument("/unsafe")] + public class AssemblyGetTypeDataFlow + { + public static void Main() + { + TestKnownType(); + TestKnownTypeWithThrowOnError(); + TestUnknownType(); + TestNullTypeName(); + TestCaseInsensitive(); + TestUnknownAssembly(); + TestUnknownTypeAssemblyGetType(null); + TestArrayType(); + TestPointerType(); + TestGenericType(); + TestTypeOnlyInCoreLib(); + TestArrayReceiver(); + TestFunctionPointerReceiver(); + TestGenericParameterReceiver(); + TestGenericMethodArrayReceiver(); + TestAssemblyQualifiedTypeName(); + } + + class InnerType + { + } + + static void TestKnownType() + { + Type type = typeof(AssemblyGetTypeDataFlow).Assembly.GetType("Mono.Linker.Tests.Cases.DataFlow.AssemblyGetTypeDataFlow+InnerType"); + type.RequiresNone(); + } + + static void TestKnownTypeWithThrowOnError() + { + Type type = typeof(AssemblyGetTypeDataFlow).Assembly.GetType("Mono.Linker.Tests.Cases.DataFlow.AssemblyGetTypeDataFlow+InnerType", false); + type.RequiresNone(); + } + + [ExpectedWarning("IL2026")] + static void TestUnknownType() + { + string typeName = GetUnknownString(); + typeof(AssemblyGetTypeDataFlow).Assembly.GetType(typeName); + } + + static void TestNullTypeName() + { + typeof(AssemblyGetTypeDataFlow).Assembly.GetType(null).RequiresAll(); + } + + [ExpectedWarning("IL2026")] + static void TestCaseInsensitive() + { + typeof(AssemblyGetTypeDataFlow).Assembly.GetType("Mono.Linker.Tests.Cases.DataFlow.AssemblyGetTypeDataFlow+InnerType", false, true); + } + + [ExpectedWarning("IL2026")] + static void TestUnknownAssembly() + { + Assembly assembly = GetUnknownAssembly(); + assembly.GetType("Mono.Linker.Tests.Cases.DataFlow.AssemblyGetTypeDataFlow+InnerType"); + } + + [ExpectedWarning("IL2026")] + static void TestUnknownTypeAssemblyGetType(Type unknownType) + { + unknownType.Assembly.GetType("Mono.Linker.Tests.Cases.DataFlow.AssemblyGetTypeDataFlow+InnerType"); + } + + // Verifies the resolver supports array type names. Without array support the analyzer + // would treat the result as unknown (Top) instead of a known SystemTypeValue, and + // GetProperty("Length") below would emit IL2075 instead of resolving Array.Length. + static void TestArrayType() + { + Type type = typeof(AssemblyGetTypeDataFlow).Assembly.GetType("Mono.Linker.Tests.Cases.DataFlow.AssemblyGetTypeDataFlow+InnerType[]"); + type.GetProperty("Length"); + } + + static void TestPointerType() + { + Type type = typeof(AssemblyGetTypeDataFlow).Assembly.GetType("Mono.Linker.Tests.Cases.DataFlow.AssemblyGetTypeDataFlow+InnerType*"); + type.RequiresAll(); + } + + class GenericType + { + } + + // Generic type arguments are unqualified; Assembly.GetType resolves them in the + // receiver assembly (no corelib fallback). + static void TestGenericType() + { + Type type = typeof(AssemblyGetTypeDataFlow).Assembly.GetType( + "Mono.Linker.Tests.Cases.DataFlow.AssemblyGetTypeDataFlow+GenericType`1[[Mono.Linker.Tests.Cases.DataFlow.AssemblyGetTypeDataFlow+InnerType]]"); + type.RequiresAll(); + } + + // Verifies Assembly.GetType does not over-resolve to corelib. "System.Reflection.Assembly" + // is not defined in this assembly, so Assembly.GetType must return null at runtime; the + // analyzer must not statically resolve it to corelib's System.Reflection.Assembly. If it + // did, RequiresAll() would mark RequiresUnreferencedCode-annotated members like LoadFrom + // and emit IL2026. + static void TestTypeOnlyInCoreLib() + { + typeof(AssemblyGetTypeDataFlow).Assembly.GetType("System.Reflection.Assembly").RequiresAll(); + } + + // The dataflow only models Type.Assembly for named types. Array, pointer, byref, function + // pointer, and open generic parameter receivers are intentionally rejected and fall back + // to an IL2026 warning at the Assembly.GetType call site. + + [ExpectedWarning("IL2026")] + static void TestArrayReceiver() + { + typeof(InnerType[]).Assembly.GetType("Mono.Linker.Tests.Cases.DataFlow.AssemblyGetTypeDataFlow+InnerType"); + } + + // The Roslyn analyzer models typeof(delegate*<...>) as Top (no SystemTypeValue), so + // the Type.Assembly intrinsic short-circuits and no warning is emitted. + [ExpectedWarning("IL2026", Tool.Trimmer | Tool.NativeAot, "Roslyn analyzer doesn't model typeof for function pointers")] + static unsafe void TestFunctionPointerReceiver() + { + typeof(delegate*).Assembly.GetType("Mono.Linker.Tests.Cases.DataFlow.AssemblyGetTypeDataFlow+InnerType"); + } + + [ExpectedWarning("IL2026")] + static void TestGenericParameterReceiver() + { + typeof(T).Assembly.GetType("Mono.Linker.Tests.Cases.DataFlow.AssemblyGetTypeDataFlow+InnerType"); + } + + [ExpectedWarning("IL2026")] + static void TestGenericMethodArrayReceiver() + { + typeof(T[]).Assembly.GetType("Mono.Linker.Tests.Cases.DataFlow.AssemblyGetTypeDataFlow+InnerType"); + } + + // Assembly.GetType rejects top-level assembly-qualified names at runtime (returns null). + // The analyzer must not honor the qualifier and resolve in the named assembly. If it did, + // RequiresAll() would mark RUC members on System.Reflection.Assembly and emit IL2026. + static void TestAssemblyQualifiedTypeName() + { + typeof(AssemblyGetTypeDataFlow).Assembly.GetType( + "System.Reflection.Assembly, System.Runtime").RequiresAll(); + } + + static string GetUnknownString() => "unknown"; + + static Assembly GetUnknownAssembly() => typeof(AssemblyGetTypeDataFlow).Assembly; + } +} diff --git a/src/tools/illink/test/Mono.Linker.Tests/TestCasesRunner/ResultChecker.cs b/src/tools/illink/test/Mono.Linker.Tests/TestCasesRunner/ResultChecker.cs index 37a5454dbd5d58..4663dcae82c15c 100644 --- a/src/tools/illink/test/Mono.Linker.Tests/TestCasesRunner/ResultChecker.cs +++ b/src/tools/illink/test/Mono.Linker.Tests/TestCasesRunner/ResultChecker.cs @@ -363,7 +363,7 @@ void VerifyLinkingOfOtherAssemblies(AssemblyDefinition original) TypeReference linkedTypeRef = null; try { - _linkedTypeNameResolver.TryResolveTypeName(linkedAssembly, expectedTypeName, out linkedTypeRef, out _); + _linkedTypeNameResolver.TryResolveTypeName(linkedAssembly, expectedTypeName, fallbackToCoreLib: true, out linkedTypeRef, out _); } catch (AssemblyResolutionException) { } TypeDefinition linkedType = linkedTypeRef?.Resolve(); From fe45871be78cc7642680690cc78b45f5c1db0bec Mon Sep 17 00:00:00 2001 From: Kevin Jones Date: Sat, 9 May 2026 11:08:09 -0400 Subject: [PATCH 072/109] Implement X25519DiffieHellmanCng Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../Interop/Windows/NCrypt/Interop.Keys.cs | 3 + .../NCrypt/Interop.NCryptDeriveKeyMaterial.cs | 40 ++++ .../ECCng.ImportExport.NamedCurve.cs | 5 +- .../Cryptography/KeyFormatHelper.Encrypted.cs | 71 ++++++ .../Security/Cryptography/KeyFormatHelper.cs | 29 ++- .../Cryptography/X25519WindowsHelpers.cs | 221 +++++++++++++++++ .../ref/System.Security.Cryptography.cs | 11 + .../src/Resources/Strings.resx | 3 + .../src/System.Security.Cryptography.csproj | 4 + .../Security/Cryptography/Cng.NotSupported.cs | 38 +++ .../X25519DiffieHellmanCng.Windows.cs | 222 +++++++++++++++++ .../Cryptography/X25519DiffieHellmanCng.cs | 70 ++++++ ...5519DiffieHellmanImplementation.Windows.cs | 224 ++---------------- .../tests/CngHelpers.cs | 15 ++ .../System.Security.Cryptography.Tests.csproj | 20 ++ .../tests/X25519DiffieHellmanBaseTests.cs | 37 ++- .../tests/X25519DiffieHellmanCngTests.cs | 177 ++++++++++++++ 17 files changed, 976 insertions(+), 214 deletions(-) create mode 100644 src/libraries/Common/src/System/Security/Cryptography/X25519WindowsHelpers.cs create mode 100644 src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/X25519DiffieHellmanCng.Windows.cs create mode 100644 src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/X25519DiffieHellmanCng.cs create mode 100644 src/libraries/System.Security.Cryptography/tests/CngHelpers.cs create mode 100644 src/libraries/System.Security.Cryptography/tests/X25519DiffieHellmanCngTests.cs diff --git a/src/libraries/Common/src/Interop/Windows/NCrypt/Interop.Keys.cs b/src/libraries/Common/src/Interop/Windows/NCrypt/Interop.Keys.cs index 1b24ea9b4e471c..4cd779d627aeba 100644 --- a/src/libraries/Common/src/Interop/Windows/NCrypt/Interop.Keys.cs +++ b/src/libraries/Common/src/Interop/Windows/NCrypt/Interop.Keys.cs @@ -31,6 +31,9 @@ internal static partial class NCrypt [LibraryImport(Interop.Libraries.NCrypt, StringMarshalling = StringMarshalling.Utf16)] internal static partial ErrorCode NCryptExportKey(SafeNCryptKeyHandle hKey, IntPtr hExportKey, string pszBlobType, IntPtr pParameterList, ref byte pbOutput, int cbOutput, out int pcbResult, int dwFlags); + [LibraryImport(Interop.Libraries.NCrypt, StringMarshalling = StringMarshalling.Utf16)] + internal static partial ErrorCode NCryptExportKey(SafeNCryptKeyHandle hKey, IntPtr hExportKey, string pszBlobType, IntPtr pParameterList, Span pbOutput, int cbOutput, out int pcbResult, int dwFlags); + [LibraryImport(Interop.Libraries.NCrypt, StringMarshalling = StringMarshalling.Utf16)] internal static partial ErrorCode NCryptExportKey(SafeNCryptKeyHandle hKey, IntPtr hExportKey, string pszBlobType, ref NCryptBufferDesc pParameterList, ref byte pbOutput, int cbOutput, out int pcbResult, int dwFlags); diff --git a/src/libraries/Common/src/Interop/Windows/NCrypt/Interop.NCryptDeriveKeyMaterial.cs b/src/libraries/Common/src/Interop/Windows/NCrypt/Interop.NCryptDeriveKeyMaterial.cs index 9806713fcf1ff8..e0c1ada8a4c9f7 100644 --- a/src/libraries/Common/src/Interop/Windows/NCrypt/Interop.NCryptDeriveKeyMaterial.cs +++ b/src/libraries/Common/src/Interop/Windows/NCrypt/Interop.NCryptDeriveKeyMaterial.cs @@ -25,6 +25,16 @@ private static partial ErrorCode NCryptDeriveKey( out int pcbResult, SecretAgreementFlags dwFlags); + [LibraryImport(Interop.Libraries.NCrypt, StringMarshalling = StringMarshalling.Utf16)] + private static partial ErrorCode NCryptDeriveKey( + SafeNCryptSecretHandle hSharedSecret, + string pwszKDF, + IntPtr pParameterList, + Span pbDerivedKey, + int cbDerivedKey, + out int pcbResult, + SecretAgreementFlags dwFlags); + /// /// Derive key material from a hash or HMAC KDF /// @@ -257,5 +267,35 @@ internal static byte[] DeriveKeyMaterialTruncate( Array.Reverse(result); return result; } + + internal static bool TryDeriveKeyMaterialTruncate( + SafeNCryptSecretHandle secretAgreement, + SecretAgreementFlags flags, + Span destination, + out int bytesWritten) + { + ErrorCode error = NCryptDeriveKey( + secretAgreement, + BCryptNative.KeyDerivationFunction.Raw, + IntPtr.Zero, + destination, + destination.Length, + out int localWritten, + flags); + + switch (error) + { + case ErrorCode.ERROR_SUCCESS: + destination.Slice(0, localWritten).Reverse(); + bytesWritten = localWritten; + return true; + case ErrorCode c when c.IsBufferTooSmall(): + destination.Clear(); + bytesWritten = 0; + return false; + default: + throw error.ToCryptographicException(); + } + } } } diff --git a/src/libraries/Common/src/System/Security/Cryptography/ECCng.ImportExport.NamedCurve.cs b/src/libraries/Common/src/System/Security/Cryptography/ECCng.ImportExport.NamedCurve.cs index 52802f1ff30265..cc7f4655f9bf23 100644 --- a/src/libraries/Common/src/System/Security/Cryptography/ECCng.ImportExport.NamedCurve.cs +++ b/src/libraries/Common/src/System/Security/Cryptography/ECCng.ImportExport.NamedCurve.cs @@ -145,7 +145,8 @@ internal static SafeNCryptKeyHandle ImportKeyBlob( string blobType, ReadOnlySpan keyBlob, string curveName, - SafeNCryptProviderHandle provider) + SafeNCryptProviderHandle provider, + int flags = 0) { ErrorCode errorCode; SafeNCryptKeyHandle keyHandle; @@ -173,7 +174,7 @@ internal static SafeNCryptKeyHandle ImportKeyBlob( out keyHandle, ref MemoryMarshal.GetReference(keyBlob), keyBlob.Length, - 0); + flags); } } diff --git a/src/libraries/Common/src/System/Security/Cryptography/KeyFormatHelper.Encrypted.cs b/src/libraries/Common/src/System/Security/Cryptography/KeyFormatHelper.Encrypted.cs index 629a13ac803fcd..71d397a02d81c2 100644 --- a/src/libraries/Common/src/System/Security/Cryptography/KeyFormatHelper.Encrypted.cs +++ b/src/libraries/Common/src/System/Security/Cryptography/KeyFormatHelper.Encrypted.cs @@ -32,6 +32,29 @@ internal static void ReadEncryptedPkcs8( out ret); } + internal static void ReadEncryptedPkcs8( + string[] validOids, + ReadOnlySpan source, + ReadOnlySpan password, + TState state, + KeyReader keyReader, + out int bytesRead, + out TRet ret) +#if NET + where TState : allows ref struct +#endif + { + ReadEncryptedPkcs8( + validOids, + source, + password, + ReadOnlySpan.Empty, + state, + keyReader, + out bytesRead, + out ret); + } + internal static void ReadEncryptedPkcs8( string[] validOids, ReadOnlySpan source, @@ -50,6 +73,29 @@ internal static void ReadEncryptedPkcs8( out ret); } + internal static void ReadEncryptedPkcs8( + string[] validOids, + ReadOnlySpan source, + ReadOnlySpan passwordBytes, + TState state, + KeyReader keyReader, + out int bytesRead, + out TRet ret) +#if NET + where TState : allows ref struct +#endif + { + ReadEncryptedPkcs8( + validOids, + source, + ReadOnlySpan.Empty, + passwordBytes, + state, + keyReader, + out bytesRead, + out ret); + } + private static void ReadEncryptedPkcs8( string[] validOids, ReadOnlySpan source, @@ -58,6 +104,30 @@ private static void ReadEncryptedPkcs8( KeyReader keyReader, out int bytesRead, out TRet ret) + { + ReadEncryptedPkcs8>( + validOids, + source, + password, + passwordBytes, + keyReader, + static (key, kr, in algId, out ret) => kr(key, algId, out ret), + out bytesRead, + out ret); + } + + private static void ReadEncryptedPkcs8( + string[] validOids, + ReadOnlySpan source, + ReadOnlySpan password, + ReadOnlySpan passwordBytes, + TState state, + KeyReader keyReader, + out int bytesRead, + out TRet ret) +#if NET + where TState : allows ref struct +#endif { int read; ValueEncryptedPrivateKeyInfoAsn epki; @@ -92,6 +162,7 @@ private static void ReadEncryptedPkcs8( ReadPkcs8( validOids, decryptedMemory.Span, + state, keyReader, out int innerRead, out ret); diff --git a/src/libraries/Common/src/System/Security/Cryptography/KeyFormatHelper.cs b/src/libraries/Common/src/System/Security/Cryptography/KeyFormatHelper.cs index 66dc46b83c9ef1..109f25afc5096c 100644 --- a/src/libraries/Common/src/System/Security/Cryptography/KeyFormatHelper.cs +++ b/src/libraries/Common/src/System/Security/Cryptography/KeyFormatHelper.cs @@ -13,6 +13,13 @@ internal static partial class KeyFormatHelper { internal delegate void KeyReader(ReadOnlySpan key, in ValueAlgorithmIdentifierAsn algId, out TRet ret); + internal delegate void KeyReader(ReadOnlySpan key, TState state, in ValueAlgorithmIdentifierAsn algId, out TRet ret) +#if NET + where TState : allows ref struct; +#else + ; +#endif + internal static void ReadSubjectPublicKeyInfo( string[] validOids, ReadOnlySpan source, @@ -78,6 +85,26 @@ internal static void ReadPkcs8( KeyReader keyReader, out int bytesRead, out TRet ret) + { + ReadPkcs8>( + validOids, + source, + keyReader, + static (key, kr, in algId, out ret) => kr(key, algId, out ret), + out bytesRead, + out ret); + } + + internal static void ReadPkcs8( + string[] validOids, + ReadOnlySpan source, + TState state, + KeyReader keyReader, + out int bytesRead, + out TRet ret) +#if NET + where TState : allows ref struct +#endif { try { @@ -91,7 +118,7 @@ internal static void ReadPkcs8( } // Fails if there are unconsumed bytes. - keyReader(privateKeyInfo.PrivateKey, privateKeyInfo.PrivateKeyAlgorithm, out ret); + keyReader(privateKeyInfo.PrivateKey, state, privateKeyInfo.PrivateKeyAlgorithm, out ret); bytesRead = read; } catch (AsnContentException e) diff --git a/src/libraries/Common/src/System/Security/Cryptography/X25519WindowsHelpers.cs b/src/libraries/Common/src/System/Security/Cryptography/X25519WindowsHelpers.cs new file mode 100644 index 00000000000000..dd5f891f08b585 --- /dev/null +++ b/src/libraries/Common/src/System/Security/Cryptography/X25519WindowsHelpers.cs @@ -0,0 +1,221 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Diagnostics; + +namespace System.Security.Cryptography +{ + internal static class X25519WindowsHelpers + { + // https://learn.microsoft.com/en-us/windows/win32/seccng/cng-named-elliptic-curves + internal const string BCRYPT_ECC_CURVE_25519 = "curve25519"; + private const int PublicKeySizeInBytes = X25519DiffieHellman.PublicKeySizeInBytes; + private const int ElementSize = 32; + + // p = 2^255 - 19 in little-endian + private static ReadOnlySpan FieldPrime => + [ + 0xed, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, + ]; + + internal static void ExportKey(ReadOnlySpan exported, bool privateKey, Span destination) + { + Interop.BCrypt.KeyBlobMagicNumber expectedMagicNumber = privateKey ? + Interop.BCrypt.KeyBlobMagicNumber.BCRYPT_ECDH_PRIVATE_GENERIC_MAGIC : + Interop.BCrypt.KeyBlobMagicNumber.BCRYPT_ECDH_PUBLIC_GENERIC_MAGIC; + + unsafe + { + int blobHeaderSize = sizeof(Interop.BCrypt.BCRYPT_ECCKEY_BLOB); + + // For private key we expect three parameters (x, y, d) and for public keys we expect two (x, y). + if (exported.Length < blobHeaderSize + ElementSize * (privateKey ? 3 : 2)) + { + throw new CryptographicException(); + } + + fixed (byte* pExportedSpan = exported) + { + Interop.BCrypt.BCRYPT_ECCKEY_BLOB* blob = (Interop.BCrypt.BCRYPT_ECCKEY_BLOB*)pExportedSpan; + + if (blob->cbKey != ElementSize || blob->Magic != expectedMagicNumber) + { + throw new CryptographicException(SR.Cryptography_NotValidPublicOrPrivateKey); + } + + // The key material after the blob is { x || y }, and optionally d if there is a private key. + // y should always be zero as it is not used for Curve25519 keys. + + // Check y is zero, skip over the blob header and x. + ReadOnlySpan y = new(pExportedSpan + blobHeaderSize + ElementSize, ElementSize); + + // y shouldn't have a value. + if (y.IndexOfAnyExcept((byte)0) >= 0) + { + throw new CryptographicException(SR.Cryptography_NotValidPublicOrPrivateKey); + } + + if (privateKey) + { + ReadOnlySpan d = new(pExportedSpan + blobHeaderSize + ElementSize * 2, ElementSize); + d.CopyTo(destination); + } + else + { + ReadOnlySpan x = new(pExportedSpan + blobHeaderSize, ElementSize); + x.CopyTo(destination); + } + } + } + } + + internal static CryptoPoolLease CreateCngBlob(ReadOnlySpan key, bool privateKey, out byte preservation) + { + Interop.BCrypt.KeyBlobMagicNumber magicNumber = privateKey ? + Interop.BCrypt.KeyBlobMagicNumber.BCRYPT_ECDH_PRIVATE_GENERIC_MAGIC : + Interop.BCrypt.KeyBlobMagicNumber.BCRYPT_ECDH_PUBLIC_GENERIC_MAGIC; + + unsafe + { + int blobHeaderSize = sizeof(Interop.BCrypt.BCRYPT_ECCKEY_BLOB); + int requiredBufferSize = blobHeaderSize + ElementSize * 2; // blob + X, Y + + if (privateKey) + { + requiredBufferSize += ElementSize; // d + } + + CryptoPoolLease lease = CryptoPoolLease.Rent(requiredBufferSize, skipClear: !privateKey); + lease.Span.Clear(); + + fixed (byte* pBlobHeader = lease.Span) + { + Interop.BCrypt.BCRYPT_ECCKEY_BLOB* blob = (Interop.BCrypt.BCRYPT_ECCKEY_BLOB*)pBlobHeader; + blob->Magic = magicNumber; + blob->cbKey = ElementSize; + } + + if (privateKey) + { + // This builds a blob of { x || y || d }. x is the public key, and we leave it as all zeros + // and CNG will reconstruct the public key from the private key. + // y is not used for Curve25519 so we leave it as zeros. + // d follows y. Since we zeroed the whole blob, skip over the header, x, and y and write d. + Span destination = lease.Span.Slice(blobHeaderSize + ElementSize * 2, ElementSize); + key.CopyTo(destination); + + // Any fixup of the key is done in-place in the rented blob, which gets zeroed later. + preservation = FixupPrivateScalar(destination); + } + else + { + // Otherwise if we are importing the public key, write x after the header. + Span destination = lease.Span.Slice(blobHeaderSize, ElementSize); + key.CopyTo(destination); + preservation = 0; + } + + return lease; + } + } + + internal static byte FixupPrivateScalar(Span bytes) + { + byte preservation = (byte)(bytes[0] & 0b111 | bytes[^1] & 0b11000000); + + // From RFC 7748: + // For X25519, in + // order to decode 32 random bytes as an integer scalar, set the three + // least significant bits of the first byte and the most significant bit + // of the last to zero, set the second most significant bit of the last + // byte to 1 and, finally, decode as little-endian. + // + // Most other X25519 implementations do this for you when importing a private key. CNG does not, so we + // apply the scalar fixup here. + // + // If we import a key that requires us to modify it, we store the modified bits in a byte. This byte does + // not effectively contain any private key material since these bits are always coerced. However we want + // keys to roundtrip correctly. + bytes[0] &= 0b11111000; + bytes[^1] &= 0b01111111; + bytes[^1] |= 0b01000000; + return preservation; + } + + internal static void RefixPrivateScalar(Span bytes, byte preservation) + { + bytes[0] = (byte)((preservation & 0b111) | (bytes[0] & 0b11111000)); + bytes[^1] = (byte)((preservation & 0b11000000) | (bytes[^1] & 0b00111111)); + } + + internal static bool ReducePublicKey(ReadOnlySpan publicKey, Span reduced) + { + Debug.Assert(publicKey.Length == PublicKeySizeInBytes); + Debug.Assert(reduced.Length == PublicKeySizeInBytes); + + // RFC 7748 Section 5: "implementations of X25519 MUST mask the most significant + // bit in the final byte" and "Implementations MUST accept non-canonical values and + // process them as if they had been reduced modulo the field prime." + // + // CNG rejects non-canonical u-coordinates (values >= p = 2^255 - 19) and does not + // mask the high bit. We handle both by masking the high bit then if the value is + // non-canonical, subtract p to reduce it. Since all values are < 2^255 after + // masking and p = 2^255 - 19, a single subtraction suffices. + publicKey.CopyTo(reduced); + reduced[^1] &= 0x7F; + + bool requiredReduction = false; + + if (IsNonCanonicalPublicKey(reduced)) + { + requiredReduction = true; + ReducePublicKey(reduced); + } + else if ((publicKey[^1] & 0x80) != 0) + { + requiredReduction = true; + } + + return requiredReduction; + } + + private static bool IsNonCanonicalPublicKey(ReadOnlySpan key) + { + Debug.Assert(key.Length == PublicKeySizeInBytes); + Debug.Assert((key[^1] & 0x80) == 0); + + // Compare key >= p (little-endian). Since key < 2^255 (high bit masked) + // and p = 2^255 - 19, a non-canonical value is in [p, 2^255 - 1]. + // Compare from most significant byte to least significant. + for (int i = PublicKeySizeInBytes - 1; i >= 0; i--) + { + if (key[i] > FieldPrime[i]) + return true; + if (key[i] < FieldPrime[i]) + return false; + } + + // key == p, which is also non-canonical (reduces to 0) + return true; + } + + private static void ReducePublicKey(Span key) + { + Debug.Assert(key.Length == PublicKeySizeInBytes); + + // Subtract p from key. Since we only call this when key >= p and key < 2^255, + // a single subtraction is sufficient: key = key - p. + int borrow = 0; + + for (int i = 0; i < PublicKeySizeInBytes; i++) + { + int diff = key[i] - FieldPrime[i] - borrow; + key[i] = (byte)diff; + borrow = (diff < 0) ? 1 : 0; + } + + Debug.Assert(borrow == 0); + } + } +} diff --git a/src/libraries/System.Security.Cryptography/ref/System.Security.Cryptography.cs b/src/libraries/System.Security.Cryptography/ref/System.Security.Cryptography.cs index 48693c2beaa2ae..ebd3d646bdbc63 100644 --- a/src/libraries/System.Security.Cryptography/ref/System.Security.Cryptography.cs +++ b/src/libraries/System.Security.Cryptography/ref/System.Security.Cryptography.cs @@ -3494,6 +3494,17 @@ public void ExportPublicKey(System.Span destination) { } protected abstract bool TryExportPkcs8PrivateKeyCore(System.Span destination, out int bytesWritten); public bool TryExportSubjectPublicKeyInfo(System.Span destination, out int bytesWritten) { throw null; } } + public sealed partial class X25519DiffieHellmanCng : System.Security.Cryptography.X25519DiffieHellman + { + [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")] + public X25519DiffieHellmanCng(System.Security.Cryptography.CngKey key) { } + protected override void DeriveRawSecretAgreementCore(System.Security.Cryptography.X25519DiffieHellman otherParty, System.Span destination) { } + protected override void Dispose(bool disposing) { } + protected override void ExportPrivateKeyCore(System.Span destination) { } + protected override void ExportPublicKeyCore(System.Span destination) { } + public System.Security.Cryptography.CngKey GetKey() { throw null; } + protected override bool TryExportPkcs8PrivateKeyCore(System.Span destination, out int bytesWritten) { throw null; } + } public sealed partial class X25519DiffieHellmanOpenSsl : System.Security.Cryptography.X25519DiffieHellman { [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("android")] diff --git a/src/libraries/System.Security.Cryptography/src/Resources/Strings.resx b/src/libraries/System.Security.Cryptography/src/Resources/Strings.resx index 4086d30920f071..9987d8ea2ea082 100644 --- a/src/libraries/System.Security.Cryptography/src/Resources/Strings.resx +++ b/src/libraries/System.Security.Cryptography/src/Resources/Strings.resx @@ -255,6 +255,9 @@ Keys used with the MLKemCng algorithm must have an algorithm group of MLKem. + + Keys used with the X25519DiffieHellmanCng algorithm must have an algorithm group of ECDiffieHellman using curve25519. + Keys used with the RSACng algorithm must have an algorithm group of RSA. diff --git a/src/libraries/System.Security.Cryptography/src/System.Security.Cryptography.csproj b/src/libraries/System.Security.Cryptography/src/System.Security.Cryptography.csproj index e4bdb62e1c1dd0..344b9f60f008ed 100644 --- a/src/libraries/System.Security.Cryptography/src/System.Security.Cryptography.csproj +++ b/src/libraries/System.Security.Cryptography/src/System.Security.Cryptography.csproj @@ -688,6 +688,7 @@ + @@ -1948,6 +1949,8 @@ Link="Common\System\Security\Cryptography\RSACng.SignVerify.cs" /> + + diff --git a/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/Cng.NotSupported.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/Cng.NotSupported.cs index 7148d243f1c220..5c5bd54dccdb08 100644 --- a/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/Cng.NotSupported.cs +++ b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/Cng.NotSupported.cs @@ -487,4 +487,42 @@ protected override bool TryExportPkcs8PrivateKeyCore(Span destination, out protected override bool VerifyDataCore(ReadOnlySpan data, ReadOnlySpan context, ReadOnlySpan signature) => throw new PlatformNotSupportedException(SR.PlatformNotSupported_CryptographyCng); } + + public sealed partial class X25519DiffieHellmanCng : X25519DiffieHellman + { + public partial X25519DiffieHellmanCng(CngKey key) + { + throw new PlatformNotSupportedException(SR.PlatformNotSupported_CryptographyCng); + } + + public partial CngKey GetKey() + { + throw new PlatformNotSupportedException(SR.PlatformNotSupported_CryptographyCng); + } + + protected override partial void DeriveRawSecretAgreementCore(X25519DiffieHellman otherParty, Span destination) + { + throw new PlatformNotSupportedException(SR.PlatformNotSupported_CryptographyCng); + } + + protected override partial void ExportPrivateKeyCore(Span destination) + { + throw new PlatformNotSupportedException(SR.PlatformNotSupported_CryptographyCng); + } + + protected override partial void ExportPublicKeyCore(Span destination) + { + throw new PlatformNotSupportedException(SR.PlatformNotSupported_CryptographyCng); + } + + protected override partial bool TryExportPkcs8PrivateKeyCore(Span destination, out int bytesWritten) + { + throw new PlatformNotSupportedException(SR.PlatformNotSupported_CryptographyCng); + } + + protected override partial void Dispose(bool disposing) + { + throw new PlatformNotSupportedException(SR.PlatformNotSupported_CryptographyCng); + } + } } diff --git a/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/X25519DiffieHellmanCng.Windows.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/X25519DiffieHellmanCng.Windows.cs new file mode 100644 index 00000000000000..4c36b457306c85 --- /dev/null +++ b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/X25519DiffieHellmanCng.Windows.cs @@ -0,0 +1,222 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Diagnostics; +using System.Formats.Asn1; +using System.Security.Cryptography.Asn1; +using Microsoft.Win32.SafeHandles; +using Internal.Cryptography; + +using ErrorCode = Interop.NCrypt.ErrorCode; + +namespace System.Security.Cryptography +{ + public sealed partial class X25519DiffieHellmanCng : X25519DiffieHellman + { + private CngKey _key; + private static readonly string[] s_eccKeyOid = [Oids.EcPublicKey]; + + public partial X25519DiffieHellmanCng(CngKey key) + { + Debug.Assert(Helpers.IsOSPlatformWindows); + ArgumentNullException.ThrowIfNull(key); + ThrowIfNotSupported(); + + if (key.AlgorithmGroup != CngAlgorithmGroup.ECDiffieHellman || + key.GetCurveName(out _) != X25519WindowsHelpers.BCRYPT_ECC_CURVE_25519) + { + throw new ArgumentException(SR.Cryptography_ArgX25519RequiresX25519Key, nameof(key)); + } + + _key = CngHelpers.Duplicate(key.HandleNoDuplicate, key.IsEphemeral); + } + + public partial CngKey GetKey() + { + ThrowIfDisposed(); + return CngHelpers.Duplicate(_key.HandleNoDuplicate, _key.IsEphemeral); + } + + protected override partial void DeriveRawSecretAgreementCore(X25519DiffieHellman otherParty, Span destination) + { + // We intentionally don't special case otherParty being an instance of X25519DiffieHellmanCng and always + // export the public key into the current instance's provider. + Span publicKeyBuffer = stackalloc byte[PublicKeySizeInBytes * 2]; + Span publicKeyBytes = publicKeyBuffer.Slice(0, PublicKeySizeInBytes); + Span reducedPublicKey = publicKeyBuffer.Slice(PublicKeySizeInBytes, PublicKeySizeInBytes); + otherParty.ExportPublicKey(publicKeyBytes); + X25519WindowsHelpers.ReducePublicKey(publicKeyBytes, reducedPublicKey); + + // CNG does not permit cross-provider key agreements. Import the public key in to the same provider + // as the current key. + CngProvider provider = _key.Provider ?? CngProvider.MicrosoftSoftwareKeyStorageProvider; + + using (CryptoPoolLease lease = X25519WindowsHelpers.CreateCngBlob(reducedPublicKey, privateKey: false, out _)) + using (SafeNCryptProviderHandle providerHandle = provider.OpenStorageProvider()) + { + int flags = 0; + + if (provider == CngProvider.MicrosoftSoftwareKeyStorageProvider) + { + const int NCRYPT_NO_KEY_VALIDATION = (int)Interop.BCrypt.BCryptImportKeyPairFlags.BCRYPT_NO_KEY_VALIDATION; + flags |= NCRYPT_NO_KEY_VALIDATION; + } + + SafeNCryptKeyHandle keyHandle = ECCng.ImportKeyBlob( + CngKeyBlobFormat.EccPublicBlob.Format, + lease.Span, + X25519WindowsHelpers.BCRYPT_ECC_CURVE_25519, + providerHandle, + flags); + + using (keyHandle) + using (SafeNCryptSecretHandle secretAgreement = Interop.NCrypt.DeriveSecretAgreement( + _key.HandleNoDuplicate, + keyHandle)) + { + bool success = Interop.NCrypt.TryDeriveKeyMaterialTruncate( + secretAgreement, + Interop.NCrypt.SecretAgreementFlags.None, + destination, + out int bytesWritten); + + if (!success || bytesWritten != SecretAgreementSizeInBytes) + { + // The destination should have already been pre-sized to a well-behaving X25519 implementation + // but a provider could be implemented incorrectly. Zero whatever was written since it is + // incorrect. + CryptographicOperations.ZeroMemory(destination); + throw new CryptographicException(); + } + + // If the CngKey was created with NCRYPT_NO_KEY_VALIDATION then low-order public keys can be imported. + // Block low-order key agreements that result in an all-zero secret. + if (CryptographicOperations.FixedTimeEquals(destination, 0)) + { + throw new CryptographicException(); + } + } + } + } + + protected override partial void ExportPublicKeyCore(Span destination) + { + Debug.Assert(destination.Length == PublicKeySizeInBytes); + ExportKeyFromBlob(_key, privateKey: false, destination); + } + + protected override partial void ExportPrivateKeyCore(Span destination) + { + Debug.Assert(destination.Length == PrivateKeySizeInBytes); + + if (CngPkcs8.AllowsOnlyEncryptedExport(_key)) + { + ExportPrivateKeyFromEncryptedPkcs8(destination); + } + else + { + ExportKeyFromBlob(_key, privateKey: true, destination); + } + } + + protected override partial bool TryExportPkcs8PrivateKeyCore(Span destination, out int bytesWritten) + { + // This will use ExportPrivateKeyCore which, in turn, will handle encrypted-only exports + // so we don't handle it here. We cannot use the PKCS#8 that CNG gives us - it does not understand + // RFC 8410 OIDs so X25519 keys are exported with explicit parameters. Since the PKCS#8 would need to be + // re-assembled anyway, let it use the existing exporter instead. + return TryExportPkcs8PrivateKeyImpl(destination, out bytesWritten); + } + + protected override partial void Dispose(bool disposing) + { + if (disposing) + { + _key?.Dispose(); + _key = null!; + } + + base.Dispose(disposing); + } + + private static void ExportKeyFromBlob(CngKey key, bool privateKey, Span destination) + { + int numBytesNeeded; + string format = privateKey ? + CngKeyBlobFormat.EccPrivateBlob.Format : + CngKeyBlobFormat.EccPublicBlob.Format; + + ErrorCode errorCode = Interop.NCrypt.NCryptExportKey( + key.HandleNoDuplicate, + IntPtr.Zero, + format, + IntPtr.Zero, + null, + 0, + out numBytesNeeded, + 0); + + if (errorCode != ErrorCode.ERROR_SUCCESS) + { + throw errorCode.ToCryptographicException(); + } + + using (CryptoPoolLease lease = CryptoPoolLease.Rent(numBytesNeeded, skipClear: !privateKey)) + { + errorCode = Interop.NCrypt.NCryptExportKey( + key.HandleNoDuplicate, + IntPtr.Zero, + format, + IntPtr.Zero, + lease.Span, + lease.Span.Length, + out numBytesNeeded, + 0); + + if (errorCode != ErrorCode.ERROR_SUCCESS) + { + throw errorCode.ToCryptographicException(); + } + + X25519WindowsHelpers.ExportKey(lease.Span.Slice(0, numBytesNeeded), privateKey, destination); + } + } + + private void ExportPrivateKeyFromEncryptedPkcs8(Span destination) + { + const string TemporaryExportPassword = "DotnetExportPhrase"; + byte[] exported = _key.ExportPkcs8KeyBlob(TemporaryExportPassword, 1); + + using (PinAndClear.Track(exported)) + { + KeyFormatHelper.ReadEncryptedPkcs8( + s_eccKeyOid, + exported, + TemporaryExportPassword, + destination, + static (ReadOnlySpan key, Span destination, in ValueAlgorithmIdentifierAsn algId, out object? ret) => + { + if (algId.Algorithm != Oids.EcPublicKey) + { + throw new CryptographicException(SR.Cryptography_NotValidPrivateKey); + } + + // Windows currently exports X25519 keys as an explicit curve. However + // since the constructor validates that the CngKey curve is curve25519 we can be reasonably sure + // that the key is for X25519, so we don't validate the parameters. + ValueECPrivateKey.Decode(key, AsnEncodingRules.BER, out ValueECPrivateKey ecKey); + + if (ecKey.PrivateKey.Length != PrivateKeySizeInBytes) + { + throw new CryptographicException(SR.Cryptography_NotValidPrivateKey); + } + + ecKey.PrivateKey.CopyTo(destination); + ret = (object?)null; + }, + out _, + out _); + } + } + } +} diff --git a/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/X25519DiffieHellmanCng.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/X25519DiffieHellmanCng.cs new file mode 100644 index 00000000000000..27e77afa6049fc --- /dev/null +++ b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/X25519DiffieHellmanCng.cs @@ -0,0 +1,70 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Runtime.Versioning; + +namespace System.Security.Cryptography +{ + /// + /// Provides a Cryptography Next Generation (CNG) implementation of X25519 Diffie-Hellman. + /// + /// + /// + /// This algorithm is specified by RFC 7748. + /// + /// + /// Developers are encouraged to program against the X25519DiffieHellman base class, + /// rather than any specific derived class. + /// The derived classes are intended for interop with the underlying system + /// cryptographic libraries. + /// + /// + public sealed partial class X25519DiffieHellmanCng : X25519DiffieHellman + { + /// + /// Initializes a new instance of the class + /// by using the specified . + /// + /// + /// The key that will be used as input to the cryptographic operations performed by the current object. + /// + /// + /// is . + /// + /// + /// does not specify an X25519 Diffie-Hellman key. + /// + /// + /// Cryptography Next Generation (CNG) classes are not supported on this system. + /// + [SupportedOSPlatform("windows")] + public partial X25519DiffieHellmanCng(CngKey key); + + /// + /// Gets a new representing the key used by the current instance. + /// + /// + /// This instance has been disposed. + /// + /// + /// This object is not the same as the one passed to , + /// if that constructor was used. However, it will point to the same CNG key. + /// + public partial CngKey GetKey(); + + /// + protected override partial void DeriveRawSecretAgreementCore(X25519DiffieHellman otherParty, Span destination); + + /// + protected override partial void ExportPublicKeyCore(Span destination); + + /// + protected override partial void ExportPrivateKeyCore(Span destination); + + /// + protected override partial bool TryExportPkcs8PrivateKeyCore(Span destination, out int bytesWritten); + + /// + protected override partial void Dispose(bool disposing); + } +} diff --git a/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/X25519DiffieHellmanImplementation.Windows.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/X25519DiffieHellmanImplementation.Windows.cs index 26652305376d6a..dcaea940398d3d 100644 --- a/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/X25519DiffieHellmanImplementation.Windows.cs +++ b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/X25519DiffieHellmanImplementation.Windows.cs @@ -13,17 +13,8 @@ namespace System.Security.Cryptography { internal sealed class X25519DiffieHellmanImplementation : X25519DiffieHellman { - // https://learn.microsoft.com/en-us/windows/win32/seccng/cng-named-elliptic-curves - private const string BCRYPT_ECC_CURVE_25519 = "curve25519"; private static readonly SafeBCryptAlgorithmHandle? s_algHandle = OpenAlgorithmHandle(); - // p = 2^255 - 19 in little-endian - private static ReadOnlySpan FieldPrime => - [ - 0xed, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, - ]; - private readonly SafeBCryptKeyHandle _key; private readonly bool _hasPrivate; private readonly byte _privatePreservation; @@ -65,7 +56,7 @@ protected override unsafe void DeriveRawSecretAgreementCore(X25519DiffieHellman Span publicKeyBytes = stackalloc byte[PublicKeySizeInBytes]; otherParty.ExportPublicKey(publicKeyBytes); - using (X25519DiffieHellmanImplementation otherPartyImplementation = X25519DiffieHellmanImplementation.ImportPublicKeyImpl(publicKeyBytes)) + using (X25519DiffieHellmanImplementation otherPartyImplementation = ImportPublicKeyImpl(publicKeyBytes)) using (SafeBCryptSecretHandle secret = Interop.BCrypt.BCryptSecretAgreement(_key, otherPartyImplementation._key)) { Interop.BCrypt.BCryptDeriveKey( @@ -103,7 +94,7 @@ protected override unsafe void DeriveRawSecretAgreementCore(X25519DiffieHellman protected override void ExportPrivateKeyCore(Span destination) { ExportKey(true, destination); - RefixPrivateScalar(destination, _privatePreservation); + X25519WindowsHelpers.RefixPrivateScalar(destination, _privatePreservation); } protected override void ExportPublicKeyCore(Span destination) @@ -161,35 +152,17 @@ internal static X25519DiffieHellmanImplementation ImportPrivateKeyImpl(ReadOnlyS internal static unsafe X25519DiffieHellmanImplementation ImportPublicKeyImpl(ReadOnlySpan source) { - // RFC 7748 Section 5: "implementations of X25519 MUST mask the most significant - // bit in the final byte" and "Implementations MUST accept non-canonical values and - // process them as if they had been reduced modulo the field prime." - // - // CNG rejects non-canonical u-coordinates (values >= p = 2^255 - 19) and does not - // mask the high bit. We handle both by masking the high bit then if the value is - // non-canonical, subtract p to reduce it. Since all values are < 2^255 after - // masking and p = 2^255 - 19, a single subtraction suffices. - Span reduced = stackalloc byte[PublicKeySizeInBytes]; - source.CopyTo(reduced); - reduced[^1] &= 0x7F; - - byte[]? originalPublicKey = null; - - if (IsNonCanonicalPublicKey(reduced)) - { - originalPublicKey = source.ToArray(); - ReducePublicKey(reduced); - } - else if ((source[^1] & 0x80) != 0) - { - // The value is canonical but has the high bit set. CNG doesn't mask it, - // so we need to clear it before import and preserve the original for export. - originalPublicKey = source.ToArray(); - } + Span reducedPublicKey = stackalloc byte[PublicKeySizeInBytes]; + bool requiredReduction = X25519WindowsHelpers.ReducePublicKey(source, reducedPublicKey); + + SafeBCryptKeyHandle key = ImportKey(false, reducedPublicKey, out _); - SafeBCryptKeyHandle key = ImportKey(false, reduced, out _); Debug.Assert(!key.IsInvalid); - return new X25519DiffieHellmanImplementation(key, hasPrivate: false, privatePreservation: 0, originalPublicKey); + return new X25519DiffieHellmanImplementation( + key, + hasPrivate: false, + privatePreservation: 0, + requiredReduction ? source.ToArray() : null); } private void ExportKey(bool privateKey, Span destination) @@ -198,51 +171,11 @@ private void ExportKey(bool privateKey, Span destination) Interop.BCrypt.KeyBlobType.BCRYPT_ECCPRIVATE_BLOB : Interop.BCrypt.KeyBlobType.BCRYPT_ECCPUBLIC_BLOB; - Interop.BCrypt.KeyBlobMagicNumber expectedMagicNumber = privateKey ? - Interop.BCrypt.KeyBlobMagicNumber.BCRYPT_ECDH_PRIVATE_GENERIC_MAGIC : - Interop.BCrypt.KeyBlobMagicNumber.BCRYPT_ECDH_PUBLIC_GENERIC_MAGIC; - ArraySegment key = Interop.BCrypt.BCryptExportKey(_key, blobType); try { - unsafe - { - int blobHeaderSize = sizeof(Interop.BCrypt.BCRYPT_ECCKEY_BLOB); - ReadOnlySpan exported = key; - - fixed (byte* pExportedSpan = exported) - { - const int ElementSize = 32; - Interop.BCrypt.BCRYPT_ECCKEY_BLOB* blob = (Interop.BCrypt.BCRYPT_ECCKEY_BLOB*)pExportedSpan; - - if (blob->cbKey != ElementSize || blob->Magic != expectedMagicNumber) - { - throw new CryptographicException(SR.Cryptography_NotValidPublicOrPrivateKey); - } - - // x - ReadOnlySpan y = new(pExportedSpan + blobHeaderSize + ElementSize, ElementSize); - // d - - // y shouldn't have a value. - if (y.IndexOfAnyExcept((byte)0) >= 0) - { - throw new CryptographicException(SR.Cryptography_NotValidPublicOrPrivateKey); - } - - if (privateKey) - { - ReadOnlySpan d = new(pExportedSpan + blobHeaderSize + ElementSize * 2, ElementSize); - d.CopyTo(destination); - } - else - { - ReadOnlySpan x = new(pExportedSpan + blobHeaderSize, ElementSize); - x.CopyTo(destination); - } - } - } + X25519WindowsHelpers.ExportKey(key, privateKey, destination); } finally { @@ -264,134 +197,17 @@ private static SafeBCryptKeyHandle ImportKey(bool privateKey, ReadOnlySpan Interop.BCrypt.KeyBlobType.BCRYPT_ECCPRIVATE_BLOB : Interop.BCrypt.KeyBlobType.BCRYPT_ECCPUBLIC_BLOB; - Interop.BCrypt.KeyBlobMagicNumber magicNumber = privateKey ? - Interop.BCrypt.KeyBlobMagicNumber.BCRYPT_ECDH_PRIVATE_GENERIC_MAGIC : - Interop.BCrypt.KeyBlobMagicNumber.BCRYPT_ECDH_PUBLIC_GENERIC_MAGIC; - - unsafe + using (CryptoPoolLease lease = X25519WindowsHelpers.CreateCngBlob(key, privateKey, out preservation)) { - int blobHeaderSize = sizeof(Interop.BCrypt.BCRYPT_ECCKEY_BLOB); - const int ElementSize = 32; - int requiredBufferSize = blobHeaderSize + ElementSize * 2; // blob + X, Y - if (privateKey) - { - requiredBufferSize += ElementSize; // d - } - - byte[] rented = CryptoPool.Rent(requiredBufferSize); - Span buffer = rented.AsSpan(0, requiredBufferSize); - buffer.Clear(); - - try - { - fixed (byte* pBlobHeader = buffer) - { - Interop.BCrypt.BCRYPT_ECCKEY_BLOB* blob = (Interop.BCrypt.BCRYPT_ECCKEY_BLOB*)pBlobHeader; - blob->Magic = magicNumber; - blob->cbKey = ElementSize; - } - - if (privateKey) - { - Span destination = buffer.Slice(blobHeaderSize + ElementSize * 2, ElementSize); - key.CopyTo(destination); - preservation = FixupPrivateScalar(destination); - } - else - { - Span destination = buffer.Slice(blobHeaderSize, ElementSize); - key.CopyTo(destination); - preservation = 0; - } - - return Interop.BCrypt.BCryptImportKeyPair( - s_algHandle, - blobType, - buffer, - Interop.BCrypt.BCryptImportKeyPairFlags.BCRYPT_NO_KEY_VALIDATION); - } - finally - { - if (privateKey) - { - CryptoPool.Return(rented); - } - else - { - CryptoPool.Return(rented, clearSize: 0); - } - } + return Interop.BCrypt.BCryptImportKeyPair( + s_algHandle, + blobType, + lease.Span, + Interop.BCrypt.BCryptImportKeyPairFlags.BCRYPT_NO_KEY_VALIDATION); } } - private static byte FixupPrivateScalar(Span bytes) - { - byte preservation = (byte)(bytes[0] & 0b111 | bytes[^1] & 0b11000000); - - // From RFC 7748: - // For X25519, in - // order to decode 32 random bytes as an integer scalar, set the three - // least significant bits of the first byte and the most significant bit - // of the last to zero, set the second most significant bit of the last - // byte to 1 and, finally, decode as little-endian. - // - // Most other X25519 implementations do this for you when importing a private key. CNG does not, so we - // apply the scalar fixup here. - // - // If we import a key that requires us to modify it, we store the modified bits in a byte. This byte does - // not effectively contain any private key material since these bits are always coerced. However we want - // keys to roundtrip correctly. - bytes[0] &= 0b11111000; - bytes[^1] &= 0b01111111; - bytes[^1] |= 0b01000000; - return preservation; - } - - private static void RefixPrivateScalar(Span bytes, byte preservation) - { - bytes[0] = (byte)((preservation & 0b111) | (bytes[0] & 0b11111000)); - bytes[^1] = (byte)((preservation & 0b11000000) | (bytes[^1] & 0b00111111)); - } - - private static bool IsNonCanonicalPublicKey(ReadOnlySpan key) - { - Debug.Assert(key.Length == PublicKeySizeInBytes); - Debug.Assert((key[^1] & 0x80) == 0); - - // Compare key >= p (little-endian). Since key < 2^255 (high bit masked) - // and p = 2^255 - 19, a non-canonical value is in [p, 2^255 - 1]. - // Compare from most significant byte to least significant. - for (int i = PublicKeySizeInBytes - 1; i >= 0; i--) - { - if (key[i] > FieldPrime[i]) - return true; - if (key[i] < FieldPrime[i]) - return false; - } - - // key == p, which is also non-canonical (reduces to 0) - return true; - } - - private static void ReducePublicKey(Span key) - { - Debug.Assert(key.Length == PublicKeySizeInBytes); - - // Subtract p from key. Since we only call this when key >= p and key < 2^255, - // a single subtraction is sufficient: key = key - p. - int borrow = 0; - - for (int i = 0; i < PublicKeySizeInBytes; i++) - { - int diff = key[i] - FieldPrime[i] - borrow; - key[i] = (byte)diff; - borrow = (diff < 0) ? 1 : 0; - } - - Debug.Assert(borrow == 0); - } - private static SafeBCryptAlgorithmHandle? OpenAlgorithmHandle() { NTSTATUS status = Interop.BCrypt.BCryptOpenAlgorithmProvider( @@ -408,13 +224,13 @@ private static void ReducePublicKey(Span key) unsafe { - fixed (char* pbInput = BCRYPT_ECC_CURVE_25519) + fixed (char* pbInput = X25519WindowsHelpers.BCRYPT_ECC_CURVE_25519) { status = Interop.BCrypt.BCryptSetProperty( hAlgorithm, KeyPropertyName.ECCCurveName, pbInput, - ((uint)BCRYPT_ECC_CURVE_25519.Length + 1) * 2, + ((uint)X25519WindowsHelpers.BCRYPT_ECC_CURVE_25519.Length + 1) * 2, 0); } } diff --git a/src/libraries/System.Security.Cryptography/tests/CngHelpers.cs b/src/libraries/System.Security.Cryptography/tests/CngHelpers.cs new file mode 100644 index 00000000000000..056c59e1fde897 --- /dev/null +++ b/src/libraries/System.Security.Cryptography/tests/CngHelpers.cs @@ -0,0 +1,15 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using Internal.Cryptography; + +namespace System.Security.Cryptography +{ + internal static class CngHelpers + { + public static CryptographicException ToCryptographicException(this Interop.NCrypt.ErrorCode errorCode) + { + return ((int)errorCode).ToCryptographicException(); + } + } +} diff --git a/src/libraries/System.Security.Cryptography/tests/System.Security.Cryptography.Tests.csproj b/src/libraries/System.Security.Cryptography/tests/System.Security.Cryptography.Tests.csproj index 396242cc2d09ad..f490702df59f7b 100644 --- a/src/libraries/System.Security.Cryptography/tests/System.Security.Cryptography.Tests.csproj +++ b/src/libraries/System.Security.Cryptography/tests/System.Security.Cryptography.Tests.csproj @@ -693,12 +693,32 @@ + + + + + + + + + + + diff --git a/src/libraries/System.Security.Cryptography/tests/X25519DiffieHellmanBaseTests.cs b/src/libraries/System.Security.Cryptography/tests/X25519DiffieHellmanBaseTests.cs index 4dc90d5b15952d..d91bb42514237c 100644 --- a/src/libraries/System.Security.Cryptography/tests/X25519DiffieHellmanBaseTests.cs +++ b/src/libraries/System.Security.Cryptography/tests/X25519DiffieHellmanBaseTests.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.Collections.Generic; +using System.Diagnostics; using System.Text; using Test.Cryptography; using Xunit; @@ -17,6 +18,7 @@ public abstract class X25519DiffieHellmanBaseTests public abstract X25519DiffieHellman GenerateKey(); public abstract X25519DiffieHellman ImportPrivateKey(ReadOnlySpan source); public abstract X25519DiffieHellman ImportPublicKey(ReadOnlySpan source); + public virtual bool CanRoundTripKeys => true; // SymCrypt, thus SCOSSL, is stricter about keys it is willing to import. These keys fall in to // two buckets. @@ -219,7 +221,7 @@ public void ExportPkcs8PrivateKey_Roundtrip() AssertExportPkcs8PrivateKey(xdh, pkcs8 => { using X25519DiffieHellman imported = X25519DiffieHellman.ImportPkcs8PrivateKey(pkcs8); - AssertExtensions.SequenceEqual( + AssertPrivateKey( X25519DiffieHellmanTestData.AlicePrivateKey, imported.ExportPrivateKey()); }); @@ -247,7 +249,7 @@ public void ExportEncryptedPkcs8PrivateKey_Roundtrip() X25519DiffieHellmanTestData.EncryptedPrivateKeyPassword, pkcs8); - AssertExtensions.SequenceEqual( + AssertPrivateKey( X25519DiffieHellmanTestData.AlicePrivateKey, imported.ExportPrivateKey()); }); @@ -321,23 +323,22 @@ public static IEnumerable ExportPkcs8Parameters public void PrivateKey_Roundtrip_UnclampedScalar() { byte[] privateKey = X25519DiffieHellmanTestData.BobPrivateKey; + using X25519DiffieHellman xdh = ImportPrivateKey(privateKey); + AssertPrivateKey(privateKey, xdh.ExportPrivateKey()); - AssertExtensions.SequenceEqual(privateKey, xdh.ExportPrivateKey()); AssertExtensions.SequenceEqual(X25519DiffieHellmanTestData.BobPublicKey, xdh.ExportPublicKey()); byte[] pkcs8 = xdh.ExportPkcs8PrivateKey(); using X25519DiffieHellman reimported = X25519DiffieHellman.ImportPkcs8PrivateKey(pkcs8); - AssertExtensions.SequenceEqual(privateKey, reimported.ExportPrivateKey()); + AssertPrivateKey(privateKey, reimported.ExportPrivateKey()); } [Fact] public void PrivateKey_Roundtrip_ClampedScalar() { byte[] privateKey = (byte[])X25519DiffieHellmanTestData.AlicePrivateKey.Clone(); - privateKey[0] &= 0b11111000; - privateKey[^1] &= 0b01111111; - privateKey[^1] |= 0b01000000; + ClampPrivateKey(privateKey); using X25519DiffieHellman xdh = ImportPrivateKey(privateKey); AssertExtensions.SequenceEqual(privateKey, xdh.ExportPrivateKey()); @@ -482,6 +483,28 @@ private static byte[] DoTryUntilDone(TryExportFunc func) return buffer.AsSpan(0, written).ToArray(); } + private static void ClampPrivateKey(Span privateKey) + { + Debug.Assert(privateKey.Length == X25519DiffieHellman.PrivateKeySizeInBytes); + privateKey[0] &= 0b11111000; + privateKey[^1] &= 0b01111111; + privateKey[^1] |= 0b01000000; + } + + private void AssertPrivateKey(ReadOnlySpan expectedPrivateKey, ReadOnlySpan actualPrivateKey) + { + if (CanRoundTripKeys) + { + AssertExtensions.SequenceEqual(expectedPrivateKey, actualPrivateKey); + } + else + { + byte[] clampedKey = expectedPrivateKey.ToArray(); + ClampPrivateKey(clampedKey); + AssertExtensions.SequenceEqual(clampedKey, actualPrivateKey); + } + } + /// /// A wrapper around an X25519DiffieHellman instance that is not the platform's /// internal implementation type. This forces the DeriveRawSecretAgreementCore fallback diff --git a/src/libraries/System.Security.Cryptography/tests/X25519DiffieHellmanCngTests.cs b/src/libraries/System.Security.Cryptography/tests/X25519DiffieHellmanCngTests.cs new file mode 100644 index 00000000000000..b50adbbffac1b0 --- /dev/null +++ b/src/libraries/System.Security.Cryptography/tests/X25519DiffieHellmanCngTests.cs @@ -0,0 +1,177 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Text; +using Microsoft.Win32.SafeHandles; +using Test.Cryptography; +using Xunit; + +namespace System.Security.Cryptography.Tests +{ + [ConditionalClass(typeof(X25519DiffieHellman), nameof(X25519DiffieHellman.IsSupported))] + public sealed class X25519DiffieHellmanExportableCngTests : X25519DiffieHellmanCngTests + { + protected override CngExportPolicies ExportPolicy => CngExportPolicies.AllowExport; + } + + [ConditionalClass(typeof(X25519DiffieHellman), nameof(X25519DiffieHellman.IsSupported))] + public sealed class X25519DiffieHellmanPlaintextExportableCngTests : X25519DiffieHellmanCngTests + { + protected override CngExportPolicies ExportPolicy => + CngExportPolicies.AllowExport | + CngExportPolicies.AllowPlaintextExport; + } + + [ConditionalClass(typeof(X25519DiffieHellman), nameof(X25519DiffieHellman.IsSupported))] + public static class X25519DiffieHellmanCngContractTests + { + [Fact] + public static void ArgValidation_Ctor_NullKey_Throws() + { + Assert.Throws("key", static () => new X25519DiffieHellmanCng(null)); + } + + [Fact] + public static void ArgValidation_Ctor_WrongAlgorithmGroup() + { + using CngKey key = CngKey.Create(CngAlgorithm.Rsa); + Assert.Throws("key", () => new X25519DiffieHellmanCng(key)); + } + + [Fact] + public static void ArgValidation_Ctor_WrongCurve() + { + using CngKey key = X25519DiffieHellmanCngTests.GenerateCngKey(nameof(ECCurve.NamedCurves.nistP256)); + Assert.Throws("key", () => new X25519DiffieHellmanCng(key)); + } + + [Fact] + public static void GetKey() + { + using CngKey key = X25519DiffieHellmanCngTests.GenerateCngKey(); + + using (X25519DiffieHellmanCng xdhKey = new(key)) + using (CngKey getKey1 = xdhKey.GetKey()) + { + using (CngKey getKey2 = xdhKey.GetKey()) + { + Assert.NotSame(key, getKey1); + Assert.NotSame(getKey1, getKey2); + } + + Assert.Equal(key.Algorithm, getKey1.Algorithm); // Assert.NoThrow on getKey1.Algorithm + } + } + + [Fact] + public static void GetKey_Disposed() + { + using CngKey key = X25519DiffieHellmanCngTests.GenerateCngKey(); + X25519DiffieHellmanCng xdhKey = new(key); + xdhKey.Dispose(); + xdhKey.Dispose(); // No-op + Assert.Throws(() => xdhKey.GetKey()); + } + } + + [ConditionalClass(typeof(X25519DiffieHellman), nameof(X25519DiffieHellman.IsSupported))] + public static class X25519DiffieHellmanCngNonExportableTests + { + [Fact] + public static void X25519DiffieHellmanCng_NonExportable_ExportPrivateKeyThrows() + { + using CngKey key = X25519DiffieHellmanCngTests.GenerateCngKey(exportPolicy: CngExportPolicies.None); + using X25519DiffieHellmanCng xdh = new(key); + Assert.Throws(() => xdh.ExportPrivateKey()); + } + + [Fact] + public static void X25519DiffieHellmanCng_NonExportable_ExportPublicKeyAlwaysWorks() + { + using CngKey key = X25519DiffieHellmanCngTests.GenerateCngKey(exportPolicy: CngExportPolicies.None); + using X25519DiffieHellmanCng xdh = new(key); + ReadOnlySpan publicKey = xdh.ExportPublicKey(); + AssertExtensions.TrueExpression(publicKey.IndexOfAnyExcept((byte)0) >= 0); + } + } + + public abstract class X25519DiffieHellmanCngTests : X25519DiffieHellmanBaseTests + { + private const int NCRYPT_NO_KEY_VALIDATION = 0x00000008; + + private static readonly Lazy s_lazyDefaultProviderHandle = new(() => + { + using CngKey key = GenerateCngKey(); + return key.ProviderHandle; + }); + + private static SafeNCryptProviderHandle DefaultProviderHandle => s_lazyDefaultProviderHandle.Value; + + protected abstract CngExportPolicies ExportPolicy { get; } + + public override X25519DiffieHellmanCng GenerateKey() + { + using CngKey key = GenerateCngKey(exportPolicy: ExportPolicy); + return new X25519DiffieHellmanCng(key); + } + + public override X25519DiffieHellmanCng ImportPrivateKey(ReadOnlySpan source) + { + using CryptoPoolLease lease = X25519WindowsHelpers.CreateCngBlob(source, true, out _); + using SafeNCryptKeyHandle keyHandle = ECCng.ImportKeyBlob( + CngKeyBlobFormat.EccPrivateBlob.Format, + lease.Span, + "curve25519", + DefaultProviderHandle, + NCRYPT_NO_KEY_VALIDATION); + + using CngKey cngKey = CngKey.Open(keyHandle, CngKeyHandleOpenOptions.EphemeralKey); + byte[] exportPolicyBytes = BitConverter.GetBytes((int)ExportPolicy); + + cngKey.SetProperty(new CngProperty( + "Export Policy", + exportPolicyBytes, + CngPropertyOptions.None)); + + return new X25519DiffieHellmanCng(cngKey); + } + + public override X25519DiffieHellmanCng ImportPublicKey(ReadOnlySpan source) + { + Span reducedPublicKey = stackalloc byte[X25519DiffieHellman.PublicKeySizeInBytes]; + X25519WindowsHelpers.ReducePublicKey(source, reducedPublicKey); + using CryptoPoolLease lease = X25519WindowsHelpers.CreateCngBlob(reducedPublicKey, false, out _); + using SafeNCryptKeyHandle keyHandle = ECCng.ImportKeyBlob( + CngKeyBlobFormat.EccPublicBlob.Format, + lease.Span, + "curve25519", + DefaultProviderHandle, + NCRYPT_NO_KEY_VALIDATION); + + using CngKey cngKey = CngKey.Open(keyHandle, CngKeyHandleOpenOptions.EphemeralKey); + return new X25519DiffieHellmanCng(cngKey); + } + + // X25519DiffieHellmanCng CNG can't unfix adjusted keys because it can't keep track of adjustments made + // since the key came from somewhere else. + public override bool CanRoundTripKeys => false; + + internal static CngKey GenerateCngKey( + string curve = "curve25519", + CngExportPolicies exportPolicy = CngExportPolicies.AllowPlaintextExport) + { + CngKeyCreationParameters creationParameters = new() { ExportPolicy = exportPolicy }; + + creationParameters.Parameters.Add( + new CngProperty( + "ECCCurveName", + Encoding.Unicode.GetBytes(curve + "\0"), + CngPropertyOptions.None)); + + return CngKey.Create( + CngAlgorithm.ECDiffieHellman, + null, + creationParameters); + } + } +} From e01b19da386e0ef4fe966b8d2c9768eaca52fa8a Mon Sep 17 00:00:00 2001 From: Tanner Gooding Date: Sat, 9 May 2026 08:17:15 -0700 Subject: [PATCH 073/109] Cleanup VisitOperandUses and GenTreeVisitor to check common kinds rather than be a big switch (#127972) This should notably reduce risk as well. Some handling had been missed before like `GT_LZCNT` not being handled and hitting the default binary path instead. ### TP impact on Linux x64 ``` linux x64 * Overall (-0.09% to -0.04%) * MinOpts (-0.10% to +0.04%) * FullOpts (-0.11% to -0.04%) ``` ### TP impact on Windows x64 ``` linux arm64 * Overall (-0.21% to -0.15%) * MinOpts (-0.14% to -0.04%) * FullOpts (-0.26% to -0.16%) linux x64 * Overall (-0.23% to -0.15%) * MinOpts (-0.16% to -0.02%) * FullOpts (-0.28% to -0.15%) osx arm64 * Overall (-0.21% to -0.16%) * MinOpts (-0.13% to -0.06%) * FullOpts (-0.22% to -0.16%) windows arm64 * Overall (-0.21% to -0.15%) * MinOpts (-0.14% to -0.04%) * FullOpts (-0.27% to -0.16%) windows x64 * Overall (-0.23% to -0.15%) * MinOpts (-0.16% to -0.02%) * FullOpts (-0.29% to -0.15%) ``` Windows x86 has a TP hit, from `-0.00% to +0.06%` for MinOpts, but that should be fine given the wins we see elsewhere and the improved robustness for the visitors when new node kinds are introduced. --- src/coreclr/jit/compiler.h | 381 +++++++++++++++-------------------- src/coreclr/jit/compiler.hpp | 151 +++++--------- 2 files changed, 211 insertions(+), 321 deletions(-) diff --git a/src/coreclr/jit/compiler.h b/src/coreclr/jit/compiler.h index 666039143125bc..9568aceac47f88 100644 --- a/src/coreclr/jit/compiler.h +++ b/src/coreclr/jit/compiler.h @@ -12692,306 +12692,245 @@ class GenTreeVisitor } } - switch (node->OperGet()) + if (node->OperIsLeaf()) { - // Leaf lclVars - case GT_LCL_VAR: - case GT_LCL_FLD: - case GT_LCL_ADDR: - if (TVisitor::DoLclVarsOnly) - { - result = reinterpret_cast(this)->PreOrderVisit(use, user); - if (result == fgWalkResult::WALK_ABORT) - { - return result; - } - } - FALLTHROUGH; - - // Leaf nodes - case GT_CATCH_ARG: - case GT_ASYNC_CONTINUATION: - case GT_ASYNC_RESUME_INFO: - case GT_LABEL: - case GT_FTN_ADDR: - case GT_FTN_ENTRY: - case GT_RET_EXPR: - case GT_CNS_INT: - case GT_CNS_LNG: - case GT_CNS_DBL: - case GT_CNS_STR: -#if defined(FEATURE_SIMD) - case GT_CNS_VEC: -#endif // FEATURE_SIMD -#if defined(FEATURE_MASKED_HW_INTRINSICS) - case GT_CNS_MSK: -#endif // FEATURE_MASKED_HW_INTRINSICS - case GT_MEMORYBARRIER: - case GT_JMP: - case GT_JCC: - case GT_SETCC: - case GT_NO_OP: - case GT_START_NONGC: - case GT_START_PREEMPTGC: - case GT_PROF_HOOK: - case GT_PHI_ARG: - case GT_JMPTABLE: - case GT_PHYSREG: - case GT_IL_OFFSET: - case GT_RECORD_ASYNC_RESUME: - case GT_NOP: - case GT_SWIFT_ERROR: - case GT_GCPOLL: - case GT_WASM_THROW_REF: - case GT_WASM_JEXCEPT: - break; - - // Lclvar unary operators - case GT_STORE_LCL_VAR: - case GT_STORE_LCL_FLD: - if (TVisitor::DoLclVarsOnly) - { - result = reinterpret_cast(this)->PreOrderVisit(use, user); - if (result == fgWalkResult::WALK_ABORT) - { - return result; - } - } - FALLTHROUGH; - - // Standard unary operators - case GT_NOT: - case GT_NEG: - case GT_BSWAP: - case GT_BSWAP16: - case GT_COPY: - case GT_RELOAD: - case GT_ARR_LENGTH: - case GT_MDARR_LENGTH: - case GT_MDARR_LOWER_BOUND: - case GT_CAST: - case GT_BITCAST: - case GT_CKFINITE: - case GT_LCLHEAP: - case GT_IND: - case GT_BLK: - case GT_BOX: - case GT_ALLOCOBJ: - case GT_INIT_VAL: - case GT_JTRUE: - case GT_SWITCH: - case GT_NULLCHECK: - case GT_PUTARG_REG: - case GT_PUTARG_STK: - case GT_RETURNTRAP: - case GT_FIELD_ADDR: - case GT_RETURN: - case GT_RETURN_SUSPEND: - case GT_PATCHPOINT_FORCED: - case GT_NONLOCAL_JMP: - case GT_RETFILT: - case GT_RUNTIMELOOKUP: - case GT_ARR_ADDR: - case GT_KEEPALIVE: - case GT_INC_SATURATE: + if (TVisitor::DoLclVarsOnly && node->OperIs(GT_LCL_VAR, GT_LCL_FLD, GT_LCL_ADDR)) { - GenTreeUnOp* const unOp = node->AsUnOp(); - if (unOp->gtOp1 != nullptr) + result = reinterpret_cast(this)->PreOrderVisit(use, user); + if (result == fgWalkResult::WALK_ABORT) { - result = WalkTree(&unOp->gtOp1, unOp); - if (result == fgWalkResult::WALK_ABORT) - { - return result; - } + return result; } - break; } + } + else if (node->OperIsBinary()) + { + GenTreeOp* const op = node->AsOp(); - // Special nodes - case GT_PHI: - for (GenTreePhi::Use& use : node->AsPhi()->Uses()) - { - result = WalkTree(&use.NodeRef(), node); - if (result == fgWalkResult::WALK_ABORT) - { - return result; - } - } - break; + GenTree** op1Use = &op->gtOp1; + GenTree** op2Use = &op->gtOp2; - case GT_FIELD_LIST: - for (GenTreeFieldList::Use& use : node->AsFieldList()->Uses()) - { - result = WalkTree(&use.NodeRef(), node); - if (result == fgWalkResult::WALK_ABORT) - { - return result; - } - } - break; - - case GT_CMPXCHG: + if (TVisitor::UseExecutionOrder && node->IsReverseOp()) { - GenTreeCmpXchg* const cmpXchg = node->AsCmpXchg(); + std::swap(op1Use, op2Use); + } - result = WalkTree(&cmpXchg->Addr(), cmpXchg); + if (*op1Use != nullptr) + { + result = WalkTree(op1Use, op); if (result == fgWalkResult::WALK_ABORT) { return result; } - result = WalkTree(&cmpXchg->Data(), cmpXchg); + } + else + { + assert(node->NullOp1Legal()); + } + + // We can have null op1 and non-null op2 for some nodes, such as GT_LEA + + if (*op2Use != nullptr) + { + result = WalkTree(op2Use, op); if (result == fgWalkResult::WALK_ABORT) { return result; } - result = WalkTree(&cmpXchg->Comparand(), cmpXchg); + } + else + { + assert(node->NullOp2Legal()); + } + } + else if (node->OperIsUnary()) + { + if (TVisitor::DoLclVarsOnly && node->OperIsLocalStore()) + { + result = reinterpret_cast(this)->PreOrderVisit(use, user); if (result == fgWalkResult::WALK_ABORT) { return result; } - break; } - case GT_ARR_ELEM: - { - GenTreeArrElem* const arrElem = node->AsArrElem(); + GenTreeUnOp* const unOp = node->AsUnOp(); - result = WalkTree(&arrElem->gtArrObj, arrElem); + if (unOp->gtOp1 != nullptr) + { + result = WalkTree(&unOp->gtOp1, unOp); if (result == fgWalkResult::WALK_ABORT) { return result; } + } + else + { + assert(node->NullOp1Legal()); + } + } + else + { + assert(node->OperIsSpecial()); - const unsigned rank = arrElem->gtArrRank; - for (unsigned dim = 0; dim < rank; dim++) - { - result = WalkTree(&arrElem->gtArrInds[dim], arrElem); - if (result == fgWalkResult::WALK_ABORT) + switch (node->OperGet()) + { + case GT_PHI: + for (GenTreePhi::Use& use : node->AsPhi()->Uses()) { - return result; + result = WalkTree(&use.NodeRef(), node); + if (result == fgWalkResult::WALK_ABORT) + { + return result; + } } - } - break; - } + break; - case GT_CALL: - { - GenTreeCall* const call = node->AsCall(); + case GT_FIELD_LIST: + for (GenTreeFieldList::Use& use : node->AsFieldList()->Uses()) + { + result = WalkTree(&use.NodeRef(), node); + if (result == fgWalkResult::WALK_ABORT) + { + return result; + } + } + break; - for (CallArg& arg : call->gtArgs.EarlyArgs()) + case GT_CMPXCHG: { - result = WalkTree(&arg.EarlyNodeRef(), call); + GenTreeCmpXchg* const cmpXchg = node->AsCmpXchg(); + + result = WalkTree(&cmpXchg->Addr(), cmpXchg); if (result == fgWalkResult::WALK_ABORT) { return result; } - } - - for (CallArg& arg : call->gtArgs.LateArgs()) - { - result = WalkTree(&arg.LateNodeRef(), call); + result = WalkTree(&cmpXchg->Data(), cmpXchg); if (result == fgWalkResult::WALK_ABORT) { return result; } - } - - if (call->gtControlExpr != nullptr) - { - result = WalkTree(&call->gtControlExpr, call); + result = WalkTree(&cmpXchg->Comparand(), cmpXchg); if (result == fgWalkResult::WALK_ABORT) { return result; } + break; } - break; - } -#if defined(FEATURE_HW_INTRINSICS) - case GT_HWINTRINSIC: - if (TVisitor::UseExecutionOrder && node->IsReverseOp()) + case GT_ARR_ELEM: { - assert(node->AsMultiOp()->GetOperandCount() == 2); - result = WalkTree(&node->AsMultiOp()->Op(2), node); + GenTreeArrElem* const arrElem = node->AsArrElem(); + + result = WalkTree(&arrElem->gtArrObj, arrElem); if (result == fgWalkResult::WALK_ABORT) { return result; } - result = WalkTree(&node->AsMultiOp()->Op(1), node); - if (result == fgWalkResult::WALK_ABORT) + + const unsigned rank = arrElem->gtArrRank; + for (unsigned dim = 0; dim < rank; dim++) { - return result; + result = WalkTree(&arrElem->gtArrInds[dim], arrElem); + if (result == fgWalkResult::WALK_ABORT) + { + return result; + } } + break; } - else + + case GT_CALL: { - for (GenTree** use : node->AsMultiOp()->UseEdges()) + GenTreeCall* const call = node->AsCall(); + + for (CallArg& arg : call->gtArgs.EarlyArgs()) { - result = WalkTree(use, node); + result = WalkTree(&arg.EarlyNodeRef(), call); if (result == fgWalkResult::WALK_ABORT) { return result; } } - } - break; -#endif // defined(FEATURE_HW_INTRINSICS) - case GT_SELECT: - { - GenTreeConditional* const conditional = node->AsConditional(); + for (CallArg& arg : call->gtArgs.LateArgs()) + { + result = WalkTree(&arg.LateNodeRef(), call); + if (result == fgWalkResult::WALK_ABORT) + { + return result; + } + } - result = WalkTree(&conditional->gtCond, conditional); - if (result == fgWalkResult::WALK_ABORT) - { - return result; - } - result = WalkTree(&conditional->gtOp1, conditional); - if (result == fgWalkResult::WALK_ABORT) - { - return result; - } - result = WalkTree(&conditional->gtOp2, conditional); - if (result == fgWalkResult::WALK_ABORT) - { - return result; + if (call->gtControlExpr != nullptr) + { + result = WalkTree(&call->gtControlExpr, call); + if (result == fgWalkResult::WALK_ABORT) + { + return result; + } + } + break; } - break; - } - // Binary nodes - default: - { - assert(node->OperIsBinary()); - - GenTreeOp* const op = node->AsOp(); - - GenTree** op1Use = &op->gtOp1; - GenTree** op2Use = &op->gtOp2; +#if defined(FEATURE_HW_INTRINSICS) + case GT_HWINTRINSIC: + if (TVisitor::UseExecutionOrder && node->IsReverseOp()) + { + assert(node->AsMultiOp()->GetOperandCount() == 2); + result = WalkTree(&node->AsMultiOp()->Op(2), node); + if (result == fgWalkResult::WALK_ABORT) + { + return result; + } + result = WalkTree(&node->AsMultiOp()->Op(1), node); + if (result == fgWalkResult::WALK_ABORT) + { + return result; + } + } + else + { + for (GenTree** use : node->AsMultiOp()->UseEdges()) + { + result = WalkTree(use, node); + if (result == fgWalkResult::WALK_ABORT) + { + return result; + } + } + } + break; +#endif // defined(FEATURE_HW_INTRINSICS) - if (TVisitor::UseExecutionOrder && node->IsReverseOp()) + case GT_SELECT: { - std::swap(op1Use, op2Use); - } + GenTreeConditional* const conditional = node->AsConditional(); - if (*op1Use != nullptr) - { - result = WalkTree(op1Use, op); + result = WalkTree(&conditional->gtCond, conditional); if (result == fgWalkResult::WALK_ABORT) { return result; } - } - - if (*op2Use != nullptr) - { - result = WalkTree(op2Use, op); + result = WalkTree(&conditional->gtOp1, conditional); if (result == fgWalkResult::WALK_ABORT) { return result; } + result = WalkTree(&conditional->gtOp2, conditional); + if (result == fgWalkResult::WALK_ABORT) + { + return result; + } + break; + } + + default: + { + assert(!"unhandled special node"); + break; } - break; } } diff --git a/src/coreclr/jit/compiler.hpp b/src/coreclr/jit/compiler.hpp index a9492b5dd84131..03b5b33273ebaa 100644 --- a/src/coreclr/jit/compiler.hpp +++ b/src/coreclr/jit/compiler.hpp @@ -4410,96 +4410,56 @@ GenTree::VisitResult GenTree::VisitOperands(TVisitor visitor) template GenTree::VisitResult GenTree::VisitOperandUses(TVisitor visitor) { - switch (OperGet()) + if (OperIsLeaf()) { - // Leaf nodes - case GT_LCL_VAR: - case GT_LCL_FLD: - case GT_LCL_ADDR: - case GT_CATCH_ARG: - case GT_ASYNC_CONTINUATION: - case GT_ASYNC_RESUME_INFO: - case GT_LABEL: - case GT_FTN_ADDR: - case GT_FTN_ENTRY: - case GT_RET_EXPR: - case GT_CNS_INT: - case GT_CNS_LNG: - case GT_CNS_DBL: - case GT_CNS_STR: -#if defined(FEATURE_SIMD) - case GT_CNS_VEC: -#endif // FEATURE_SIMD -#if defined(FEATURE_MASKED_HW_INTRINSICS) - case GT_CNS_MSK: -#endif // FEATURE_MASKED_HW_INTRINSICS - case GT_MEMORYBARRIER: - case GT_JMP: - case GT_JCC: - case GT_SETCC: - case GT_NO_OP: - case GT_START_NONGC: - case GT_START_PREEMPTGC: - case GT_PROF_HOOK: - case GT_PHI_ARG: - case GT_JMPTABLE: - case GT_PHYSREG: - case GT_IL_OFFSET: - case GT_RECORD_ASYNC_RESUME: - case GT_NOP: - case GT_SWIFT_ERROR: - case GT_GCPOLL: - case GT_WASM_THROW_REF: - case GT_WASM_JEXCEPT: - return VisitResult::Continue; + return VisitResult::Continue; + } - // Unary operators with an optional operand - case GT_FIELD_ADDR: - case GT_RETURN: - case GT_RETFILT: - if (this->AsUnOp()->gtOp1 == nullptr) - { - return VisitResult::Continue; - } - FALLTHROUGH; + if (OperIsBinary()) + { + GenTreeOp* op = AsOp(); - // Standard unary operators - case GT_STORE_LCL_VAR: - case GT_STORE_LCL_FLD: - case GT_NOT: - case GT_NEG: - case GT_BSWAP: - case GT_BSWAP16: - case GT_COPY: - case GT_RELOAD: - case GT_ARR_LENGTH: - case GT_MDARR_LENGTH: - case GT_MDARR_LOWER_BOUND: - case GT_CAST: - case GT_BITCAST: - case GT_CKFINITE: - case GT_LCLHEAP: - case GT_IND: - case GT_BLK: - case GT_BOX: - case GT_ALLOCOBJ: - case GT_INIT_VAL: - case GT_RUNTIMELOOKUP: - case GT_ARR_ADDR: - case GT_JTRUE: - case GT_SWITCH: - case GT_NULLCHECK: - case GT_PUTARG_REG: - case GT_PUTARG_STK: - case GT_RETURNTRAP: - case GT_KEEPALIVE: - case GT_INC_SATURATE: - case GT_RETURN_SUSPEND: - case GT_PATCHPOINT_FORCED: - case GT_NONLOCAL_JMP: - return visitor(&this->AsUnOp()->gtOp1); - - // Variadic nodes + if (op->gtOp1 != nullptr) + { + RETURN_IF_ABORT(visitor(&op->gtOp1)); + } + else + { + assert(NullOp1Legal()); + } + + // We can have null op1 and non-null op2 for some nodes, such as GT_LEA + + if (op->gtOp2 != nullptr) + { + return visitor(&op->gtOp2); + } + else + { + assert(NullOp2Legal()); + } + return VisitResult::Continue; + } + + if (OperIsUnary()) + { + GenTreeUnOp* unOp = AsUnOp(); + + if (unOp->gtOp1 != nullptr) + { + return visitor(&unOp->gtOp1); + } + else + { + assert(NullOp1Legal()); + } + return VisitResult::Continue; + } + + assert(OperIsSpecial()); + + switch (OperGet()) + { #if defined(FEATURE_HW_INTRINSICS) case GT_HWINTRINSIC: for (GenTree** use : this->AsMultiOp()->UseEdges()) @@ -4507,9 +4467,8 @@ GenTree::VisitResult GenTree::VisitOperandUses(TVisitor visitor) RETURN_IF_ABORT(visitor(use)); } return VisitResult::Continue; -#endif // defined(FEATURE_HW_INTRINSICS) +#endif - // Special nodes case GT_PHI: for (GenTreePhi::Use& use : AsPhi()->Uses()) { @@ -4571,19 +4530,11 @@ GenTree::VisitResult GenTree::VisitOperandUses(TVisitor visitor) return visitor(&cond->gtOp2); } - // Binary nodes default: - assert(this->OperIsBinary()); - if (AsOp()->gtOp1 != nullptr) - { - RETURN_IF_ABORT(visitor(&AsOp()->gtOp1)); - } - - if (AsOp()->gtOp2 != nullptr) - { - return visitor(&AsOp()->gtOp2); - } + { + assert(!"unhandled special node"); return VisitResult::Continue; + } } } From 197132f5db01dd076ddc1c537d70f7ff78bf5f03 Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Sat, 9 May 2026 08:34:56 -0700 Subject: [PATCH 074/109] [cDAC] implement DacDbi GetTypeLayout/GetArrayLayout (#127877) ## Description Implements cDAC-side `DacDbi` type/array layout APIs and adds RuntimeTypeSystem classification APIs required for this. ```csharp bool IsObjRef(TypeHandle typeHandle) => throw new NotImplementedException(); CorElementType GetInternalCorElementType(TypeHandle typeHandle) => throw new NotImplementedException(); ``` --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: rcj1 <77995559+rcj1@users.noreply.github.com> Co-authored-by: rcj1 --- .../design/datacontracts/RuntimeTypeSystem.md | 22 +++ src/coreclr/debug/daccess/dacdbiimpl.cpp | 12 +- src/coreclr/debug/daccess/dacdbiimpl.h | 4 +- src/coreclr/debug/di/process.cpp | 4 +- src/coreclr/debug/inc/dacdbiinterface.h | 4 +- src/coreclr/inc/dacdbi.idl | 4 +- .../Contracts/IRuntimeTypeSystem.cs | 6 + .../Contracts/RuntimeTypeSystem_1.cs | 19 +++ .../Dbi/DacDbiImpl.cs | 132 +++++++++++++++++- .../Dbi/IDacDbiInterface.cs | 18 ++- .../DumpTests/DacDbi/DacDbiObjectDumpTests.cs | 75 ++++++++++ .../DumpTests/RuntimeTypeSystemDumpTests.cs | 26 ++++ .../managed/cdac/tests/MethodTableTests.cs | 55 ++++++++ .../MockDescriptors.RuntimeTypeSystem.cs | 12 ++ 14 files changed, 373 insertions(+), 20 deletions(-) diff --git a/docs/design/datacontracts/RuntimeTypeSystem.md b/docs/design/datacontracts/RuntimeTypeSystem.md index 28605efe3c70b3..0ce6cca2e5a141 100644 --- a/docs/design/datacontracts/RuntimeTypeSystem.md +++ b/docs/design/datacontracts/RuntimeTypeSystem.md @@ -52,6 +52,8 @@ partial interface IRuntimeTypeSystem : IContract // True if the MethodTable is the sentinel value associated with unallocated space in the managed heap public virtual bool IsFreeObjectMethodTable(TypeHandle typeHandle); public virtual bool IsString(TypeHandle typeHandle); + // True if the type is a GC-collectable object reference. + public virtual bool IsObjRef(TypeHandle typeHandle); // True if the MethodTable represents a type that contains managed references public virtual bool ContainsGCPointers(TypeHandle typeHandle); // True if the type requires 8-byte alignment on platforms that don't 8-byte align by default (FEATURE_64BIT_ALIGNMENT) @@ -97,6 +99,11 @@ partial interface IRuntimeTypeSystem : IContract // HasTypeParam will return true for cases where this is the interop view, and false for normal valuetypes. public virtual CorElementType GetSignatureCorElementType(TypeHandle typeHandle); + // Internal element type of the type. Unlike GetSignatureCorElementType, this returns the underlying + // primitive type for enums (e.g. I4 for an enum with int underlying type). + // For arrays, reference types, and TypeDescs, behaves identically to GetSignatureCorElementType. + public virtual CorElementType GetInternalCorElementType(TypeHandle typeHandle); + bool IsValueType(TypeHandle typeHandle); // return true if the TypeHandle represents an enum type. bool IsEnum(TypeHandle typeHandle); @@ -567,6 +574,8 @@ Contracts used: public bool IsString(TypeHandle TypeHandle) => !typeHandle.IsMethodTable() ? false : _methodTables[TypeHandle.Address].Flags.IsString; + public bool IsObjRef(TypeHandle typeHandle) => // Returns true if GetSignatureCorElementType returns Class, Array, or SzArray. + public bool ContainsGCPointers(TypeHandle TypeHandle) => !typeHandle.IsMethodTable() ? false : _methodTables[TypeHandle.Address].Flags.ContainsGCPointers; public bool RequiresAlign8(TypeHandle typeHandle) => !typeHandle.IsMethodTable() ? false : _methodTables[typeHandle.Address].Flags.RequiresAlign8; @@ -829,6 +838,19 @@ Contracts used: return default(CorElementType); } + // Internal element type: returns the underlying primitive type for enums. For all other types, identical to GetSignatureCorElementType. + public CorElementType GetInternalCorElementType(TypeHandle typeHandle) + { + CorElementType sigType = GetSignatureCorElementType(typeHandle); + if (sigType == CorElementType.ValueType && typeHandle.IsMethodTable()) + { + CorElementType internalType = (CorElementType)GetClassData(typeHandle).InternalCorElementType; + if (internalType != CorElementType.ValueType) + return internalType; + } + return sigType; + } + public bool IsValueType(TypeHandle typeHandle) { // if methodtable: check WFLAGS_HIGH for Category_ValueType diff --git a/src/coreclr/debug/daccess/dacdbiimpl.cpp b/src/coreclr/debug/daccess/dacdbiimpl.cpp index bce89a76385ff1..478b6ae9155f10 100644 --- a/src/coreclr/debug/daccess/dacdbiimpl.cpp +++ b/src/coreclr/debug/daccess/dacdbiimpl.cpp @@ -7347,17 +7347,17 @@ HRESULT STDMETHODCALLTYPE DacDbiInterfaceImpl::GetObjectFields(COR_TYPEID id, UL } -HRESULT STDMETHODCALLTYPE DacDbiInterfaceImpl::GetTypeLayout(COR_TYPEID id, COR_TYPE_LAYOUT *pLayout) +HRESULT STDMETHODCALLTYPE DacDbiInterfaceImpl::GetTypeLayout(CORDB_ADDRESS id, COR_TYPE_LAYOUT *pLayout) { if (pLayout == NULL) return E_POINTER; - if (id.token1 == 0) + if (id == 0) return CORDBG_E_CLASS_NOT_LOADED; DD_ENTER_MAY_THROW; - PTR_MethodTable mt = PTR_MethodTable(TO_TADDR(id.token1)); + PTR_MethodTable mt = PTR_MethodTable(TO_TADDR(id)); PTR_MethodTable parentMT = mt->GetParentMethodTable(); COR_TYPEID parent = {parentMT.GetAddr(), 0}; @@ -7377,17 +7377,17 @@ HRESULT STDMETHODCALLTYPE DacDbiInterfaceImpl::GetTypeLayout(COR_TYPEID id, COR_ return S_OK; } -HRESULT STDMETHODCALLTYPE DacDbiInterfaceImpl::GetArrayLayout(COR_TYPEID id, COR_ARRAY_LAYOUT *pLayout) +HRESULT STDMETHODCALLTYPE DacDbiInterfaceImpl::GetArrayLayout(CORDB_ADDRESS id, COR_ARRAY_LAYOUT *pLayout) { if (pLayout == NULL) return E_POINTER; - if (id.token1 == 0) + if (id == 0) return CORDBG_E_CLASS_NOT_LOADED; DD_ENTER_MAY_THROW; - PTR_MethodTable mt = PTR_MethodTable(TO_TADDR(id.token1)); + PTR_MethodTable mt = PTR_MethodTable(TO_TADDR(id)); if (!mt->IsStringOrArray()) return E_INVALIDARG; diff --git a/src/coreclr/debug/daccess/dacdbiimpl.h b/src/coreclr/debug/daccess/dacdbiimpl.h index 54d1a5bf000d05..36a077548987cd 100644 --- a/src/coreclr/debug/daccess/dacdbiimpl.h +++ b/src/coreclr/debug/daccess/dacdbiimpl.h @@ -133,8 +133,8 @@ class DacDbiInterfaceImpl : HRESULT STDMETHODCALLTYPE GetTypeIDForType(VMPTR_TypeHandle vmTypeHandle, COR_TYPEID *pID); HRESULT STDMETHODCALLTYPE GetObjectFields(COR_TYPEID id, ULONG32 celt, COR_FIELD *layout, ULONG32 *pceltFetched); - HRESULT STDMETHODCALLTYPE GetTypeLayout(COR_TYPEID id, COR_TYPE_LAYOUT *pLayout); - HRESULT STDMETHODCALLTYPE GetArrayLayout(COR_TYPEID id, COR_ARRAY_LAYOUT *pLayout); + HRESULT STDMETHODCALLTYPE GetTypeLayout(CORDB_ADDRESS id, COR_TYPE_LAYOUT *pLayout); + HRESULT STDMETHODCALLTYPE GetArrayLayout(CORDB_ADDRESS id, COR_ARRAY_LAYOUT *pLayout); HRESULT STDMETHODCALLTYPE GetGCHeapInformation(OUT COR_HEAPINFO * pHeapInfo); HRESULT STDMETHODCALLTYPE GetPEFileMDInternalRW(VMPTR_PEAssembly vmPEAssembly, OUT TADDR* pAddrMDInternalRW); #ifdef FEATURE_CODE_VERSIONING diff --git a/src/coreclr/debug/di/process.cpp b/src/coreclr/debug/di/process.cpp index b779b5a990727c..f8b5a443e3cb9f 100644 --- a/src/coreclr/debug/di/process.cpp +++ b/src/coreclr/debug/di/process.cpp @@ -2392,7 +2392,7 @@ COM_METHOD CordbProcess::GetArrayLayout(COR_TYPEID id, COR_ARRAY_LAYOUT *pLayout HRESULT hr = S_OK; PUBLIC_API_BEGIN(this); - hr = GetProcess()->GetDAC()->GetArrayLayout(id, pLayout); + hr = GetProcess()->GetDAC()->GetArrayLayout((CORDB_ADDRESS)id.token1, pLayout); PUBLIC_API_END(hr); return hr; @@ -2406,7 +2406,7 @@ COM_METHOD CordbProcess::GetTypeLayout(COR_TYPEID id, COR_TYPE_LAYOUT *pLayout) HRESULT hr = S_OK; PUBLIC_API_BEGIN(this); - hr = GetProcess()->GetDAC()->GetTypeLayout(id, pLayout); + hr = GetProcess()->GetDAC()->GetTypeLayout((CORDB_ADDRESS)id.token1, pLayout); PUBLIC_API_END(hr); return hr; diff --git a/src/coreclr/debug/inc/dacdbiinterface.h b/src/coreclr/debug/inc/dacdbiinterface.h index 0b8797a4eccb8f..c024524724e633 100644 --- a/src/coreclr/debug/inc/dacdbiinterface.h +++ b/src/coreclr/debug/inc/dacdbiinterface.h @@ -2042,9 +2042,9 @@ IDacDbiInterface : public IUnknown virtual HRESULT STDMETHODCALLTYPE GetObjectFields(COR_TYPEID id, ULONG32 celt, OUT COR_FIELD * layout, OUT ULONG32 * pceltFetched) = 0; - virtual HRESULT STDMETHODCALLTYPE GetTypeLayout(COR_TYPEID id, COR_TYPE_LAYOUT * pLayout) = 0; + virtual HRESULT STDMETHODCALLTYPE GetTypeLayout(CORDB_ADDRESS id, COR_TYPE_LAYOUT * pLayout) = 0; - virtual HRESULT STDMETHODCALLTYPE GetArrayLayout(COR_TYPEID id, COR_ARRAY_LAYOUT * pLayout) = 0; + virtual HRESULT STDMETHODCALLTYPE GetArrayLayout(CORDB_ADDRESS id, COR_ARRAY_LAYOUT * pLayout) = 0; virtual HRESULT STDMETHODCALLTYPE GetGCHeapInformation(OUT COR_HEAPINFO * pHeapInfo) = 0; diff --git a/src/coreclr/inc/dacdbi.idl b/src/coreclr/inc/dacdbi.idl index f8e647b376d45a..edbeec2e00e1b4 100644 --- a/src/coreclr/inc/dacdbi.idl +++ b/src/coreclr/inc/dacdbi.idl @@ -393,8 +393,8 @@ interface IDacDbiInterface : IUnknown HRESULT GetTypeID([in] CORDB_ADDRESS obj, [out] COR_TYPEID * pType); HRESULT GetTypeIDForType([in] VMPTR_TypeHandle vmTypeHandle, [out] COR_TYPEID * pId); HRESULT GetObjectFields([in] COR_TYPEID id, [in] ULONG32 celt, [out] COR_FIELD * layout, [out] ULONG32 * pceltFetched); - HRESULT GetTypeLayout([in] COR_TYPEID id, [out] COR_TYPE_LAYOUT * pLayout); - HRESULT GetArrayLayout([in] COR_TYPEID id, [out] COR_ARRAY_LAYOUT * pLayout); + HRESULT GetTypeLayout([in] CORDB_ADDRESS id, [out] COR_TYPE_LAYOUT * pLayout); + HRESULT GetArrayLayout([in] CORDB_ADDRESS id, [out] COR_ARRAY_LAYOUT * pLayout); HRESULT GetGCHeapInformation([out] COR_HEAPINFO * pHeapInfo); // PE File diff --git a/src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Abstractions/Contracts/IRuntimeTypeSystem.cs b/src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Abstractions/Contracts/IRuntimeTypeSystem.cs index 4ba56875057856..3d1c8cf60fbaaf 100644 --- a/src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Abstractions/Contracts/IRuntimeTypeSystem.cs +++ b/src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Abstractions/Contracts/IRuntimeTypeSystem.cs @@ -115,6 +115,7 @@ public interface IRuntimeTypeSystem : IContract // True if the MethodTable is the sentinel value associated with unallocated space in the managed heap bool IsFreeObjectMethodTable(TypeHandle typeHandle) => throw new NotImplementedException(); bool IsString(TypeHandle typeHandle) => throw new NotImplementedException(); + bool IsObjRef(TypeHandle typeHandle) => throw new NotImplementedException(); // True if the MethodTable represents a type that contains managed references bool ContainsGCPointers(TypeHandle typeHandle) => throw new NotImplementedException(); // True if the type requires 8-byte alignment on platforms that don't 8-byte align by default (FEATURE_64BIT_ALIGNMENT) @@ -164,6 +165,11 @@ public interface IRuntimeTypeSystem : IContract CorElementType GetSignatureCorElementType(TypeHandle typeHandle) => throw new NotImplementedException(); bool IsValueType(TypeHandle typeHandle) => throw new NotImplementedException(); + // Internal element type of the type. Unlike GetSignatureCorElementType, this returns the underlying primitive + // type for enums (e.g. I4 for an enum with int underlying type) and for PrimitiveValueType categories. + // For arrays, reference types, and TypeDescs, behaves identically to GetSignatureCorElementType. + CorElementType GetInternalCorElementType(TypeHandle typeHandle) => throw new NotImplementedException(); + // return true if the TypeHandle represents an enum type. bool IsEnum(TypeHandle typeHandle) => throw new NotImplementedException(); diff --git a/src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/RuntimeTypeSystem_1.cs b/src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/RuntimeTypeSystem_1.cs index 26debd447f39ec..cd9fb666c51962 100644 --- a/src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/RuntimeTypeSystem_1.cs +++ b/src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/RuntimeTypeSystem_1.cs @@ -561,6 +561,12 @@ private Data.EEClass GetClassData(TypeHandle typeHandle) public bool IsFreeObjectMethodTable(TypeHandle typeHandle) => FreeObjectMethodTablePointer == typeHandle.Address; public bool IsString(TypeHandle typeHandle) => !typeHandle.IsMethodTable() ? false : _methodTables[typeHandle.Address].Flags.IsString; + public bool IsObjRef(TypeHandle typeHandle) + { + CorElementType elementType = GetSignatureCorElementType(typeHandle); + // Keep this aligned with CorTypeInfo::IsObjRef semantics for signature element types. + return elementType is CorElementType.Class or CorElementType.Array or CorElementType.SzArray; + } public bool ContainsGCPointers(TypeHandle typeHandle) => !typeHandle.IsMethodTable() ? false : _methodTables[typeHandle.Address].Flags.ContainsGCPointers; public bool RequiresAlign8(TypeHandle typeHandle) => !typeHandle.IsMethodTable() ? false : _methodTables[typeHandle.Address].Flags.RequiresAlign8; public bool IsContinuation(TypeHandle typeHandle) => typeHandle.IsMethodTable() @@ -865,6 +871,19 @@ public CorElementType GetSignatureCorElementType(TypeHandle typeHandle) return default; } + public CorElementType GetInternalCorElementType(TypeHandle typeHandle) + { + CorElementType sigType = GetSignatureCorElementType(typeHandle); + if (sigType == CorElementType.ValueType && typeHandle.IsMethodTable()) + { + CorElementType internalType = (CorElementType)GetClassData(typeHandle).InternalCorElementType; + if (internalType != CorElementType.ValueType) + return internalType; + } + + return sigType; + } + public bool IsValueType(TypeHandle typeHandle) { if (typeHandle.IsMethodTable()) diff --git a/src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Legacy/Dbi/DacDbiImpl.cs b/src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Legacy/Dbi/DacDbiImpl.cs index f9e808ff23de9f..508aaeb440d322 100644 --- a/src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Legacy/Dbi/DacDbiImpl.cs +++ b/src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Legacy/Dbi/DacDbiImpl.cs @@ -1725,11 +1725,135 @@ public int GetTypeIDForType(ulong vmTypeHandle, COR_TYPEID* pId) public int GetObjectFields(nint id, uint celt, COR_FIELD* layout, uint* pceltFetched) => LegacyFallbackHelper.CanFallback() && _legacy is not null ? _legacy.GetObjectFields(id, celt, layout, pceltFetched) : HResults.E_NOTIMPL; - public int GetTypeLayout(nint id, COR_TYPE_LAYOUT* pLayout) - => LegacyFallbackHelper.CanFallback() && _legacy is not null ? _legacy.GetTypeLayout(id, pLayout) : HResults.E_NOTIMPL; + public int GetTypeLayout(ulong id, COR_TYPE_LAYOUT* pLayout) + { + int hr = HResults.S_OK; + try + { + if (pLayout is null) + throw new NullReferenceException(nameof(pLayout)); + + if (id == 0) + throw Marshal.GetExceptionForHR(CorDbgHResults.CORDBG_E_CLASS_NOT_LOADED)!; + + IRuntimeTypeSystem rts = _target.Contracts.RuntimeTypeSystem; + TypeHandle typeHandle = rts.GetTypeHandle(new TargetPointer((ulong)id)); + + TargetPointer parentMT = rts.GetParentMethodTable(typeHandle); + pLayout->parentID.token1 = parentMT.Value; + pLayout->parentID.token2 = 0; + pLayout->objectSize = rts.GetBaseSize(typeHandle); + ushort numInstanceFields = rts.GetNumInstanceFields(typeHandle); + if (parentMT != TargetPointer.Null) + { + TypeHandle parentHandle = rts.GetTypeHandle(parentMT); + numInstanceFields -= rts.GetNumInstanceFields(parentHandle); + } + pLayout->numFields = numInstanceFields; + pLayout->boxOffset = rts.IsObjRef(typeHandle) ? 0u : (uint)_target.PointerSize; + pLayout->type = (int)(rts.IsString(typeHandle) ? CorElementType.String : rts.GetInternalCorElementType(typeHandle)); + } + catch (System.Exception ex) + { + hr = ex.HResult; + } + +#if DEBUG + if (_legacy is not null) + { + COR_TYPE_LAYOUT resultLocal; + int hrLocal = _legacy.GetTypeLayout(id, &resultLocal); + Debug.ValidateHResult(hr, hrLocal); + if (hr == HResults.S_OK) + { + Debug.Assert(pLayout->parentID.token1 == resultLocal.parentID.token1, $"cDAC: {pLayout->parentID.token1:x}, DAC: {resultLocal.parentID.token1:x}"); + Debug.Assert(pLayout->parentID.token2 == resultLocal.parentID.token2, $"cDAC: {pLayout->parentID.token2:x}, DAC: {resultLocal.parentID.token2:x}"); + Debug.Assert(pLayout->objectSize == resultLocal.objectSize, $"cDAC: {pLayout->objectSize}, DAC: {resultLocal.objectSize}"); + Debug.Assert(pLayout->numFields == resultLocal.numFields, $"cDAC: {pLayout->numFields}, DAC: {resultLocal.numFields}"); + Debug.Assert(pLayout->boxOffset == resultLocal.boxOffset, $"cDAC: {pLayout->boxOffset}, DAC: {resultLocal.boxOffset}"); + Debug.Assert(pLayout->type == resultLocal.type, $"cDAC: {pLayout->type}, DAC: {resultLocal.type}"); + } + } +#endif + + return hr; + } + + public int GetArrayLayout(ulong id, COR_ARRAY_LAYOUT* pLayout) + { + int hr = HResults.S_OK; + try + { + if (pLayout is null) + throw new NullReferenceException(nameof(pLayout)); - public int GetArrayLayout(nint id, nint pLayout) - => LegacyFallbackHelper.CanFallback() && _legacy is not null ? _legacy.GetArrayLayout(id, pLayout) : HResults.E_NOTIMPL; + if (id == 0) + throw Marshal.GetExceptionForHR(CorDbgHResults.CORDBG_E_CLASS_NOT_LOADED)!; + IRuntimeTypeSystem rts = _target.Contracts.RuntimeTypeSystem; + TypeHandle arrayOrStringTypeHandle = rts.GetTypeHandle(new TargetPointer(id)); + uint pointerSize = (uint)_target.PointerSize; + + if (rts.IsString(arrayOrStringTypeHandle)) + { + TypeHandle charTypeHandle = rts.GetPrimitiveType(CorElementType.Char); + pLayout->componentID.token1 = charTypeHandle.Address.Value; + pLayout->componentID.token2 = 0; + pLayout->componentType = CorElementType.Char; + pLayout->firstElementOffset = pointerSize + 4; + pLayout->elementSize = sizeof(char); + pLayout->countOffset = pointerSize; + pLayout->rankSize = 4; + pLayout->numRanks = 1; + pLayout->rankOffset = pointerSize; + } + else + { + if (!rts.IsArray(arrayOrStringTypeHandle, out uint rank)) + throw Marshal.GetExceptionForHR(HResults.E_INVALIDARG)!; + + TypeHandle componentTypeHandle = rts.GetTypeParam(arrayOrStringTypeHandle); + CorElementType componentType = rts.IsString(componentTypeHandle) ? CorElementType.String : rts.GetInternalCorElementType(componentTypeHandle); + pLayout->componentID.token1 = componentTypeHandle.Address.Value; + pLayout->componentID.token2 = 0; + pLayout->componentType = componentType; + Target.TypeInfo objectHeaderTypeInfo = _target.GetTypeInfo(DataType.ObjectHeader); + uint objectHeaderSize = (uint)objectHeaderTypeInfo.Size!.Value; + pLayout->firstElementOffset = rts.GetBaseSize(arrayOrStringTypeHandle) - objectHeaderSize; + pLayout->elementSize = rts.GetComponentSize(arrayOrStringTypeHandle); + pLayout->countOffset = pointerSize; + pLayout->rankSize = 4; + pLayout->numRanks = rank; + pLayout->rankOffset = rank > 1 ? pointerSize * 2 : pointerSize; + } + } + catch (System.Exception ex) + { + hr = ex.HResult; + } + +#if DEBUG + if (_legacy is not null) + { + COR_ARRAY_LAYOUT resultLocal; + int hrLocal = _legacy.GetArrayLayout(id, &resultLocal); + Debug.ValidateHResult(hr, hrLocal); + if (hr == HResults.S_OK) + { + Debug.Assert(pLayout->componentID.token1 == resultLocal.componentID.token1, $"cDAC: {pLayout->componentID.token1:x}, DAC: {resultLocal.componentID.token1:x}"); + Debug.Assert(pLayout->componentID.token2 == resultLocal.componentID.token2, $"cDAC: {pLayout->componentID.token2:x}, DAC: {resultLocal.componentID.token2:x}"); + Debug.Assert(pLayout->componentType == resultLocal.componentType, $"cDAC: {pLayout->componentType}, DAC: {resultLocal.componentType}"); + Debug.Assert(pLayout->firstElementOffset == resultLocal.firstElementOffset, $"cDAC: {pLayout->firstElementOffset}, DAC: {resultLocal.firstElementOffset}"); + Debug.Assert(pLayout->elementSize == resultLocal.elementSize, $"cDAC: {pLayout->elementSize}, DAC: {resultLocal.elementSize}"); + Debug.Assert(pLayout->countOffset == resultLocal.countOffset, $"cDAC: {pLayout->countOffset}, DAC: {resultLocal.countOffset}"); + Debug.Assert(pLayout->rankSize == resultLocal.rankSize, $"cDAC: {pLayout->rankSize}, DAC: {resultLocal.rankSize}"); + Debug.Assert(pLayout->numRanks == resultLocal.numRanks, $"cDAC: {pLayout->numRanks}, DAC: {resultLocal.numRanks}"); + Debug.Assert(pLayout->rankOffset == resultLocal.rankOffset, $"cDAC: {pLayout->rankOffset}, DAC: {resultLocal.rankOffset}"); + } + } +#endif + + return hr; + } public int GetGCHeapInformation(COR_HEAPINFO* pHeapInfo) { diff --git a/src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Legacy/Dbi/IDacDbiInterface.cs b/src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Legacy/Dbi/IDacDbiInterface.cs index d675d433240dfd..e3a2e87bd70421 100644 --- a/src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Legacy/Dbi/IDacDbiInterface.cs +++ b/src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Legacy/Dbi/IDacDbiInterface.cs @@ -4,6 +4,7 @@ using System; using System.Runtime.InteropServices; using System.Runtime.InteropServices.Marshalling; +using CorElementType = Microsoft.Diagnostics.DataContractReader.Contracts.CorElementType; namespace Microsoft.Diagnostics.DataContractReader.Legacy; @@ -128,6 +129,19 @@ public struct COR_TYPE_LAYOUT public int type; } +[StructLayout(LayoutKind.Sequential)] +public struct COR_ARRAY_LAYOUT +{ + public COR_TYPEID componentID; + public CorElementType componentType; + public uint firstElementOffset; + public uint elementSize; + public uint countOffset; + public uint rankSize; + public uint numRanks; + public uint rankOffset; +} + [StructLayout(LayoutKind.Sequential)] public struct COR_FIELD { @@ -505,10 +519,10 @@ public unsafe partial interface IDacDbiInterface int GetObjectFields(nint id, uint celt, COR_FIELD* layout, uint* pceltFetched); [PreserveSig] - int GetTypeLayout(nint id, COR_TYPE_LAYOUT* pLayout); + int GetTypeLayout(ulong id, COR_TYPE_LAYOUT* pLayout); [PreserveSig] - int GetArrayLayout(nint id, nint pLayout); + int GetArrayLayout(ulong id, COR_ARRAY_LAYOUT* pLayout); [PreserveSig] int GetGCHeapInformation(COR_HEAPINFO* pHeapInfo); diff --git a/src/native/managed/cdac/tests/DumpTests/DacDbi/DacDbiObjectDumpTests.cs b/src/native/managed/cdac/tests/DumpTests/DacDbi/DacDbiObjectDumpTests.cs index bfc99d47991f09..cb96724be12e54 100644 --- a/src/native/managed/cdac/tests/DumpTests/DacDbi/DacDbiObjectDumpTests.cs +++ b/src/native/managed/cdac/tests/DumpTests/DacDbi/DacDbiObjectDumpTests.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using Microsoft.Diagnostics.DataContractReader.Legacy; +using Microsoft.Diagnostics.DataContractReader.Contracts; using Xunit; namespace Microsoft.Diagnostics.DataContractReader.DumpTests; @@ -45,4 +46,78 @@ public unsafe void GetHandleAddressFromVmHandle_IsIdentity(TestConfiguration con Assert.Equal(testAddr, result); } + [ConditionalTheory] + [MemberData(nameof(TestConfigurations))] + public unsafe void GetTypeLayout_Object_CrossValidatesContract(TestConfiguration config) + { + InitializeDumpTest(config); + DacDbiImpl dbi = CreateDacDbi(); + + TargetPointer objectMT = Target.ReadPointer(Target.ReadGlobalPointer("ObjectMethodTable")); + TypeHandle objectHandle = Target.Contracts.RuntimeTypeSystem.GetTypeHandle(objectMT); + + COR_TYPE_LAYOUT layout; + int hr = dbi.GetTypeLayout(objectMT.Value, &layout); + Assert.Equal(System.HResults.S_OK, hr); + + Assert.Equal(Target.Contracts.RuntimeTypeSystem.GetParentMethodTable(objectHandle).Value, layout.parentID.token1); + Assert.Equal(Target.Contracts.RuntimeTypeSystem.GetBaseSize(objectHandle), layout.objectSize); + Assert.Equal(Target.Contracts.RuntimeTypeSystem.GetNumInstanceFields(objectHandle), layout.numFields); + Assert.Equal(0u, layout.boxOffset); + Assert.Equal((int)CorElementType.Class, layout.type); + } + + [ConditionalTheory] + [MemberData(nameof(TestConfigurations))] + public unsafe void GetArrayLayout_ObjectArray_CrossValidatesContract(TestConfiguration config) + { + InitializeDumpTest(config); + DacDbiImpl dbi = CreateDacDbi(); + IRuntimeTypeSystem rts = Target.Contracts.RuntimeTypeSystem; + + TargetPointer arrayMT = Target.ReadPointer(Target.ReadGlobalPointer("ObjectArrayMethodTable")); + TypeHandle arrayHandle = rts.GetTypeHandle(arrayMT); + TypeHandle componentHandle = rts.GetTypeParam(arrayHandle); + Assert.True(rts.IsArray(arrayHandle, out uint rank)); + + COR_ARRAY_LAYOUT layout; + int hr = dbi.GetArrayLayout(arrayMT.Value, &layout); + Assert.Equal(System.HResults.S_OK, hr); + + CorElementType expectedComponentType = rts.IsString(componentHandle) + ? CorElementType.String + : rts.GetSignatureCorElementType(componentHandle); + + Assert.Equal(componentHandle.Address.Value, layout.componentID.token1); + Assert.Equal(expectedComponentType, layout.componentType); + Assert.Equal((uint)Target.PointerSize, layout.elementSize); + Assert.Equal((uint)Target.PointerSize, layout.countOffset); + Assert.Equal((uint)sizeof(uint), layout.rankSize); + Assert.Equal(rank, layout.numRanks); + Assert.Equal((uint)Target.PointerSize, layout.rankOffset); + } + + [ConditionalTheory] + [MemberData(nameof(TestConfigurations))] + public unsafe void GetArrayLayout_String_HasExpectedLayout(TestConfiguration config) + { + InitializeDumpTest(config); + DacDbiImpl dbi = CreateDacDbi(); + IRuntimeTypeSystem rts = Target.Contracts.RuntimeTypeSystem; + + TargetPointer stringMT = Target.ReadPointer(Target.ReadGlobalPointer("StringMethodTable")); + COR_ARRAY_LAYOUT layout; + int hr = dbi.GetArrayLayout(stringMT.Value, &layout); + Assert.Equal(System.HResults.S_OK, hr); + + Assert.Equal(rts.GetPrimitiveType(CorElementType.Char).Address.Value, layout.componentID.token1); + Assert.Equal(CorElementType.Char, layout.componentType); + Assert.Equal((uint)Target.PointerSize + sizeof(uint), layout.firstElementOffset); + Assert.Equal((uint)sizeof(char), layout.elementSize); + Assert.Equal((uint)Target.PointerSize, layout.countOffset); + Assert.Equal((uint)sizeof(uint), layout.rankSize); + Assert.Equal(1u, layout.numRanks); + Assert.Equal((uint)Target.PointerSize, layout.rankOffset); + } + } diff --git a/src/native/managed/cdac/tests/DumpTests/RuntimeTypeSystemDumpTests.cs b/src/native/managed/cdac/tests/DumpTests/RuntimeTypeSystemDumpTests.cs index 7abd590dff17e1..8a049c6a436af8 100644 --- a/src/native/managed/cdac/tests/DumpTests/RuntimeTypeSystemDumpTests.cs +++ b/src/native/managed/cdac/tests/DumpTests/RuntimeTypeSystemDumpTests.cs @@ -228,6 +228,32 @@ public void RuntimeTypeSystem_StringCorElementTypeIsClass(TestConfiguration conf Assert.Equal(CorElementType.Class, corType); } + [ConditionalTheory] + [MemberData(nameof(TestConfigurations))] + public void RuntimeTypeSystem_IsObjRef_AreConsistent(TestConfiguration config) + { + InitializeDumpTest(config); + IRuntimeTypeSystem rts = Target.Contracts.RuntimeTypeSystem; + ILoader loader = Target.Contracts.Loader; + + TargetPointer objectMT = Target.ReadPointer(Target.ReadGlobalPointer("ObjectMethodTable")); + TargetPointer stringMT = Target.ReadPointer(Target.ReadGlobalPointer("StringMethodTable")); + TargetPointer objectArrayMT = Target.ReadPointer(Target.ReadGlobalPointer("ObjectArrayMethodTable")); + + TypeHandle objectHandle = rts.GetTypeHandle(objectMT); + TypeHandle stringHandle = rts.GetTypeHandle(stringMT); + TypeHandle objectArrayHandle = rts.GetTypeHandle(objectArrayMT); + + TargetPointer systemAssembly = loader.GetSystemAssembly(); + ModuleHandle coreLibModule = loader.GetModuleHandleFromAssemblyPtr(systemAssembly); + TypeHandle intPtrHandle = rts.GetTypeByNameAndModule("IntPtr", "System", coreLibModule); + + Assert.True(rts.IsObjRef(objectHandle)); + Assert.True(rts.IsObjRef(stringHandle)); + Assert.True(rts.IsObjRef(objectArrayHandle)); + Assert.False(rts.IsObjRef(intPtrHandle)); + } + [ConditionalTheory] [MemberData(nameof(TestConfigurations))] public void RuntimeTypeSystem_ObjectMethodTableHasIntroducedMethods(TestConfiguration config) diff --git a/src/native/managed/cdac/tests/MethodTableTests.cs b/src/native/managed/cdac/tests/MethodTableTests.cs index e8c15ad11f6734..6ceafece039de6 100644 --- a/src/native/managed/cdac/tests/MethodTableTests.cs +++ b/src/native/managed/cdac/tests/MethodTableTests.cs @@ -510,6 +510,61 @@ public void ValidateContinuationMethodTablePointer(MockTarget.Architecture arch) Assert.True(contract.IsContinuation(continuationTypeHandle)); } + [Theory] + [ClassData(typeof(MockTarget.StdArch))] + public void IsObjRef_ReturnsExpectedValues(MockTarget.Architecture arch) + { + TargetPointer objectTypePtr = default; + TargetPointer stringTypePtr = default; + TargetPointer szArrayTypePtr = default; + TargetPointer truePrimitiveTypePtr = default; + + TestPlaceholderTarget target = CreateTarget( + arch, + rtsBuilder => + { + TargetTestHelpers helpers = rtsBuilder.Builder.TargetTestHelpers; + objectTypePtr = rtsBuilder.SystemObjectMethodTable.Address; + + MockEEClass stringEEClass = rtsBuilder.AddEEClass("System.String"); + MockMethodTable stringMethodTable = rtsBuilder.AddMethodTable("System.String"); + stringMethodTable.MTFlags = (uint)MethodTableFlags_1.WFLAGS_HIGH.HasComponentSize | 2; + stringMethodTable.BaseSize = helpers.StringBaseSize; + stringMethodTable.ParentMethodTable = objectTypePtr; + stringTypePtr = stringMethodTable.Address; + stringEEClass.MethodTable = stringTypePtr; + stringMethodTable.EEClassOrCanonMT = stringEEClass.Address; + + MockEEClass szArrayEEClass = rtsBuilder.AddEEClass("System.Int32[]"); + MockMethodTable szArrayMethodTable = rtsBuilder.AddMethodTable("System.Int32[]"); + szArrayMethodTable.MTFlags = + (uint)MethodTableFlags_1.WFLAGS_HIGH.HasComponentSize + | (uint)MethodTableFlags_1.WFLAGS_HIGH.Category_Array + | (uint)MethodTableFlags_1.WFLAGS_HIGH.Category_IfArrayThenSzArray + | 4; + szArrayMethodTable.BaseSize = helpers.ArrayBaseBaseSize; + szArrayMethodTable.ParentMethodTable = objectTypePtr; + szArrayTypePtr = szArrayMethodTable.Address; + szArrayEEClass.MethodTable = szArrayTypePtr; + szArrayMethodTable.EEClassOrCanonMT = szArrayEEClass.Address; + + MockEEClass truePrimitiveEEClass = rtsBuilder.AddEEClass("System.IntPtr"); + truePrimitiveEEClass.InternalCorElementType = (byte)CorElementType.I; + MockMethodTable truePrimitiveMethodTable = rtsBuilder.AddMethodTable("System.IntPtr"); + truePrimitiveMethodTable.MTFlags = (uint)MethodTableFlags_1.WFLAGS_HIGH.Category_TruePrimitive; + truePrimitiveMethodTable.BaseSize = helpers.ObjectBaseSize; + truePrimitiveTypePtr = truePrimitiveMethodTable.Address; + truePrimitiveEEClass.MethodTable = truePrimitiveTypePtr; + truePrimitiveMethodTable.EEClassOrCanonMT = truePrimitiveEEClass.Address; + }); + + IRuntimeTypeSystem contract = target.Contracts.RuntimeTypeSystem; + Assert.True(contract.IsObjRef(contract.GetTypeHandle(objectTypePtr))); + Assert.True(contract.IsObjRef(contract.GetTypeHandle(stringTypePtr))); + Assert.True(contract.IsObjRef(contract.GetTypeHandle(szArrayTypePtr))); + Assert.False(contract.IsObjRef(contract.GetTypeHandle(truePrimitiveTypePtr))); + } + [Theory] [ClassData(typeof(MockTarget.StdArch))] public void IsValueTypeReturnsTrueForValueTypeCategories(MockTarget.Architecture arch) diff --git a/src/native/managed/cdac/tests/MockDescriptors/MockDescriptors.RuntimeTypeSystem.cs b/src/native/managed/cdac/tests/MockDescriptors/MockDescriptors.RuntimeTypeSystem.cs index ccf99761dd4dd4..6ad4ed4996405a 100644 --- a/src/native/managed/cdac/tests/MockDescriptors/MockDescriptors.RuntimeTypeSystem.cs +++ b/src/native/managed/cdac/tests/MockDescriptors/MockDescriptors.RuntimeTypeSystem.cs @@ -139,6 +139,18 @@ public ushort NumMethods set => WriteUInt16Field(NumMethodsFieldName, value); } + public byte InternalCorElementType + { + get => ReadByteField(InternalCorElementTypeFieldName); + set => WriteByteField(InternalCorElementTypeFieldName, value); + } + + public ushort NumInstanceFields + { + get => ReadUInt16Field(NumInstanceFieldsFieldName); + set => WriteUInt16Field(NumInstanceFieldsFieldName, value); + } + public ushort NumNonVirtualSlots { get => ReadUInt16Field(NumNonVirtualSlotsFieldName); From 917ea403e6f62ecdff98be6f841e5ace11fe5efb Mon Sep 17 00:00:00 2001 From: Nikolay Zdravkov Date: Sat, 9 May 2026 21:19:34 +0300 Subject: [PATCH 075/109] perf: reuse counter snapshot buffer in CounterGroup.OnTimer (#127886) `CounterGroup.OnTimer` allocates a fresh `DiagnosticCounter[]` snapshot every poll to copy the counter list. In practice the counter set is fixed at `EventSource` construction and rarely changes. Reuse a per-instance buffer instead, grow on demand, and clear trailing slots for disposed counters. --- .../Diagnostics/Tracing/CounterGroup.cs | 21 +++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/CounterGroup.cs b/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/CounterGroup.cs index 8bdda96a727971..fdc01f6d58b4a7 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/CounterGroup.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/CounterGroup.cs @@ -148,6 +148,9 @@ internal static CounterGroup GetCounterGroup(EventSource eventSource) private TimeSpan _pollingInterval; private TimeSpan _nextPollingOffset; + // Accessed only from OnTimer, which runs only on the single s_pollingThread. + private DiagnosticCounter[] _onTimerCounters = []; + private void EnableTimer(float pollingIntervalInSeconds) { Debug.Assert(pollingIntervalInSeconds > 0); @@ -232,21 +235,29 @@ private void OnTimer() TimeSpan nowOffset; TimeSpan elapsed; TimeSpan pollingInterval; - DiagnosticCounter[] counters; + int counterCount; lock (s_counterGroupLock) { nowOffset = Stopwatch.GetElapsedTime(_baseTimestamp); elapsed = nowOffset - _timeSinceCollectionStarted; pollingInterval = _pollingInterval; - counters = new DiagnosticCounter[_counters.Count]; - _counters.CopyTo(counters); + + // Safe to reuse _onTimerCounters: OnTimer is the only reader/writer, + // and runs only on the single s_pollingThread (see PollForValues). + counterCount = _counters.Count; + if (_onTimerCounters.Length < counterCount) + { + _onTimerCounters = new DiagnosticCounter[counterCount]; + } + + _counters.CopyTo(_onTimerCounters); } // MUST keep out of the scope of s_counterGroupLock because this will cause WritePayload // callback can be re-entrant to CounterGroup (i.e. it's possible it calls back into EnableTimer() // above, since WritePayload callback can contain user code that can invoke EventSource constructor // and lead to a deadlock. (See https://github.com/dotnet/runtime/issues/40190 for details) - foreach (DiagnosticCounter counter in counters) + foreach (DiagnosticCounter counter in _onTimerCounters.AsSpan(0, counterCount)) { // NOTE: It is still possible for a race condition to occur here. An example is if the session // that subscribed to these batch of counters was disabled and it was immediately enabled in @@ -260,6 +271,8 @@ private void OnTimer() counter.WritePayload((float)elapsed.TotalSeconds, (int)pollingInterval.TotalMilliseconds); } + Array.Clear(_onTimerCounters); + lock (s_counterGroupLock) { _timeSinceCollectionStarted = nowOffset; From 1e3ffb5b253f0f9fa7d32b37400efdb82bcc83d9 Mon Sep 17 00:00:00 2001 From: Kevin Jones Date: Sat, 9 May 2026 15:00:45 -0400 Subject: [PATCH 076/109] Fix EncodeUnsignedInteger for test DSA signer `EncodeUnsignedInteger` did not encode ASN.1 integers correctly when there was a leading zero and the second octet had its high bit set, requiring a leading zero to preserve positive sign. For example, encoding the unsigned integer `[0x00, 0xFF]` would get encoded to the ASN.1 `0201FF`, or -1. It should be encoded to `020200FF`. Conscrypt is picky about the ASN.1 encoding. This test had a ~0.46% failure chance (because it would fail if either r or s were encoded incorrectly). The first commit to this PR fixes `EncodeUnsignedInteger`. However all of the hand-rolled ASN.1 encoding is unnecessary. We can 1. Use `AsnWriter` to do ASN.1 encoding. Let `BigInteger` and `AsnWriter` do the correct encoding for us. 2. Use `DSASignatureFormat.Rfc3279DerSequence` so we don't have to convert from IEEE. Finally, this removed the ActiveIssue attribute. --- .../CertificateCreation/CrlBuilderTests.cs | 1 - .../DSAX509SignatureGenerator.cs | 136 +++--------------- 2 files changed, 21 insertions(+), 116 deletions(-) diff --git a/src/libraries/System.Security.Cryptography/tests/X509Certificates/CertificateCreation/CrlBuilderTests.cs b/src/libraries/System.Security.Cryptography/tests/X509Certificates/CertificateCreation/CrlBuilderTests.cs index 7e08d3b39e01af..f6299dfe02004a 100644 --- a/src/libraries/System.Security.Cryptography/tests/X509Certificates/CertificateCreation/CrlBuilderTests.cs +++ b/src/libraries/System.Security.Cryptography/tests/X509Certificates/CertificateCreation/CrlBuilderTests.cs @@ -778,7 +778,6 @@ public static void UnsupportedRevocationReasons() } [ConditionalFact(typeof(PlatformSupport), nameof(PlatformSupport.IsDSASupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/119023", TestPlatforms.Android)] public static void DsaNotDirectlySupported() { CertificateRevocationListBuilder builder = new CertificateRevocationListBuilder(); diff --git a/src/libraries/System.Security.Cryptography/tests/X509Certificates/CertificateCreation/DSAX509SignatureGenerator.cs b/src/libraries/System.Security.Cryptography/tests/X509Certificates/CertificateCreation/DSAX509SignatureGenerator.cs index b35e0496cafc3d..4a0c3f0c390764 100644 --- a/src/libraries/System.Security.Cryptography/tests/X509Certificates/CertificateCreation/DSAX509SignatureGenerator.cs +++ b/src/libraries/System.Security.Cryptography/tests/X509Certificates/CertificateCreation/DSAX509SignatureGenerator.cs @@ -1,9 +1,8 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -using System.Collections.Generic; -using System.Diagnostics; -using System.Linq; +using System.Formats.Asn1; +using System.Numerics; using Test.Cryptography; namespace System.Security.Cryptography.X509Certificates.Tests.CertificateCreation @@ -35,109 +34,9 @@ public override byte[] GetSignatureAlgorithmIdentifier(HashAlgorithmName hashAlg throw new InvalidOperationException(); } - private static byte[] EncodeLength(int length) - { - Debug.Assert(length >= 0); - - byte low = unchecked((byte)length); - - // If the length value fits in 7 bits, it's an answer all by itself. - if (length < 0x80) - { - return new[] { low }; - } - - if (length <= 0xFF) - { - return new byte[] { 0x81, low }; - } - - int remainder = length >> 8; - byte midLow = unchecked((byte)remainder); - - if (length <= 0xFFFF) - { - return new byte[] { 0x82, midLow, low }; - } - - remainder >>= 8; - byte midHigh = unchecked((byte)remainder); - - if (length <= 0xFFFFFF) - { - return new byte[] { 0x83, midHigh, midLow, low }; - } - - remainder >>= 8; - byte high = unchecked((byte)remainder); - - // Since we know this was a non-negative signed number, the highest - // legal value here is 0x7F. - Debug.Assert(remainder < 0x80); - - return new byte[] { 0x84, high, midHigh, midLow, low }; - } - - private byte[] EncodeUnsignedInteger(byte[] data) - { - return EncodeUnsignedInteger(data, 0, data.Length); - } - - private byte[] EncodeUnsignedInteger(byte[] data, int offset, int count) - { - int length = count; - int realOffset = offset; - bool paddingByte = false; - - if (count == 0 || data[offset] >= 0x80) - { - paddingByte = true; - } - else - { - while (length > 1 && data[realOffset] == 0) - { - realOffset++; - length--; - } - } - - byte encodedLength = (byte)length; - - if (paddingByte) - { - encodedLength++; - } - - IEnumerable bytes = new byte[] { 0x02 }; - bytes = bytes.Concat(EncodeLength(encodedLength)); - - if (paddingByte) - { - bytes = bytes.Concat(new byte[1]); - } - - bytes = bytes.Concat(data.Skip(realOffset).Take(length)); - - return bytes.ToArray(); - } - public override byte[] SignData(byte[] data, HashAlgorithmName hashAlgorithm) { - byte[] ieeeFormat = _key.SignData(data, hashAlgorithm); - - Debug.Assert(ieeeFormat.Length % 2 == 0); - int segmentLength = ieeeFormat.Length / 2; - - byte[] r = EncodeUnsignedInteger(ieeeFormat, 0, segmentLength); - byte[] s = EncodeUnsignedInteger(ieeeFormat, segmentLength, segmentLength); - - return - new byte[] { 0x30 }. - Concat(EncodeLength(r.Length + s.Length)). - Concat(r). - Concat(s). - ToArray(); + return _key.SignData(data, hashAlgorithm, DSASignatureFormat.Rfc3279DerSequence); } protected override PublicKey BuildPublicKey() @@ -153,24 +52,31 @@ protected override PublicKey BuildPublicKey() // g INTEGER // } - byte[] p = EncodeUnsignedInteger(dsaParameters.P); - byte[] q = EncodeUnsignedInteger(dsaParameters.Q); - byte[] g = EncodeUnsignedInteger(dsaParameters.G); + AsnWriter writer = new AsnWriter(AsnEncodingRules.DER); - byte[] algParameters = - new byte[] { 0x30 }. - Concat(EncodeLength(p.Length + q.Length + g.Length)). - Concat(p). - Concat(q). - Concat(g). - ToArray(); + using (writer.PushSequence()) + { + WriteUnsignedInteger(writer, dsaParameters.P); + WriteUnsignedInteger(writer, dsaParameters.Q); + WriteUnsignedInteger(writer, dsaParameters.G); + } + + byte[] algParameters = writer.Encode(); - byte[] keyValue = EncodeUnsignedInteger(dsaParameters.Y); + writer.Reset(); + WriteUnsignedInteger(writer, dsaParameters.Y); + byte[] keyValue = writer.Encode(); return new PublicKey( oid, new AsnEncodedData(oid, algParameters), new AsnEncodedData(oid, keyValue)); } + + private static void WriteUnsignedInteger(AsnWriter writer, ReadOnlySpan value) + { + BigInteger integer = new BigInteger(value, isUnsigned: true, isBigEndian: true); + writer.WriteInteger(integer); + } } } From c701e381728c5e2cac9e8e8298b9d8921d6f751d Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Sun, 10 May 2026 04:03:53 +0000 Subject: [PATCH 077/109] Fix CS9361 stackalloc unsafe context in X25519DiffieHellmanCng Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: EgorBo <523221+EgorBo@users.noreply.github.com> Co-authored-by: vcsjones <361677+vcsjones@users.noreply.github.com> --- .../Cryptography/X25519DiffieHellmanCng.Windows.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/X25519DiffieHellmanCng.Windows.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/X25519DiffieHellmanCng.Windows.cs index 4c36b457306c85..c02392df0f300d 100644 --- a/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/X25519DiffieHellmanCng.Windows.cs +++ b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/X25519DiffieHellmanCng.Windows.cs @@ -41,7 +41,13 @@ protected override partial void DeriveRawSecretAgreementCore(X25519DiffieHellman { // We intentionally don't special case otherParty being an instance of X25519DiffieHellmanCng and always // export the public key into the current instance's provider. - Span publicKeyBuffer = stackalloc byte[PublicKeySizeInBytes * 2]; + scoped Span publicKeyBuffer; + + unsafe + { + publicKeyBuffer = stackalloc byte[PublicKeySizeInBytes * 2]; + } + Span publicKeyBytes = publicKeyBuffer.Slice(0, PublicKeySizeInBytes); Span reducedPublicKey = publicKeyBuffer.Slice(PublicKeySizeInBytes, PublicKeySizeInBytes); otherParty.ExportPublicKey(publicKeyBytes); From 5fbc0821a24089c78b4463857965e402f78aead9 Mon Sep 17 00:00:00 2001 From: Andy Gocke Date: Sun, 10 May 2026 01:31:55 -0700 Subject: [PATCH 078/109] Remove buildConfig from sccache cache key to share across PR/rolling builds (#127997) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit > [!NOTE] > This PR description was generated with the assistance of GitHub Copilot. ## Summary Remove `buildConfig` (Debug/Release) from the sccache ADO Pipeline Cache key so that PR builds can warm-start from rolling-build caches. ## Problem The sccache cache key included `buildConfig`, which is `Debug` for PR builds and `Release` for rolling builds. This created completely separate cache namespaces, meaning: - Rolling builds saved caches to `sccache|...|Release|...` keys in the `refs/heads/main` scope - PR builds looked for `sccache|...|Debug|...` keys, never finding rolling build caches - **Every first build of a new PR started with a cold sccache cache (0% hit rate)** - Cache hits only occurred on subsequent pushes to the *same* PR ## Why this is safe The native compiler flags are determined by `-rc` (RuntimeConfiguration), **not** `-c` (Configuration): | Leg | `-rc` (native) | `-c` (managed) PR | `-c` (managed) Rolling | |-----|----------------|-------------------|------------------------| | CoreCLR_Libraries | **Release** | Debug | Release | | Libraries_CheckedCoreCLR | **Checked** | Debug | Release | Since `-rc` is hardcoded per leg, the CMake build type and native compiler flags are identical between PR and rolling builds. The `-c` flag only affects managed code, which sccache doesn't cache. ## Expected impact PR builds will restore sccache caches from rolling builds (saved in the main scope), giving ~99% hit rates on first push — a **33-46% reduction in build time** for the linux-x64 native compilation legs based on [prior analysis](https://gist.github.com/steveisok/15758f11d9c5e8e2e29455cd768da955). --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- eng/pipelines/coreclr/templates/setup-sccache.yml | 11 +++++++++-- .../System/Security/Cryptography/Cng.NotSupported.cs | 2 +- .../Cryptography/X25519DiffieHellmanCng.Windows.cs | 2 +- .../Security/Cryptography/X25519DiffieHellmanCng.cs | 2 +- 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/eng/pipelines/coreclr/templates/setup-sccache.yml b/eng/pipelines/coreclr/templates/setup-sccache.yml index 8956dd833099ea..e4df573e00ef40 100644 --- a/eng/pipelines/coreclr/templates/setup-sccache.yml +++ b/eng/pipelines/coreclr/templates/setup-sccache.yml @@ -19,13 +19,20 @@ steps: # Set up the Azure Pipeline Cache for sccache's local cache directory. # Use a rolling key so each build can update the cache; restoreKeys # falls back to the most recent saved entry. + # + # buildConfig is intentionally excluded from the key: it reflects + # the *managed* Configuration (Debug for PRs, Release for rolling + # builds), but sccache only caches native (C/C++) compilations whose + # flags are controlled by RuntimeConfiguration (-rc), which is + # constant per leg regardless of buildConfig. Omitting it lets PR + # builds warm-start from rolling-build caches saved in the main scope. - task: Cache@2 displayName: Sccache cache inputs: - key: sccache | ${{ parameters.osGroup }} | ${{ parameters.archType }} | ${{ parameters.nameSuffix }} | ${{ parameters.buildConfig }} | "$(Build.BuildId)" + key: sccache | ${{ parameters.osGroup }} | ${{ parameters.archType }} | ${{ parameters.nameSuffix }} | "$(Build.BuildId)" path: $(Pipeline.Workspace)/.sccache restoreKeys: | - sccache | ${{ parameters.osGroup }} | ${{ parameters.archType }} | ${{ parameters.nameSuffix }} | ${{ parameters.buildConfig }} + sccache | ${{ parameters.osGroup }} | ${{ parameters.archType }} | ${{ parameters.nameSuffix }} # Configure sccache environment and add binary to PATH. # The sccache package is restored by runtime-prereqs.proj during the build. diff --git a/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/Cng.NotSupported.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/Cng.NotSupported.cs index 5c5bd54dccdb08..0182251fa124ac 100644 --- a/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/Cng.NotSupported.cs +++ b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/Cng.NotSupported.cs @@ -500,7 +500,7 @@ public partial CngKey GetKey() throw new PlatformNotSupportedException(SR.PlatformNotSupported_CryptographyCng); } - protected override partial void DeriveRawSecretAgreementCore(X25519DiffieHellman otherParty, Span destination) + protected override unsafe partial void DeriveRawSecretAgreementCore(X25519DiffieHellman otherParty, Span destination) { throw new PlatformNotSupportedException(SR.PlatformNotSupported_CryptographyCng); } diff --git a/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/X25519DiffieHellmanCng.Windows.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/X25519DiffieHellmanCng.Windows.cs index c02392df0f300d..912e6866c644c7 100644 --- a/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/X25519DiffieHellmanCng.Windows.cs +++ b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/X25519DiffieHellmanCng.Windows.cs @@ -37,7 +37,7 @@ public partial CngKey GetKey() return CngHelpers.Duplicate(_key.HandleNoDuplicate, _key.IsEphemeral); } - protected override partial void DeriveRawSecretAgreementCore(X25519DiffieHellman otherParty, Span destination) + protected override unsafe partial void DeriveRawSecretAgreementCore(X25519DiffieHellman otherParty, Span destination) { // We intentionally don't special case otherParty being an instance of X25519DiffieHellmanCng and always // export the public key into the current instance's provider. diff --git a/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/X25519DiffieHellmanCng.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/X25519DiffieHellmanCng.cs index 27e77afa6049fc..588a4597c4deb4 100644 --- a/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/X25519DiffieHellmanCng.cs +++ b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/X25519DiffieHellmanCng.cs @@ -53,7 +53,7 @@ public sealed partial class X25519DiffieHellmanCng : X25519DiffieHellman public partial CngKey GetKey(); /// - protected override partial void DeriveRawSecretAgreementCore(X25519DiffieHellman otherParty, Span destination); + protected override unsafe partial void DeriveRawSecretAgreementCore(X25519DiffieHellman otherParty, Span destination); /// protected override partial void ExportPublicKeyCore(Span destination); From 033157d3f5d5a5a45524cba80619cd20e7354b6f Mon Sep 17 00:00:00 2001 From: Egor Bogatov Date: Sun, 10 May 2026 16:15:29 +0200 Subject: [PATCH 079/109] Optimize Enumerable Min/Max final reduction with shuffles (#127995) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit > [!NOTE] > This PR was filed by AI (GitHub Copilot CLI). Inspired by a similar helper in Tensors. I guess we don't want to consume Tensors in Linq due to IL size concerns. It also doesn't look beneficial to share this function via source file due to different generics being used. Maybe Vector128 will get this as public API at some point. ## Benchmark ```cs [Params(16, 64)] public int Length; private byte[] _bytes; private sbyte[] _sbytes; private short[] _shorts; private ushort[] _ushorts; private int[] _ints; private uint[] _uints; private long[] _longs; private ulong[] _ulongs; [Benchmark] public byte MaxByte() => _bytes.Max(); [Benchmark] public sbyte MaxSByte() => _sbytes.Max(); [Benchmark] public short MaxShort() => _shorts.Max(); [Benchmark] public ushort MaxUShort() => _ushorts.Max(); [Benchmark] public int MaxInt() => _ints.Max(); [Benchmark] public uint MaxUInt() => _uints.Max(); [Benchmark] public long MaxLong() => _longs.Max(); [Benchmark] public ulong MaxULong() => _ulongs.Max(); ``` Full benchmark request and raw output: https://github.com/EgorBot/Benchmarks/issues/198 ## Results Speed-up = `main` time / `PR` time (higher is better). Numbers below are from EgorBot. ### ARM64 — Neoverse-N2 (`ubuntu24_azure_cobalt100`) | Method | Length | main | PR | Speed-up | |-----------|-------:|-------------:|-------------:|---------:| | MaxByte | 16 | 51.54 ns | 1.85 ns | **27.85×** | | MaxSByte | 16 | 49.58 ns | 1.90 ns | **26.16×** | | MaxShort | 16 | 23.66 ns | 0.98 ns | **24.16×** | | MaxUShort | 16 | 21.82 ns | 1.22 ns | **17.93×** | | MaxInt | 16 | 1.72 ns | 1.84 ns | 0.93× | | MaxUInt | 16 | 1.93 ns | 1.74 ns | 1.11× | | MaxLong | 16 | 3.77 ns | 3.91 ns | 0.96× | | MaxULong | 16 | 3.81 ns | 3.93 ns | 0.97× | | MaxByte | 64 | 49.64 ns | 2.03 ns | **24.51×** | | MaxSByte | 64 | 48.76 ns | 2.04 ns | **23.95×** | | MaxShort | 64 | 22.35 ns | 3.53 ns | **6.33×** | | MaxUShort | 64 | 22.33 ns | 3.36 ns | **6.64×** | | MaxInt | 64 | 6.33 ns | 6.21 ns | 1.02× | | MaxUInt | 64 | 6.17 ns | 6.51 ns | 0.95× | | MaxLong | 64 | 23.55 ns | 23.51 ns | 1.00× | | MaxULong | 64 | 23.36 ns | 23.44 ns | 1.00× | ### Intel — Emerald Rapids / AVX-512 (`ubuntu24_azure_emeraldrapids`) | Method | Length | main | PR | Speed-up | |-----------|-------:|-------------:|-------------:|---------:| | MaxByte | 16 | 8.88 ns | 0.93 ns | **9.54×** | | MaxSByte | 16 | 9.86 ns | 0.89 ns | **11.10×** | | MaxShort | 16 | 4.42 ns | 1.55 ns | **2.87×** | | MaxUShort | 16 | 4.45 ns | 1.02 ns | **4.38×** | | MaxInt | 16 | 1.66 ns | 0.88 ns | **1.89×** | | MaxUInt | 16 | 1.81 ns | 1.50 ns | 1.20× | | MaxLong | 16 | 0.96 ns | 0.89 ns | 1.08× | | MaxULong | 16 | 1.00 ns | 0.94 ns | 1.06× | | MaxByte | 64 | 16.31 ns | 1.44 ns | **11.39×** | | MaxSByte | 64 | 10.03 ns | 1.59 ns | **6.33×** | | MaxShort | 64 | 6.52 ns | 1.37 ns | **4.77×** | | MaxUShort | 64 | 6.54 ns | 1.54 ns | **4.26×** | | MaxInt | 64 | 2.44 ns | 1.68 ns | **1.47×** | | MaxUInt | 64 | 2.84 ns | 1.94 ns | **1.47×** | | MaxLong | 64 | 2.72 ns | 3.17 ns | 0.86× | | MaxULong | 64 | 3.17 ns | 2.97 ns | 1.07× | ### AMD — EPYC 9V45 (Turin) / AVX-512 (`ubuntu24_azure_turin`) | Method | Length | main | PR | Speed-up | |-----------|-------:|-------------:|-------------:|---------:| | MaxByte | 16 | 4.41 ns | 0.70 ns | **6.27×** | | MaxSByte | 16 | 4.96 ns | 0.83 ns | **5.96×** | | MaxShort | 16 | 3.01 ns | 0.87 ns | **3.45×** | | MaxUShort | 16 | 2.09 ns | 0.89 ns | **2.35×** | | MaxInt | 16 | 1.48 ns | 0.98 ns | **1.52×** | | MaxUInt | 16 | 1.64 ns | 0.98 ns | **1.68×** | | MaxLong | 16 | 0.94 ns | 0.91 ns | 1.03× | | MaxULong | 16 | 1.05 ns | 0.91 ns | 1.16× | | MaxByte | 64 | 5.86 ns | 1.27 ns | **4.61×** | | MaxSByte | 64 | 7.57 ns | 1.28 ns | **5.93×** | | MaxShort | 64 | 2.78 ns | 1.39 ns | **2.01×** | | MaxUShort | 64 | 2.96 ns | 1.13 ns | **2.61×** | | MaxInt | 64 | 2.27 ns | 1.61 ns | **1.41×** | | MaxUInt | 64 | 1.97 ns | 1.62 ns | **1.22×** | | MaxLong | 64 | 3.02 ns | 3.00 ns | 1.01× | | MaxULong | 64 | 2.87 ns | 2.10 ns | 1.37× | --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../System.Linq/src/System/Linq/MaxMin.cs | 52 +++++++++++++++---- 1 file changed, 43 insertions(+), 9 deletions(-) diff --git a/src/libraries/System.Linq/src/System/Linq/MaxMin.cs b/src/libraries/System.Linq/src/System/Linq/MaxMin.cs index 26e1d6eec512e4..760c70da179fc5 100644 --- a/src/libraries/System.Linq/src/System/Linq/MaxMin.cs +++ b/src/libraries/System.Linq/src/System/Linq/MaxMin.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.Collections.Generic; +using System.Diagnostics; using System.Numerics; using System.Runtime.Intrinsics; using System.Runtime.CompilerServices; @@ -101,15 +102,7 @@ private static T MinMaxInteger(this IEnumerable source) } // Reduce to single value - // NOTE: this can be optimized further with shuffles. - value = best128[0]; - for (int i = 1; i < Vector128.Count; i++) - { - if (TMinMax.Compare(best128[i], value)) - { - value = best128[i]; - } - } + value = HorizontalMinMax(best128); } else { @@ -132,5 +125,46 @@ private static T MinMaxInteger(this IEnumerable source) return value; } + + /// Reduces a to a single element using . + [MethodImpl(MethodImplOptions.AggressiveInlining)] + private static T HorizontalMinMax(Vector128 x) + where T : struct, IBinaryInteger + where TMinMax : IMinMaxCalc + { + // Perform log2(Vector128.Count) reductions, each combining the vector with a shuffled + // copy of itself so that lane 0 ends up holding the min/max of all original lanes. + if (Vector128.Count == 16) + { + x = TMinMax.Compare(x, Vector128.Shuffle(x.AsByte(), + Vector128.Create((byte)8, 9, 10, 11, 12, 13, 14, 15, 0, 1, 2, 3, 4, 5, 6, 7)).As()); + x = TMinMax.Compare(x, Vector128.Shuffle(x.AsByte(), + Vector128.Create((byte)4, 5, 6, 7, 0, 1, 2, 3, 8, 9, 10, 11, 12, 13, 14, 15)).As()); + x = TMinMax.Compare(x, Vector128.Shuffle(x.AsByte(), + Vector128.Create((byte)2, 3, 0, 1, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15)).As()); + x = TMinMax.Compare(x, Vector128.Shuffle(x.AsByte(), + Vector128.Create((byte)1, 0, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15)).As()); + } + else if (Vector128.Count == 8) + { + x = TMinMax.Compare(x, Vector128.Shuffle(x.AsInt16(), + Vector128.Create(4, 5, 6, 7, 0, 1, 2, 3)).As()); + x = TMinMax.Compare(x, Vector128.Shuffle(x.AsInt16(), + Vector128.Create(2, 3, 0, 1, 4, 5, 6, 7)).As()); + x = TMinMax.Compare(x, Vector128.Shuffle(x.AsInt16(), + Vector128.Create(1, 0, 2, 3, 4, 5, 6, 7)).As()); + } + else if (Vector128.Count == 4) + { + x = TMinMax.Compare(x, Vector128.Shuffle(x.AsInt32(), Vector128.Create(2, 3, 0, 1)).As()); + x = TMinMax.Compare(x, Vector128.Shuffle(x.AsInt32(), Vector128.Create(1, 0, 3, 2)).As()); + } + else + { + Debug.Assert(Vector128.Count == 2); + x = TMinMax.Compare(x, Vector128.Shuffle(x.AsInt64(), Vector128.Create(1, 0)).As()); + } + return x.ToScalar(); + } } } From df032fb61a567910e373066ea8de1cdbbe393337 Mon Sep 17 00:00:00 2001 From: BoyBaykiller <88141582+BoyBaykiller@users.noreply.github.com> Date: Sun, 10 May 2026 21:26:55 +0200 Subject: [PATCH 080/109] JIT: Fix GenTree::IsPow2 functions (#127615) `IsIntegralConstUnsignedPow2` was passing in sign extended value to `isPow2`. So it wasn't actually unsigned. For example: 1 << 31 would not be recognized as pow2. Add a `UnsignedIntegralValue` that gives the zero-extended literal. Use it in `IsIntegralConstUnsignedPow2` to fix it's impl. Also use it in `fgMorphUModToAndSub` and a place in lower. --- src/coreclr/jit/emitarm64.cpp | 17 +++-------------- src/coreclr/jit/gentree.cpp | 9 +++++++++ src/coreclr/jit/gentree.h | 9 ++++----- src/coreclr/jit/lower.cpp | 4 ++-- src/coreclr/jit/morph.cpp | 4 ++-- src/coreclr/jit/utils.h | 8 ++++++++ 6 files changed, 28 insertions(+), 23 deletions(-) diff --git a/src/coreclr/jit/emitarm64.cpp b/src/coreclr/jit/emitarm64.cpp index da56820d919774..3bf05d5936ecf4 100644 --- a/src/coreclr/jit/emitarm64.cpp +++ b/src/coreclr/jit/emitarm64.cpp @@ -2595,20 +2595,9 @@ emitter::code_t emitter::emitInsCode(instruction ins, insFormat fmt) { assert(width <= 64); - UINT64 result = ~value; - - if (width < 64) - { - // Check that 'value' fits in 'width' bits. Don't consider "sign" bits above width. - UINT64 maxVal = 1ULL << width; - UINT64 lowBitsMask = maxVal - 1; - UINT64 signBitsMask = ~lowBitsMask | (1ULL << (width - 1)); // The high bits must be set, and the top bit - // (sign bit) must be set. - assert((value < maxVal) || ((value & signBitsMask) == signBitsMask)); - - // mask off any extra bits that we got from the complement operation - result &= lowBitsMask; - } + // Mask for zero'ing bits above width. + UINT64 mask = UINT64_MAX >> (64 - width); + UINT64 result = ~value & mask; return result; } diff --git a/src/coreclr/jit/gentree.cpp b/src/coreclr/jit/gentree.cpp index d91d1961bc2ba4..30f8cee66ac294 100644 --- a/src/coreclr/jit/gentree.cpp +++ b/src/coreclr/jit/gentree.cpp @@ -19614,6 +19614,15 @@ bool GenTreeIntConCommon::ImmedValCanBeFolded(Compiler* comp, genTreeOps op) return !ImmedValNeedsReloc(comp) || (op == GT_EQ) || (op == GT_NE); } +UINT64 GenTreeIntConCommon::UnsignedIntegralValue() const +{ + uint64_t mask = (UINT64_MAX >> (64 - (genTypeSize(this) * BITS_PER_BYTE))); + + int64_t signExtended = IntegralValue(); + uint64_t zeroExtended = signExtended & mask; + return zeroExtended; +} + #if defined(TARGET_AMD64) || defined(TARGET_RISCV64) // Returns true if this absolute address fits within the base of an addr mode. // On Amd64 this effectively means, whether an absolute indirect address can diff --git a/src/coreclr/jit/gentree.h b/src/coreclr/jit/gentree.h index f0ad4bda78899c..f35406f4cf3044 100644 --- a/src/coreclr/jit/gentree.h +++ b/src/coreclr/jit/gentree.h @@ -3340,6 +3340,7 @@ struct GenTreeIntConCommon : public GenTree inline ssize_t IconValue() const; inline void SetIconValue(ssize_t val); inline INT64 IntegralValue() const; + UINT64 UnsignedIntegralValue() const; inline void SetIntegralValue(int64_t value); template @@ -3539,7 +3540,7 @@ inline INT64 GenTreeIntConCommon::IntegralValue() const #ifdef TARGET_64BIT return LngValue(); #else - return OperIs(GT_CNS_LNG) ? LngValue() : (INT64)IconValue(); + return OperIs(GT_CNS_LNG) ? LngValue() : static_cast(IconValue()); #endif // TARGET_64BIT } @@ -10476,7 +10477,7 @@ inline bool GenTree::IsIntegralConstUnsignedPow2() const { if (IsIntegralConst()) { - return isPow2((UINT64)AsIntConCommon()->IntegralValue()); + return isPow2(AsIntConCommon()->UnsignedIntegralValue()); } return false; @@ -10494,9 +10495,7 @@ inline bool GenTree::IsIntegralConstAbsPow2() const { if (IsIntegralConst()) { - INT64 svalue = AsIntConCommon()->IntegralValue(); - size_t value = (svalue == SSIZE_T_MIN) ? static_cast(svalue) : static_cast(abs(svalue)); - return isPow2(value); + return isAbsPow2(AsIntConCommon()->IntegralValue()); } return false; diff --git a/src/coreclr/jit/lower.cpp b/src/coreclr/jit/lower.cpp index 73bba8ae8a1914..8d1957e357db38 100644 --- a/src/coreclr/jit/lower.cpp +++ b/src/coreclr/jit/lower.cpp @@ -4326,8 +4326,8 @@ GenTree* Lowering::OptimizeConstCompare(GenTree* cmp) #ifdef TARGET_RISCV64 if (bitOp->IsIntegralConstUnsignedPow2()) { - INT64 bit = bitOp->AsIntConCommon()->IntegralValue(); - int log2 = BitOperations::Log2((UINT64)bit); + UINT64 bit = bitOp->AsIntConCommon()->UnsignedIntegralValue(); + int log2 = BitOperations::Log2(bit); bitOp->AsIntConCommon()->SetIntegralValue(log2); return true; } diff --git a/src/coreclr/jit/morph.cpp b/src/coreclr/jit/morph.cpp index 0a8073a84b3d23..771732a23624b0 100644 --- a/src/coreclr/jit/morph.cpp +++ b/src/coreclr/jit/morph.cpp @@ -12229,8 +12229,8 @@ GenTree* Compiler::fgMorphUModToAndSub(GenTreeOp* tree) const var_types type = tree->TypeGet(); - const size_t cnsValue = (static_cast(tree->gtOp2->AsIntConCommon()->IntegralValue())) - 1; - GenTree* const newTree = gtNewOperNode(GT_AND, type, tree->gtOp1, gtNewIconNodeWithVN(this, cnsValue, type)); + const size_t mask = static_cast(tree->gtOp2->AsIntConCommon()->UnsignedIntegralValue() - 1); + GenTree* const newTree = gtNewOperNode(GT_AND, type, tree->gtOp1, gtNewIconNodeWithVN(this, mask, type)); newTree->SetMorphed(this); DEBUG_DESTROY_NODE(tree->gtOp2); diff --git a/src/coreclr/jit/utils.h b/src/coreclr/jit/utils.h index 38c819e0672896..06b72fc33cd71e 100644 --- a/src/coreclr/jit/utils.h +++ b/src/coreclr/jit/utils.h @@ -67,6 +67,14 @@ inline bool isPow2(T i) return (i > 0 && ((i - 1) & i) == 0); } +// return true if abs(arg) is a power of 2 +template +inline bool isAbsPow2(T i) +{ + static_assert(std::numeric_limits::is_signed); + return (i == std::numeric_limits::min()) || isPow2(std::abs(i)); +} + template constexpr bool AreContiguous(T val1, T val2) { From 5001116c5cef4a620fd25d9fe909f38935c5023b Mon Sep 17 00:00:00 2001 From: Max Charlamb <44248479+max-charlamb@users.noreply.github.com> Date: Sun, 10 May 2026 19:56:34 -0400 Subject: [PATCH 081/109] Fix flaky AsyncContinuation cDAC dump test on osx-arm64 by using Task.Yield (#128004) > [!NOTE] > This pull request was prepared with assistance from GitHub Copilot. ## Problem `AsyncContinuationDumpTests.ThreadLocalContinuation_IsContinuation` fails intermittently on **osx-arm64 R2R** with: > Could not find AsyncDispatcherInfo type in CoreLib Failure tracked in #127774. Recently observed in builds [1413917](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1413917) and [1411121](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1411121). Fixes #127774 ## Root cause The test relies on the runtime having executed `AsyncHelpers+RuntimeAsyncTask.DispatchContinuations()`, which writes `AsyncDispatcherInfo.t_current` and forces the JIT to load the `AsyncDispatcherInfo` MethodTable. The current debuggee uses `await Task.Delay(1)` to force a suspension. On fast machines (in particular Apple Silicon CI machines) the 1ms timer can fire before the runtime-async `Await` helper checks `IsCompleted`, so the awaiter is observed as already-completed and the await runs straight through synchronously. With no suspension there is no dispatch, no `t_current` write, and the `AsyncDispatcherInfo` MT is never loaded. I downloaded the failing osx-arm64 dump and walked the crashed thread: ``` [2-4] FailFast [5] InnerAsync [6] OuterAsync (async2 body) [7] OuterAsync (thunk) [8] Main [9] CallEntryPoint ``` There is no `DispatchContinuations` frame on the stack. `OuterAsync` calls `InnerAsync` directly, confirming the await did not suspend. I also walked all 3 modules' `TypeDefToMethodTable` maps and confirmed `AsyncDispatcherInfo` MT is genuinely null everywhere (i.e. cDAC is reporting reality - the type never got loaded). `Object`, `Task`, and `Continuation` MTs are all loaded as expected. ## Fix Replace `await Task.Delay(1)` with `await Task.Yield()` in `InnerAsync`. `Task.Yield()` returns a `YieldAwaitable` whose awaiter's `IsCompleted` always returns `false`, so the continuation is unconditionally posted back via `DispatchContinuations`. This guarantees `AsyncDispatcherInfo.t_current` is written before `InnerAsync` resumes and calls `FailFast`, regardless of machine timing. ## Validation Posting as a draft to run CI across all platforms; the osx-arm64 R2R leg is the one to watch. Co-authored-by: Max Charlamb Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../cdac/tests/DumpTests/Debuggees/AsyncContinuation/Program.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/native/managed/cdac/tests/DumpTests/Debuggees/AsyncContinuation/Program.cs b/src/native/managed/cdac/tests/DumpTests/Debuggees/AsyncContinuation/Program.cs index c9e22fe6b76512..2e5c91ab0ab5a2 100644 --- a/src/native/managed/cdac/tests/DumpTests/Debuggees/AsyncContinuation/Program.cs +++ b/src/native/managed/cdac/tests/DumpTests/Debuggees/AsyncContinuation/Program.cs @@ -18,7 +18,7 @@ internal static class Program { internal static async Task InnerAsync(int value) { - await Task.Delay(1); + await Task.Yield(); // Crash while still inside Resume — t_current is set on this thread // and NextContinuation points to OuterAsync's continuation. From 0bccdce838fcce449299d5889ebd5a2a94eb3d28 Mon Sep 17 00:00:00 2001 From: Miha Zupan Date: Mon, 11 May 2026 13:47:33 +0200 Subject: [PATCH 082/109] Improve some string Rune helpers (#127939) --- .../src/System/String.Comparison.cs | 18 +++- .../src/System/String.Manipulation.cs | 85 +++++++------------ .../src/System/String.Searching.cs | 5 ++ 3 files changed, 53 insertions(+), 55 deletions(-) diff --git a/src/libraries/System.Private.CoreLib/src/System/String.Comparison.cs b/src/libraries/System.Private.CoreLib/src/System/String.Comparison.cs index 7f9785ea3110f7..fd346c17eb3b59 100644 --- a/src/libraries/System.Private.CoreLib/src/System/String.Comparison.cs +++ b/src/libraries/System.Private.CoreLib/src/System/String.Comparison.cs @@ -523,7 +523,14 @@ public bool EndsWith(char value, StringComparison comparisonType) /// if matches the end of this instance; otherwise, . public bool EndsWith(Rune value) { - return EndsWith(value, StringComparison.Ordinal); + if (value.IsBmp) + { + return EndsWith((char)value.Value); + } + + UnicodeUtility.GetUtf16SurrogatesFromSupplementaryPlaneScalar((uint)value.Value, out char highSurrogate, out char lowSurrogate); + + return Length > 1 && this[^2] == highSurrogate && this[^1] == lowSurrogate; } /// @@ -1134,7 +1141,14 @@ public bool StartsWith(char value, StringComparison comparisonType) /// if value matches the beginning of this string; otherwise, . public bool StartsWith(Rune value) { - return StartsWith(value, StringComparison.Ordinal); + if (value.IsBmp) + { + return StartsWith((char)value.Value); + } + + UnicodeUtility.GetUtf16SurrogatesFromSupplementaryPlaneScalar((uint)value.Value, out char highSurrogate, out char lowSurrogate); + + return Length > 1 && _firstChar == highSurrogate && this[1] == lowSurrogate; } /// diff --git a/src/libraries/System.Private.CoreLib/src/System/String.Manipulation.cs b/src/libraries/System.Private.CoreLib/src/System/String.Manipulation.cs index a69f9d934ca9c6..7b68b4aa46f105 100644 --- a/src/libraries/System.Private.CoreLib/src/System/String.Manipulation.cs +++ b/src/libraries/System.Private.CoreLib/src/System/String.Manipulation.cs @@ -1456,9 +1456,9 @@ private string ReplaceHelper(int oldValueLength, string newValue, ReadOnlySpan public unsafe string Replace(Rune oldRune, Rune newRune) { - if (Length == 0) + if (oldRune.IsBmp && newRune.IsBmp) { - return this; + return Replace((char)oldRune.Value, (char)newRune.Value); } ReadOnlySpan oldChars = oldRune.AsSpan(stackalloc char[Rune.MaxUtf16CharsPerRune]); @@ -1684,11 +1684,9 @@ public string[] Split(Rune separator, StringSplitOptions options = StringSplitOp /// An array whose elements contain the substrings from this instance that are delimited by . public unsafe string[] Split(Rune separator, int count, StringSplitOptions options = StringSplitOptions.None) { - ReadOnlySpan separatorSpan = separator.AsSpan(stackalloc char[Rune.MaxUtf16CharsPerRune]); - - if (separatorSpan.Length == 1) + if (separator.IsBmp) { - return Split(separatorSpan[0], count, options); + return Split((char)separator.Value, count, options); } ArgumentOutOfRangeException.ThrowIfNegative(count); @@ -1696,7 +1694,13 @@ public unsafe string[] Split(Rune separator, int count, StringSplitOptions optio CheckStringSplitOptions(options); // Ensure matching the string separator overload. - return (count <= 1 || Length == 0) ? CreateSplitArrayOfThisAsSoleValue(options, count) : Split(separatorSpan, count, options); + if (count <= 1 || Length == 0) + { + return CreateSplitArrayOfThisAsSoleValue(options, count); + } + + ReadOnlySpan separatorSpan = separator.AsSpan(stackalloc char[Rune.MaxUtf16CharsPerRune]); + return Split(separatorSpan, count, options); } // Creates an array of strings by splitting this string at each @@ -2413,39 +2417,28 @@ public unsafe string Trim(char trimChar) /// public unsafe string Trim(Rune trimRune) { - if (Length == 0) + if (trimRune.IsBmp) { - return this; + return Trim((char)trimRune.Value); } - // Convert trimRune to span - ReadOnlySpan trimChars = trimRune.AsSpan(stackalloc char[Rune.MaxUtf16CharsPerRune]); + UnicodeUtility.GetUtf16SurrogatesFromSupplementaryPlaneScalar((uint)trimRune.Value, out char highSurrogate, out char lowSurrogate); // Trim start int index = 0; - while (index < Length && this.AsSpan(index).StartsWith(trimChars)) + while ((uint)(index + 1) < (uint)Length && this[index] == highSurrogate && this[index + 1] == lowSurrogate) { - index += trimChars.Length; - } - - if (index >= Length) - { - return Empty; + index += 2; } // Trim end - int endIndex = Length - 1; - while (endIndex >= index && this.AsSpan(index..(endIndex + 1)).EndsWith(trimChars)) - { - endIndex -= trimChars.Length; - } - - if (endIndex < index) + int endIndex = Length - 2; + while (endIndex > index && this[endIndex] == highSurrogate && this[endIndex + 1] == lowSurrogate) { - return Empty; + endIndex -= 2; } - return this[index..(endIndex + 1)]; + return this[index..(endIndex + 2)]; } // Removes a set of characters from the beginning and end of this string. @@ -2499,24 +2492,17 @@ public unsafe string Trim(params ReadOnlySpan trimChars) /// public unsafe string TrimStart(Rune trimRune) { - if (Length == 0) + if (trimRune.IsBmp) { - return this; + return TrimStart((char)trimRune.Value); } - // Convert trimRune to span - ReadOnlySpan trimChars = trimRune.AsSpan(stackalloc char[Rune.MaxUtf16CharsPerRune]); + UnicodeUtility.GetUtf16SurrogatesFromSupplementaryPlaneScalar((uint)trimRune.Value, out char highSurrogate, out char lowSurrogate); - // Trim start int index = 0; - while (index < Length && this.AsSpan(index).StartsWith(trimChars)) + while ((uint)(index + 1) < (uint)Length && this[index] == highSurrogate && this[index + 1] == lowSurrogate) { - index += trimChars.Length; - } - - if (index >= Length) - { - return Empty; + index += 2; } return this[index..]; @@ -2573,27 +2559,20 @@ public unsafe string TrimStart(params ReadOnlySpan trimChars) /// public unsafe string TrimEnd(Rune trimRune) { - if (Length == 0) + if (trimRune.IsBmp) { - return this; + return TrimEnd((char)trimRune.Value); } - // Convert trimRune to span - ReadOnlySpan trimChars = trimRune.AsSpan(stackalloc char[Rune.MaxUtf16CharsPerRune]); + UnicodeUtility.GetUtf16SurrogatesFromSupplementaryPlaneScalar((uint)trimRune.Value, out char highSurrogate, out char lowSurrogate); - // Trim end - int endIndex = Length - 1; - while (endIndex >= 0 && this.AsSpan(..(endIndex + 1)).EndsWith(trimChars)) + int endIndex = Length - 2; + while ((uint)endIndex < (uint)Length && this[endIndex] == highSurrogate && this[endIndex + 1] == lowSurrogate) { - endIndex -= trimChars.Length; - } - - if (endIndex < 0) - { - return Empty; + endIndex -= 2; } - return this[..(endIndex + 1)]; + return this[..(endIndex + 2)]; } // Removes a set of characters from the end of this string. diff --git a/src/libraries/System.Private.CoreLib/src/System/String.Searching.cs b/src/libraries/System.Private.CoreLib/src/System/String.Searching.cs index 5d69071526579b..66fedbface5e31 100644 --- a/src/libraries/System.Private.CoreLib/src/System/String.Searching.cs +++ b/src/libraries/System.Private.CoreLib/src/System/String.Searching.cs @@ -52,6 +52,11 @@ public bool Contains(char value, StringComparison comparisonType) /// if occurs within this string; otherwise, . public bool Contains(Rune value) { + if (value.IsBmp) + { + return Contains((char)value.Value); + } + return Contains(value, StringComparison.Ordinal); } From 4557afb42c989b0b3b823d3e6c74e3dfbf1fbce8 Mon Sep 17 00:00:00 2001 From: Radek Doulik Date: Mon, 11 May 2026 16:48:08 +0200 Subject: [PATCH 083/109] [wasm][coreclr] Enable System.Linq.Expressions.Tests (#127926) The suite was disabled due to suspected test failures, but investigation shows all 5,670 tests pass on Release CoreCLR. The only 3 failures are already covered by [ActiveIssue] attributes. Previous 0-tests-run results were caused by a Debug-only SkipOnCoreClr trait filter. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/libraries/tests.proj | 1 - 1 file changed, 1 deletion(-) diff --git a/src/libraries/tests.proj b/src/libraries/tests.proj index bff3061df6e50c..59e6b8bba0a846 100644 --- a/src/libraries/tests.proj +++ b/src/libraries/tests.proj @@ -187,7 +187,6 @@ - From 6f89eaf23a549a04aec8522c602034287d6f348b Mon Sep 17 00:00:00 2001 From: Max Charlamb <44248479+max-charlamb@users.noreply.github.com> Date: Mon, 11 May 2026 10:53:36 -0400 Subject: [PATCH 084/109] [cDAC] RuntimeSignatureDecoder and centralized Signature contract (2/5) (#127636) ## Summary Part 2 of 5 stacked PRs splitting [#126408](https://github.com/dotnet/runtime/pull/126408). Builds on [#127395](https://github.com/dotnet/runtime/pull/127395) (merged). This PR adds a cDAC ECMA-335 signature decoder that closely mirrors `System.Reflection.Metadata.SignatureDecoder` and supports the two runtime-only extensions used in CoreCLR-internal signatures: `ELEMENT_TYPE_INTERNAL` (`0x21`) and `ELEMENT_TYPE_CMOD_INTERNAL` (`0x22`). The decoder is then used by both the Signature contract (for field signatures) and the StackWalk contract (for signature-based GC reference scanning of transition frames). ### What this PR contains **`RuntimeSignatureDecoder` (SRM-aligned polyfill):** - `RuntimeSignatureDecoder` -- readonly struct mirroring SRM's `SignatureDecoder` (`DecodeType`, `DecodeFieldSignature`, `DecodeMethodSignature`, `DecodeLocalSignature`, all taking `ref BlobReader`). - `IRuntimeSignatureTypeProvider` -- superset of SRM's `ISignatureTypeProvider` adding `GetInternalType(TargetPointer)` and `GetInternalModifiedType(TargetPointer, TType, bool)` for the two runtime-only encodings. - `SignatureTypeProvider` (the existing field-signature provider) implements `IRuntimeSignatureTypeProvider` so internal types in field signatures resolve via `RuntimeTypeSystem.GetTypeHandle`. **Signature-based GC reference scanning in StackWalk:** - `GcSignatureTypeProvider` (internal, in `StackWalkHelpers`) classifies each method-signature parameter as `Ref`, `Interior`, `Other` (value type or larger-than-slot), or `None`. - A new `GcSignatureContext(TypeHandle classContext, MethodDescHandle methodContext)` record struct is plumbed through `RuntimeSignatureDecoder` so `ELEMENT_TYPE_VAR` / `ELEMENT_TYPE_MVAR` placeholders resolve to the method's actual class / method instantiation -- matching native `SigTypeContext`-driven `PeekElemTypeNormalized` behavior. - `GcScanner.PromoteCallerStack` constructs the provider per call and walks the `TransitionBlock` using a reserved-slot count derived from `IsInstance` / return-buffer / `RequiresInstArg` / `IsAsyncMethod` / ARM64 `x8`, reporting each parameter slot as a GC reference, interior pointer, or skip. - Signature acquisition mirrors native `MethodDesc::GetSig`: prefers `IsStoredSigMethodDesc` (dynamic, EEImpl, array methods) before falling back to the metadata token, so caller-stack roots of dynamic and array-method transition frames are handled. Stored sigs are pinned with an inline `fixed` block and read via a `BlobReader`, matching the existing `SigFormat.cs` pattern. - This is the cDAC equivalent of native `TransitionFrame::PromoteCallerStack` and is used for `PrestubMethodFrame`, `CallCountingHelperFrame`, and the `StubDispatchFrame` / `ExternalMethodFrame` fallback when no GCRefMap is available. **Signature contract surface stays minimal:** - `ISignatureDecoder` continues to expose only `DecodeFieldSignature(BlobHandle, ModuleHandle, TypeHandle)`. - GC-specific decoding lives entirely inside the StackWalk contract; the Signature contract has no GC dependencies. **cDAC documentation:** - `docs/design/datacontracts/SignatureDecoder.md` -- describes `RuntimeSignatureDecoder`, `IRuntimeSignatureTypeProvider`, and the `ELEMENT_TYPE_INTERNAL` / `CMOD_INTERNAL` extensions; refreshed `DecodeFieldSignature` code sample. - `docs/design/datacontracts/StackWalk.md` -- new "Signature-Based Scanning" section under GC stack reference scanning, covering `GcSignatureTypeProvider` (with module scoping, `GcSignatureContext`, and enum normalization), the `PromoteCallerStack` algorithm, the reserved-slot table, and limitations vs. native. ### Testing - Build: clean, 0 warnings / 0 errors. - 1921 / 1921 cDAC unit tests pass. - Behavioral verification against the legacy DAC happens via the GC-stress verification harness introduced later in the PR series. > [!NOTE] > This PR description was created with AI assistance from Copilot. --------- Co-authored-by: Max Charlamb Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- docs/design/datacontracts/Signature.md | 71 ++++ docs/design/datacontracts/SignatureDecoder.md | 70 ---- docs/design/datacontracts/StackWalk.md | 59 +++- src/coreclr/inc/corhdr.h | 2 +- .../vm/datadescriptor/datadescriptor.inc | 2 +- .../ContractRegistry.cs | 4 +- .../{ISignatureDecoder.cs => ISignature.cs} | 6 +- .../IRuntimeSignatureTypeProvider.cs | 33 ++ .../Signature/RuntimeSignatureDecoder.cs | 326 ++++++++++++++++++ .../Signature/SignatureTypeProvider.cs | 10 +- .../{SignatureDecoder_1.cs => Signature_1.cs} | 38 +- .../Contracts/StackWalk/GC/GcScanner.cs | 89 ++--- .../StackWalk/GC/GcSignatureTypeProvider.cs | 173 +++++++++- .../CoreCLRContracts.cs | 2 +- .../SOSDacImpl.cs | 4 +- 15 files changed, 720 insertions(+), 169 deletions(-) create mode 100644 docs/design/datacontracts/Signature.md delete mode 100644 docs/design/datacontracts/SignatureDecoder.md rename src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Abstractions/Contracts/{ISignatureDecoder.cs => ISignature.cs} (71%) create mode 100644 src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/Signature/IRuntimeSignatureTypeProvider.cs create mode 100644 src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/Signature/RuntimeSignatureDecoder.cs rename src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/Signature/{SignatureDecoder_1.cs => Signature_1.cs} (50%) diff --git a/docs/design/datacontracts/Signature.md b/docs/design/datacontracts/Signature.md new file mode 100644 index 00000000000000..e0eb96ab807a17 --- /dev/null +++ b/docs/design/datacontracts/Signature.md @@ -0,0 +1,71 @@ +# Contract Signature + +This contract describes the format of method, field, and local-variable signatures stored in target memory. Signatures use the ECMA-335 §II.23.2 format with CoreCLR-internal element types added by the runtime. + +## Internal element types + +The runtime extends the standard ECMA-335 element type encoding with values that may appear in signatures stored in target memory: + +| Encoding | Value | Layout following the tag | +| --- | --- | --- | +| `ELEMENT_TYPE_INTERNAL` | `0x21` | a target-sized pointer to a runtime `TypeHandle` | +| `ELEMENT_TYPE_CMOD_INTERNAL` | `0x22` | one byte (`1` = required, `0` = optional), then a target-sized pointer to a runtime `TypeHandle` | + +These tags are used in signatures generated internally by the runtime that are not persisted to a managed image. They are defined alongside the standard ECMA-335 element types in `src/coreclr/inc/corhdr.h`. Their literal values are part of this contract -- changing them is a breaking change. + +## APIs of contract + +```csharp +TypeHandle DecodeFieldSignature(BlobHandle blobHandle, ModuleHandle moduleHandle, TypeHandle ctx); +``` + +## Version 1 + +Data descriptors used: +| Data Descriptor Name | Field | Meaning | +| --- | --- | --- | +| _none_ | | | + +Global variables used: +| Global Name | Type | Purpose | +| --- | --- | --- | +| _none_ | | | + +Contracts used: +| Contract Name | +| --- | +| RuntimeTypeSystem | +| Loader | +| EcmaMetadata | + +Constants: +| Constant Name | Meaning | Value | +| --- | --- | --- | +| `ELEMENT_TYPE_INTERNAL` | runtime-internal element type tag for an internal `TypeHandle` | `0x21` | +| `ELEMENT_TYPE_CMOD_INTERNAL` | runtime-internal element type tag for an internal modified type | `0x22` | + +Decoding a signature follows the ECMA-335 §II.23.2 grammar. For all standard element types, decoding behaves identically to `System.Reflection.Metadata.SignatureDecoder`. When the decoder encounters one of the runtime-internal tags above, it reads the target-sized pointer (and optional `required` byte for `ELEMENT_TYPE_CMOD_INTERNAL`) from the signature blob and resolves it to a runtime `TypeHandle`. + +The decoder is implemented as `RuntimeSignatureDecoder` -- a clone of SRM's `SignatureDecoder` with added support for the runtime-internal element types. The clone takes an additional `Target` so internal-type pointers can be sized for the target architecture. Provider implementations implement `IRuntimeSignatureTypeProvider` -- a superset of `System.Reflection.Metadata.ISignatureTypeProvider` -- adding methods for the runtime-internal element types: + +```csharp +TType GetInternalType(TargetPointer typeHandlePointer); +TType GetInternalModifiedType(TargetPointer typeHandlePointer, TType unmodifiedType, bool isRequired); +``` + +The contract's provider resolves these pointers through `RuntimeTypeSystem.GetTypeHandle`. Standard ECMA-335 element types resolve through `RuntimeTypeSystem.GetPrimitiveType` and `RuntimeTypeSystem.GetConstructedType`. Generic type parameters (`VAR`) and generic method parameters (`MVAR`) resolve via `RuntimeTypeSystem.GetInstantiation` and `RuntimeTypeSystem.GetGenericMethodInstantiation` respectively, using a `TypeHandle` (for generic types) or `MethodDescHandle` (for generic methods) generic context. `GetTypeFromDefinition` and `GetTypeFromReference` resolve tokens via the module's `TypeDefToMethodTableMap` / `TypeRefToMethodTableMap`; cross-module references and `GetTypeFromSpecification` are not currently implemented. + +```csharp +TypeHandle ISignature.DecodeFieldSignature(BlobHandle blobHandle, ModuleHandle moduleHandle, TypeHandle ctx) +{ + SignatureTypeProvider provider = new(_target, moduleHandle); + MetadataReader mdReader = _target.Contracts.EcmaMetadata.GetMetadata(moduleHandle)!; + BlobReader blobReader = mdReader.GetBlobReader(blobHandle); + RuntimeSignatureDecoder decoder = new(provider, _target, mdReader, ctx); + return decoder.DecodeFieldSignature(ref blobReader); +} +``` + +### Other consumers + +`RuntimeSignatureDecoder` is shared infrastructure within the cDAC. Other contracts construct their own decoder and provider directly when they need to decode method or local signatures rather than going through this contract. For example, the [StackWalk](./StackWalk.md) contract uses `RuntimeSignatureDecoder` with a GC-specific provider to classify method parameters during signature-based GC reference scanning. diff --git a/docs/design/datacontracts/SignatureDecoder.md b/docs/design/datacontracts/SignatureDecoder.md deleted file mode 100644 index 08f41f49917dd3..00000000000000 --- a/docs/design/datacontracts/SignatureDecoder.md +++ /dev/null @@ -1,70 +0,0 @@ -# Contract SignatureDecoder - -This contract encapsulates signature decoding in the cDAC. - -## APIs of contract - -```csharp -TypeHandle DecodeFieldSignature(BlobHandle blobHandle, ModuleHandle moduleHandle, TypeHandle ctx); -``` - -## Version 1 - -In version 1 of the SignatureDecoder contract we take advantage of the System.Reflection.Metadata signature decoding. We implement a SignatureTypeProvider that inherits from System.Reflection.Metadata ISignatureTypeProvider. - -Data descriptors used: -| Data Descriptor Name | Field | Meaning | -| --- | --- | --- | - - -Global variables used: -| Global Name | Type | Purpose | -| --- | --- | --- | - - -Contracts used: -| Contract Name | -| --- | -| RuntimeTypeSystem | -| Loader | -| EcmaMetadata | - -### SignatureTypeProvider -The cDAC implements the ISignatureTypeProvider with TType=TypeHandle. TGenericContext can either be a MethodDescHandle or TypeHandle; MethodDescHandle context is used to look up generic method parameters, and TypeHandle context is used to look up generic type parameters. - -A cDAC SignatureTypeProvider is instantiated over a Module which is used to lookup types. - -The following ISignatureTypeProvider APIs are trivially implemented using RuntimeTypeSystem.GetPrimitiveType and RuntimeTypeSystem.GetConstructedType: - -* GetArrayType - GetConstructedType -* GetByReferenceType - GetConstructedType -* GetFunctionPointerType - Implemented as primitive IntPtr type -* GetGenericInstantiation - GetConstructedType -* GetModifiedType - Returns unmodified type -* GetPinnedType - Returns unpinned type -* GetPointerType - GetConstructedType -* GetPrimitiveType - GetConstructedType -* GetSZArrayType - GetConstructedType - -GetGenericMethodParameter is only supported when TGenericContext=MethodDescHandle and looks up the method parameters from the context using RuntimeTypeSystem.GetGenericMethodInstantiation. - -GetGenericTypeParameter is only supported when TGenericContext=TypeHandle and looks up the type parameters from the context using RuntimeTypeSystem.GetInstantiation. - -GetTypeFromDefinition uses the SignatureTypeProvider's ModuleHandle to lookup the given Token in the Module's TypeDefToMethodTableMap. If a value is not found return null. - -GetTypeFromReference uses the SignatureTypeProvider's ModuleHandle to lookup the given Token in the Module's TypeRefToMethodTableMap. If a value is not found return null.The implementation when the type exists in a different module is incomplete. - -GetTypeFromSpecification is not currently implemented. - - -### APIs -```csharp -TypeHandle ISignatureDecoder.DecodeFieldSignature(BlobHandle blobHandle, ModuleHandle moduleHandle, TypeHandle ctx) -{ - SignatureTypeProvider provider = new(_target, moduleHandle); - MetadataReader mdReader = _target.Contracts.EcmaMetadata.GetMetadata(moduleHandle)!; - BlobReader blobReader = mdReader.GetBlobReader(blobHandle); - SignatureDecoder decoder = new(provider, mdReader, ctx); - return decoder.DecodeFieldSignature(ref blobReader); -} -``` diff --git a/docs/design/datacontracts/StackWalk.md b/docs/design/datacontracts/StackWalk.md index 35c8a33e00c2c7..e8d88ed9957bca 100644 --- a/docs/design/datacontracts/StackWalk.md +++ b/docs/design/datacontracts/StackWalk.md @@ -471,7 +471,64 @@ At each frame yielded by `Filter`, the walk determines whether to scan for GC re - **PrestubMethodFrame / CallCountingHelperFrame**: Use signature-based scanning. - Other frame types: No GC roots to report. -See [GCRefMap Format and Resolution](#gcrefmap-format-and-resolution) for the GCRefMap scanning path details. +See [GCRefMap Format and Resolution](#gcrefmap-format-and-resolution) for the GCRefMap scanning path and [Signature-Based Scanning](#signature-based-scanning) for the signature decoding path. + +### Signature-Based Scanning + +When a transition frame's calling convention is not described by a precomputed GCRefMap (`PrestubMethodFrame`, `CallCountingHelperFrame`, and the fallback path for `StubDispatchFrame`/`ExternalMethodFrame`), the GC reference walk classifies caller-stack arguments by decoding the callee's method signature. This corresponds to native `TransitionFrame::PromoteCallerStack` (`src/coreclr/vm/frames.cpp`). + +#### GcSignatureTypeProvider + +`GcSignatureTypeProvider` is an `IRuntimeSignatureTypeProvider` that classifies each parameter type into one of: + +```csharp +internal enum GcTypeKind +{ + None, // Non-GC primitive that fits in a single slot + Ref, // Object reference (TYPE_GC_REF) + Interior, // Managed pointer / byref (TYPE_GC_BYREF) + Other, // Value type that may contain GC refs, or any type larger than a slot +} +``` + +The provider is scoped to the method's containing module (captured at construction) so that `TypeDef` and `TypeRef` tokens can be resolved to a loaded `MethodTable` via the module's `TypeDefToMethodTable` / `TypeRefToMethodTable` lookup tables. The decoder's generic context is a `GcSignatureContext(TypeHandle classContext, MethodDescHandle methodContext)` carrying the method's class and method instantiations. + +The provider classifies primitives directly (`String`/`Object` -> `Ref`, `TypedReference` -> `Other`, others -> `None`). For `TypeDef`/`TypeRef` it resolves the loaded `TypeHandle` and classifies via `RuntimeTypeSystem.GetSignatureCorElementType`, treating enums (`IsEnum`) as their underlying primitive (`None`). When the type cannot be resolved (e.g., not yet loaded), classification falls back to the signature's `rawTypeKind` (`ValueType` -> `Other`, otherwise `Ref`). Arrays are `Ref`, byrefs are `Interior`, raw pointers are `None`. Generic parameters (`!T`, `!!T`) are resolved against the `GcSignatureContext` (via `GetInstantiation` / `GetGenericMethodInstantiation`) and classified by their actual instantiation -- matching native `SigTypeContext`-driven `PeekElemTypeNormalized` behavior. `ELEMENT_TYPE_INTERNAL` resolves the `TypeHandle` via `RuntimeTypeSystem.GetSignatureCorElementType` and maps the `CorElementType` to a `GcTypeKind`. + +#### PromoteCallerStack Algorithm + +1. Read the `MethodDesc` pointer from the `FramedMethodFrame` and obtain a `MethodDescHandle` from `RuntimeTypeSystem`. +2. Resolve the method's `MetadataReader` via `Loader.GetModuleHandleFromModulePtr` and `EcmaMetadata.GetMetadata`. If metadata is unavailable, no caller-stack refs are reported (matches native fallback behavior). +3. Obtain the method's signature blob, matching native `MethodDesc::GetSig`: + - If `RuntimeTypeSystem.IsStoredSigMethodDesc` is true (dynamic, EEImpl, and array method descs), pin the stored signature span and pass a `BlobReader` over it to `RuntimeSignatureDecoder.DecodeMethodSignature`. + - Otherwise, look up the signature via the metadata token (`mdMethodDef`), skipping methods with a nil token (`0x06000000`). +4. Decode the signature with `RuntimeSignatureDecoder` and a `GcSignatureTypeProvider` constructed for the method's module. The `GcSignatureContext` passes the method's class and method instantiations so that `VAR`/`MVAR` placeholders resolve to their actual types. See [Signature contract](./Signature.md) for the decoder. +5. Skip varargs methods (the caller-stack layout is not described by the callee signature alone). +6. Compute the number of reserved register slots in the `TransitionBlock`: + + | Reserved Slot | Condition | + |---|---| + | `this` pointer | `MethodSignature.Header.IsInstance` | + | Return buffer | Return type is `GcTypeKind.Other` | + | Generic instantiation arg | `RuntimeTypeSystem.RequiresInstArg(methodDesc)` | + | Async continuation | `RuntimeTypeSystem.IsAsyncMethod(methodDesc)` | + | ARM64 indirect-result register (`x8`) | Target architecture is ARM64 | + +7. If `IsInstance`, report the `this` slot at position `0` (or `1` on ARM64 to skip `x8`). The slot is reported as `GC_CALL_INTERIOR` for value-type `this`, otherwise as a normal reference. +8. Walk `MethodSignature.ParameterTypes` starting at slot index = reserved slot count, advancing one slot per parameter: + - `GcTypeKind.Ref` -> report as a reference. + - `GcTypeKind.Interior` -> report with `GC_CALL_INTERIOR`. + - `GcTypeKind.Other` / `GcTypeKind.None` -> not reported (large value types are reported via the GCRefMap path when one is available; otherwise their interior refs are not visible to this scan). + +The slot address is computed using the same formula as the GCRefMap path: + +```csharp +slotAddress = transitionBlockPtr + FirstGCRefMapSlot + (position * pointerSize); +``` + +#### Limitations vs. Native + +This signature-based scan has known gaps relative to native see [dotnet/runtime#127765](https://github.com/dotnet/runtime/issues/127765) for tracking. ### GCRefMap Format and Resolution diff --git a/src/coreclr/inc/corhdr.h b/src/coreclr/inc/corhdr.h index 466e1e8307fddf..7c6336a6571c5b 100644 --- a/src/coreclr/inc/corhdr.h +++ b/src/coreclr/inc/corhdr.h @@ -913,7 +913,7 @@ typedef enum CorElementType ELEMENT_TYPE_CMOD_OPT = 0x20, // optional C modifier : E_T_CMOD_OPT // This is for signatures generated internally (which will not be persisted in any way). - // [cDAC] [RuntimeTypeSystem]: Contract depends on the values of ELEMENT_TYPE_INTERNAL and ELEMENT_TYPE_CMOD_INTERNAL. + // [cDAC] [Signature][RuntimeTypeSystem]: Contract depends on the values of ELEMENT_TYPE_INTERNAL and ELEMENT_TYPE_CMOD_INTERNAL. ELEMENT_TYPE_INTERNAL = 0x21, // INTERNAL ELEMENT_TYPE_CMOD_INTERNAL = 0x22, // CMOD_INTERNAL diff --git a/src/coreclr/vm/datadescriptor/datadescriptor.inc b/src/coreclr/vm/datadescriptor/datadescriptor.inc index dbf0dcc7de9434..87cef264915b3d 100644 --- a/src/coreclr/vm/datadescriptor/datadescriptor.inc +++ b/src/coreclr/vm/datadescriptor/datadescriptor.inc @@ -1580,7 +1580,7 @@ CDAC_GLOBAL_CONTRACT(ReJIT, c1) CDAC_GLOBAL_CONTRACT(RuntimeInfo, c1) CDAC_GLOBAL_CONTRACT(RuntimeTypeSystem, c1) CDAC_GLOBAL_CONTRACT(SHash, c1) -CDAC_GLOBAL_CONTRACT(SignatureDecoder, c1) +CDAC_GLOBAL_CONTRACT(Signature, c1) CDAC_GLOBAL_CONTRACT(StackWalk, c1) CDAC_GLOBAL_CONTRACT(StressLog, c2) CDAC_GLOBAL_CONTRACT(SyncBlock, c1) diff --git a/src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Abstractions/ContractRegistry.cs b/src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Abstractions/ContractRegistry.cs index 174272de29e519..17cfcd1000ee19 100644 --- a/src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Abstractions/ContractRegistry.cs +++ b/src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Abstractions/ContractRegistry.cs @@ -97,9 +97,9 @@ public abstract class ContractRegistry /// public virtual ICodeNotifications CodeNotifications => GetContract(); /// - /// Gets an instance of the SignatureDecoder contract for the target. + /// Gets an instance of the Signature contract for the target. /// - public virtual ISignatureDecoder SignatureDecoder => GetContract(); + public virtual ISignature Signature => GetContract(); /// /// Gets an instance of the SyncBlock contract for the target. /// diff --git a/src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Abstractions/Contracts/ISignatureDecoder.cs b/src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Abstractions/Contracts/ISignature.cs similarity index 71% rename from src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Abstractions/Contracts/ISignatureDecoder.cs rename to src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Abstractions/Contracts/ISignature.cs index 5977d736b74d43..f53847ea4e3b55 100644 --- a/src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Abstractions/Contracts/ISignatureDecoder.cs +++ b/src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Abstractions/Contracts/ISignature.cs @@ -6,13 +6,13 @@ namespace Microsoft.Diagnostics.DataContractReader.Contracts; -public interface ISignatureDecoder : IContract +public interface ISignature : IContract { - static string IContract.Name { get; } = nameof(SignatureDecoder); + static string IContract.Name { get; } = nameof(Signature); TypeHandle DecodeFieldSignature(BlobHandle blobHandle, ModuleHandle moduleHandle, TypeHandle ctx) => throw new NotImplementedException(); } -public readonly struct SignatureDecoder : ISignatureDecoder +public readonly struct Signature : ISignature { // Everything throws NotImplementedException } diff --git a/src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/Signature/IRuntimeSignatureTypeProvider.cs b/src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/Signature/IRuntimeSignatureTypeProvider.cs new file mode 100644 index 00000000000000..a8d9b15251dd40 --- /dev/null +++ b/src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/Signature/IRuntimeSignatureTypeProvider.cs @@ -0,0 +1,33 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Reflection.Metadata; + +namespace Microsoft.Diagnostics.DataContractReader.SignatureHelpers; + +/// +/// Superset of SRM's +/// that adds support for runtime-internal type codes +/// (ELEMENT_TYPE_INTERNAL 0x21 and ELEMENT_TYPE_CMOD_INTERNAL 0x22). +/// +/// +/// Providers implementing this interface automatically satisfy SRM's +/// and can be used +/// with both SRM's SignatureDecoder and our +/// . +/// +public interface IRuntimeSignatureTypeProvider + : ISignatureTypeProvider +{ + /// + /// Classify an ELEMENT_TYPE_INTERNAL (0x21) type by resolving the + /// embedded TypeHandle pointer via the target's runtime type system. + /// + TType GetInternalType(TargetPointer typeHandlePointer); + + /// + /// Classify an ELEMENT_TYPE_CMOD_INTERNAL (0x22) custom modifier by + /// resolving the embedded TypeHandle pointer via the target's runtime type system. + /// + TType GetInternalModifiedType(TargetPointer typeHandlePointer, TType unmodifiedType, bool isRequired); +} diff --git a/src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/Signature/RuntimeSignatureDecoder.cs b/src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/Signature/RuntimeSignatureDecoder.cs new file mode 100644 index 00000000000000..aa1700383b8944 --- /dev/null +++ b/src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/Signature/RuntimeSignatureDecoder.cs @@ -0,0 +1,326 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System; +using System.Collections.Immutable; +using System.Reflection.Metadata; +using System.Reflection.Metadata.Ecma335; + +namespace Microsoft.Diagnostics.DataContractReader.SignatureHelpers; + +/// +/// Decodes signature blobs. Behaves identically to SRM's +/// for standard ECMA-335 type codes, +/// with added support for runtime-internal types +/// (ELEMENT_TYPE_INTERNAL 0x21 and ELEMENT_TYPE_CMOD_INTERNAL 0x22). +/// +internal readonly struct RuntimeSignatureDecoder +{ + private const int ELEMENT_TYPE_CMOD_INTERNAL = 0x22; + private const int ELEMENT_TYPE_INTERNAL = 0x21; + + private readonly IRuntimeSignatureTypeProvider _provider; + private readonly MetadataReader _metadataReader; + private readonly TGenericContext _genericContext; + private readonly int _pointerSize; + + public RuntimeSignatureDecoder( + IRuntimeSignatureTypeProvider provider, + Target target, + MetadataReader metadataReader, + TGenericContext genericContext) + { + _provider = provider; + _metadataReader = metadataReader; + _genericContext = genericContext; + _pointerSize = target.PointerSize; + } + + /// + /// Decodes a type embedded in a signature and advances the reader past the type. + /// + public TType DecodeType(ref BlobReader blobReader, bool allowTypeSpecifications = false) + { + return DecodeType(ref blobReader, allowTypeSpecifications, blobReader.ReadCompressedInteger()); + } + + private TType DecodeType(ref BlobReader blobReader, bool allowTypeSpecifications, int typeCode) + { + TType elementType; + int index; + + switch (typeCode) + { + case (int)SignatureTypeCode.Boolean: + case (int)SignatureTypeCode.Char: + case (int)SignatureTypeCode.SByte: + case (int)SignatureTypeCode.Byte: + case (int)SignatureTypeCode.Int16: + case (int)SignatureTypeCode.UInt16: + case (int)SignatureTypeCode.Int32: + case (int)SignatureTypeCode.UInt32: + case (int)SignatureTypeCode.Int64: + case (int)SignatureTypeCode.UInt64: + case (int)SignatureTypeCode.Single: + case (int)SignatureTypeCode.Double: + case (int)SignatureTypeCode.IntPtr: + case (int)SignatureTypeCode.UIntPtr: + case (int)SignatureTypeCode.Object: + case (int)SignatureTypeCode.String: + case (int)SignatureTypeCode.Void: + case (int)SignatureTypeCode.TypedReference: + return _provider.GetPrimitiveType((PrimitiveTypeCode)typeCode); + + case (int)SignatureTypeCode.Pointer: + elementType = DecodeType(ref blobReader); + return _provider.GetPointerType(elementType); + + case (int)SignatureTypeCode.ByReference: + elementType = DecodeType(ref blobReader); + return _provider.GetByReferenceType(elementType); + + case (int)SignatureTypeCode.Pinned: + elementType = DecodeType(ref blobReader); + return _provider.GetPinnedType(elementType); + + case (int)SignatureTypeCode.SZArray: + elementType = DecodeType(ref blobReader); + return _provider.GetSZArrayType(elementType); + + case (int)SignatureTypeCode.FunctionPointer: + MethodSignature methodSignature = DecodeMethodSignature(ref blobReader); + return _provider.GetFunctionPointerType(methodSignature); + + case (int)SignatureTypeCode.Array: + return DecodeArrayType(ref blobReader); + + case (int)SignatureTypeCode.RequiredModifier: + return DecodeModifiedType(ref blobReader, isRequired: true); + + case (int)SignatureTypeCode.OptionalModifier: + return DecodeModifiedType(ref blobReader, isRequired: false); + + case (int)SignatureTypeCode.GenericTypeInstance: + return DecodeGenericTypeInstance(ref blobReader); + + case (int)SignatureTypeCode.GenericTypeParameter: + index = blobReader.ReadCompressedInteger(); + return _provider.GetGenericTypeParameter(_genericContext, index); + + case (int)SignatureTypeCode.GenericMethodParameter: + index = blobReader.ReadCompressedInteger(); + return _provider.GetGenericMethodParameter(_genericContext, index); + + case (int)SignatureTypeKind.Class: + case (int)SignatureTypeKind.ValueType: + return DecodeTypeHandle(ref blobReader, (byte)typeCode, allowTypeSpecifications); + + case ELEMENT_TYPE_INTERNAL: + return DecodeInternalType(ref blobReader); + + case ELEMENT_TYPE_CMOD_INTERNAL: + return DecodeInternalModifiedType(ref blobReader); + + default: + throw new BadImageFormatException($"Unexpected signature type code: 0x{typeCode:X2}"); + } + } + + /// + /// Decodes a list of types, with at least one instance that is preceded by its count as a compressed integer. + /// + private ImmutableArray DecodeTypeSequence(ref BlobReader blobReader) + { + int count = blobReader.ReadCompressedInteger(); + if (count == 0) + { + throw new BadImageFormatException("Signature type sequence must have at least one element"); + } + + var types = ImmutableArray.CreateBuilder(count); + for (int i = 0; i < count; i++) + { + types.Add(DecodeType(ref blobReader)); + } + return types.MoveToImmutable(); + } + + /// + /// Decodes a method (definition, reference, or standalone) or property signature blob. + /// + public MethodSignature DecodeMethodSignature(ref BlobReader blobReader) + { + SignatureHeader header = blobReader.ReadSignatureHeader(); + CheckMethodOrPropertyHeader(header); + + int genericParameterCount = 0; + if (header.IsGeneric) + { + genericParameterCount = blobReader.ReadCompressedInteger(); + } + + int parameterCount = blobReader.ReadCompressedInteger(); + TType returnType = DecodeType(ref blobReader); + ImmutableArray parameterTypes; + int requiredParameterCount; + + if (parameterCount == 0) + { + requiredParameterCount = 0; + parameterTypes = ImmutableArray.Empty; + } + else + { + var parameterBuilder = ImmutableArray.CreateBuilder(parameterCount); + int parameterIndex; + + for (parameterIndex = 0; parameterIndex < parameterCount; parameterIndex++) + { + int typeCode = blobReader.ReadCompressedInteger(); + if (typeCode == (int)SignatureTypeCode.Sentinel) + { + break; + } + parameterBuilder.Add(DecodeType(ref blobReader, allowTypeSpecifications: false, typeCode: typeCode)); + } + + requiredParameterCount = parameterIndex; + for (; parameterIndex < parameterCount; parameterIndex++) + { + parameterBuilder.Add(DecodeType(ref blobReader)); + } + parameterTypes = parameterBuilder.MoveToImmutable(); + } + + return new MethodSignature(header, returnType, requiredParameterCount, genericParameterCount, parameterTypes); + } + + /// + /// Decodes a local variable signature blob and advances the reader past the signature. + /// + public ImmutableArray DecodeLocalSignature(ref BlobReader blobReader) + { + SignatureHeader header = blobReader.ReadSignatureHeader(); + CheckHeader(header, SignatureKind.LocalVariables); + return DecodeTypeSequence(ref blobReader); + } + + /// + /// Decodes a field signature blob and advances the reader past the signature. + /// + public TType DecodeFieldSignature(ref BlobReader blobReader) + { + SignatureHeader header = blobReader.ReadSignatureHeader(); + CheckHeader(header, SignatureKind.Field); + return DecodeType(ref blobReader); + } + + private TType DecodeArrayType(ref BlobReader blobReader) + { + TType elementType = DecodeType(ref blobReader); + int rank = blobReader.ReadCompressedInteger(); + var sizes = ImmutableArray.Empty; + var lowerBounds = ImmutableArray.Empty; + + int sizesCount = blobReader.ReadCompressedInteger(); + if (sizesCount > 0) + { + var builder = ImmutableArray.CreateBuilder(sizesCount); + for (int i = 0; i < sizesCount; i++) + { + builder.Add(blobReader.ReadCompressedInteger()); + } + sizes = builder.MoveToImmutable(); + } + + int lowerBoundsCount = blobReader.ReadCompressedInteger(); + if (lowerBoundsCount > 0) + { + var builder = ImmutableArray.CreateBuilder(lowerBoundsCount); + for (int i = 0; i < lowerBoundsCount; i++) + { + builder.Add(blobReader.ReadCompressedSignedInteger()); + } + lowerBounds = builder.MoveToImmutable(); + } + + return _provider.GetArrayType(elementType, new ArrayShape(rank, sizes, lowerBounds)); + } + + private TType DecodeGenericTypeInstance(ref BlobReader blobReader) + { + TType genericType = DecodeType(ref blobReader); + ImmutableArray types = DecodeTypeSequence(ref blobReader); + return _provider.GetGenericInstantiation(genericType, types); + } + + private TType DecodeModifiedType(ref BlobReader blobReader, bool isRequired) + { + // A standard modifier may be followed by an internal modifier; allow type specifications + // for the modifier handle (matches SRM behavior). + TType modifier = DecodeTypeHandle(ref blobReader, 0, allowTypeSpecifications: true); + TType unmodifiedType = DecodeType(ref blobReader); + return _provider.GetModifiedType(modifier, unmodifiedType, isRequired); + } + + private TType DecodeInternalType(ref BlobReader blobReader) + { + ulong val = ReadPointerSized(ref blobReader); + return _provider.GetInternalType(new TargetPointer(val)); + } + + private TType DecodeInternalModifiedType(ref BlobReader blobReader) + { + bool isRequired = blobReader.ReadByte() != 0; + ulong val = ReadPointerSized(ref blobReader); + TType unmodifiedType = DecodeType(ref blobReader); + return _provider.GetInternalModifiedType(new TargetPointer(val), unmodifiedType, isRequired); + } + + private TType DecodeTypeHandle(ref BlobReader blobReader, byte rawTypeKind, bool allowTypeSpecifications) + { + EntityHandle handle = blobReader.ReadTypeHandle(); + if (!handle.IsNil) + { + switch (handle.Kind) + { + case HandleKind.TypeDefinition: + return _provider.GetTypeFromDefinition(_metadataReader, (TypeDefinitionHandle)handle, rawTypeKind); + + case HandleKind.TypeReference: + return _provider.GetTypeFromReference(_metadataReader, (TypeReferenceHandle)handle, rawTypeKind); + + case HandleKind.TypeSpecification: + if (!allowTypeSpecifications) + { + throw new BadImageFormatException("TypeSpecification handle not allowed in this context"); + } + return _provider.GetTypeFromSpecification(_metadataReader, _genericContext, (TypeSpecificationHandle)handle, rawTypeKind); + } + } + + throw new BadImageFormatException("Expected TypeDef, TypeRef, or TypeSpec handle"); + } + + private ulong ReadPointerSized(ref BlobReader blobReader) + { + return _pointerSize == 8 ? blobReader.ReadUInt64() : blobReader.ReadUInt32(); + } + + private static void CheckHeader(SignatureHeader header, SignatureKind expectedKind) + { + if (header.Kind != expectedKind) + { + throw new BadImageFormatException($"Expected signature header {expectedKind}, got {header.Kind} (raw 0x{header.RawValue:X2})"); + } + } + + private static void CheckMethodOrPropertyHeader(SignatureHeader header) + { + SignatureKind kind = header.Kind; + if (kind != SignatureKind.Method && kind != SignatureKind.Property) + { + throw new BadImageFormatException($"Expected Method or Property signature header, got {kind} (raw 0x{header.RawValue:X2})"); + } + } +} diff --git a/src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/Signature/SignatureTypeProvider.cs b/src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/Signature/SignatureTypeProvider.cs index 82672504975f49..c6cb2bfb47fbd5 100644 --- a/src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/Signature/SignatureTypeProvider.cs +++ b/src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/Signature/SignatureTypeProvider.cs @@ -10,7 +10,7 @@ namespace Microsoft.Diagnostics.DataContractReader.SignatureHelpers; -public class SignatureTypeProvider : ISignatureTypeProvider +public class SignatureTypeProvider : IRuntimeSignatureTypeProvider { private readonly Target _target; private readonly Contracts.ModuleHandle _moduleHandle; @@ -89,4 +89,12 @@ public TypeHandle GetTypeFromReference(MetadataReader reader, TypeReferenceHandl public TypeHandle GetTypeFromSpecification(MetadataReader reader, T context, TypeSpecificationHandle handle, byte rawTypeKind) => throw new NotImplementedException(); + + public TypeHandle GetInternalType(TargetPointer typeHandlePointer) + => typeHandlePointer == TargetPointer.Null + ? new TypeHandle(TargetPointer.Null) + : _runtimeTypeSystem.GetTypeHandle(typeHandlePointer); + + public TypeHandle GetInternalModifiedType(TargetPointer typeHandlePointer, TypeHandle unmodifiedType, bool isRequired) + => unmodifiedType; } diff --git a/src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/Signature/SignatureDecoder_1.cs b/src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/Signature/Signature_1.cs similarity index 50% rename from src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/Signature/SignatureDecoder_1.cs rename to src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/Signature/Signature_1.cs index adfdbeca340134..8517cf674bccdb 100644 --- a/src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/Signature/SignatureDecoder_1.cs +++ b/src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/Signature/Signature_1.cs @@ -1,29 +1,24 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -using System; using System.Collections.Generic; using System.Reflection.Metadata; -using System.Reflection.Metadata.Ecma335; using Microsoft.Diagnostics.DataContractReader.SignatureHelpers; namespace Microsoft.Diagnostics.DataContractReader.Contracts; -/* NOTE: some elements of SignatureTypeProvider remain unimplemented or minimally implemented - * as they are not needed for the current usage of ISignatureDecoder. - * GetModifiedType and GetPinnedType ignore pinning and custom modifiers. - * GetTypeFromReference does not look up the type in another module. - * GetTypeFromSpecification is unimplemented. - * These can be completed as needed. - */ - -internal sealed class SignatureDecoder_1 : ISignatureDecoder +// NOTE: some elements of SignatureTypeProvider remain unimplemented or minimally implemented +// as they are not needed for the current usage of ISignature. +// GetModifiedType and GetPinnedType ignore pinning and custom modifiers. +// GetTypeFromReference does not look up the type in another module. +// GetTypeFromSpecification is unimplemented. +// These can be completed as needed. +internal sealed class Signature_1 : ISignature { private readonly Target _target; private readonly Dictionary> _thProviders = []; - private readonly Dictionary> _mdhProviders = []; - internal SignatureDecoder_1(Target target) + internal Signature_1(Target target) { _target = target; } @@ -31,7 +26,6 @@ internal SignatureDecoder_1(Target target) public void Flush() { _thProviders.Clear(); - _mdhProviders.Clear(); } private SignatureTypeProvider GetTypeHandleProvider(ModuleHandle moduleHandle) @@ -46,23 +40,13 @@ private SignatureTypeProvider GetTypeHandleProvider(ModuleHandle mod return newProvider; } - private SignatureTypeProvider GetMethodDescHandleProvider(ModuleHandle moduleHandle) - { - if (_mdhProviders.TryGetValue(moduleHandle, out SignatureTypeProvider? mdhProvider)) - { - return mdhProvider; - } - SignatureTypeProvider newProvider = new(_target, moduleHandle); - _mdhProviders[moduleHandle] = newProvider; - return newProvider; - } - - TypeHandle ISignatureDecoder.DecodeFieldSignature(BlobHandle blobHandle, ModuleHandle moduleHandle, TypeHandle ctx) + TypeHandle ISignature.DecodeFieldSignature(BlobHandle blobHandle, ModuleHandle moduleHandle, TypeHandle ctx) { SignatureTypeProvider provider = GetTypeHandleProvider(moduleHandle); MetadataReader mdReader = _target.Contracts.EcmaMetadata.GetMetadata(moduleHandle)!; + BlobReader blobReader = mdReader.GetBlobReader(blobHandle); - SignatureDecoder decoder = new(provider, mdReader, ctx); + RuntimeSignatureDecoder decoder = new(provider, _target, mdReader, ctx); return decoder.DecodeFieldSignature(ref blobReader); } } diff --git a/src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/StackWalk/GC/GcScanner.cs b/src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/StackWalk/GC/GcScanner.cs index d050adb8617be2..807c66ae8bacaf 100644 --- a/src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/StackWalk/GC/GcScanner.cs +++ b/src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/StackWalk/GC/GcScanner.cs @@ -5,6 +5,7 @@ using System.Collections.Generic; using System.Reflection.Metadata; using System.Reflection.Metadata.Ecma335; +using Microsoft.Diagnostics.DataContractReader.SignatureHelpers; namespace Microsoft.Diagnostics.DataContractReader.Contracts.StackWalkHelpers; @@ -323,32 +324,51 @@ private void PromoteCallerStack( if (methodDescPtr == TargetPointer.Null) return; - ReadOnlySpan signature; - try - { - signature = GetMethodSignatureBytes(methodDescPtr); - } - catch (System.Exception) - { - return; - } - - if (signature.IsEmpty) - return; + IRuntimeTypeSystem rts = _target.Contracts.RuntimeTypeSystem; + MethodDescHandle mdh = rts.GetMethodDescHandle(methodDescPtr); MethodSignature methodSig; try { - unsafe + TargetPointer methodTablePtr = rts.GetMethodTable(mdh); + TypeHandle typeHandle = rts.GetTypeHandle(methodTablePtr); + TargetPointer modulePtr = rts.GetModule(typeHandle); + + ModuleHandle moduleHandle = _target.Contracts.Loader.GetModuleHandleFromModulePtr(modulePtr); + MetadataReader? mdReader = _target.Contracts.EcmaMetadata.GetMetadata(moduleHandle); + if (mdReader is null) + return; + + GcSignatureTypeProvider provider = new(_target, moduleHandle); + GcSignatureContext genericContext = new(typeHandle, mdh); + RuntimeSignatureDecoder decoder = new( + provider, _target, mdReader, genericContext); + + // Match native MethodDesc::GetSig: prefer stored signature (dynamic, EEImpl, + // and array method descs) before falling back to a metadata token lookup. + if (rts.IsStoredSigMethodDesc(mdh, out ReadOnlySpan storedSig)) { - fixed (byte* pSig = signature) + unsafe { - BlobReader blobReader = new(pSig, signature.Length); - SignatureDecoder decoder = new( - GcSignatureTypeProvider.Instance, metadataReader: null!, genericContext: null); - methodSig = decoder.DecodeMethodSignature(ref blobReader); + fixed (byte* pStoredSig = storedSig) + { + BlobReader blobReader = new BlobReader(pStoredSig, storedSig.Length); + methodSig = decoder.DecodeMethodSignature(ref blobReader); + } } } + else + { + uint methodToken = rts.GetMethodToken(mdh); + if (methodToken == (uint)EcmaMetadataUtils.TokenType.mdtMethodDef) + return; + + MethodDefinitionHandle methodDefHandle = MetadataTokens.MethodDefinitionHandle((int)EcmaMetadataUtils.GetRowId(methodToken)); + MethodDefinition methodDef = mdReader.GetMethodDefinition(methodDefHandle); + + BlobReader blobReader = mdReader.GetBlobReader(methodDef.Signature); + methodSig = decoder.DecodeMethodSignature(ref blobReader); + } } catch (System.Exception) { @@ -358,9 +378,6 @@ private void PromoteCallerStack( if (methodSig.Header.CallingConvention is SignatureCallingConvention.VarArgs) return; - IRuntimeTypeSystem rts = _target.Contracts.RuntimeTypeSystem; - MethodDescHandle mdh = rts.GetMethodDescHandle(methodDescPtr); - bool hasThis = methodSig.Header.IsInstance; bool hasRetBuf = methodSig.ReturnType is GcTypeKind.Other; bool requiresInstArg = false; @@ -440,36 +457,6 @@ private void PromoteCallerStackHelper( } } - private ReadOnlySpan GetMethodSignatureBytes(TargetPointer methodDescPtr) - { - IRuntimeTypeSystem rts = _target.Contracts.RuntimeTypeSystem; - MethodDescHandle mdh = rts.GetMethodDescHandle(methodDescPtr); - - if (rts.IsStoredSigMethodDesc(mdh, out ReadOnlySpan storedSig)) - return storedSig; - - uint methodToken = rts.GetMethodToken(mdh); - if (methodToken == 0x06000000) - return default; - - TargetPointer methodTablePtr = rts.GetMethodTable(mdh); - TypeHandle typeHandle = rts.GetTypeHandle(methodTablePtr); - TargetPointer modulePtr = rts.GetModule(typeHandle); - - ILoader loader = _target.Contracts.Loader; - ModuleHandle moduleHandle = loader.GetModuleHandleFromModulePtr(modulePtr); - - IEcmaMetadata ecmaMetadata = _target.Contracts.EcmaMetadata; - MetadataReader? mdReader = ecmaMetadata.GetMetadata(moduleHandle); - if (mdReader is null) - return default; - - MethodDefinitionHandle methodDefHandle = MetadataTokens.MethodDefinitionHandle((int)(methodToken & 0x00FFFFFF)); - MethodDefinition methodDef = mdReader.GetMethodDefinition(methodDefHandle); - BlobReader blobReader = mdReader.GetBlobReader(methodDef.Signature); - return blobReader.ReadBytes(blobReader.Length); - } - private TargetPointer AddressFromGCRefMapPos(Data.TransitionBlock tb, int pos) { return new TargetPointer(tb.FirstGCRefMapSlot.Value + (ulong)(pos * _target.PointerSize)); diff --git a/src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/StackWalk/GC/GcSignatureTypeProvider.cs b/src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/StackWalk/GC/GcSignatureTypeProvider.cs index 46e6c8af2de24c..8852f733df6a97 100644 --- a/src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/StackWalk/GC/GcSignatureTypeProvider.cs +++ b/src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/StackWalk/GC/GcSignatureTypeProvider.cs @@ -1,8 +1,12 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using System; using System.Collections.Immutable; +using System.Diagnostics; using System.Reflection.Metadata; +using System.Reflection.Metadata.Ecma335; +using Microsoft.Diagnostics.DataContractReader.SignatureHelpers; namespace Microsoft.Diagnostics.DataContractReader.Contracts.StackWalkHelpers; @@ -21,15 +25,38 @@ internal enum GcTypeKind Other, } +/// +/// Generic context used to resolve ELEMENT_TYPE_VAR and ELEMENT_TYPE_MVAR +/// while decoding a method signature for GC scanning. is the +/// owning type's (used for VAR), and +/// is the owning method's (used for MVAR). +/// +internal readonly record struct GcSignatureContext(TypeHandle ClassContext, MethodDescHandle MethodContext); + /// /// Classifies signature types for GC scanning purposes. -/// Implements for use -/// with SRM's . +/// Implements which +/// is a superset of SRM's , +/// adding support for ELEMENT_TYPE_INTERNAL. /// +/// +/// The provider is scoped to a single module: GetTypeFromDefinition and +/// GetTypeFromReference resolve TypeDef/TypeRef tokens via the module's +/// lookup tables so enums (and other runtime-normalized value types) are classified +/// using the actual , matching native +/// SigPointer::PeekElemTypeNormalized. +/// internal sealed class GcSignatureTypeProvider - : ISignatureTypeProvider + : IRuntimeSignatureTypeProvider { - public static readonly GcSignatureTypeProvider Instance = new(); + private readonly Target _target; + private readonly ModuleHandle _moduleHandle; + + public GcSignatureTypeProvider(Target target, ModuleHandle moduleHandle) + { + _target = target; + _moduleHandle = moduleHandle; + } public GcTypeKind GetPrimitiveType(PrimitiveTypeCode typeCode) => typeCode switch @@ -40,12 +67,12 @@ public GcTypeKind GetPrimitiveType(PrimitiveTypeCode typeCode) }; public GcTypeKind GetTypeFromDefinition(MetadataReader reader, TypeDefinitionHandle handle, byte rawTypeKind) - => rawTypeKind == (byte)SignatureTypeKind.ValueType ? GcTypeKind.Other : GcTypeKind.Ref; + => ClassifyTokenLookup(_target.Contracts.Loader.GetLookupTables(_moduleHandle).TypeDefToMethodTable, MetadataTokens.GetToken(handle), rawTypeKind); public GcTypeKind GetTypeFromReference(MetadataReader reader, TypeReferenceHandle handle, byte rawTypeKind) - => rawTypeKind == (byte)SignatureTypeKind.ValueType ? GcTypeKind.Other : GcTypeKind.Ref; + => ClassifyTokenLookup(_target.Contracts.Loader.GetLookupTables(_moduleHandle).TypeRefToMethodTable, MetadataTokens.GetToken(handle), rawTypeKind); - public GcTypeKind GetTypeFromSpecification(MetadataReader reader, object? genericContext, TypeSpecificationHandle handle, byte rawTypeKind) + public GcTypeKind GetTypeFromSpecification(MetadataReader reader, GcSignatureContext genericContext, TypeSpecificationHandle handle, byte rawTypeKind) => rawTypeKind == (byte)SignatureTypeKind.ValueType ? GcTypeKind.Other : GcTypeKind.Ref; public GcTypeKind GetSZArrayType(GcTypeKind elementType) => GcTypeKind.Ref; @@ -56,9 +83,137 @@ public GcTypeKind GetTypeFromSpecification(MetadataReader reader, object? generi public GcTypeKind GetGenericInstantiation(GcTypeKind genericType, ImmutableArray typeArguments) => genericType; - public GcTypeKind GetGenericMethodParameter(object? genericContext, int index) => GcTypeKind.Ref; - public GcTypeKind GetGenericTypeParameter(object? genericContext, int index) => GcTypeKind.Ref; + public GcTypeKind GetGenericMethodParameter(GcSignatureContext genericContext, int index) + { + try + { + ReadOnlySpan instantiation = _target.Contracts.RuntimeTypeSystem.GetGenericMethodInstantiation(genericContext.MethodContext); + if ((uint)index >= (uint)instantiation.Length) + return GcTypeKind.Ref; + return ClassifyTypeHandle(instantiation[index]); + } + catch + { + return GcTypeKind.Ref; + } + } + + public GcTypeKind GetGenericTypeParameter(GcSignatureContext genericContext, int index) + { + try + { + IRuntimeTypeSystem rts = _target.Contracts.RuntimeTypeSystem; + TypeHandle classCtx = genericContext.ClassContext; + + if (rts.IsArray(classCtx, out _)) + { + // Match native SigTypeContext::InitTypeContext (typectxt.cpp): arrays use + // the element type as their class instantiation. RuntimeTypeSystem.GetInstantiation + // returns an empty span for arrays, so consult GetTypeParam directly (the + // managed equivalent of MethodTable::GetArrayInstantiation). + Debug.Assert(index == 0, "Array class context has a 1-element instantiation; index > 0 indicates a malformed signature."); + if (index != 0) + return GcTypeKind.Ref; + return ClassifyTypeHandle(rts.GetTypeParam(classCtx)); + } + + ReadOnlySpan instantiation = rts.GetInstantiation(classCtx); + if ((uint)index >= (uint)instantiation.Length) + return GcTypeKind.Ref; + return ClassifyTypeHandle(instantiation[index]); + } + catch + { + return GcTypeKind.Ref; + } + } + public GcTypeKind GetFunctionPointerType(MethodSignature signature) => GcTypeKind.None; public GcTypeKind GetModifiedType(GcTypeKind modifier, GcTypeKind unmodifiedType, bool isRequired) => unmodifiedType; + public GcTypeKind GetInternalModifiedType(TargetPointer typeHandlePointer, GcTypeKind unmodifiedType, bool isRequired) => unmodifiedType; public GcTypeKind GetPinnedType(GcTypeKind elementType) => elementType; + + public GcTypeKind GetInternalType(TargetPointer typeHandlePointer) + { + if (typeHandlePointer == TargetPointer.Null) + return GcTypeKind.None; + + try + { + return ClassifyTypeHandle(_target.Contracts.RuntimeTypeSystem.GetTypeHandle(typeHandlePointer)); + } + catch + { + return GcTypeKind.Ref; + } + } + + /// + /// Resolve a TypeDef/TypeRef token via the module's lookup tables and classify the + /// resulting . Falls back to a -based + /// classification when the type has not been loaded. + /// + private GcTypeKind ClassifyTokenLookup(TargetPointer lookupTable, int token, byte rawTypeKind) + { + try + { + TargetPointer typeHandlePtr = _target.Contracts.Loader.GetModuleLookupMapElement(lookupTable, (uint)token, out _); + if (typeHandlePtr == TargetPointer.Null) + return rawTypeKind == (byte)SignatureTypeKind.ValueType ? GcTypeKind.Other : GcTypeKind.Ref; + + return ClassifyTypeHandle(_target.Contracts.RuntimeTypeSystem.GetTypeHandle(typeHandlePtr)); + } + catch + { + return rawTypeKind == (byte)SignatureTypeKind.ValueType ? GcTypeKind.Other : GcTypeKind.Ref; + } + } + + /// + /// Classify a resolved . Mirrors native + /// SigPointer::PeekElemTypeNormalized + gElementTypeInfo[etype].m_gc: + /// enums collapse to their underlying primitive () so + /// they are skipped during stack scanning, matching native behavior. + /// + private GcTypeKind ClassifyTypeHandle(TypeHandle typeHandle) + { + if (typeHandle.Address == TargetPointer.Null) + return GcTypeKind.Ref; + + IRuntimeTypeSystem rts = _target.Contracts.RuntimeTypeSystem; + CorElementType corType = rts.GetSignatureCorElementType(typeHandle); + + switch (corType) + { + case CorElementType.Void: + case CorElementType.Boolean: + case CorElementType.Char: + case CorElementType.I1: + case CorElementType.U1: + case CorElementType.I2: + case CorElementType.U2: + case CorElementType.I4: + case CorElementType.U4: + case CorElementType.I8: + case CorElementType.U8: + case CorElementType.R4: + case CorElementType.R8: + case CorElementType.I: + case CorElementType.U: + case CorElementType.FnPtr: + case CorElementType.Ptr: + return GcTypeKind.None; + + case CorElementType.Byref: + return GcTypeKind.Interior; + + case CorElementType.ValueType: + // Native PeekElemTypeNormalized resolves enums to their underlying primitive + // CorElementType, which classifies as TYPE_GC_NONE in gElementTypeInfo. + return rts.IsEnum(typeHandle) ? GcTypeKind.None : GcTypeKind.Other; + + default: + return GcTypeKind.Ref; + } + } } diff --git a/src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/CoreCLRContracts.cs b/src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/CoreCLRContracts.cs index c60f905bbe6fd8..83996e38ef1d42 100644 --- a/src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/CoreCLRContracts.cs +++ b/src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/CoreCLRContracts.cs @@ -25,7 +25,7 @@ public static void Register(ContractRegistry registry) registry.Register("c1", static t => new SHash_1(t)); registry.Register("c1", static t => new Notifications_1(t)); registry.Register("c1", static t => new CodeNotifications_1(t)); - registry.Register("c1", static t => new SignatureDecoder_1(t)); + registry.Register("c1", static t => new Signature_1(t)); registry.Register("c1", static t => new BuiltInCOM_1(t)); registry.Register("c1", static t => new ObjectiveCMarshal_1(t)); registry.Register("c1", static t => new ConditionalWeakTable_1(t)); diff --git a/src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Legacy/SOSDacImpl.cs b/src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Legacy/SOSDacImpl.cs index b058d026347fd3..f276d69bb326ee 100644 --- a/src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Legacy/SOSDacImpl.cs +++ b/src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Legacy/SOSDacImpl.cs @@ -1071,7 +1071,7 @@ int ISOSDacInterface.GetFieldDescData(ClrDataAddress fieldDesc, DacpFieldDescDat IRuntimeTypeSystem rtsContract = _target.Contracts.RuntimeTypeSystem; IEcmaMetadata ecmaMetadataContract = _target.Contracts.EcmaMetadata; - ISignatureDecoder signatureDecoder = _target.Contracts.SignatureDecoder; + ISignature signatureContract = _target.Contracts.Signature; TargetPointer fieldDescTargetPtr = fieldDesc.ToTargetPointer(_target); CorElementType fieldDescType = rtsContract.GetFieldDescType(fieldDescTargetPtr); @@ -1090,7 +1090,7 @@ int ISOSDacInterface.GetFieldDescData(ClrDataAddress fieldDesc, DacpFieldDescDat try { // try to completely decode the signature - TypeHandle foundTypeHandle = signatureDecoder.DecodeFieldSignature(fieldDef.Signature, moduleHandle, ctx); + TypeHandle foundTypeHandle = signatureContract.DecodeFieldSignature(fieldDef.Signature, moduleHandle, ctx); // get the MT of the type // This is an implementation detail of the DAC that we replicate here to get method tables for non-MT types From 195e37b6ffc9d7c8105d999afd1b99264866adf2 Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Mon, 11 May 2026 10:53:57 -0400 Subject: [PATCH 085/109] Fix ThinSList size and unify `EMPTY_BASES` definitions (#127911) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Found that SList was taking up two pointer sizes because MSVC does not do empty base class optimization by default. We already have `EMPTY_BASES_DECL`, but it is not defined in NativeAOT. Given that SList is used in both CoreCLR and NativeAOT I also refactored `EMPTY_BASES_DECL` to be defined in minipal so it can be accessed by both builds. ## Changes - **`src/coreclr/pal/inc/pal.h`** — removed the unconditional `#define EMPTY_BASES_DECL` (always empty, wrong on MSVC). `pal.h` already `#include`s `` above that line, so the minipal definition takes effect automatically. - **`src/coreclr/inc/slist.h`** — switched to `#include ` and `EMPTY_BASES_DECL` directly; moved `SListLayoutValidationElem` and related `static_assert`s under `#ifdef _DEBUG` so they don't affect release builds. `src/native/minipal/utils.h` is now the single source of truth for `EMPTY_BASES_DECL`. --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: max-charlamb <44248479+max-charlamb@users.noreply.github.com> Co-authored-by: Max Charlamb --- docs/design/features/cross-dac.md | 2 +- src/coreclr/debug/di/rspriv.h | 2 +- src/coreclr/debug/ee/debugger.h | 4 +- src/coreclr/inc/palclr.h | 7 ---- src/coreclr/inc/sarray.h | 6 +-- src/coreclr/inc/sbuffer.h | 8 ++-- src/coreclr/inc/shash.h | 48 +++++++++++------------ src/coreclr/inc/slist.h | 11 +++++- src/coreclr/inc/sstring.h | 10 ++--- src/coreclr/pal/inc/pal.h | 2 - src/coreclr/vm/crossloaderallocatorhash.h | 4 +- src/native/minipal/utils.h | 2 + 12 files changed, 54 insertions(+), 52 deletions(-) diff --git a/docs/design/features/cross-dac.md b/docs/design/features/cross-dac.md index 45d99b326ee650..81ac308ee121a1 100644 --- a/docs/design/features/cross-dac.md +++ b/docs/design/features/cross-dac.md @@ -43,7 +43,7 @@ These cases have proven to be problematic: - Classes with empty base classes. (I the only issue is with multiple base classes.) - By default `gcc` use an empty base class optimization to eliminate the 1 byte of space these empty base classes normally consume (alone). - By default `Windows` compilers do not do this optimization. This is to preserve backward binary compatibility. - - The Windows compilers allow this optimization to be enabled. Our code uses `EMPTY_BASES_DECL` to enable this optimization. It has to be applied to every structure that has multiple base classes or derives from a such a structure. See `__declspec(empty_bases)`. + - The Windows compilers allow this optimization to be enabled. Our code uses `EMPTY_BASES` to enable this optimization. It has to be applied to every structure that has multiple base classes or derives from a such a structure. See `__declspec(empty_bases)`. - Packing of the first member of the derived class. In the case where the base class ended with padding: - `gcc` compilers reuse the padding for the first member of the derived class. This effectively removes the padding of the base class in the derived class. - Windows compilers do not remove this padding. diff --git a/src/coreclr/debug/di/rspriv.h b/src/coreclr/debug/di/rspriv.h index d376dea2ba6ebc..015e4776ca4a5e 100644 --- a/src/coreclr/debug/di/rspriv.h +++ b/src/coreclr/debug/di/rspriv.h @@ -2896,7 +2896,7 @@ class UnmanagedThreadTracker #endif // OUT_OF_PROCESS_SETTHREADCONTEXT }; -class EMPTY_BASES_DECL CUnmanagedThreadSHashTraits : public DefaultSHashTraits +class EMPTY_BASES CUnmanagedThreadSHashTraits : public DefaultSHashTraits { public: typedef DWORD key_t; diff --git a/src/coreclr/debug/ee/debugger.h b/src/coreclr/debug/ee/debugger.h index 08bb7ffe2815e9..ac28ac84c9c637 100644 --- a/src/coreclr/debug/ee/debugger.h +++ b/src/coreclr/debug/ee/debugger.h @@ -491,7 +491,7 @@ typedef DPTR(struct DebuggerPendingFuncEval) PTR_DebuggerPendingFuncEval; * SHash to hold weak object handles of exceptions with ForceCatchHandlerFound equal to true * ------------------------------------------------------------------------ */ #ifndef DACCESS_COMPILE -class EMPTY_BASES_DECL ForceCatchHandlerFoundSHashTraits : public DefaultSHashTraits +class EMPTY_BASES ForceCatchHandlerFoundSHashTraits : public DefaultSHashTraits { public: typedef OBJECTHANDLE element_t; @@ -582,7 +582,7 @@ class TypeInModule } }; -class EMPTY_BASES_DECL CustomNotificationSHashTraits : public DefaultSHashTraits +class EMPTY_BASES CustomNotificationSHashTraits : public DefaultSHashTraits { public: typedef TypeInModule element_t; diff --git a/src/coreclr/inc/palclr.h b/src/coreclr/inc/palclr.h index 21b52140b9522c..b6f814756b783c 100644 --- a/src/coreclr/inc/palclr.h +++ b/src/coreclr/inc/palclr.h @@ -41,13 +41,6 @@ #endif // !_MSC_VER #endif // !NOTHROW_DECL -#ifdef _MSC_VER -#define EMPTY_BASES_DECL __declspec(empty_bases) -#else -#define EMPTY_BASES_DECL -#endif // !_MSC_VER - - // PORTABILITY_ASSERT and PORTABILITY_WARNING macros are meant to be used to // mark places in the code that needs attention for portability. The usual // usage pattern is: diff --git a/src/coreclr/inc/sarray.h b/src/coreclr/inc/sarray.h index 4c5e7ef86c1b6d..6a78f75f1a96f2 100644 --- a/src/coreclr/inc/sarray.h +++ b/src/coreclr/inc/sarray.h @@ -114,7 +114,7 @@ class SArray public: - class EMPTY_BASES_DECL Iterator : public CheckedIteratorBase >, + class EMPTY_BASES Iterator : public CheckedIteratorBase >, public Indexer { friend class SArray; @@ -184,7 +184,7 @@ class SArray // ================================================================================ template -class EMPTY_BASES_DECL InlineSArray : public SArray +class EMPTY_BASES InlineSArray : public SArray { private: #ifdef TARGET_WINDOWS @@ -209,7 +209,7 @@ class EMPTY_BASES_DECL InlineSArray : public SArray #define STACK_ALLOC 256 template -class EMPTY_BASES_DECL StackSArray : public InlineSArray +class EMPTY_BASES StackSArray : public InlineSArray { }; diff --git a/src/coreclr/inc/sbuffer.h b/src/coreclr/inc/sbuffer.h index aa743695895b2f..3573a798db92c5 100644 --- a/src/coreclr/inc/sbuffer.h +++ b/src/coreclr/inc/sbuffer.h @@ -419,7 +419,7 @@ class SBuffer friend class CheckedIteratorBase; - class EMPTY_BASES_DECL Index : public CheckedIteratorBase + class EMPTY_BASES Index : public CheckedIteratorBase { friend class SBuffer; @@ -445,7 +445,7 @@ class SBuffer public: - class EMPTY_BASES_DECL CIterator : public Index, public Indexer + class EMPTY_BASES CIterator : public Index, public Indexer { friend class SBuffer; @@ -460,7 +460,7 @@ class SBuffer } }; - class EMPTY_BASES_DECL Iterator : public Index, public Indexer + class EMPTY_BASES Iterator : public Index, public Indexer { friend class SBuffer; @@ -528,7 +528,7 @@ class SBuffer #define BUFFER_ALIGNMENT 4 template -class EMPTY_BASES_DECL InlineSBuffer : public SBuffer +class EMPTY_BASES InlineSBuffer : public SBuffer { private: #ifdef _MSC_VER diff --git a/src/coreclr/inc/shash.h b/src/coreclr/inc/shash.h index c9284da4601771..ae6892c1625abc 100644 --- a/src/coreclr/inc/shash.h +++ b/src/coreclr/inc/shash.h @@ -160,7 +160,7 @@ class DefaultSHashTraits // Hash table class definition template -class EMPTY_BASES_DECL SHash : public TRAITS +class EMPTY_BASES SHash : public TRAITS , private noncopyable { friend class VerifyLayoutsMD; // verifies class layout doesn't accidentally change @@ -350,7 +350,7 @@ class EMPTY_BASES_DECL SHash : public TRAITS public: - class EMPTY_BASES_DECL Index + class EMPTY_BASES Index : public CheckedIteratorBase< SHash > { friend class SHash; @@ -448,7 +448,7 @@ class EMPTY_BASES_DECL SHash : public TRAITS } }; - class EMPTY_BASES_DECL Iterator : public Index, public Enumerator + class EMPTY_BASES Iterator : public Index, public Enumerator { friend class SHash; @@ -465,7 +465,7 @@ class EMPTY_BASES_DECL SHash : public TRAITS // is artificially bumped to m_tableSize when the end of iteration is reached. // This allows a canonical End iterator to be used. - class EMPTY_BASES_DECL KeyIndex : public Index + class EMPTY_BASES KeyIndex : public Index { friend class SHash; friend class KeyIterator; @@ -555,7 +555,7 @@ class EMPTY_BASES_DECL SHash : public TRAITS } }; - class EMPTY_BASES_DECL KeyIterator : public KeyIndex, public Enumerator + class EMPTY_BASES KeyIterator : public KeyIndex, public Enumerator { friend class SHash; @@ -599,7 +599,7 @@ class EMPTY_BASES_DECL SHash : public TRAITS // disables support for DAC marshaling. Useful for defining right-side only SHashes template -class EMPTY_BASES_DECL NonDacAwareSHashTraits : public PARENT +class EMPTY_BASES NonDacAwareSHashTraits : public PARENT { public: typedef typename PARENT::element_t element_t; @@ -609,7 +609,7 @@ class EMPTY_BASES_DECL NonDacAwareSHashTraits : public PARENT // disables support for removing elements - produces slightly faster implementation template -class EMPTY_BASES_DECL NoRemoveSHashTraits : public PARENT +class EMPTY_BASES NoRemoveSHashTraits : public PARENT { public: // explicitly declare local typedefs for these traits types, otherwise @@ -626,7 +626,7 @@ class EMPTY_BASES_DECL NoRemoveSHashTraits : public PARENT // It relies on methods GetKey and Hash defined on ELEMENT template -class EMPTY_BASES_DECL PtrSHashTraits : public DefaultSHashTraits +class EMPTY_BASES PtrSHashTraits : public DefaultSHashTraits { public: @@ -656,7 +656,7 @@ class EMPTY_BASES_DECL PtrSHashTraits : public DefaultSHashTraits }; template -class EMPTY_BASES_DECL PtrSHash : public SHash< PtrSHashTraits > +class EMPTY_BASES PtrSHash : public SHash< PtrSHashTraits > { }; @@ -675,7 +675,7 @@ class PtrSHashWithCleanupTraits // a class that automatically deletes data referenced by the pointers (so effectively it takes ownership of the data) // since I was too lazy to implement Remove() APIs properly, removing entries is disallowed template -class EMPTY_BASES_DECL PtrSHashWithCleanup : public SHash< NoRemoveSHashTraits< PtrSHashWithCleanupTraits > > +class EMPTY_BASES PtrSHashWithCleanup : public SHash< NoRemoveSHashTraits< PtrSHashWithCleanupTraits > > { }; @@ -778,7 +778,7 @@ struct CaseInsensitiveStringCompareHash // pointer hash tables. template > -class EMPTY_BASES_DECL StringSHashTraits : public PtrSHashTraits +class EMPTY_BASES StringSHashTraits : public PtrSHashTraits { public: // explicitly declare local typedefs for these traits types, otherwise @@ -822,7 +822,7 @@ struct StringHashElement }; template > -class EMPTY_BASES_DECL StringHashWithCleanupTraits : public StringSHashTraits, CharT, ComparerT> +class EMPTY_BASES StringHashWithCleanupTraits : public StringSHashTraits, CharT, ComparerT> { public: void OnDestructPerEntryCleanupAction(StringHashElement * e) @@ -841,22 +841,22 @@ class EMPTY_BASES_DECL StringHashWithCleanupTraits : public StringSHashTraits > -class EMPTY_BASES_DECL StringSHashWithCleanup : public SHash< StringHashWithCleanupTraits > +class EMPTY_BASES StringSHashWithCleanup : public SHash< StringHashWithCleanupTraits > { }; template -class EMPTY_BASES_DECL StringSHash : public SHash< StringSHashTraits > +class EMPTY_BASES StringSHash : public SHash< StringSHashTraits > { }; template -class EMPTY_BASES_DECL WStringSHash : public SHash< StringSHashTraits > +class EMPTY_BASES WStringSHash : public SHash< StringSHashTraits > { }; template -class EMPTY_BASES_DECL SStringSHashTraits : public PtrSHashTraits +class EMPTY_BASES SStringSHashTraits : public PtrSHashTraits { public: typedef PtrSHashTraits PARENT; @@ -879,12 +879,12 @@ class EMPTY_BASES_DECL SStringSHashTraits : public PtrSHashTraits -class EMPTY_BASES_DECL SStringSHash : public SHash< SStringSHashTraits > +class EMPTY_BASES SStringSHash : public SHash< SStringSHashTraits > { }; template -class EMPTY_BASES_DECL SetSHashTraits : public DefaultSHashTraits +class EMPTY_BASES SetSHashTraits : public DefaultSHashTraits { public: // explicitly declare local typedefs for these traits types, otherwise @@ -912,7 +912,7 @@ class EMPTY_BASES_DECL SetSHashTraits : public DefaultSHashTraits }; template > > -class EMPTY_BASES_DECL SetSHash : public SHash< TRAITS > +class EMPTY_BASES SetSHash : public SHash< TRAITS > { typedef SHash PARENT; @@ -924,7 +924,7 @@ class EMPTY_BASES_DECL SetSHash : public SHash< TRAITS > }; template -class EMPTY_BASES_DECL PtrSetSHashTraits : public SetSHashTraits +class EMPTY_BASES PtrSetSHashTraits : public SetSHashTraits { public: @@ -943,7 +943,7 @@ class EMPTY_BASES_DECL PtrSetSHashTraits : public SetSHashTraits }; template -class EMPTY_BASES_DECL DeleteElementsOnDestructSHashTraits : public PARENT_TRAITS +class EMPTY_BASES DeleteElementsOnDestructSHashTraits : public PARENT_TRAITS { public: static inline void OnDestructPerEntryCleanupAction(typename PARENT_TRAITS::element_t e) @@ -984,7 +984,7 @@ class KeyValuePair { }; template -class EMPTY_BASES_DECL MapSHashTraits : public DefaultSHashTraits< KeyValuePair > +class EMPTY_BASES MapSHashTraits : public DefaultSHashTraits< KeyValuePair > { public: // explicitly declare local typedefs for these traits types, otherwise @@ -1017,7 +1017,7 @@ class EMPTY_BASES_DECL MapSHashTraits : public DefaultSHashTraits< KeyValuePair< }; template > > -class EMPTY_BASES_DECL MapSHash : public SHash< TRAITS > +class EMPTY_BASES MapSHash : public SHash< TRAITS > { typedef SHash< TRAITS > PARENT; @@ -1039,7 +1039,7 @@ class EMPTY_BASES_DECL MapSHash : public SHash< TRAITS > }; template -class EMPTY_BASES_DECL MapSHashWithRemove : public SHash< MapSHashTraits > +class EMPTY_BASES MapSHashWithRemove : public SHash< MapSHashTraits > { typedef SHash< MapSHashTraits > PARENT; diff --git a/src/coreclr/inc/slist.h b/src/coreclr/inc/slist.h index d746f8d3f46158..b4969f27c2b847 100644 --- a/src/coreclr/inc/slist.h +++ b/src/coreclr/inc/slist.h @@ -21,6 +21,7 @@ #endif #include "cdacdata.h" +#include #include // std::forward (used by SListElem) // --------------------------------------------------------------------------- @@ -78,7 +79,7 @@ struct SListTailBase // field. Use SListTraits for O(1) tail insertion. // --------------------------------------------------------------------------- template > -struct SList : public Traits, private SListTailBase +struct EMPTY_BASES SList : public Traits, private SListTailBase { typedef typename Traits::PTR_T PTR_T; typedef typename Traits::PTR_PTR_T PTR_PTR_T; @@ -386,6 +387,14 @@ struct SList : public Traits, private SListTailBase using SListTail = SList>; +struct SListLayoutValidationElem +{ + SListLayoutValidationElem* m_pNext; +}; + +static_assert(sizeof(SList) == sizeof(SListTraits::PTR_T)); +static_assert(sizeof(SListTail) == 2 * sizeof(SListTraits::PTR_T)); + // --------------------------------------------------------------------------- // SListElem — non-intrusive list element wrapper. // --------------------------------------------------------------------------- diff --git a/src/coreclr/inc/sstring.h b/src/coreclr/inc/sstring.h index 82463acc654601..bf2c7ab80a4d87 100644 --- a/src/coreclr/inc/sstring.h +++ b/src/coreclr/inc/sstring.h @@ -70,7 +70,7 @@ typedef const UTF8 *LPCUTF8; typedef DPTR(class SString) PTR_SString; -class EMPTY_BASES_DECL SString : private SBuffer +class EMPTY_BASES SString : private SBuffer { friend struct _DacGlobals; @@ -333,7 +333,7 @@ class EMPTY_BASES_DECL SString : private SBuffer protected: - class EMPTY_BASES_DECL Index : public SBuffer::Index + class EMPTY_BASES Index : public SBuffer::Index { friend class SString; @@ -365,7 +365,7 @@ class EMPTY_BASES_DECL SString : private SBuffer public: - class EMPTY_BASES_DECL CIterator : public Index, public Indexer + class EMPTY_BASES CIterator : public Index, public Indexer { friend class SString; @@ -405,7 +405,7 @@ class EMPTY_BASES_DECL SString : private SBuffer WCHAR operator[](int index) const { return Index::operator[](index); } }; - class EMPTY_BASES_DECL Iterator : public Index, public Indexer + class EMPTY_BASES Iterator : public Index, public Indexer { friend class SString; @@ -711,7 +711,7 @@ class EMPTY_BASES_DECL SString : private SBuffer // =========================================================================== template -class EMPTY_BASES_DECL InlineSString : public SString +class EMPTY_BASES InlineSString : public SString { private: DAC_ALIGNAS(SString) diff --git a/src/coreclr/pal/inc/pal.h b/src/coreclr/pal/inc/pal.h index ed96882ab468ea..e3a779a3d3704b 100644 --- a/src/coreclr/pal/inc/pal.h +++ b/src/coreclr/pal/inc/pal.h @@ -119,8 +119,6 @@ extern bool g_arm64_atomics_present; /******************* Compiler-specific glue *******************************/ #define DECLSPEC_NORETURN PAL_NORETURN -#define EMPTY_BASES_DECL - #if !defined(_MSC_VER) || defined(SOURCE_FORMATTING) #if __has_builtin(__builtin_assume) #define __assume(condition) do { bool assume_cond = (condition); __builtin_assume(assume_cond); } while (0) diff --git a/src/coreclr/vm/crossloaderallocatorhash.h b/src/coreclr/vm/crossloaderallocatorhash.h index 26677635326324..c601d4cd17f004 100644 --- a/src/coreclr/vm/crossloaderallocatorhash.h +++ b/src/coreclr/vm/crossloaderallocatorhash.h @@ -232,7 +232,7 @@ class CrossLoaderAllocatorHash virtual bool IsLAHashKeyToTrackers() const override { return true; } }; - class EMPTY_BASES_DECL KeyToValuesHashTraits : public DefaultSHashTraits + class EMPTY_BASES KeyToValuesHashTraits : public DefaultSHashTraits { private: typedef DefaultSHashTraits Base; @@ -352,7 +352,7 @@ class CrossLoaderAllocatorHash #endif // !DACCESS_COMPILE }; - class EMPTY_BASES_DECL LAHashDependentHashTrackerHashTraits : public DefaultSHashTraits + class EMPTY_BASES LAHashDependentHashTrackerHashTraits : public DefaultSHashTraits { public: typedef TCount count_t; diff --git a/src/native/minipal/utils.h b/src/native/minipal/utils.h index 97758ffcf0f8a8..cb1fa309b3b134 100644 --- a/src/native/minipal/utils.h +++ b/src/native/minipal/utils.h @@ -67,8 +67,10 @@ #ifdef _MSC_VER #define DECLSPEC_ALIGN(x) __declspec(align(x)) +#define EMPTY_BASES __declspec(empty_bases) #else #define DECLSPEC_ALIGN(x) __attribute__((aligned(x))) +#define EMPTY_BASES #endif #if defined(_MSC_VER) From 82219d20d177cdcd596c609a978312e2980e4ed8 Mon Sep 17 00:00:00 2001 From: Egor Bogatov Date: Mon, 11 May 2026 17:11:51 +0200 Subject: [PATCH 086/109] Reduce Unsafe usage in TryWriteSignificand/TryHash helpers (#127921) --- .../src/System/Decimal.cs | 30 +------ .../src/System/Double.cs | 36 +++++++-- .../System/Runtime/InteropServices/NFloat.cs | 81 +------------------ .../src/System/Single.cs | 36 +++++++-- 4 files changed, 64 insertions(+), 119 deletions(-) diff --git a/src/libraries/System.Private.CoreLib/src/System/Decimal.cs b/src/libraries/System.Private.CoreLib/src/System/Decimal.cs index 1a85cd80202461..a5ff30b93be1b3 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Decimal.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Decimal.cs @@ -1175,19 +1175,8 @@ bool IFloatingPoint.TryWriteSignificandBigEndian(Span destination { if (destination.Length >= (sizeof(uint) + sizeof(ulong))) { - uint hi32 = _hi32; - ulong lo64 = _lo64; - - if (BitConverter.IsLittleEndian) - { - hi32 = BinaryPrimitives.ReverseEndianness(hi32); - lo64 = BinaryPrimitives.ReverseEndianness(lo64); - } - - ref byte address = ref MemoryMarshal.GetReference(destination); - - Unsafe.WriteUnaligned(ref address, hi32); - Unsafe.WriteUnaligned(ref Unsafe.AddByteOffset(ref address, sizeof(uint)), lo64); + BinaryPrimitives.WriteUInt32BigEndian(destination, _hi32); + BinaryPrimitives.WriteUInt64BigEndian(destination.Slice(sizeof(uint)), _lo64); bytesWritten = sizeof(uint) + sizeof(ulong); return true; @@ -1204,19 +1193,8 @@ bool IFloatingPoint.TryWriteSignificandLittleEndian(Span destinat { if (destination.Length >= (sizeof(ulong) + sizeof(uint))) { - ulong lo64 = _lo64; - uint hi32 = _hi32; - - if (!BitConverter.IsLittleEndian) - { - lo64 = BinaryPrimitives.ReverseEndianness(lo64); - hi32 = BinaryPrimitives.ReverseEndianness(hi32); - } - - ref byte address = ref MemoryMarshal.GetReference(destination); - - Unsafe.WriteUnaligned(ref address, lo64); - Unsafe.WriteUnaligned(ref Unsafe.AddByteOffset(ref address, sizeof(ulong)), hi32); + BinaryPrimitives.WriteUInt64LittleEndian(destination, _lo64); + BinaryPrimitives.WriteUInt32LittleEndian(destination.Slice(sizeof(ulong)), _hi32); bytesWritten = sizeof(ulong) + sizeof(uint); return true; diff --git a/src/libraries/System.Private.CoreLib/src/System/Double.cs b/src/libraries/System.Private.CoreLib/src/System/Double.cs index 94d7a627d3f70b..2ff9c3662e42d9 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Double.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Double.cs @@ -721,8 +721,7 @@ int IFloatingPoint.GetExponentShortestBitLength() /// int IFloatingPoint.GetSignificandBitLength() => 53; - /// - bool IFloatingPoint.TryWriteExponentBigEndian(Span destination, out int bytesWritten) + internal bool TryWriteExponentBigEndian(Span destination, out int bytesWritten) { if (BinaryPrimitives.TryWriteInt16BigEndian(destination, Exponent)) { @@ -734,8 +733,13 @@ bool IFloatingPoint.TryWriteExponentBigEndian(Span destination, ou return false; } - /// - bool IFloatingPoint.TryWriteExponentLittleEndian(Span destination, out int bytesWritten) + /// + bool IFloatingPoint.TryWriteExponentBigEndian(Span destination, out int bytesWritten) + { + return TryWriteExponentBigEndian(destination, out bytesWritten); + } + + internal bool TryWriteExponentLittleEndian(Span destination, out int bytesWritten) { if (BinaryPrimitives.TryWriteInt16LittleEndian(destination, Exponent)) { @@ -747,8 +751,13 @@ bool IFloatingPoint.TryWriteExponentLittleEndian(Span destination, return false; } - /// - bool IFloatingPoint.TryWriteSignificandBigEndian(Span destination, out int bytesWritten) + /// + bool IFloatingPoint.TryWriteExponentLittleEndian(Span destination, out int bytesWritten) + { + return TryWriteExponentLittleEndian(destination, out bytesWritten); + } + + internal bool TryWriteSignificandBigEndian(Span destination, out int bytesWritten) { if (BinaryPrimitives.TryWriteUInt64BigEndian(destination, Significand)) { @@ -760,8 +769,13 @@ bool IFloatingPoint.TryWriteSignificandBigEndian(Span destination, return false; } - /// - bool IFloatingPoint.TryWriteSignificandLittleEndian(Span destination, out int bytesWritten) + /// + bool IFloatingPoint.TryWriteSignificandBigEndian(Span destination, out int bytesWritten) + { + return TryWriteSignificandBigEndian(destination, out bytesWritten); + } + + internal bool TryWriteSignificandLittleEndian(Span destination, out int bytesWritten) { if (BinaryPrimitives.TryWriteUInt64LittleEndian(destination, Significand)) { @@ -773,6 +787,12 @@ bool IFloatingPoint.TryWriteSignificandLittleEndian(Span destinati return false; } + /// + bool IFloatingPoint.TryWriteSignificandLittleEndian(Span destination, out int bytesWritten) + { + return TryWriteSignificandLittleEndian(destination, out bytesWritten); + } + // // IFloatingPointConstants // diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/NFloat.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/NFloat.cs index d542d13b39f07a..fd875adcc67b1f 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/NFloat.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/NFloat.cs @@ -1,7 +1,6 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -using System.Buffers.Binary; using System.Diagnostics.CodeAnalysis; using System.Globalization; using System.Numerics; @@ -1040,97 +1039,25 @@ int IFloatingPoint.GetSignificandBitLength() /// bool IFloatingPoint.TryWriteExponentBigEndian(Span destination, out int bytesWritten) { - if (destination.Length >= sizeof(NativeExponentType)) - { - NativeExponentType exponent = _value.Exponent; - - if (BitConverter.IsLittleEndian) - { - exponent = BinaryPrimitives.ReverseEndianness(exponent); - } - - Unsafe.WriteUnaligned(ref MemoryMarshal.GetReference(destination), exponent); - - bytesWritten = sizeof(NativeExponentType); - return true; - } - else - { - bytesWritten = 0; - return false; - } + return _value.TryWriteExponentBigEndian(destination, out bytesWritten); } /// bool IFloatingPoint.TryWriteExponentLittleEndian(Span destination, out int bytesWritten) { - if (destination.Length >= sizeof(NativeExponentType)) - { - NativeExponentType exponent = _value.Exponent; - - if (!BitConverter.IsLittleEndian) - { - exponent = BinaryPrimitives.ReverseEndianness(exponent); - } - - Unsafe.WriteUnaligned(ref MemoryMarshal.GetReference(destination), exponent); - - bytesWritten = sizeof(NativeExponentType); - return true; - } - else - { - bytesWritten = 0; - return false; - } + return _value.TryWriteExponentLittleEndian(destination, out bytesWritten); } /// bool IFloatingPoint.TryWriteSignificandBigEndian(Span destination, out int bytesWritten) { - if (destination.Length >= sizeof(NativeSignificandType)) - { - NativeSignificandType significand = _value.Significand; - - if (BitConverter.IsLittleEndian) - { - significand = BinaryPrimitives.ReverseEndianness(significand); - } - - Unsafe.WriteUnaligned(ref MemoryMarshal.GetReference(destination), significand); - - bytesWritten = sizeof(NativeSignificandType); - return true; - } - else - { - bytesWritten = 0; - return false; - } + return _value.TryWriteSignificandBigEndian(destination, out bytesWritten); } /// bool IFloatingPoint.TryWriteSignificandLittleEndian(Span destination, out int bytesWritten) { - if (destination.Length >= sizeof(NativeSignificandType)) - { - NativeSignificandType significand = _value.Significand; - - if (!BitConverter.IsLittleEndian) - { - significand = BinaryPrimitives.ReverseEndianness(significand); - } - - Unsafe.WriteUnaligned(ref MemoryMarshal.GetReference(destination), significand); - - bytesWritten = sizeof(NativeSignificandType); - return true; - } - else - { - bytesWritten = 0; - return false; - } + return _value.TryWriteSignificandLittleEndian(destination, out bytesWritten); } // diff --git a/src/libraries/System.Private.CoreLib/src/System/Single.cs b/src/libraries/System.Private.CoreLib/src/System/Single.cs index cfad70514b4dc9..7a106630b6c841 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Single.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Single.cs @@ -716,8 +716,7 @@ int IFloatingPoint.GetExponentShortestBitLength() /// int IFloatingPoint.GetSignificandBitLength() => 24; - /// - bool IFloatingPoint.TryWriteExponentBigEndian(Span destination, out int bytesWritten) + internal bool TryWriteExponentBigEndian(Span destination, out int bytesWritten) { if (destination.Length >= sizeof(sbyte)) { @@ -730,8 +729,13 @@ bool IFloatingPoint.TryWriteExponentBigEndian(Span destination, out return false; } - /// - bool IFloatingPoint.TryWriteExponentLittleEndian(Span destination, out int bytesWritten) + /// + bool IFloatingPoint.TryWriteExponentBigEndian(Span destination, out int bytesWritten) + { + return TryWriteExponentBigEndian(destination, out bytesWritten); + } + + internal bool TryWriteExponentLittleEndian(Span destination, out int bytesWritten) { if (destination.Length >= sizeof(sbyte)) { @@ -744,8 +748,13 @@ bool IFloatingPoint.TryWriteExponentLittleEndian(Span destination, return false; } - /// - bool IFloatingPoint.TryWriteSignificandBigEndian(Span destination, out int bytesWritten) + /// + bool IFloatingPoint.TryWriteExponentLittleEndian(Span destination, out int bytesWritten) + { + return TryWriteExponentLittleEndian(destination, out bytesWritten); + } + + internal bool TryWriteSignificandBigEndian(Span destination, out int bytesWritten) { if (BinaryPrimitives.TryWriteUInt32BigEndian(destination, Significand)) { @@ -757,8 +766,13 @@ bool IFloatingPoint.TryWriteSignificandBigEndian(Span destination, return false; } - /// - bool IFloatingPoint.TryWriteSignificandLittleEndian(Span destination, out int bytesWritten) + /// + bool IFloatingPoint.TryWriteSignificandBigEndian(Span destination, out int bytesWritten) + { + return TryWriteSignificandBigEndian(destination, out bytesWritten); + } + + internal bool TryWriteSignificandLittleEndian(Span destination, out int bytesWritten) { if (BinaryPrimitives.TryWriteUInt32LittleEndian(destination, Significand)) { @@ -770,6 +784,12 @@ bool IFloatingPoint.TryWriteSignificandLittleEndian(Span destinatio return false; } + /// + bool IFloatingPoint.TryWriteSignificandLittleEndian(Span destination, out int bytesWritten) + { + return TryWriteSignificandLittleEndian(destination, out bytesWritten); + } + // // IFloatingPointConstants // From 1daec0a195e1a62ed7664eb5cc8e98208d0377ee Mon Sep 17 00:00:00 2001 From: Milos Kotlar Date: Mon, 11 May 2026 17:14:55 +0200 Subject: [PATCH 087/109] [mono] Handle nint/nuint in Crc32 and ArmBase intrinsic dispatch (#127787) ## Description The Mono SIMD intrinsic dispatch in `simd-intrinsics.c` did not match `MONO_TYPE_I/U`, so the new `nint`/`nuint` overloads added by #127327 (`Crc32.ComputeCrc32(uint, nuint)`, `Crc32.ComputeCrc32C(uint, nuint)`, `ArmBase.ReverseElementBits(nint/nuint)`) tripped `g_assert_not_reached()` at line 4981 during AOT of `System.Private.CoreLib.dll` on tvos-arm64 (build [1406826](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1406826)). This unblocks AOT precompilation of `System.Private.CoreLib.dll` on 64-bit ARM Mono targets and recovers four tvos appletv work items (`System.Configuration.ConfigurationManager.Tests`, `System.Reflection.MetadataLoadContext.Tests`, `System.Security.Cryptography.Xml.Tests`, `System.Text.Json.Tests`) that previously exited 21 before any test ran. Fixes https://github.com/dotnet/runtime/issues/127792 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/mono/mono/mini/simd-intrinsics.c | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/src/mono/mono/mini/simd-intrinsics.c b/src/mono/mono/mini/simd-intrinsics.c index 36dcf1a4f29990..21295764fad806 100644 --- a/src/mono/mono/mini/simd-intrinsics.c +++ b/src/mono/mono/mini/simd-intrinsics.c @@ -4951,8 +4951,8 @@ emit_arm64_intrinsics ( (arg0_type == MONO_TYPE_I8 ? OP_ARM64_SMULH : OP_ARM64_UMULH), 0, arg0_type, fsig, args); case SN_ReverseElementBits: return emit_simd_ins_for_sig (cfg, klass, - (is_64bit ? OP_XOP_I8_I8 : OP_XOP_I4_I4), - (is_64bit ? INTRINS_BITREVERSE_I64 : INTRINS_BITREVERSE_I32), + (arg0_i32 ? OP_XOP_I4_I4 : OP_XOP_I8_I8), + (arg0_i32 ? INTRINS_BITREVERSE_I32 : INTRINS_BITREVERSE_I64), arg0_type, fsig, args); case SN_Yield: { MonoInst* ins; @@ -4973,14 +4973,26 @@ emit_arm64_intrinsics ( case SN_ComputeCrc32C: { IntrinsicId op = (IntrinsicId)0; gboolean is_c = info->id == SN_ComputeCrc32C; + gboolean is_8byte_data = FALSE; switch (get_underlying_type (fsig->params [1])) { case MONO_TYPE_U1: op = is_c ? INTRINS_AARCH64_CRC32CB : INTRINS_AARCH64_CRC32B; break; case MONO_TYPE_U2: op = is_c ? INTRINS_AARCH64_CRC32CH : INTRINS_AARCH64_CRC32H; break; +#if TARGET_SIZEOF_VOID_P == 4 + case MONO_TYPE_I: + case MONO_TYPE_U: +#endif case MONO_TYPE_U4: op = is_c ? INTRINS_AARCH64_CRC32CW : INTRINS_AARCH64_CRC32W; break; - case MONO_TYPE_U8: op = is_c ? INTRINS_AARCH64_CRC32CX : INTRINS_AARCH64_CRC32X; break; +#if TARGET_SIZEOF_VOID_P == 8 + case MONO_TYPE_I: + case MONO_TYPE_U: + is_8byte_data = TRUE; + op = is_c ? INTRINS_AARCH64_CRC32CX : INTRINS_AARCH64_CRC32X; + break; +#endif + case MONO_TYPE_U8: is_8byte_data = TRUE; op = is_c ? INTRINS_AARCH64_CRC32CX : INTRINS_AARCH64_CRC32X; break; default: g_assert_not_reached (); break; } - return emit_simd_ins_for_sig (cfg, klass, is_64bit ? OP_XOP_I4_I4_I8 : OP_XOP_I4_I4_I4, op, arg0_type, fsig, args); + return emit_simd_ins_for_sig (cfg, klass, is_8byte_data ? OP_XOP_I4_I4_I8 : OP_XOP_I4_I4_I4, op, arg0_type, fsig, args); } default: g_assert_not_reached (); // if a new API is added we need to either implement it or change IsSupported to false From 15aceeac0dcc0d2fcca3cd159dff7adab5d351cb Mon Sep 17 00:00:00 2001 From: Pavel Savara Date: Mon, 11 May 2026 17:22:11 +0200 Subject: [PATCH 088/109] Replace `GetOsPageSize()` with `minipal_getpagesize()` in CoreCLR (#127904) Co-authored-by: Adeel Mujahid <3840695+am11@users.noreply.github.com> --- .../debug/createdump/createdumpunix.cpp | 3 +- src/coreclr/debug/daccess/enummem.cpp | 4 +-- src/coreclr/debug/di/shimlocaldatatarget.cpp | 2 +- src/coreclr/debug/di/shimremotedatatarget.cpp | 4 ++- src/coreclr/gc/unix/gcenv.unix.cpp | 6 ++-- src/coreclr/inc/loaderheap.h | 2 +- src/coreclr/inc/pedecoder.inl | 4 +-- src/coreclr/inc/utilcode.h | 3 +- .../pal/src/exception/machexception.cpp | 3 +- .../IsBadWritePtr/test2/test2.cpp | 19 ++++++------ .../IsBadWritePtr/test3/test3.cpp | 5 ++-- .../utilcode/clrhost_nodependencies.cpp | 4 +-- src/coreclr/utilcode/dacutil.cpp | 2 +- src/coreclr/utilcode/executableallocator.cpp | 2 +- .../utilcode/explicitcontrolloaderheap.cpp | 6 ++-- .../utilcode/interleavedloaderheap.cpp | 4 +-- src/coreclr/utilcode/loaderheap.cpp | 4 +-- src/coreclr/utilcode/util.cpp | 30 ------------------- src/coreclr/vm/appdomain.hpp | 16 +++++----- src/coreclr/vm/ceemain.cpp | 4 +-- src/coreclr/vm/codeman.h | 6 ++-- src/coreclr/vm/debughelp.cpp | 6 ++-- src/coreclr/vm/excep.h | 2 +- src/coreclr/vm/frames.cpp | 12 ++++---- src/coreclr/vm/hosting.cpp | 4 +-- src/coreclr/vm/i386/jitinterfacex86.cpp | 4 +-- src/coreclr/vm/jitinterface.cpp | 2 +- src/coreclr/vm/jitinterface.h | 2 +- src/coreclr/vm/loaderallocator.cpp | 12 ++++---- src/coreclr/vm/peimagelayout.cpp | 8 ++--- src/coreclr/vm/threads.cpp | 24 +++++++-------- src/coreclr/vm/threads.h | 6 ++-- src/coreclr/vm/virtualcallstub.cpp | 26 ++++++++-------- .../managed/cdac/tests/PrecodeStubsTests.cs | 2 +- src/native/minipal/ospagesize.c | 21 ++++++++----- src/native/minipal/ospagesize.h | 8 ++--- 36 files changed, 126 insertions(+), 146 deletions(-) diff --git a/src/coreclr/debug/createdump/createdumpunix.cpp b/src/coreclr/debug/createdump/createdumpunix.cpp index ea6fa5b8b94d48..ac9ba3043e35d9 100644 --- a/src/coreclr/debug/createdump/createdumpunix.cpp +++ b/src/coreclr/debug/createdump/createdumpunix.cpp @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. #include "createdump.h" +#include #if defined(__arm__) || defined(__aarch64__) || defined(__loongarch64) || defined(__riscv) long g_pageSize = 0; @@ -20,7 +21,7 @@ CreateDump(const CreateDumpOptions& options) // Initialize PAGE_SIZE #if defined(__arm__) || defined(__aarch64__) || defined(__loongarch64) || defined(__riscv) - g_pageSize = sysconf(_SC_PAGESIZE); + g_pageSize = minipal_getpagesize(); #endif TRACE("PAGE_SIZE %d\n", PAGE_SIZE); diff --git a/src/coreclr/debug/daccess/enummem.cpp b/src/coreclr/debug/daccess/enummem.cpp index 23d30c832c4658..f23ad172e3f2be 100644 --- a/src/coreclr/debug/daccess/enummem.cpp +++ b/src/coreclr/debug/daccess/enummem.cpp @@ -99,7 +99,7 @@ HRESULT ClrDataAccess::EnumMemCollectImages() ulSize = assembly->GetLoadedLayout()->GetSize(); } - // memory are mapped in GetOsPageSize() size. + // memory are mapped in minipal_getpagesize() size. // Some memory are mapped in but some are not. You cannot // write all in one block. So iterating through page size // @@ -112,7 +112,7 @@ HRESULT ClrDataAccess::EnumMemCollectImages() // MethodHeader MethodDesc::GetILHeader. Without this RVA, // all locals are broken. In case, you are asked about this question again. // - ulSizeBlock = ulSize > GetOsPageSize() ? GetOsPageSize() : ulSize; + ulSizeBlock = ulSize > minipal_getpagesize() ? minipal_getpagesize() : ulSize; ReportMem(pStartAddr, ulSizeBlock, false); pStartAddr += ulSizeBlock; ulSize -= ulSizeBlock; diff --git a/src/coreclr/debug/di/shimlocaldatatarget.cpp b/src/coreclr/debug/di/shimlocaldatatarget.cpp index 4240c3dd159782..ca9e92018125eb 100644 --- a/src/coreclr/debug/di/shimlocaldatatarget.cpp +++ b/src/coreclr/debug/di/shimlocaldatatarget.cpp @@ -321,7 +321,7 @@ ShimLocalDataTarget::ReadVirtual( { // Calculate bytes to read and don't let read cross // a page boundary. - readSize = GetOsPageSize() - (ULONG32)(address & (GetOsPageSize() - 1)); + readSize = minipal_getpagesize() - (ULONG32)(address & (minipal_getpagesize() - 1)); readSize = min(cbRequestSize, readSize); if (!ReadProcessMemory(m_hProcess, (PVOID)(ULONG_PTR)address, diff --git a/src/coreclr/debug/di/shimremotedatatarget.cpp b/src/coreclr/debug/di/shimremotedatatarget.cpp index 1c37159ca061db..de3413e1c7fc1b 100644 --- a/src/coreclr/debug/di/shimremotedatatarget.cpp +++ b/src/coreclr/debug/di/shimremotedatatarget.cpp @@ -14,6 +14,8 @@ #include "dbgtransportsession.h" #include "dbgtransportmanager.h" +#include + #ifdef __APPLE__ #include #else @@ -299,7 +301,7 @@ ShimRemoteDataTarget::ReadVirtual( #ifdef __APPLE__ // vm_read_overwrite usually requires the address be page-aligned and the size be a multiple // of the page size, so we always page-align ourselves and copy out the relevant slice. - const size_t pageSize = (size_t)sysconf(_SC_PAGESIZE); + const size_t pageSize = minipal_getpagesize(); vm_address_t addressAligned = (vm_address_t)(address & ~(ULONG64)(pageSize - 1)); ssize_t offset = (ssize_t)(address & (pageSize - 1)); ssize_t bytesLeft = (ssize_t)cbRequestSize; diff --git a/src/coreclr/gc/unix/gcenv.unix.cpp b/src/coreclr/gc/unix/gcenv.unix.cpp index 126483bde3ec96..98b0588e2083ae 100644 --- a/src/coreclr/gc/unix/gcenv.unix.cpp +++ b/src/coreclr/gc/unix/gcenv.unix.cpp @@ -1084,7 +1084,7 @@ uint64_t GetAvailablePhysicalMemory() sz = sizeof(free_count); sysctlbyname("vm.stats.vm.v_free_count", &free_count, &sz, NULL, 0); - available = (inactive_count + laundry_count + free_count) * sysconf(_SC_PAGESIZE); + available = (inactive_count + laundry_count + free_count) * minipal_getpagesize(); #elif defined(__HAIKU__) system_info info; if (get_system_info(&info) == B_OK) @@ -1140,7 +1140,7 @@ uint64_t GetAvailablePageFile() rc = sysctlnametomib("vm.swap_info", mib, &length); if (rc == 0) { - int pagesize = getpagesize(); + uint32_t pagesize = minipal_getpagesize(); // Aggregate the information for all swap files on the system for (mib[2] = 0; ; mib[2]++) { @@ -1161,7 +1161,7 @@ uint64_t GetAvailablePageFile() struct anoninfo ai; if (swapctl(SC_AINFO, &ai) != -1) { - int pagesize = getpagesize(); + uint32_t pagesize = minipal_getpagesize(); available = ai.ani_free * pagesize; } #elif HAVE_SYSINFO diff --git a/src/coreclr/inc/loaderheap.h b/src/coreclr/inc/loaderheap.h index 56b494701d6898..0d7c7a349939ea 100644 --- a/src/coreclr/inc/loaderheap.h +++ b/src/coreclr/inc/loaderheap.h @@ -160,7 +160,7 @@ struct LoaderHeapEvent; inline UINT32 GetStubCodePageSize() { #if (defined(TARGET_ARM64) && defined(TARGET_UNIX)) || defined(TARGET_WASM) - return max(16*1024u, GetOsPageSize()); + return max(16*1024u, minipal_getpagesize()); #elif defined(TARGET_ARM) return 4096; // ARM is special as the 32bit instruction set does not easily permit a 16KB offset #else diff --git a/src/coreclr/inc/pedecoder.inl b/src/coreclr/inc/pedecoder.inl index c458c00af6f307..3d39202e5a5a59 100644 --- a/src/coreclr/inc/pedecoder.inl +++ b/src/coreclr/inc/pedecoder.inl @@ -109,7 +109,7 @@ inline PEDecoder::PEDecoder(PTR_VOID mappedBase, bool fixedUp /*= FALSE*/) CONTRACTL_END; // Temporarily set the size to 2 pages, so we can get the headers. - m_size = GetOsPageSize()*2; + m_size = minipal_getpagesize()*2; m_pNTHeaders = PTR_IMAGE_NT_HEADERS(FindNTHeaders()); if (!m_pNTHeaders) @@ -182,7 +182,7 @@ inline HRESULT PEDecoder::Init(void *mappedBase, bool fixedUp /*= FALSE*/) m_flags |= FLAG_RELOCATED; // Temporarily set the size to 2 pages, so we can get the headers. - m_size = GetOsPageSize()*2; + m_size = minipal_getpagesize()*2; m_pNTHeaders = FindNTHeaders(); if (!m_pNTHeaders) diff --git a/src/coreclr/inc/utilcode.h b/src/coreclr/inc/utilcode.h index d074869642da63..9e4d0b6dd608d9 100644 --- a/src/coreclr/inc/utilcode.h +++ b/src/coreclr/inc/utilcode.h @@ -38,6 +38,7 @@ using std::nothrow; #include #include #include +#include #include #include "clrnt.h" @@ -577,8 +578,6 @@ int GetTotalProcessorCount(); //****************************************************************************** int GetCurrentProcessCpuCount(); -uint32_t GetOsPageSize(); - //***************************************************************************** // Return != 0 if the bit at the specified index in the array is on and 0 if diff --git a/src/coreclr/pal/src/exception/machexception.cpp b/src/coreclr/pal/src/exception/machexception.cpp index f52519959a8736..3610f4813cb358 100644 --- a/src/coreclr/pal/src/exception/machexception.cpp +++ b/src/coreclr/pal/src/exception/machexception.cpp @@ -32,6 +32,7 @@ SET_DEFAULT_DEBUG_CHANNEL(EXCEPT); // some headers have code with asserts, so do #include #include +#include #include "machmessage.h" @@ -751,7 +752,7 @@ HijackFaultingThread( if (exceptionRecord.ExceptionCode == EXCEPTION_ACCESS_VIOLATION) { // Calculate the page base addresses for the fault and the faulting thread's SP. - int cbPage = getpagesize(); + int cbPage = minipal_getpagesize(); char *pFaultPage = (char*)(exceptionRecord.ExceptionInformation[1] & ~(cbPage - 1)); char *pStackTopPage = (char*)((size_t)targetSP & ~(cbPage - 1)); diff --git a/src/coreclr/pal/tests/palsuite/miscellaneous/IsBadWritePtr/test2/test2.cpp b/src/coreclr/pal/tests/palsuite/miscellaneous/IsBadWritePtr/test2/test2.cpp index b1b23f3280125a..d9876bdbf507ce 100644 --- a/src/coreclr/pal/tests/palsuite/miscellaneous/IsBadWritePtr/test2/test2.cpp +++ b/src/coreclr/pal/tests/palsuite/miscellaneous/IsBadWritePtr/test2/test2.cpp @@ -15,6 +15,7 @@ **=========================================================*/ #include +#include PALTEST(miscellaneous_IsBadWritePtr_test2_paltest_isbadwriteptr_test2, "miscellaneous/IsBadWritePtr/test2/paltest_isbadwriteptr_test2") { @@ -31,7 +32,7 @@ PALTEST(miscellaneous_IsBadWritePtr_test2_paltest_isbadwriteptr_test2, "miscella */ PageOne = VirtualAlloc(NULL, - GetOsPageSize()*4, + minipal_getpagesize()*4, MEM_RESERVE, PAGE_NOACCESS); @@ -43,7 +44,7 @@ PALTEST(miscellaneous_IsBadWritePtr_test2_paltest_isbadwriteptr_test2, "miscella /* Set the first Page to PAGE_NOACCESS */ PageOne = VirtualAlloc(PageOne, - GetOsPageSize(), + minipal_getpagesize(), MEM_COMMIT, PAGE_NOACCESS); @@ -57,8 +58,8 @@ PALTEST(miscellaneous_IsBadWritePtr_test2_paltest_isbadwriteptr_test2, "miscella /* Set the second Page to PAGE_READWRITE */ - PageTwo = VirtualAlloc(((BYTE*)PageOne)+GetOsPageSize(), - GetOsPageSize(), + PageTwo = VirtualAlloc(((BYTE*)PageOne)+minipal_getpagesize(), + minipal_getpagesize(), MEM_COMMIT, PAGE_READWRITE); if(PageTwo == NULL) @@ -71,8 +72,8 @@ PALTEST(miscellaneous_IsBadWritePtr_test2_paltest_isbadwriteptr_test2, "miscella /* Set the third Page to PAGE_NOACCESS */ - PageThree = VirtualAlloc(((BYTE*)PageTwo) + (2 * GetOsPageSize()), - GetOsPageSize(), + PageThree = VirtualAlloc(((BYTE*)PageTwo) + (2 * minipal_getpagesize()), + minipal_getpagesize(), MEM_COMMIT, PAGE_NOACCESS); @@ -87,7 +88,7 @@ PALTEST(miscellaneous_IsBadWritePtr_test2_paltest_isbadwriteptr_test2, "miscella /* Check that calling IsBadWritePtr on the first page returns non-zero */ - if(IsBadWritePtr(PageThree,GetOsPageSize()) == 0) + if(IsBadWritePtr(PageThree,minipal_getpagesize()) == 0) { VirtualFree(PageOne,0,MEM_RELEASE); @@ -98,7 +99,7 @@ PALTEST(miscellaneous_IsBadWritePtr_test2_paltest_isbadwriteptr_test2, "miscella /* Check that calling IsBadWritePtr on the middle page returns 0 */ - if(IsBadWritePtr(PageTwo,GetOsPageSize()) != 0) + if(IsBadWritePtr(PageTwo,minipal_getpagesize()) != 0) { VirtualFree(PageOne,0,MEM_RELEASE); @@ -108,7 +109,7 @@ PALTEST(miscellaneous_IsBadWritePtr_test2_paltest_isbadwriteptr_test2, "miscella /* Check that calling IsBadWritePtr on the third page returns non-zero */ - if(IsBadWritePtr(PageThree,GetOsPageSize()) == 0) + if(IsBadWritePtr(PageThree,minipal_getpagesize()) == 0) { VirtualFree(PageOne,0,MEM_RELEASE); diff --git a/src/coreclr/pal/tests/palsuite/miscellaneous/IsBadWritePtr/test3/test3.cpp b/src/coreclr/pal/tests/palsuite/miscellaneous/IsBadWritePtr/test3/test3.cpp index b49c0c63418d6d..58192937694fe7 100644 --- a/src/coreclr/pal/tests/palsuite/miscellaneous/IsBadWritePtr/test3/test3.cpp +++ b/src/coreclr/pal/tests/palsuite/miscellaneous/IsBadWritePtr/test3/test3.cpp @@ -12,6 +12,7 @@ **=========================================================*/ #include +#include PALTEST(miscellaneous_IsBadWritePtr_test3_paltest_isbadwriteptr_test3, "miscellaneous/IsBadWritePtr/test3/paltest_isbadwriteptr_test3") { @@ -28,7 +29,7 @@ PALTEST(miscellaneous_IsBadWritePtr_test3_paltest_isbadwriteptr_test3, "miscella */ PageOne = VirtualAlloc(NULL, - GetOsPageSize(), + minipal_getpagesize(), MEM_COMMIT, PAGE_READONLY); @@ -37,7 +38,7 @@ PALTEST(miscellaneous_IsBadWritePtr_test3_paltest_isbadwriteptr_test3, "miscella Fail("ERROR: VirtualAlloc failed to commit the required memory.\n"); } - if(IsBadWritePtr(PageOne,GetOsPageSize()) == 0) + if(IsBadWritePtr(PageOne,minipal_getpagesize()) == 0) { VirtualFree(PageOne,0,MEM_RELEASE); diff --git a/src/coreclr/utilcode/clrhost_nodependencies.cpp b/src/coreclr/utilcode/clrhost_nodependencies.cpp index 766081eab81366..de6c0f5241e98a 100644 --- a/src/coreclr/utilcode/clrhost_nodependencies.cpp +++ b/src/coreclr/utilcode/clrhost_nodependencies.cpp @@ -173,8 +173,8 @@ BOOL DbgIsExecutable(LPVOID lpMem, SIZE_T length) // No NX support on PAL return TRUE; #else // !(TARGET_UNIX) - BYTE *regionStart = (BYTE*) ALIGN_DOWN((BYTE*)lpMem, GetOsPageSize()); - BYTE *regionEnd = (BYTE*) ALIGN_UP((BYTE*)lpMem+length, GetOsPageSize()); + BYTE *regionStart = (BYTE*) ALIGN_DOWN((BYTE*)lpMem, minipal_getpagesize()); + BYTE *regionEnd = (BYTE*) ALIGN_UP((BYTE*)lpMem+length, minipal_getpagesize()); _ASSERTE(length > 0); _ASSERTE(regionStart < regionEnd); diff --git a/src/coreclr/utilcode/dacutil.cpp b/src/coreclr/utilcode/dacutil.cpp index d8bd3180bc83c5..94f63a9e4946b7 100644 --- a/src/coreclr/utilcode/dacutil.cpp +++ b/src/coreclr/utilcode/dacutil.cpp @@ -140,7 +140,7 @@ LiveProcDataTarget::ReadVirtual( { // Calculate bytes to read and don't let read cross // a page boundary. - readSize = GetOsPageSize() - (ULONG32)(address & (GetOsPageSize() - 1)); + readSize = minipal_getpagesize() - (ULONG32)(address & (minipal_getpagesize() - 1)); readSize = min(request, readSize); if (!ReadProcessMemory(m_process, (PVOID)(ULONG_PTR)address, diff --git a/src/coreclr/utilcode/executableallocator.cpp b/src/coreclr/utilcode/executableallocator.cpp index 11c1af97f79770..f982fa1f940b6b 100644 --- a/src/coreclr/utilcode/executableallocator.cpp +++ b/src/coreclr/utilcode/executableallocator.cpp @@ -190,7 +190,7 @@ void ExecutableAllocator::InitLazyPreferredRange(size_t base, size_t size, int r } // Randomize the address space - pStart += GetOsPageSize() * randomPageOffset; + pStart += minipal_getpagesize() * randomPageOffset; g_lazyPreferredRangeStart = pStart; g_lazyPreferredRangeHint = pStart; diff --git a/src/coreclr/utilcode/explicitcontrolloaderheap.cpp b/src/coreclr/utilcode/explicitcontrolloaderheap.cpp index 06a5e76d14cf2d..61d5063663033a 100644 --- a/src/coreclr/utilcode/explicitcontrolloaderheap.cpp +++ b/src/coreclr/utilcode/explicitcontrolloaderheap.cpp @@ -64,7 +64,7 @@ ExplicitControlLoaderHeap::ExplicitControlLoaderHeap(bool fMakeExecutable) : m_pEndReservedRegion = NULL; m_pAllocPtr = NULL; - m_dwCommitBlockSize = GetOsPageSize(); + m_dwCommitBlockSize = minipal_getpagesize(); #ifdef _DEBUG m_dwDebugWastedBytes = 0; @@ -165,7 +165,7 @@ BOOL ExplicitControlLoaderHeap::ReservePages(size_t dwSizeToCommit) size_t dwSizeToReserve; // Round to page size again - dwSizeToCommit = ALIGN_UP(dwSizeToCommit, GetOsPageSize()); + dwSizeToCommit = ALIGN_UP(dwSizeToCommit, minipal_getpagesize()); ReservedMemoryHolder pData = NULL; BOOL fReleaseMemory = TRUE; @@ -266,7 +266,7 @@ BOOL ExplicitControlLoaderHeap::GetMoreCommittedPages(size_t dwMinSize) dwSizeToCommit = min((SIZE_T)(m_pEndReservedRegion - m_pPtrToEndOfCommittedRegion), (SIZE_T)m_dwCommitBlockSize); // Round to page size - dwSizeToCommit = ALIGN_UP(dwSizeToCommit, GetOsPageSize()); + dwSizeToCommit = ALIGN_UP(dwSizeToCommit, minipal_getpagesize()); size_t dwSizeToCommitPart = dwSizeToCommit; diff --git a/src/coreclr/utilcode/interleavedloaderheap.cpp b/src/coreclr/utilcode/interleavedloaderheap.cpp index 8ce0a91e2f032c..6bcc133681cd6a 100644 --- a/src/coreclr/utilcode/interleavedloaderheap.cpp +++ b/src/coreclr/utilcode/interleavedloaderheap.cpp @@ -49,7 +49,7 @@ UnlockedInterleavedLoaderHeap::UnlockedInterleavedLoaderHeap( } CONTRACTL_END; - _ASSERTE((GetStubCodePageSize() % GetOsPageSize()) == 0); // Stub code page size MUST be in increments of the page size. (Really it must be a power of 2 as well, but this is good enough) + _ASSERTE((GetStubCodePageSize() % minipal_getpagesize()) == 0); // Stub code page size MUST be in increments of the page size. (Really it must be a power of 2 as well, but this is good enough) } UnlockedInterleavedLoaderHeap::~UnlockedInterleavedLoaderHeap() @@ -151,7 +151,7 @@ BOOL UnlockedInterleavedLoaderHeap::UnlockedReservePages(size_t dwSizeToCommit) size_t dwSizeToReserve; // Round to page size again - dwSizeToCommit = ALIGN_UP(dwSizeToCommit, GetOsPageSize()); + dwSizeToCommit = ALIGN_UP(dwSizeToCommit, minipal_getpagesize()); ReservedMemoryHolder pData = NULL; diff --git a/src/coreclr/utilcode/loaderheap.cpp b/src/coreclr/utilcode/loaderheap.cpp index 073b24ba56d7ce..8c91e3d3b62f86 100644 --- a/src/coreclr/utilcode/loaderheap.cpp +++ b/src/coreclr/utilcode/loaderheap.cpp @@ -172,7 +172,7 @@ BOOL UnlockedLoaderHeap::UnlockedReservePages(size_t dwSizeToCommit) size_t dwSizeToReserve; // Round to page size again - dwSizeToCommit = ALIGN_UP(dwSizeToCommit, GetOsPageSize()); + dwSizeToCommit = ALIGN_UP(dwSizeToCommit, minipal_getpagesize()); ReservedMemoryHolder pData = NULL; BOOL fReleaseMemory = TRUE; @@ -307,7 +307,7 @@ BOOL UnlockedLoaderHeap::GetMoreCommittedPages(size_t dwMinSize) dwSizeToCommit = min((SIZE_T)(m_pEndReservedRegion - m_pPtrToEndOfCommittedRegion), (SIZE_T)m_dwCommitBlockSize); // Round to page size - dwSizeToCommit = ALIGN_UP(dwSizeToCommit, GetOsPageSize()); + dwSizeToCommit = ALIGN_UP(dwSizeToCommit, minipal_getpagesize()); size_t dwSizeToCommitPart = dwSizeToCommit; diff --git a/src/coreclr/utilcode/util.cpp b/src/coreclr/utilcode/util.cpp index 638101bea78243..4cb88c41fe08f2 100644 --- a/src/coreclr/utilcode/util.cpp +++ b/src/coreclr/utilcode/util.cpp @@ -1085,36 +1085,6 @@ DWORD_PTR GetCurrentProcessCpuMask() } #endif // HOST_WINDOWS -uint32_t GetOsPageSizeUncached() -{ - SYSTEM_INFO sysInfo; - ::GetSystemInfo(&sysInfo); - return sysInfo.dwAllocationGranularity ? sysInfo.dwAllocationGranularity : 0x1000; -} - -namespace -{ - Volatile g_pageSize = 0; -} - -uint32_t GetOsPageSize() -{ -#ifdef HOST_UNIX - size_t result = g_pageSize.LoadWithoutBarrier(); - - if(!result) - { - result = GetOsPageSizeUncached(); - - g_pageSize.StoreWithoutBarrier(result); - } - - return result; -#else - return 0x1000; -#endif -} - //============================================================================= // AssemblyNamesList //============================================================================= diff --git a/src/coreclr/vm/appdomain.hpp b/src/coreclr/vm/appdomain.hpp index 3e6893f0884da6..b005646a79db6b 100644 --- a/src/coreclr/vm/appdomain.hpp +++ b/src/coreclr/vm/appdomain.hpp @@ -202,17 +202,17 @@ FORCEINLINE void PinnedHeapHandleBlockHolder__StaticFree(PinnedHeapHandleBlockH // set) and being able to specify specific versions. // -#define LOW_FREQUENCY_HEAP_RESERVE_SIZE (3 * GetOsPageSize()) -#define LOW_FREQUENCY_HEAP_COMMIT_SIZE (1 * GetOsPageSize()) +#define LOW_FREQUENCY_HEAP_RESERVE_SIZE (3 * minipal_getpagesize()) +#define LOW_FREQUENCY_HEAP_COMMIT_SIZE (1 * minipal_getpagesize()) -#define HIGH_FREQUENCY_HEAP_RESERVE_SIZE (8 * GetOsPageSize()) -#define HIGH_FREQUENCY_HEAP_COMMIT_SIZE (1 * GetOsPageSize()) +#define HIGH_FREQUENCY_HEAP_RESERVE_SIZE (8 * minipal_getpagesize()) +#define HIGH_FREQUENCY_HEAP_COMMIT_SIZE (1 * minipal_getpagesize()) -#define STUB_HEAP_RESERVE_SIZE (3 * GetOsPageSize()) -#define STUB_HEAP_COMMIT_SIZE (1 * GetOsPageSize()) +#define STUB_HEAP_RESERVE_SIZE (3 * minipal_getpagesize()) +#define STUB_HEAP_COMMIT_SIZE (1 * minipal_getpagesize()) -#define STATIC_FIELD_HEAP_RESERVE_SIZE (2 * GetOsPageSize()) -#define STATIC_FIELD_HEAP_COMMIT_SIZE (1 * GetOsPageSize()) +#define STATIC_FIELD_HEAP_RESERVE_SIZE (2 * minipal_getpagesize()) +#define STATIC_FIELD_HEAP_COMMIT_SIZE (1 * minipal_getpagesize()) // -------------------------------------------------------------------------------- // PE File List lock - for creating list locks on PE files diff --git a/src/coreclr/vm/ceemain.cpp b/src/coreclr/vm/ceemain.cpp index 613cb42fae511c..75be2fb95a0052 100644 --- a/src/coreclr/vm/ceemain.cpp +++ b/src/coreclr/vm/ceemain.cpp @@ -1011,8 +1011,8 @@ void EEStartupHelper() #ifdef FEATURE_MINIMETADATA_IN_TRIAGEDUMPS // retrieve configured max size for the mini-metadata buffer (defaults to 64KB) g_MiniMetaDataBuffMaxSize = CLRConfig::GetConfigValue(CLRConfig::INTERNAL_MiniMdBufferCapacity); - // align up to GetOsPageSize(), with a maximum of 1 MB - g_MiniMetaDataBuffMaxSize = (DWORD) min(ALIGN_UP(g_MiniMetaDataBuffMaxSize, GetOsPageSize()), (DWORD)(1024 * 1024)); + // align up to minipal_getpagesize(), with a maximum of 1 MB + g_MiniMetaDataBuffMaxSize = (DWORD) min(ALIGN_UP(g_MiniMetaDataBuffMaxSize, minipal_getpagesize()), (DWORD)(1024 * 1024)); // allocate the buffer. this is never touched while the process is running, so it doesn't // contribute to the process' working set. it is needed only as a "shadow" for a mini-metadata // buffer that will be set up and reported / updated in the Watson process (the diff --git a/src/coreclr/vm/codeman.h b/src/coreclr/vm/codeman.h index 668b95beb9ddef..0437e6b4f0abc1 100644 --- a/src/coreclr/vm/codeman.h +++ b/src/coreclr/vm/codeman.h @@ -89,8 +89,8 @@ typedef struct } EH_CLAUSE_ENUMERATOR; class EECodeInfo; -#define ROUND_DOWN_TO_PAGE(x) ( (size_t) (x) & ~((size_t)GetOsPageSize()-1)) -#define ROUND_UP_TO_PAGE(x) (((size_t) (x) + (GetOsPageSize()-1)) & ~((size_t)GetOsPageSize()-1)) +#define ROUND_DOWN_TO_PAGE(x) ( (size_t) (x) & ~((size_t)minipal_getpagesize()-1)) +#define ROUND_UP_TO_PAGE(x) (((size_t) (x) + (minipal_getpagesize()-1)) & ~((size_t)minipal_getpagesize()-1)) enum StubCodeBlockKind : int @@ -528,7 +528,7 @@ struct HeapList TADDR startAddress; TADDR endAddress; // the current end of the used portion of the Heap - TADDR mapBase; // "startAddress" rounded down to GetOsPageSize(). pHdrMap is relative to this address + TADDR mapBase; // "startAddress" rounded down to minipal_getpagesize(). pHdrMap is relative to this address PTR_DWORD pHdrMap; // bit array used to find the start of methods size_t maxCodeHeapSize;// Size of the entire contiguous block of memory diff --git a/src/coreclr/vm/debughelp.cpp b/src/coreclr/vm/debughelp.cpp index 6879495ac95581..76e2f13bf1cd39 100644 --- a/src/coreclr/vm/debughelp.cpp +++ b/src/coreclr/vm/debughelp.cpp @@ -71,10 +71,10 @@ BOOL isMemoryReadable(const TADDR start, unsigned len) // Now we have to loop thru each and every page in between and touch them. // location = start; - while (len > GetOsPageSize()) + while (len > minipal_getpagesize()) { - location += GetOsPageSize(); - len -= GetOsPageSize(); + location += minipal_getpagesize(); + len -= minipal_getpagesize(); #ifdef DACCESS_COMPILE if (DacReadAll(location, &buff, 1, false) != S_OK) diff --git a/src/coreclr/vm/excep.h b/src/coreclr/vm/excep.h index 33f7444ae220a7..a37f1a490d3cfd 100644 --- a/src/coreclr/vm/excep.h +++ b/src/coreclr/vm/excep.h @@ -45,7 +45,7 @@ enum LFH { // Windows uses 64kB as the null-reference area #define NULL_AREA_SIZE (64 * 1024) #else // !TARGET_UNIX -#define NULL_AREA_SIZE GetOsPageSize() +#define NULL_AREA_SIZE minipal_getpagesize() #endif // !TARGET_UNIX class IJitManager; diff --git a/src/coreclr/vm/frames.cpp b/src/coreclr/vm/frames.cpp index 18045f0b7ac46c..76ba93dbdd8bc3 100644 --- a/src/coreclr/vm/frames.cpp +++ b/src/coreclr/vm/frames.cpp @@ -554,14 +554,14 @@ VOID Frame::Push(Thread *pThread) m_Next = pThread->GetFrame(); - // GetOsPageSize() is used to relax the assert for cases where two Frames are + // minipal_getpagesize() is used to relax the assert for cases where two Frames are // declared in the same source function. We cannot predict the order // in which the C compiler will lay them out in the stack frame. - // So GetOsPageSize() is a guess of the maximum stack frame size of any method + // So minipal_getpagesize() is a guess of the maximum stack frame size of any method // with multiple Frames in coreclr.dll _ASSERTE((pThread->IsExecutingOnAltStack() || (m_Next == FRAME_TOP) || - (PBYTE(m_Next) + (2 * GetOsPageSize())) > PBYTE(this)) && + (PBYTE(m_Next) + (2 * minipal_getpagesize())) > PBYTE(this)) && "Pushing a frame out of order ?"); _ASSERTE(// If AssertOnFailFast is set, the test expects to do stack overrun @@ -1214,13 +1214,13 @@ void GCFrame::Push(Thread* pThread) m_Next = pThread->GetGCFrame(); m_pCurThread = pThread; - // GetOsPageSize() is used to relax the assert for cases where two Frames are + // minipal_getpagesize() is used to relax the assert for cases where two Frames are // declared in the same source function. We cannot predict the order // in which the compiler will lay them out in the stack frame. - // So GetOsPageSize() is a guess of the maximum stack frame size of any method + // So minipal_getpagesize() is a guess of the maximum stack frame size of any method // with multiple GCFrames in coreclr.dll _ASSERTE(((m_Next == GCFRAME_TOP) || - (PBYTE(m_Next->GetOSStackLocation()) + (2 * GetOsPageSize())) > PBYTE(this->GetOSStackLocation())) && + (PBYTE(m_Next->GetOSStackLocation()) + (2 * minipal_getpagesize())) > PBYTE(this->GetOSStackLocation())) && "Pushing a GCFrame out of order ?"); pThread->SetGCFrame(this); diff --git a/src/coreclr/vm/hosting.cpp b/src/coreclr/vm/hosting.cpp index d3b40449c66ca7..640f31baf71fcb 100644 --- a/src/coreclr/vm/hosting.cpp +++ b/src/coreclr/vm/hosting.cpp @@ -165,9 +165,9 @@ BOOL ClrVirtualProtect(LPVOID lpAddress, SIZE_T dwSize, DWORD flNewProtect, PDWO // // because the section following UEF will also be included in the region size // if it has the same protection as the UEF section. - DWORD dwUEFSectionPageCount = ((pUEFSection->Misc.VirtualSize + GetOsPageSize() - 1) / GetOsPageSize()); + DWORD dwUEFSectionPageCount = (DWORD)((pUEFSection->Misc.VirtualSize + minipal_getpagesize() - 1) / minipal_getpagesize()); - BYTE* pAddressOfFollowingSection = pStartOfUEFSection + (GetOsPageSize() * dwUEFSectionPageCount); + BYTE* pAddressOfFollowingSection = pStartOfUEFSection + (minipal_getpagesize() * dwUEFSectionPageCount); // Ensure that the section following us is having different memory protection MEMORY_BASIC_INFORMATION nextSectionInfo; diff --git a/src/coreclr/vm/i386/jitinterfacex86.cpp b/src/coreclr/vm/i386/jitinterfacex86.cpp index 78fa7bf97fb00f..8c6c4eabf988d2 100644 --- a/src/coreclr/vm/i386/jitinterfacex86.cpp +++ b/src/coreclr/vm/i386/jitinterfacex86.cpp @@ -120,8 +120,8 @@ void InitJITWriteBarrierHelpers() // All write barrier helpers should fit into one page. // If you hit this assert on retail build, there is most likely problem with BBT script. - _ASSERTE_ALL_BUILDS((BYTE*)JIT_WriteBarrierGroup_End - (BYTE*)JIT_WriteBarrierGroup < (ptrdiff_t)GetOsPageSize()); - _ASSERTE_ALL_BUILDS((BYTE*)JIT_PatchedWriteBarrierGroup_End - (BYTE*)JIT_PatchedWriteBarrierGroup < (ptrdiff_t)GetOsPageSize()); + _ASSERTE_ALL_BUILDS((BYTE*)JIT_WriteBarrierGroup_End - (BYTE*)JIT_WriteBarrierGroup < (ptrdiff_t)minipal_getpagesize()); + _ASSERTE_ALL_BUILDS((BYTE*)JIT_PatchedWriteBarrierGroup_End - (BYTE*)JIT_PatchedWriteBarrierGroup < (ptrdiff_t)minipal_getpagesize()); // Copy the write barriers to their final resting place. if (IsWriteBarrierCopyEnabled()) diff --git a/src/coreclr/vm/jitinterface.cpp b/src/coreclr/vm/jitinterface.cpp index aaf24318c47019..56d43c5f285c89 100644 --- a/src/coreclr/vm/jitinterface.cpp +++ b/src/coreclr/vm/jitinterface.cpp @@ -10355,7 +10355,7 @@ void CEEInfo::getEEInfo(CORINFO_EE_INFO *pEEInfoOut) _ASSERTE(sizeof(ReversePInvokeFrame) <= pEEInfoOut->sizeOfReversePInvokeFrame); #endif - pEEInfoOut->osPageSize = GetOsPageSize(); + pEEInfoOut->osPageSize = minipal_getpagesize(); pEEInfoOut->maxUncheckedOffsetForNullObject = MAX_UNCHECKED_OFFSET_FOR_NULL_OBJECT; pEEInfoOut->targetAbi = CORINFO_CORECLR_ABI; pEEInfoOut->osType = getClrVmOs(); diff --git a/src/coreclr/vm/jitinterface.h b/src/coreclr/vm/jitinterface.h index 955923c747fe4b..9ec98a22dd9b5b 100644 --- a/src/coreclr/vm/jitinterface.h +++ b/src/coreclr/vm/jitinterface.h @@ -15,7 +15,7 @@ // TODO: Set this value to 0 for Wasm #define MAX_UNCHECKED_OFFSET_FOR_NULL_OBJECT (1024 - 1) #elif defined (TARGET_UNIX) -#define MAX_UNCHECKED_OFFSET_FOR_NULL_OBJECT ((GetOsPageSize() / 2) - 1) +#define MAX_UNCHECKED_OFFSET_FOR_NULL_OBJECT ((minipal_getpagesize() / 2) - 1) #else #define MAX_UNCHECKED_OFFSET_FOR_NULL_OBJECT ((32*1024)-1) // when generating JIT code #endif diff --git a/src/coreclr/vm/loaderallocator.cpp b/src/coreclr/vm/loaderallocator.cpp index 7cf751d3260593..cf19f7cbd40e1b 100644 --- a/src/coreclr/vm/loaderallocator.cpp +++ b/src/coreclr/vm/loaderallocator.cpp @@ -1086,11 +1086,11 @@ void LoaderAllocator::ActivateManagedTracking() // We don't actually allocate a low frequency heap for collectible types. // This is carefully tuned to sum up to 16 pages to reduce waste. -#define COLLECTIBLE_LOW_FREQUENCY_HEAP_SIZE (0 * GetOsPageSize()) -#define COLLECTIBLE_HIGH_FREQUENCY_HEAP_SIZE (3 * GetOsPageSize()) -#define COLLECTIBLE_STUB_HEAP_SIZE GetOsPageSize() -#define COLLECTIBLE_CODEHEAP_SIZE (10 * GetOsPageSize()) -#define COLLECTIBLE_VIRTUALSTUBDISPATCH_HEAP_SPACE (2 * GetOsPageSize()) +#define COLLECTIBLE_LOW_FREQUENCY_HEAP_SIZE 0 +#define COLLECTIBLE_HIGH_FREQUENCY_HEAP_SIZE (3 * minipal_getpagesize()) +#define COLLECTIBLE_STUB_HEAP_SIZE minipal_getpagesize() +#define COLLECTIBLE_CODEHEAP_SIZE (10 * minipal_getpagesize()) +#define COLLECTIBLE_VIRTUALSTUBDISPATCH_HEAP_SPACE (2 * minipal_getpagesize()) void LoaderAllocator::Init(BYTE *pExecutableHeapMemory) { @@ -1144,7 +1144,7 @@ void LoaderAllocator::Init(BYTE *pExecutableHeapMemory) // Take a page from the high-frequency heap for this. if (pExecutableHeapMemory != NULL) { - dwExecutableHeapReserveSize = GetOsPageSize(); + dwExecutableHeapReserveSize = minipal_getpagesize(); _ASSERTE(dwExecutableHeapReserveSize < dwHighFrequencyHeapReserveSize); dwHighFrequencyHeapReserveSize -= dwExecutableHeapReserveSize; diff --git a/src/coreclr/vm/peimagelayout.cpp b/src/coreclr/vm/peimagelayout.cpp index 464565ecb3eb2a..5caec95faa1b9b 100644 --- a/src/coreclr/vm/peimagelayout.cpp +++ b/src/coreclr/vm/peimagelayout.cpp @@ -1135,7 +1135,7 @@ static PVOID SplitPlaceholder( static SIZE_T OffsetWithinPage(SIZE_T addr) { - return addr & (GetOsPageSize() - 1); + return addr & (minipal_getpagesize() - 1); } static SIZE_T RoundToPage(SIZE_T size, SIZE_T offset) @@ -1169,13 +1169,13 @@ void* FlatImageLayout::LoadImageByMappingParts(SIZE_T* m_imageParts) const PVOID reservedEnd = NULL; IMAGE_NT_HEADERS* ntHeader = FindNTHeaders(); - if ((ntHeader->OptionalHeader.FileAlignment < GetOsPageSize()) && + if ((ntHeader->OptionalHeader.FileAlignment < minipal_getpagesize()) && (ntHeader->OptionalHeader.FileAlignment != ntHeader->OptionalHeader.SectionAlignment)) { goto UNSUPPORTED; } - if (this->GetSize() < GetOsPageSize() * 2) + if (this->GetSize() < minipal_getpagesize() * 2) { goto UNSUPPORTED; } @@ -1278,7 +1278,7 @@ void* FlatImageLayout::LoadImageByMappingParts(SIZE_T* m_imageParts) const // then map only the aligned chunk that fits, the rest we will copy. while (mapEnd > offset + this->GetSize()) { - mapEnd -= GetOsPageSize(); + mapEnd -= minipal_getpagesize(); } // if we have something to map at page granularity, map it diff --git a/src/coreclr/vm/threads.cpp b/src/coreclr/vm/threads.cpp index 4d18424e8b0a82..d2e2df0ed44c35 100644 --- a/src/coreclr/vm/threads.cpp +++ b/src/coreclr/vm/threads.cpp @@ -1053,7 +1053,7 @@ void InitThreadManager() // All patched helpers should fit into one page. // If you hit this assert on retail build, there is most likely problem with BBT script. _ASSERTE_ALL_BUILDS((BYTE*)JIT_PatchedCodeLast - (BYTE*)JIT_PatchedCodeStart > (ptrdiff_t)0); - _ASSERTE_ALL_BUILDS((BYTE*)JIT_PatchedCodeLast - (BYTE*)JIT_PatchedCodeStart < (ptrdiff_t)GetOsPageSize()); + _ASSERTE_ALL_BUILDS((BYTE*)JIT_PatchedCodeLast - (BYTE*)JIT_PatchedCodeStart < (ptrdiff_t)minipal_getpagesize()); if (IsWriteBarrierCopyEnabled()) { @@ -1924,11 +1924,11 @@ BOOL Thread::CreateNewOSThread(SIZE_T sizeToCommitOrReserve, LPTHREAD_START_ROUT } #ifndef TARGET_UNIX // the PAL does its own adjustments as necessary - if (sizeToCommitOrReserve != 0 && sizeToCommitOrReserve <= GetOsPageSize()) + if (sizeToCommitOrReserve != 0 && sizeToCommitOrReserve <= minipal_getpagesize()) { // On Windows, passing a value that is <= one page size bizarrely causes the OS to use the default stack size instead of // a minimum, which is undesirable. This adjustment fixes that issue to use a minimum stack size (typically 64 KB). - sizeToCommitOrReserve = GetOsPageSize() + 1; + sizeToCommitOrReserve = minipal_getpagesize() + 1; } #endif // !TARGET_UNIX @@ -4469,7 +4469,7 @@ void Thread::HandleThreadInterrupt () } #ifdef _DEBUG -#define MAXSTACKBYTES (2 * GetOsPageSize()) +#define MAXSTACKBYTES (2 * minipal_getpagesize()) void CleanStackForFastGCStress () { CONTRACTL { @@ -5045,7 +5045,7 @@ HRESULT Thread::CLRSetThreadStackGuarantee(SetThreadStackGuaranteeScope fScope) INDEBUG(EXTRA_PAGES += 1); int ThreadGuardPages = CLRConfig::GetConfigValue(CLRConfig::EXTERNAL_ThreadGuardPages, EXTRA_PAGES); - uGuardSize += (ThreadGuardPages * GetOsPageSize()); + uGuardSize += (ThreadGuardPages * minipal_getpagesize()); LOG((LF_EH, LL_INFO10000, "STACKOVERFLOW: setting thread stack guarantee to 0x%x\n", uGuardSize)); @@ -5086,14 +5086,14 @@ UINT_PTR Thread::GetLastNormalStackAddress(UINT_PTR StackLimit) UINT_PTR cbStackGuarantee = GetStackGuarantee(); // Here we take the "hard guard region size", the "stack guarantee" and the "fault page" and add them - // all together. Note that the "fault page" is the reason for the extra GetOsPageSize() below. The OS + // all together. Note that the "fault page" is the reason for the extra minipal_getpagesize() below. The OS // will guarantee us a certain amount of stack remaining after a stack overflow. This is called the // "stack guarantee". But to do this, it has to fault on the page before that region as the app is // allowed to fault at the very end of that page. So, as a result, the last normal stack address is // one page sooner. return StackLimit + (cbStackGuarantee #ifndef TARGET_UNIX - + GetOsPageSize() + + minipal_getpagesize() #endif // !TARGET_UNIX + HARD_GUARD_REGION_SIZE); } @@ -5192,7 +5192,7 @@ static void DebugLogStackRegionMBIs(UINT_PTR uLowAddress, UINT_PTR uHighAddress) UINT_PTR uRegionSize = uStartOfNextRegion - uStartOfThisRegion; - LOG((LF_EH, LL_INFO1000, "0x%p -> 0x%p (%d pg) ", uStartOfThisRegion, uStartOfNextRegion - 1, uRegionSize / GetOsPageSize())); + LOG((LF_EH, LL_INFO1000, "0x%p -> 0x%p (%d pg) ", uStartOfThisRegion, uStartOfNextRegion - 1, (int)(uRegionSize / minipal_getpagesize()))); DebugLogMBIFlags(meminfo.State, meminfo.Protect); LOG((LF_EH, LL_INFO1000, "\n")); @@ -5230,7 +5230,7 @@ void Thread::DebugLogStackMBIs() UINT_PTR uStackSize = uStackBase - uStackLimit; LOG((LF_EH, LL_INFO1000, "----------------------------------------------------------------------\n")); - LOG((LF_EH, LL_INFO1000, "Stack Snapshot 0x%p -> 0x%p (%d pg)\n", uStackLimit, uStackBase, uStackSize / GetOsPageSize())); + LOG((LF_EH, LL_INFO1000, "Stack Snapshot 0x%p -> 0x%p (%d pg)\n", uStackLimit, uStackBase, (int)(uStackSize / minipal_getpagesize()))); if (pThread) { LOG((LF_EH, LL_INFO1000, "Last normal addr: 0x%p\n", pThread->GetLastNormalStackAddress())); @@ -5485,13 +5485,13 @@ VOID Thread::RestoreGuardPage() // to change the size of the guard region, we'll just go ahead and protect the next page down from where we are // now. The guard page will get pushed forward again, just like normal, until the next stack overflow. approxStackPointer = (UINT_PTR)GetCurrentSP(); - guardPageBase = (UINT_PTR)ALIGN_DOWN(approxStackPointer, GetOsPageSize()) - GetOsPageSize(); + guardPageBase = (UINT_PTR)ALIGN_DOWN(approxStackPointer, minipal_getpagesize()) - minipal_getpagesize(); // OS uses soft guard page to update the stack info in TEB. If our guard page is not beyond the current stack, the TEB // will not be updated, and then OS's check of stack during exception will fail. if (approxStackPointer >= guardPageBase) { - guardPageBase -= GetOsPageSize(); + guardPageBase -= minipal_getpagesize(); } // If we're currently "too close" to the page we want to mark as a guard then the call to VirtualProtect to set // PAGE_GUARD will fail, but it won't return an error. Therefore, we protect the page, then query it to make @@ -5521,7 +5521,7 @@ VOID Thread::RestoreGuardPage() } else { - guardPageBase -= GetOsPageSize(); + guardPageBase -= minipal_getpagesize(); } } } diff --git a/src/coreclr/vm/threads.h b/src/coreclr/vm/threads.h index 339e7f04eb1ab3..04f47a2f2f11cc 100644 --- a/src/coreclr/vm/threads.h +++ b/src/coreclr/vm/threads.h @@ -2288,8 +2288,6 @@ class Thread UINT_PTR m_CacheStackSufficientExecutionLimit; UINT_PTR m_CacheStackStackAllocNonRiskyExecutionLimit; -#define HARD_GUARD_REGION_SIZE GetOsPageSize() - private: // static HRESULT CLRSetThreadStackGuarantee(SetThreadStackGuaranteeScope fScope = STSGuarantee_OnlyIfEnabled); @@ -2302,8 +2300,8 @@ class Thread // Every stack has a single reserved page at its limit that we call the 'hard guard page'. This page is never // committed, and access to it after a stack overflow will terminate the thread. -#define HARD_GUARD_REGION_SIZE GetOsPageSize() -#define SIZEOF_DEFAULT_STACK_GUARANTEE 1 * GetOsPageSize() +#define HARD_GUARD_REGION_SIZE (minipal_getpagesize()) +#define SIZEOF_DEFAULT_STACK_GUARANTEE (minipal_getpagesize()) public: // This will return the last stack address that one could write to before a stack overflow. diff --git a/src/coreclr/vm/virtualcallstub.cpp b/src/coreclr/vm/virtualcallstub.cpp index 203426267b2189..81320ed6c38a1f 100644 --- a/src/coreclr/vm/virtualcallstub.cpp +++ b/src/coreclr/vm/virtualcallstub.cpp @@ -495,12 +495,12 @@ void VirtualCallStubManager::Init(LoaderAllocator *pLoaderAllocator) // // Align up all of the commit and reserve sizes // - indcell_heap_reserve_size = (DWORD) ALIGN_UP(indcell_heap_reserve_size, GetOsPageSize()); - indcell_heap_commit_size = (DWORD) ALIGN_UP(indcell_heap_commit_size, GetOsPageSize()); + indcell_heap_reserve_size = (DWORD) ALIGN_UP(indcell_heap_reserve_size, minipal_getpagesize()); + indcell_heap_commit_size = (DWORD) ALIGN_UP(indcell_heap_commit_size, minipal_getpagesize()); #ifdef FEATURE_VIRTUAL_STUB_DISPATCH - cache_entry_heap_reserve_size = (DWORD) ALIGN_UP(cache_entry_heap_reserve_size, GetOsPageSize()); - cache_entry_heap_commit_size = (DWORD) ALIGN_UP(cache_entry_heap_commit_size, GetOsPageSize()); + cache_entry_heap_reserve_size = (DWORD) ALIGN_UP(cache_entry_heap_reserve_size, minipal_getpagesize()); + cache_entry_heap_commit_size = (DWORD) ALIGN_UP(cache_entry_heap_commit_size, minipal_getpagesize()); #endif // FEATURE_VIRTUAL_STUB_DISPATCH BYTE * initReservedMem = NULL; @@ -520,17 +520,17 @@ void VirtualCallStubManager::Init(LoaderAllocator *pLoaderAllocator) DWORD dwWastedReserveMemSize = dwTotalReserveMemSize - dwTotalReserveMemSizeCalc; if (dwWastedReserveMemSize != 0) { - DWORD cWastedPages = dwWastedReserveMemSize / GetOsPageSize(); + DWORD cWastedPages = dwWastedReserveMemSize / minipal_getpagesize(); // Split the wasted pages over the 2 LoaderHeaps that we allocate as part of a VirtualCallStubManager DWORD cPagesPerHeap = cWastedPages / 2; DWORD cPagesRemainder = cWastedPages % 2; // We'll throw this at the cache entry heap - indcell_heap_reserve_size += cPagesPerHeap * GetOsPageSize(); + indcell_heap_reserve_size += cPagesPerHeap * minipal_getpagesize(); #ifdef FEATURE_VIRTUAL_STUB_DISPATCH - cache_entry_heap_reserve_size += (cPagesPerHeap + cPagesRemainder) * GetOsPageSize(); + cache_entry_heap_reserve_size += (cPagesPerHeap + cPagesRemainder) * minipal_getpagesize(); #else - indcell_heap_reserve_size += (cPagesPerHeap + cPagesRemainder) * GetOsPageSize(); + indcell_heap_reserve_size += (cPagesPerHeap + cPagesRemainder) * minipal_getpagesize(); #endif // FEATURE_VIRTUAL_STUB_DISPATCH } @@ -552,15 +552,15 @@ void VirtualCallStubManager::Init(LoaderAllocator *pLoaderAllocator) } else { - indcell_heap_reserve_size = GetOsPageSize(); - indcell_heap_commit_size = GetOsPageSize(); + indcell_heap_reserve_size = minipal_getpagesize(); + indcell_heap_commit_size = minipal_getpagesize(); #ifdef FEATURE_VIRTUAL_STUB_DISPATCH - cache_entry_heap_reserve_size = GetOsPageSize(); - cache_entry_heap_commit_size = GetOsPageSize(); + cache_entry_heap_reserve_size = minipal_getpagesize(); + cache_entry_heap_commit_size = minipal_getpagesize(); #else // If we don't support VSD, use a slightly bigger heap size to avoid wasting memory - indcell_heap_reserve_size = 2 * GetOsPageSize(); + indcell_heap_reserve_size = 2 * minipal_getpagesize(); #endif // FEATURE_VIRTUAL_STUB_DISPATCH #ifdef _DEBUG diff --git a/src/native/managed/cdac/tests/PrecodeStubsTests.cs b/src/native/managed/cdac/tests/PrecodeStubsTests.cs index 3d6bfef6dff061..8d220b8e4538cd 100644 --- a/src/native/managed/cdac/tests/PrecodeStubsTests.cs +++ b/src/native/managed/cdac/tests/PrecodeStubsTests.cs @@ -22,7 +22,7 @@ public class PrecodeTestDescriptor { public required int OffsetOfPrecodeType { get; init; } public required int ShiftOfPrecodeType { get; init; } // #if defined(TARGET_ARM64) && defined(TARGET_UNIX) - // return max(16*1024u, GetOsPageSize()); + // return max(16*1024u, minipal_getpagesize()); // #elif defined(TARGET_ARM) // return 4096; // ARM is special as the 32bit instruction set does not easily permit a 16KB offset // #else diff --git a/src/native/minipal/ospagesize.c b/src/native/minipal/ospagesize.c index 0d171149e25a1c..b5ece750e1a2cf 100644 --- a/src/native/minipal/ospagesize.c +++ b/src/native/minipal/ospagesize.c @@ -7,18 +7,25 @@ // src/native/minipal/CMakeLists.txt to avoid an empty translation unit. #include +#include +#include #include "ospagesize.h" -size_t minipal_getpagesize(void) +uint32_t minipal_getpagesize(void) { - // Process-wide constant. Any thread that races to initialize the cache writes - // the same value, so no synchronization is required. - static size_t cached_page_size = 0; - size_t page_size = cached_page_size; + static atomic_uint cached_page_size = 0; + uint32_t page_size = atomic_load_explicit(&cached_page_size, memory_order_relaxed); if (page_size == 0) { - page_size = (size_t)getpagesize(); - cached_page_size = page_size; + long sc = sysconf(_SC_PAGESIZE); + // _SC_PAGESIZE is mandatory in POSIX 2001; treat any failure as fatal + // rather than caching a nonsense value (e.g. (uint32_t)-1). + if (sc <= 0) + { + abort(); + } + page_size = (uint32_t)sc; + atomic_store_explicit(&cached_page_size, page_size, memory_order_relaxed); } return page_size; } diff --git a/src/native/minipal/ospagesize.h b/src/native/minipal/ospagesize.h index 4657625402a448..0b6e0c317e2f2f 100644 --- a/src/native/minipal/ospagesize.h +++ b/src/native/minipal/ospagesize.h @@ -4,7 +4,7 @@ #ifndef HAVE_MINIPAL_OSPAGESIZE_H #define HAVE_MINIPAL_OSPAGESIZE_H -#include +#include #ifdef __cplusplus extern "C" { @@ -19,7 +19,7 @@ extern "C" { // On other platforms the value is queried from the OS once and cached; the // definition lives in ospagesize.c so there is exactly one cache per process. #if defined(HOST_WASM) -static inline size_t minipal_getpagesize(void) +static inline uint32_t minipal_getpagesize(void) { // WASM has no hardware pages; getpagesize() returns the 64KB memory.grow granularity, // which is too coarse for GC alignment and thresholds. Reduce the OS page size used @@ -27,13 +27,13 @@ static inline size_t minipal_getpagesize(void) return 16 * 1024; } #elif defined(HOST_WINDOWS) -static inline size_t minipal_getpagesize(void) +static inline uint32_t minipal_getpagesize(void) { // The page size on Windows is 4KB and is not going to change. return 4 * 1024; } #else -size_t minipal_getpagesize(void); +uint32_t minipal_getpagesize(void); #endif #ifdef __cplusplus From f7280f5f87c1646b6c3aaccd33210188043870e4 Mon Sep 17 00:00:00 2001 From: Adam Perlin Date: Mon, 11 May 2026 09:01:11 -0700 Subject: [PATCH 089/109] crossgen2: Add Length Prefix to Crossgen-Generated Wasm (#127936) #127773 adds length prefixes directly to emitted Wasm code in the JIT. This change is a follow up which adds length prefixes directly to generated wasm import thunks and stubs in crossgen. It also removes the logic in the Object Writer around handling length prefixes, since these will now be encoded in the `ObjectData` itself. --- .../Target_Wasm/WasmEmitter.cs | 3 +- .../Compiler/ObjectWriter/ObjectWriter.cs | 23 +--------- .../Compiler/ObjectWriter/SectionWriter.cs | 45 +------------------ .../Compiler/ObjectWriter/WasmInstructions.cs | 14 ++++-- .../Compiler/ObjectWriter/WasmObjectWriter.cs | 11 ----- 5 files changed, 15 insertions(+), 81 deletions(-) diff --git a/src/coreclr/tools/Common/Compiler/DependencyAnalysis/Target_Wasm/WasmEmitter.cs b/src/coreclr/tools/Common/Compiler/DependencyAnalysis/Target_Wasm/WasmEmitter.cs index 23d6f76bde1e68..900b7a089812e4 100644 --- a/src/coreclr/tools/Common/Compiler/DependencyAnalysis/Target_Wasm/WasmEmitter.cs +++ b/src/coreclr/tools/Common/Compiler/DependencyAnalysis/Target_Wasm/WasmEmitter.cs @@ -26,8 +26,9 @@ public ObjectNode.ObjectData Encode(ISymbolDefinitionNode symbolDefinitionNode) { #if READYTORUN byte[] encodedThunk = new byte[FunctionBody.EncodeSize()]; + FunctionBody.Encode(encodedThunk); + Relocation[] relocs = new Relocation[FunctionBody.EncodeRelocationCount()]; - FunctionBody.Encode(encodedThunk.AsSpan()); FunctionBody.EncodeRelocations(relocs.AsSpan()); return new ObjectNode.ObjectData(encodedThunk, relocs, 1, new ISymbolDefinitionNode[] { symbolDefinitionNode }); diff --git a/src/coreclr/tools/Common/Compiler/ObjectWriter/ObjectWriter.cs b/src/coreclr/tools/Common/Compiler/ObjectWriter/ObjectWriter.cs index d1d9c4e50a5209..5eb2018c7cf947 100644 --- a/src/coreclr/tools/Common/Compiler/ObjectWriter/ObjectWriter.cs +++ b/src/coreclr/tools/Common/Compiler/ObjectWriter/ObjectWriter.cs @@ -84,20 +84,6 @@ private protected ObjectWriter(NodeFactory factory, ObjectWritingOptions options private protected SectionWriter GetOrCreateSection(ObjectNodeSection section) => GetOrCreateSection(section, default, default); - private readonly SectionWriter.Params _defaultParams = new SectionWriter.Params - { - LengthEncodeFormat = LengthEncodeFormat.None - }; - - /// - /// Some architectures may require section-specific params for the writer. For example, on Wasm, - /// certain sections require length prefixes before each object entry which the section writer does support, - /// but this has to be indicated by a particular implementation. - /// - /// - /// - private protected virtual SectionWriter.Params WriterParams(ObjectNodeSection section) => _defaultParams; - /// /// Get or creates an object file section. /// @@ -139,8 +125,7 @@ private protected SectionWriter GetOrCreateSection(ObjectNodeSection section, Ut return new SectionWriter( this, sectionIndex, - sectionData, - WriterParams(section)); + sectionData); } private protected bool ShouldShareSymbol(ObjectNode node) @@ -482,13 +467,9 @@ public virtual void EmitObject(Stream outputFileStream, IReadOnlyCollection Buffer => _sectionData.BufferWriter; - public struct Params - { - public LengthEncodeFormat LengthEncodeFormat; - } - - public bool HasLengthPrefix => _params.LengthEncodeFormat != LengthEncodeFormat.None; - internal SectionWriter( ObjectWriter objectWriter, int sectionIndex, - SectionData sectionData, - Params ps) + SectionData sectionData) { _objectWriter = objectWriter; SectionIndex = sectionIndex; _sectionData = sectionData; - _params = ps; - } - - public readonly void EmitLengthPrefix(ulong length) - { - switch (_params.LengthEncodeFormat) - { - case LengthEncodeFormat.ULEB128: - WriteULEB128(length); - break; - case LengthEncodeFormat.None: - break; - default: - throw new InvalidOperationException("Length prefix encoding not specified"); - } - } - - public readonly uint LengthPrefixSize(int length) - { - switch (_params.LengthEncodeFormat) - { - case LengthEncodeFormat.ULEB128: - return DwarfHelper.SizeOfULEB128((ulong)length); - default: - return 0; - } } public readonly void EmitData(ReadOnlyMemory data) { - EmitLengthPrefix((ulong)data.Length); _sectionData.AppendData(data); } diff --git a/src/coreclr/tools/Common/Compiler/ObjectWriter/WasmInstructions.cs b/src/coreclr/tools/Common/Compiler/ObjectWriter/WasmInstructions.cs index 813b439c2ecac3..57a060714d44d8 100644 --- a/src/coreclr/tools/Common/Compiler/ObjectWriter/WasmInstructions.cs +++ b/src/coreclr/tools/Common/Compiler/ObjectWriter/WasmInstructions.cs @@ -85,13 +85,17 @@ private int BodyContentSize() public int EncodeSize() { - return BodyContentSize(); + int bodySize = BodyContentSize(); + int sizePrefixLength = (int)DwarfHelper.SizeOfULEB128((ulong)bodySize); + return sizePrefixLength + bodySize; } public int Encode(Span buffer) { - _locals.CopyTo(buffer); - int pos = _locals.Length; + int contentSize = BodyContentSize(); + int pos = DwarfHelper.WriteULEB128(buffer, (ulong)contentSize); + _locals.CopyTo(buffer.Slice(pos)); + pos += _locals.Length; pos += _body.Encode(buffer.Slice(pos)); return pos; @@ -104,8 +108,10 @@ public int EncodeRelocationCount() public int EncodeRelocations(Span buffer) { + uint bodySize = (uint)BodyContentSize(); + int bodySizePrefixLength = (int)DwarfHelper.SizeOfULEB128(bodySize); int relocsEncoded = _body.EncodeRelocations(buffer); - WasmExpr.OffsetRelocationsByOffset(buffer.Slice(0, relocsEncoded), _locals.Length); + WasmExpr.OffsetRelocationsByOffset(buffer.Slice(0, relocsEncoded), bodySizePrefixLength + _locals.Length); return relocsEncoded; } } diff --git a/src/coreclr/tools/Common/Compiler/ObjectWriter/WasmObjectWriter.cs b/src/coreclr/tools/Common/Compiler/ObjectWriter/WasmObjectWriter.cs index b6fabef169fa91..c65ef39b255993 100644 --- a/src/coreclr/tools/Common/Compiler/ObjectWriter/WasmObjectWriter.cs +++ b/src/coreclr/tools/Common/Compiler/ObjectWriter/WasmObjectWriter.cs @@ -359,9 +359,6 @@ private void InsertWasmStub(Utf8String name, WasmFunctionBody body) byte[] data = new byte[codeSize]; body.Encode(data); - // We must emit the length prefix explicitly - Debug.Assert(!codeWriter.HasLengthPrefix); - codeWriter.WriteULEB128((ulong)codeSize); codeWriter.EmitData(data); _uniqueSymbols.Add(name.ToString(), _methodCount); _methodCount++; @@ -480,14 +477,6 @@ private protected override ObjectNodeSection GetEmitSection(ObjectNodeSection se return section; } - private protected override SectionWriter.Params WriterParams(ObjectNodeSection section) - { - return new SectionWriter.Params - { - LengthEncodeFormat = LengthEncodeFormat.None - }; - } - private protected override void CreateSection(ObjectNodeSection section, Utf8String comdatName, Utf8String symbolName, int sectionIndex, Stream sectionStream) { WasmSectionType sectionType = GetWasmSectionType(section); From 4bdd9f8488636fae5084626fcaf74d827599d6f1 Mon Sep 17 00:00:00 2001 From: Vlad Brezae Date: Mon, 11 May 2026 19:08:04 +0300 Subject: [PATCH 090/109] Move the return var out of liveLocalsIntervals (#127931) When generating an async call, in EmitSuspend, we obtain the set of vars that are alive at this point in time and we store this information inside the suspenData. If they async call needs to suspend it will store these vars into the ContinuationObject, with their values being restored when we resume the continuation. Previous code would store the result value as well into the ContinuationObject. The problem is that this would lead to storing uninitialized data into the object, which can result in random GC crashes. This commit removes the result var from the set of live vars, stores associated information specifically for the return var inside the suspend data and we make use of this information to write the result only on the suspend resume path. Fixes https://github.com/dotnet/runtime/issues/127855 --- src/coreclr/interpreter/compiler.cpp | 28 ++++++++++++++++++- .../interpreter/inc/interpretershared.h | 2 ++ src/coreclr/vm/interpexec.cpp | 17 +++++++++-- 3 files changed, 43 insertions(+), 4 deletions(-) diff --git a/src/coreclr/interpreter/compiler.cpp b/src/coreclr/interpreter/compiler.cpp index bb5ee520be236c..8de3da4758f7d2 100644 --- a/src/coreclr/interpreter/compiler.cpp +++ b/src/coreclr/interpreter/compiler.cpp @@ -5789,8 +5789,8 @@ void InterpCompiler::EmitSuspend(const CORINFO_CALL_INFO &callInfo, Continuation int32_t returnValueVar = -1; if (stackDepth > 0 && callInfo.sig.retType != CORINFO_TYPE_VOID) { + // The return value var is written explicitly during resume, it is not included in the set of liveVars returnValueVar = m_pStackPointer[-1].var; - liveVars.Add(returnValueVar); } // Step 1: Collect live IL vars @@ -6018,6 +6018,21 @@ void InterpCompiler::EmitSuspend(const CORINFO_CALL_INFO &callInfo, Continuation suspendData->resumeInfo.DiagnosticIP = (size_t)NULL; suspendData->methodStartIP = 0; // This is filled in by logic later in emission once we know the final address of the method suspendData->continuationArgOffset = m_pVars[m_continuationArgIndex].offset; + + if (returnValueVar != -1) + { + int32_t alignDummy; + int32_t size = GetInterpTypeStackSize(m_pVars[returnValueVar].clsHnd, m_pVars[returnValueVar].interpType, &alignDummy); + suspendData->returnValueContinuationDataSize = ALIGN_UP_TO(size, INTERP_STACK_SLOT_SIZE); + } + else + { + suspendData->returnValueContinuationDataSize = 0; + } + + // Patched up in UpdateLocalIntervalMaps to hold the actual offset of the var + suspendData->returnValueVarStackOffset = returnValueVar; + suspendData->asyncMethodReturnType = NULL; switch (m_methodInfo->args.retType) { @@ -6326,6 +6341,17 @@ void InterpCompiler::UpdateLocalIntervalMaps() { ConvertToIntervalMapData_ForOffsets(m_varIntervalMaps.Get(i)); } + + // Fix up return value var stack offsets for async suspend data + for (int32_t i = 0; i < m_asyncSuspendDataItems.GetSize(); i++) + { + InterpAsyncSuspendData* suspendData = m_asyncSuspendDataItems.Get(i); + int32_t varIndex = suspendData->returnValueVarStackOffset; + if (varIndex != -1) + { + suspendData->returnValueVarStackOffset = m_pVars[varIndex].offset; + } + } } static int32_t GetStindForType(InterpType interpType) diff --git a/src/coreclr/interpreter/inc/interpretershared.h b/src/coreclr/interpreter/inc/interpretershared.h index 24b081e73ba7cc..f9e2b902597d04 100644 --- a/src/coreclr/interpreter/inc/interpretershared.h +++ b/src/coreclr/interpreter/inc/interpretershared.h @@ -213,6 +213,8 @@ struct InterpAsyncSuspendData COMPILER_SHARED_TYPE(CORINFO_CLASS_HANDLE, DPTR(MethodTable), asyncMethodReturnType); int32_t asyncMethodReturnTypePrimitiveSize; // 0 if not primitive, otherwise size in bytes int32_t continuationArgOffset; + int32_t returnValueContinuationDataSize; // Aligned size of the return value in continuation data (0 if void). Live locals start after this offset. + int32_t returnValueVarStackOffset; // Interpreter stack offset of the return value var (valid only when returnValueContinuationDataSize > 0) COMPILER_SHARED_TYPE(CORINFO_METHOD_HANDLE, DPTR(MethodDesc), captureSyncContextMethod); COMPILER_SHARED_TYPE(CORINFO_METHOD_HANDLE, DPTR(MethodDesc), restoreContextsOnSuspensionMethod); diff --git a/src/coreclr/vm/interpexec.cpp b/src/coreclr/vm/interpexec.cpp index 2196c2b73acb4d..92bc3638ccb124 100644 --- a/src/coreclr/vm/interpexec.cpp +++ b/src/coreclr/vm/interpexec.cpp @@ -4501,9 +4501,11 @@ do \ } ip += 3; - // copy locals that need to move to the continuation object + // Copy locals that need to move to the continuation object + // The copied continuation data begins immediately after the + // continuation's result storage. size_t continuationOffset = OFFSETOF__CORINFO_Continuation__data; - uint8_t *pContinuationDataStart = continuation->GetResultStorage(); + uint8_t *pContinuationDataStart = continuation->GetResultStorage() + pAsyncSuspendData->returnValueContinuationDataSize; uint8_t *pContinuationData = pContinuationDataStart; size_t bytesTotal = 0; InterpIntervalMapEntry *pCopyEntry = pAsyncSuspendData->liveLocalsIntervals; @@ -4568,7 +4570,7 @@ do \ _ASSERTE(pInterpreterFrame->GetContinuation() == NULL); // copy locals that need to move from the continuation object - uint8_t *pContinuationData = continuation->GetResultStorage(); + uint8_t *pContinuationData = continuation->GetResultStorage() + pAsyncSuspendData->returnValueContinuationDataSize; InterpIntervalMapEntry *pCopyEntry = pAsyncSuspendData->liveLocalsIntervals; while (pCopyEntry->countBytes != 0) { @@ -4577,6 +4579,15 @@ do \ pCopyEntry++; } + // Explicitly copy the return value from the continuation's result storage + // to the interpreter stack. + if (pAsyncSuspendData->returnValueContinuationDataSize > 0) + { + memcpy(LOCAL_VAR_ADDR(pAsyncSuspendData->returnValueVarStackOffset, uint8_t), + continuation->GetResultStorage(), + pAsyncSuspendData->returnValueContinuationDataSize); + } + PTR_OBJECTREF pException = continuation->GetExceptionObjectStorageOrNull(); if (pException != NULL) { From 0306ba79b0cf0d07106d92f69c582a425446a20f Mon Sep 17 00:00:00 2001 From: Egor Bogatov Date: Mon, 11 May 2026 19:02:12 +0200 Subject: [PATCH 091/109] Fold more branches via O1K_VN O2K_VN comparisons (#127950) Minimal example: ```cs if (x > 10 && x < 100) { if (y > x) // means y > 11 { return y > 0; // always true ``` --------- Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- src/coreclr/jit/assertionprop.cpp | 35 ++++++++++ src/coreclr/jit/compiler.h | 26 ++++++- src/coreclr/jit/rangecheck.cpp | 108 +++++++++++++++++++++++++++++- src/coreclr/jit/rangecheck.h | 12 ++++ 4 files changed, 178 insertions(+), 3 deletions(-) diff --git a/src/coreclr/jit/assertionprop.cpp b/src/coreclr/jit/assertionprop.cpp index 2d4a84a3e41da4..f2989ae7b45a72 100644 --- a/src/coreclr/jit/assertionprop.cpp +++ b/src/coreclr/jit/assertionprop.cpp @@ -904,6 +904,10 @@ void Compiler::optPrintAssertion(const AssertionDsc& curAssertion, AssertionInde curAssertion.GetOp2().GetCheckedBoundConstant()); break; + case O2K_VN: + printf("VN " FMT_VN "", curAssertion.GetOp2().GetVN()); + break; + default: unreached(); break; @@ -1421,6 +1425,13 @@ AssertionIndex Compiler::optAddAssertion(const AssertionDsc& newAssertion) mayHaveDuplicates |= optAssertionHasAssertionsForVN(addOpVN, /* addIfNotFound */ canAddNewAssertions); } } + else if (newAssertion.GetOp2().KindIs(O2K_VN)) + { + // For VN VN assertions, register op2's VN too so consumers can find + // the assertion when iterating from the op2 side. + mayHaveDuplicates |= optAssertionHasAssertionsForVN(newAssertion.GetOp2().GetVN(), + /* addIfNotFound */ canAddNewAssertions); + } if (mayHaveDuplicates) { @@ -1550,6 +1561,12 @@ void Compiler::optDebugCheckAssertion(const AssertionDsc& assertion) const assert(optLocalAssertionProp); break; + case O2K_VN: + assert(!optLocalAssertionProp); + assert(assertion.GetOp1().KindIs(O1K_VN)); + assert(assertion.IsRelop()); + break; + case O2K_ZEROOBJ: // We only make these assertion for stores (not control flow). assert(assertion.KindIs(OAK_EQUAL)); @@ -1807,6 +1824,24 @@ AssertionInfo Compiler::optCreateJTrueBoundsAssertion(GenTree* tree) return idx; } + // "X relop Y" where neither side is a constant nor a checked bound. + // For now, we only create such assertions for signed comparisons of int32 (and smaller, after promotion). + // This widens what global assertion prop can reason about: e.g. "b > a" combined with "a > 10" + // can be used to deduce "b > 10". + // + // To keep table pressure under control, we only create the assertion if at least one of the + // operands already has assertions registered. Otherwise the new assertion has no other facts + // it can chain with and is unlikely to enable any deduction, while still consuming a slot + // (and potentially crowding out useful ones). + if (!isUnsignedRelop && (op1VN != op2VN) && !vnStore->IsVNConstant(op1VN) && !vnStore->IsVNConstant(op2VN) && + (optAssertionHasAssertionsForVN(op1VN) || optAssertionHasAssertionsForVN(op2VN))) + { + AssertionDsc dsc = AssertionDsc::CreateRelopVN(this, relopFunc, op1VN, op2VN); + AssertionIndex idx = optAddAssertion(dsc); + optCreateComplementaryAssertion(idx); + return idx; + } + return NO_ASSERTION_INDEX; } diff --git a/src/coreclr/jit/compiler.h b/src/coreclr/jit/compiler.h index 9568aceac47f88..6d83b3ff0030e5 100644 --- a/src/coreclr/jit/compiler.h +++ b/src/coreclr/jit/compiler.h @@ -8200,7 +8200,8 @@ class Compiler // nor it implies that it's never negative. O2K_ZEROOBJ, O2K_SUBRANGE, - O2K_CONST_VEC + O2K_CONST_VEC, + O2K_VN, // op2 is an arbitrary value number (used for VN VN assertions in global prop). }; struct AssertionDsc @@ -8346,7 +8347,7 @@ class Compiler ValueNum GetVN() const { assert(!m_compiler->optLocalAssertionProp); - assert(KindIs(O2K_CONST_INT, O2K_CONST_DOUBLE, O2K_ZEROOBJ, O2K_CONST_VEC)); + assert(KindIs(O2K_CONST_INT, O2K_CONST_DOUBLE, O2K_ZEROOBJ, O2K_CONST_VEC, O2K_VN)); assert(m_vn != ValueNumStore::NoVN); return m_vn; } @@ -8697,6 +8698,9 @@ class Compiler case O2K_SUBRANGE: return GetOp2().GetIntegralRange().Equals(that.GetOp2().GetIntegralRange()); + case O2K_VN: + return GetOp2().GetVN() == that.GetOp2().GetVN(); + default: assert(!"Unexpected value for GetOp2().m_kind in AssertionDsc."); break; @@ -8956,6 +8960,24 @@ class Compiler dsc.m_op2.m_icon.m_iconVal = cns; return dsc; } + + // Create "op1VN op2VN" assertion where both operands are arbitrary value numbers + // (used by global assertion prop for VN-to-VN signed comparisons of int32 and smaller). + static AssertionDsc CreateRelopVN(const Compiler* comp, VNFunc relop, ValueNum op1VN, ValueNum op2VN) + { + assert(!comp->optLocalAssertionProp); + assert(op1VN != ValueNumStore::NoVN); + assert(op2VN != ValueNumStore::NoVN); + assert(op1VN != op2VN); + + AssertionDsc dsc = CreateEmptyAssertion(comp); + dsc.m_assertionKind = FromVNFunc(relop); + dsc.m_op1.m_kind = O1K_VN; + dsc.m_op1.m_vn = op1VN; + dsc.m_op2.m_kind = O2K_VN; + dsc.m_op2.m_vn = op2VN; + return dsc; + } }; protected: diff --git a/src/coreclr/jit/rangecheck.cpp b/src/coreclr/jit/rangecheck.cpp index 55a2c5ab7e3545..2d92e6cc0a8ab9 100644 --- a/src/coreclr/jit/rangecheck.cpp +++ b/src/coreclr/jit/rangecheck.cpp @@ -938,7 +938,12 @@ Range RangeCheck::GetRangeFromAssertionsWorker( result = phiRange; } - MergeEdgeAssertions(comp, num, ValueNumStore::NoVN, assertions, &result, false); + // MergeEdgeAssertionsWorker may recursively call back to GetRangeFromAssertionsWorker for other VN-to-VN assertion + // lookups. + int edgeAssertionsBudget = min(3, budget); + MergeEdgeAssertionsWorker(comp, num, ValueNumStore::NoVN, assertions, &result, /* canUseCheckedBounds */ false, + edgeAssertionsBudget, visited); + assert(result.IsConstantRange()); return result; } @@ -1044,6 +1049,37 @@ void RangeCheck::MergeEdgeAssertions(Compiler* comp, ASSERT_VALARG_TP assertions, Range* pRange, bool canUseCheckedBounds) +{ + // Public entry point: no shared visited set; create a fresh one and use a small recursion + // budget for VN-to-VN assertion lookups. + ValueNumStore::SmallValueNumSet visited; + MergeEdgeAssertionsWorker(comp, normalLclVN, preferredBoundVN, assertions, pRange, canUseCheckedBounds, + /* budget */ 3, &visited); +} + +//------------------------------------------------------------------------ +// MergeEdgeAssertionsWorker: Worker for MergeEdgeAssertions that takes a visited set and recursion +// budget for VN-to-VN assertion lookups. +// +// Arguments: +// comp - the compiler instance +// normalLclVN - the value number to look for assertions for +// preferredBoundVN - when this VN is set, it will be given preference over constant limits +// assertions - the assertions to use +// pRange - the range to tighten with assertions +// canUseCheckedBounds - true if we can use checked bounds assertions (cache) +// budget - the remaining budget for recursive VN-to-VN assertion lookups +// visited - the set of value numbers already visited in the current search path to prevent infinite +// recursion +// +void RangeCheck::MergeEdgeAssertionsWorker(Compiler* comp, + ValueNum normalLclVN, + ValueNum preferredBoundVN, + ASSERT_VALARG_TP assertions, + Range* pRange, + bool canUseCheckedBounds, + int budget, + ValueNumStore::SmallValueNumSet* visited) { Range assertedRange = Range(Limit(Limit::keUnknown)); if (BitVecOps::IsEmpty(comp->apTraits, assertions)) @@ -1343,6 +1379,76 @@ void RangeCheck::MergeEdgeAssertions(Compiler* comp, continue; } } + // Current assertion is of the form "X Y" where both X and Y are arbitrary VNs + // We try to derive a bound on normalLclVN by recursively computing the range of the other operand. + // + // Example: + // + // if (a > 10 && a < 100) + // { + // if (normalLclVN > a) // a is an unknown VN with [11..99] range derived from assertions. + // { + // + else if (curAssertion.IsRelop() && curAssertion.GetOp2().KindIs(Compiler::O2K_VN) && + (curAssertion.GetOp1().GetVN() == normalLclVN || curAssertion.GetOp2().GetVN() == normalLclVN)) + { + ValueNum op1VN = curAssertion.GetOp1().GetVN(); + ValueNum op2VN = curAssertion.GetOp2().GetVN(); + + cmpOper = Compiler::AssertionDsc::ToCompareOper(curAssertion.GetKind(), &isUnsigned); + if (isUnsigned) + { + continue; + } + + ValueNum otherVN; + if (op1VN == normalLclVN) + { + // Assertion is "normalLclVN otherVN" - keep cmpOper as-is. + otherVN = op2VN; + } + else + { + // Assertion is "otherVN normalLclVN" - swap to get + // "normalLclVN otherVN". + assert(op2VN == normalLclVN); + otherVN = op1VN; + cmpOper = GenTree::SwapRelop(cmpOper); + } + + if (budget <= 0) + { + continue; + } + + budget--; + Range otherRange = GetRangeFromAssertionsWorker(comp, otherVN, assertions, budget, visited); + if (!otherRange.IsConstantRange()) + { + continue; + } + + // Derive a constant limit for normalLclVN from the constant range of otherVN. + // We use the most useful bound for each direction of the comparison. + int derivedLimit; + switch (cmpOper) + { + case GT_LT: + case GT_LE: + // normalLclVN < otherVN (or <=) => normalLclVN <(=) otherVN.UpperLimit + derivedLimit = otherRange.UpperLimit().GetConstant(); + break; + case GT_GT: + case GT_GE: + // normalLclVN > otherVN (or >=) => normalLclVN >(=) otherVN.LowerLimit + derivedLimit = otherRange.LowerLimit().GetConstant(); + break; + + default: + continue; + } + limit = Limit(Limit::keConstant, derivedLimit); + } // Current assertion is not supported, ignore it else { diff --git a/src/coreclr/jit/rangecheck.h b/src/coreclr/jit/rangecheck.h index cab98b29c85b60..ea399f334edbeb 100644 --- a/src/coreclr/jit/rangecheck.h +++ b/src/coreclr/jit/rangecheck.h @@ -827,6 +827,18 @@ class RangeCheck Range* pRange, bool canUseCheckedBounds = true); + // Internal worker used by GetRangeFromAssertionsWorker: same as the public overload + // but threads a recursion budget and visited set so that VN-to-VN assertions can be + // resolved by recursing into GetRangeFromAssertionsWorker without unbounded work. + static void MergeEdgeAssertionsWorker(Compiler* comp, + ValueNum num, + ValueNum preferredBoundVN, + ASSERT_VALARG_TP assertions, + Range* pRange, + bool canUseCheckedBounds, + int budget, + ValueNumStore::SmallValueNumSet* visited); + // The maximum possible value of the given "limit". If such a value could not be determined // return "false". For example: CORINFO_Array_MaxLength for array length. bool GetLimitMax(Limit& limit, int* pMax); From 59b21cb13924c63b21f8ba575733ff7c1f355509 Mon Sep 17 00:00:00 2001 From: Mitchell Hwang Date: Mon, 11 May 2026 21:26:13 -0400 Subject: [PATCH 092/109] Extract signal-safe integer formatters into a shared SignalSafeFormat namespace Moves the async-signal-safe integer formatting helpers and buffer-size constants out of SignalSafeJsonWriter into a shared SignalSafeFormat namespace. The helpers are JSON-agnostic and are needed by both the JSON writer and later compact console output without introducing a sibling dependency. This is intended as a behavior-preserving refactor: JSON writer call sites continue to use the same bounded fixed-buffer formatting logic, just through the shared helper namespace. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/coreclr/debug/crashreport/CMakeLists.txt | 1 + .../debug/crashreport/inproccrashreporter.cpp | 5 +- .../debug/crashreport/signalsafeformat.cpp | 114 ++++++++++++++++ .../debug/crashreport/signalsafeformat.h | 42 ++++++ .../crashreport/signalsafejsonwriter.cpp | 124 +----------------- .../debug/crashreport/signalsafejsonwriter.h | 17 --- 6 files changed, 167 insertions(+), 136 deletions(-) create mode 100644 src/coreclr/debug/crashreport/signalsafeformat.cpp create mode 100644 src/coreclr/debug/crashreport/signalsafeformat.h diff --git a/src/coreclr/debug/crashreport/CMakeLists.txt b/src/coreclr/debug/crashreport/CMakeLists.txt index f88699a4c6a464..9d78e9976cb1c2 100644 --- a/src/coreclr/debug/crashreport/CMakeLists.txt +++ b/src/coreclr/debug/crashreport/CMakeLists.txt @@ -1,6 +1,7 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CRASHREPORT_SOURCES + signalsafeformat.cpp signalsafejsonwriter.cpp inproccrashreporter.cpp ) diff --git a/src/coreclr/debug/crashreport/inproccrashreporter.cpp b/src/coreclr/debug/crashreport/inproccrashreporter.cpp index fe771432eee5f4..81fdef4d7b62de 100644 --- a/src/coreclr/debug/crashreport/inproccrashreporter.cpp +++ b/src/coreclr/debug/crashreport/inproccrashreporter.cpp @@ -7,6 +7,7 @@ #include "inproccrashreporter.h" #include "signalsafejsonwriter.h" +#include "signalsafeformat.h" #include "pal.h" @@ -526,7 +527,7 @@ CrashReportHelpers::ExpandDumpTemplate( case 'p': case 'd': - if (SignalSafeJsonWriter::FormatUnsignedDecimal(numberBuf, sizeof(numberBuf), pid) == 0) + if (SignalSafeFormat::FormatUnsignedDecimal(numberBuf, sizeof(numberBuf), pid) == 0) { return 0; } @@ -542,7 +543,7 @@ CrashReportHelpers::ExpandDumpTemplate( break; case 't': - if (SignalSafeJsonWriter::FormatUnsignedDecimal( + if (SignalSafeFormat::FormatUnsignedDecimal( numberBuf, sizeof(numberBuf), static_cast(time(nullptr))) == 0) { return 0; diff --git a/src/coreclr/debug/crashreport/signalsafeformat.cpp b/src/coreclr/debug/crashreport/signalsafeformat.cpp new file mode 100644 index 00000000000000..9efed80e982a22 --- /dev/null +++ b/src/coreclr/debug/crashreport/signalsafeformat.cpp @@ -0,0 +1,114 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +#include "signalsafeformat.h" + +namespace SignalSafeFormat +{ + +void +FormatHex( + char* buffer, + size_t bufferSize, + uint64_t value) +{ + if (buffer == nullptr || bufferSize == 0) + { + return; + } + + char reverse[MAX_HEX_DIGITS_UINT64]; + size_t reverseLength = 0; + do + { + unsigned digit = static_cast(value & 0xf); + reverse[reverseLength++] = static_cast(digit < 10 ? ('0' + digit) : ('a' + digit - 10)); + value >>= 4; + } while (value != 0 && reverseLength < sizeof(reverse)); + + if (bufferSize < HEX_PREFIX_LEN + reverseLength + NULL_TERMINATOR_LEN) + { + buffer[0] = '\0'; + return; + } + + buffer[0] = '0'; + buffer[1] = 'x'; + + size_t index = HEX_PREFIX_LEN; + while (reverseLength > 0) + { + buffer[index++] = reverse[--reverseLength]; + } + buffer[index] = '\0'; +} + +size_t +FormatUnsignedDecimal( + char* buffer, + size_t bufferSize, + uint64_t value) +{ + if (buffer == nullptr || bufferSize == 0) + { + return 0; + } + + char reverse[MAX_DECIMAL_DIGITS_UINT64]; + size_t reverseLength = 0; + do + { + reverse[reverseLength++] = static_cast('0' + (value % 10)); + value /= 10; + } while (value != 0 && reverseLength < sizeof(reverse)); + + if (bufferSize < reverseLength + NULL_TERMINATOR_LEN) + { + buffer[0] = '\0'; + return 0; + } + + size_t pos = 0; + while (reverseLength > 0) + { + buffer[pos++] = reverse[--reverseLength]; + } + buffer[pos] = '\0'; + return pos; +} + +size_t +FormatSignedDecimal( + char* buffer, + size_t bufferSize, + int64_t value) +{ + if (buffer == nullptr || bufferSize == 0) + { + return 0; + } + + if (value >= 0) + { + return FormatUnsignedDecimal(buffer, bufferSize, static_cast(value)); + } + + if (bufferSize < SIGN_LEN + NULL_TERMINATOR_LEN) + { + buffer[0] = '\0'; + return 0; + } + + buffer[0] = '-'; + // Cast to unsigned first to handle INT64_MIN without signed overflow. + uint64_t absValue = static_cast(-(value + 1)) + 1; + size_t written = FormatUnsignedDecimal(buffer + 1, bufferSize - 1, absValue); + if (written == 0) + { + buffer[0] = '\0'; + return 0; + } + return written + 1; +} + +} // namespace SignalSafeFormat diff --git a/src/coreclr/debug/crashreport/signalsafeformat.h b/src/coreclr/debug/crashreport/signalsafeformat.h new file mode 100644 index 00000000000000..2bf40cf963dfe1 --- /dev/null +++ b/src/coreclr/debug/crashreport/signalsafeformat.h @@ -0,0 +1,42 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +// Async-signal-safe integer-to-string format primitives shared across the +// signal-safe writer family (SignalSafeJsonWriter, SignalSafeConsoleWriter, +// and any other consumer that needs to render integers without stdio, +// locale, or heap allocation). Bounded buffer-size constants document the +// minimum buffer required for each formatter. + +#pragma once + +#include +#include + +namespace SignalSafeFormat +{ + constexpr size_t MAX_HEX_DIGITS_UINT64 = 16; + constexpr size_t MAX_DECIMAL_DIGITS_UINT64 = 20; + constexpr size_t HEX_PREFIX_LEN = 2; // "0x" + constexpr size_t SIGN_LEN = 1; // '-' for signed decimals + constexpr size_t NULL_TERMINATOR_LEN = 1; + + constexpr size_t MAX_HEX_BUFFER_SIZE = HEX_PREFIX_LEN + MAX_HEX_DIGITS_UINT64 + NULL_TERMINATOR_LEN; + constexpr size_t MAX_UNSIGNED_DECIMAL_BUFFER_SIZE = MAX_DECIMAL_DIGITS_UINT64 + NULL_TERMINATOR_LEN; + constexpr size_t MAX_SIGNED_DECIMAL_BUFFER_SIZE = SIGN_LEN + MAX_DECIMAL_DIGITS_UINT64 + NULL_TERMINATOR_LEN; + + // Writes "0x"-prefixed hex (lowercase) of `value` into `buffer`. On + // success the buffer is null-terminated. If `buffer` is null, `bufferSize` + // is zero, or the buffer is too small to hold the formatted value, the + // buffer is left empty (or null-terminated at index 0 when possible). + void FormatHex(char* buffer, size_t bufferSize, uint64_t value); + + // Writes the unsigned-decimal representation of `value` into `buffer` and + // returns the number of bytes written (excluding the null terminator). + // Returns 0 on failure with the same buffer-state guarantees as FormatHex. + size_t FormatUnsignedDecimal(char* buffer, size_t bufferSize, uint64_t value); + + // Writes the signed-decimal representation of `value` into `buffer` and + // returns the number of bytes written (excluding the null terminator). + // Returns 0 on failure. Handles INT64_MIN without signed overflow. + size_t FormatSignedDecimal(char* buffer, size_t bufferSize, int64_t value); +} diff --git a/src/coreclr/debug/crashreport/signalsafejsonwriter.cpp b/src/coreclr/debug/crashreport/signalsafejsonwriter.cpp index 2cd858ab544564..44adea0af9b321 100644 --- a/src/coreclr/debug/crashreport/signalsafejsonwriter.cpp +++ b/src/coreclr/debug/crashreport/signalsafejsonwriter.cpp @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. #include "signalsafejsonwriter.h" +#include "signalsafeformat.h" #include #include @@ -257,124 +258,13 @@ SignalSafeJsonWriter::WriteEscapedString( AppendChar('"'); } -// Bounded, async-signal-safe integer-to-string formatters. They write into the -// caller-supplied buffer and never allocate or call into stdio/locale code. -// If the buffer is too small to hold the maximum-width output (per the -// MAX_*_BUFFER_SIZE constants on SignalSafeJsonWriter), they leave only a null -// terminator and return early. - -void -SignalSafeJsonWriter::FormatHexValue( - char* buffer, - size_t bufferSize, - uint64_t value) -{ - if (buffer == nullptr || bufferSize == 0) - { - return; - } - - char reverse[MAX_HEX_DIGITS_UINT64]; - size_t reverseLength = 0; - do - { - unsigned digit = static_cast(value & 0xf); - reverse[reverseLength++] = static_cast(digit < 10 ? ('0' + digit) : ('a' + digit - 10)); - value >>= 4; - } while (value != 0 && reverseLength < sizeof(reverse)); - - if (bufferSize < HEX_PREFIX_LEN + reverseLength + NULL_TERMINATOR_LEN) - { - buffer[0] = '\0'; - return; - } - - buffer[0] = '0'; - buffer[1] = 'x'; - - size_t index = HEX_PREFIX_LEN; - while (reverseLength > 0) - { - buffer[index++] = reverse[--reverseLength]; - } - buffer[index] = '\0'; -} - -size_t -SignalSafeJsonWriter::FormatUnsignedDecimal( - char* buffer, - size_t bufferSize, - uint64_t value) -{ - if (buffer == nullptr || bufferSize == 0) - { - return 0; - } - - char reverse[MAX_DECIMAL_DIGITS_UINT64]; - size_t reverseLength = 0; - do - { - reverse[reverseLength++] = static_cast('0' + (value % 10)); - value /= 10; - } while (value != 0 && reverseLength < sizeof(reverse)); - - if (bufferSize < reverseLength + NULL_TERMINATOR_LEN) - { - buffer[0] = '\0'; - return 0; - } - - size_t pos = 0; - while (reverseLength > 0) - { - buffer[pos++] = reverse[--reverseLength]; - } - buffer[pos] = '\0'; - return pos; -} - -size_t -SignalSafeJsonWriter::FormatSignedDecimal( - char* buffer, - size_t bufferSize, - int64_t value) -{ - if (buffer == nullptr || bufferSize == 0) - { - return 0; - } - - if (value >= 0) - { - return FormatUnsignedDecimal(buffer, bufferSize, static_cast(value)); - } - - if (bufferSize < SIGN_LEN + NULL_TERMINATOR_LEN) - { - buffer[0] = '\0'; - return 0; - } - - buffer[0] = '-'; - // Cast to unsigned first to handle INT64_MIN without signed overflow. - uint64_t absValue = static_cast(-(value + 1)) + 1; - size_t written = FormatUnsignedDecimal(buffer + 1, bufferSize - 1, absValue); - if (written == 0) - { - buffer[0] = '\0'; - return 0; - } - return written + 1; -} - bool SignalSafeJsonWriter::WriteHexAsString( const char* key, uint64_t value) { - char scratch[MAX_HEX_FORMAT_BUFFER_SIZE]; - FormatHexValue(scratch, sizeof(scratch), value); + char scratch[SignalSafeFormat::MAX_HEX_BUFFER_SIZE]; + SignalSafeFormat::FormatHex(scratch, sizeof(scratch), value); return WriteString(key, scratch); } @@ -383,8 +273,8 @@ SignalSafeJsonWriter::WriteDecimalAsString( const char* key, uint64_t value) { - char scratch[MAX_UNSIGNED_DECIMAL_BUFFER_SIZE]; - (void)FormatUnsignedDecimal(scratch, sizeof(scratch), value); + char scratch[SignalSafeFormat::MAX_UNSIGNED_DECIMAL_BUFFER_SIZE]; + (void)SignalSafeFormat::FormatUnsignedDecimal(scratch, sizeof(scratch), value); return WriteString(key, scratch); } @@ -393,7 +283,7 @@ SignalSafeJsonWriter::WriteSignedDecimalAsString( const char* key, int64_t value) { - char scratch[MAX_SIGNED_DECIMAL_BUFFER_SIZE]; - (void)FormatSignedDecimal(scratch, sizeof(scratch), value); + char scratch[SignalSafeFormat::MAX_SIGNED_DECIMAL_BUFFER_SIZE]; + (void)SignalSafeFormat::FormatSignedDecimal(scratch, sizeof(scratch), value); return WriteString(key, scratch); } diff --git a/src/coreclr/debug/crashreport/signalsafejsonwriter.h b/src/coreclr/debug/crashreport/signalsafejsonwriter.h index 54eac5dbf6d30d..650e1edcb82802 100644 --- a/src/coreclr/debug/crashreport/signalsafejsonwriter.h +++ b/src/coreclr/debug/crashreport/signalsafejsonwriter.h @@ -19,16 +19,6 @@ static constexpr size_t SIGNAL_SAFE_JSON_BUFFER_SIZE = 4 * 1024; class SignalSafeJsonWriter { public: - // Maximum digit counts and required buffer sizes for the static format helpers below. - static constexpr size_t MAX_HEX_DIGITS_UINT64 = 16; - static constexpr size_t MAX_DECIMAL_DIGITS_UINT64 = 20; - static constexpr size_t HEX_PREFIX_LEN = 2; // "0x" - static constexpr size_t SIGN_LEN = 1; // '-' for signed decimals - static constexpr size_t NULL_TERMINATOR_LEN = 1; - static constexpr size_t MAX_HEX_FORMAT_BUFFER_SIZE = HEX_PREFIX_LEN + MAX_HEX_DIGITS_UINT64 + NULL_TERMINATOR_LEN; - static constexpr size_t MAX_UNSIGNED_DECIMAL_BUFFER_SIZE = MAX_DECIMAL_DIGITS_UINT64 + NULL_TERMINATOR_LEN; - static constexpr size_t MAX_SIGNED_DECIMAL_BUFFER_SIZE = SIGN_LEN + MAX_DECIMAL_DIGITS_UINT64 + NULL_TERMINATOR_LEN; - SignalSafeJsonWriter() : m_pos(0), m_commaNeeded(false), @@ -55,13 +45,6 @@ class SignalSafeJsonWriter bool Finish(); bool Flush(); - // Async-signal-safe integer-to-string formatters used by the Write* members - // above and by the few non-writer call sites that need the raw text (e.g. - // dump-name pattern expansion). All are bounded and never allocate. - static void FormatHexValue(char* buffer, size_t bufferSize, uint64_t value); - static size_t FormatUnsignedDecimal(char* buffer, size_t bufferSize, uint64_t value); - static size_t FormatSignedDecimal(char* buffer, size_t bufferSize, int64_t value); - private: bool Append(const char* str, size_t len); bool AppendChar(char c); From 1a348af6fc68418b26418d6fd57bccbfba03da77 Mon Sep 17 00:00:00 2001 From: Mitchell Hwang Date: Mon, 11 May 2026 22:07:39 -0400 Subject: [PATCH 093/109] Add DOTNET_CRASH compact log alongside the JSON file crash report Adds SignalSafeConsoleWriter, a bounded line-oriented sink that writes DOTNET_CRASH entries through __android_log_write on Android and newline-terminated stderr lines elsewhere. CreateReport now emits a compact tombstone-style header/footer alongside the existing JSON report path. The JSON header/footer emission is split into helpers, and DbgMiniDumpName becomes optional: when no JSON path is configured, the JSON writer uses a no-op sink while the compact log still runs. PROCGetSignalNameAscii exposes the existing signal-name table in the narrow form used by the compact log. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/coreclr/debug/crashreport/CMakeLists.txt | 1 + .../debug/crashreport/inproccrashreporter.cpp | 217 ++++++++++++++---- .../debug/crashreport/inproccrashreporter.h | 6 + .../crashreport/signalsafeconsolewriter.cpp | 142 ++++++++++++ .../crashreport/signalsafeconsolewriter.h | 75 ++++++ src/coreclr/pal/src/include/pal/process.h | 12 + src/coreclr/pal/src/thread/process.cpp | 15 ++ src/coreclr/vm/crashreportstackwalker.cpp | 4 - 8 files changed, 420 insertions(+), 52 deletions(-) create mode 100644 src/coreclr/debug/crashreport/signalsafeconsolewriter.cpp create mode 100644 src/coreclr/debug/crashreport/signalsafeconsolewriter.h diff --git a/src/coreclr/debug/crashreport/CMakeLists.txt b/src/coreclr/debug/crashreport/CMakeLists.txt index 9d78e9976cb1c2..f23dd004846df5 100644 --- a/src/coreclr/debug/crashreport/CMakeLists.txt +++ b/src/coreclr/debug/crashreport/CMakeLists.txt @@ -3,6 +3,7 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CRASHREPORT_SOURCES signalsafeformat.cpp signalsafejsonwriter.cpp + signalsafeconsolewriter.cpp inproccrashreporter.cpp ) diff --git a/src/coreclr/debug/crashreport/inproccrashreporter.cpp b/src/coreclr/debug/crashreport/inproccrashreporter.cpp index 81fdef4d7b62de..b80333121371dd 100644 --- a/src/coreclr/debug/crashreport/inproccrashreporter.cpp +++ b/src/coreclr/debug/crashreport/inproccrashreporter.cpp @@ -6,6 +6,7 @@ // Streams a createdump-shaped JSON skeleton to a crashreport.json file. #include "inproccrashreporter.h" +#include "signalsafeconsolewriter.h" #include "signalsafejsonwriter.h" #include "signalsafeformat.h" @@ -24,6 +25,42 @@ #include #endif +extern "C" const char* PROCGetSignalNameAscii(int signal); + +static const char CRASHREPORT_PROTOCOL_VERSION[] = "1.0.0"; + +#if defined(__x86_64__) +static const char CRASHREPORT_ARCHITECTURE_NAME[] = "amd64"; +#elif defined(__aarch64__) +static const char CRASHREPORT_ARCHITECTURE_NAME[] = "arm64"; +#elif defined(__arm__) +static const char CRASHREPORT_ARCHITECTURE_NAME[] = "arm"; +#endif + +// Prescribed compact crash report log format. One logical line == one +// __android_log_write entry under tag "DOTNET_CRASH" on Android, one +// '\n'-terminated stderr write elsewhere. +// +// *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** (EmitConsoleHeader) +// .NET Crash Report v +// Build: (omitted if empty) +// ABI: amd64|arm64|arm +// Cmdline: (omitted if empty) +// pid: +// signal () +// (blank between sections) +// --- thread 0xTID [(crashed)] --- (per thread; OnThread) +// managed exception: (0x) (only if EE provided one) +// #NN [M] Class.Method + 0xILOFFSET (token=0xTOKEN) (managed frame; WriteFrameToConsole) +// #NN [M] 0xIP (module + 0xOFFSET) (native frame; WriteFrameToConsole) +// (no managed frames) | ... +N more frames (FinishCurrentThreadCompactBlock) +// (blank between threads) +// modules: (EmitConsoleModulesAndFooter) +// [N] {} (one per ModuleTable entry) +// *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** (closing separator) + +static SignalSafeConsoleWriter s_consoleWriter; + // Include the .NET version string instead of linking because it is "static". #if __has_include("_version.c") #include "_version.c" @@ -208,6 +245,12 @@ class CrashReportHelpers const char* buffer, size_t len); + // SignalSafeJsonWriter callback that drops everything: used when the + // crash report is running in compact-log-only mode (no DbgMiniDumpName) + // so the JSON formatter still keeps its bookkeeping consistent without + // emitting bytes anywhere. + static bool DiscardOutputCallback(const char* buffer, size_t len, void* ctx); + static bool BuildReportPath( char* buffer, size_t bufferSize, @@ -238,46 +281,39 @@ InProcCrashReporter::CreateReport( char reportPath[CRASHREPORT_PATH_BUFFER_SIZE]; reportPath[0] = '\0'; - if (m_reportPath[0] == '\0' || !CrashReportHelpers::BuildReportPath(reportPath, sizeof(reportPath), m_reportPath, m_processName, m_hostName)) - { - return; - } + // The JSON file sink is only enabled when DbgMiniDumpName supplied a + // template AND the template expanded to a valid path. Otherwise the + // crash report runs in compact-log-only mode: the JSON emitter still + // executes (so it can keep its bookkeeping consistent) but writes go + // to a no-op DiscardOutputCallback instead of an open fd. + bool jsonEnabled = m_reportPath[0] != '\0' && + CrashReportHelpers::BuildReportPath(reportPath, sizeof(reportPath), m_reportPath, m_processName, m_hostName); - int fd = open(reportPath, O_WRONLY | O_CREAT | O_TRUNC, 0600); - if (fd == -1) + int fd = -1; + if (jsonEnabled) { - return; + fd = open(reportPath, O_WRONLY | O_CREAT | O_TRUNC, 0600); + if (fd == -1) + { + jsonEnabled = false; + } } (void)siginfo; - CrashReportOutputContext outputContext(fd); - - m_jsonWriter.Init(&CrashReportOutputContext::ChunkCallback, &outputContext); - - m_jsonWriter.OpenObject(); - m_jsonWriter.OpenObject("payload"); - m_jsonWriter.WriteString("protocol_version", "1.0.0"); - - m_jsonWriter.OpenObject("configuration"); -#if defined(__x86_64__) - m_jsonWriter.WriteString("architecture", "amd64"); -#elif defined(__aarch64__) - m_jsonWriter.WriteString("architecture", "arm64"); -#elif defined(__arm__) - m_jsonWriter.WriteString("architecture", "arm"); -#endif - char version[sizeof(sccsid)]; - CrashReportHelpers::GetVersionString(version, sizeof(version)); - m_jsonWriter.WriteString("version", version); - m_jsonWriter.CloseObject(); // configuration + EmitConsoleHeader(signal); - if (m_processName[0] != '\0') + CrashReportOutputContext outputContext(fd); + if (jsonEnabled) { - m_jsonWriter.WriteString("process_name", m_processName); + m_jsonWriter.Init(&CrashReportOutputContext::ChunkCallback, &outputContext); + } + else + { + m_jsonWriter.Init(&CrashReportHelpers::DiscardOutputCallback, nullptr); } - m_jsonWriter.WriteDecimalAsString("pid", static_cast(GetCurrentProcessId())); + EmitJsonHeader(); m_jsonWriter.OpenArray("threads"); if (m_enumerateThreadsCallback != nullptr) @@ -298,26 +334,11 @@ InProcCrashReporter::CreateReport( } m_jsonWriter.CloseArray(); // threads - m_jsonWriter.CloseObject(); // payload + EmitJsonFooter(signal); - m_jsonWriter.OpenObject("parameters"); - m_jsonWriter.WriteSignedDecimalAsString("signal", static_cast(signal)); -#ifdef __APPLE__ - if (m_osVersion[0] != '\0') - { - m_jsonWriter.WriteString("OSVersion", m_osVersion); - } - if (m_systemModel[0] != '\0') - { - m_jsonWriter.WriteString("SystemModel", m_systemModel); - } - m_jsonWriter.WriteString("SystemManufacturer", "apple"); -#endif - m_jsonWriter.CloseObject(); // parameters - - m_jsonWriter.CloseObject(); // root + EmitConsoleFooter(); - if (fd != -1) + if (jsonEnabled) { bool writeSucceeded = m_jsonWriter.Finish() && !outputContext.WriteFailed() && @@ -328,6 +349,10 @@ InProcCrashReporter::CreateReport( unlink(reportPath); } } + else + { + (void)m_jsonWriter.Finish(); + } } InProcCrashReporter& @@ -445,6 +470,15 @@ CrashReportHelpers::WriteToFile( return true; } +bool +CrashReportHelpers::DiscardOutputCallback( + const char* /*buffer*/, + size_t /*len*/, + void* /*ctx*/) +{ + return true; +} + bool CrashReportOutputContext::HandleChunk( const char* buffer, @@ -1100,3 +1134,90 @@ InProcCrashReporter::EmitSynthesizedCrashThread( m_jsonWriter.CloseArray(); // stack_frames m_jsonWriter.CloseObject(); // thread } + +// --- InProcCrashReporter: console header and footer ------------------------ + +void +InProcCrashReporter::EmitConsoleHeader(int signal) +{ + s_consoleWriter.WriteSeparator(); + s_consoleWriter.AppendStr(".NET Crash Report v"); + s_consoleWriter.AppendStr(CRASHREPORT_PROTOCOL_VERSION); + s_consoleWriter.EndLine(); + + char version[sizeof(sccsid)]; + CrashReportHelpers::GetVersionString(version, sizeof(version)); + if (version[0] != '\0') + { + s_consoleWriter.WriteKeyValueStr("Build", version); + } + + s_consoleWriter.WriteKeyValueStr("ABI", CRASHREPORT_ARCHITECTURE_NAME); + + if (m_processName[0] != '\0') + { + s_consoleWriter.WriteKeyValueStr("Cmdline", m_processName); + } + + s_consoleWriter.WriteKeyValueDecimal("pid", static_cast(GetCurrentProcessId())); + + s_consoleWriter.AppendStr("signal "); + s_consoleWriter.AppendSignedDecimal(signal); + s_consoleWriter.AppendStr(" ("); + s_consoleWriter.AppendStr(PROCGetSignalNameAscii(signal)); + s_consoleWriter.AppendChar(')'); + s_consoleWriter.EndLine(); +} + +void +InProcCrashReporter::EmitConsoleFooter() +{ + s_consoleWriter.WriteSeparator(); +} + +// --- InProcCrashReporter: JSON header and footer --------------------------- + +void +InProcCrashReporter::EmitJsonHeader() +{ + m_jsonWriter.OpenObject(); + m_jsonWriter.OpenObject("payload"); + m_jsonWriter.WriteString("protocol_version", CRASHREPORT_PROTOCOL_VERSION); + + m_jsonWriter.OpenObject("configuration"); + m_jsonWriter.WriteString("architecture", CRASHREPORT_ARCHITECTURE_NAME); + char version[sizeof(sccsid)]; + CrashReportHelpers::GetVersionString(version, sizeof(version)); + m_jsonWriter.WriteString("version", version); + m_jsonWriter.CloseObject(); // configuration + + if (m_processName[0] != '\0') + { + m_jsonWriter.WriteString("process_name", m_processName); + } + + m_jsonWriter.WriteDecimalAsString("pid", static_cast(GetCurrentProcessId())); +} + +void +InProcCrashReporter::EmitJsonFooter(int signal) +{ + m_jsonWriter.CloseObject(); // payload + + m_jsonWriter.OpenObject("parameters"); + m_jsonWriter.WriteSignedDecimalAsString("signal", static_cast(signal)); +#ifdef __APPLE__ + if (m_osVersion[0] != '\0') + { + m_jsonWriter.WriteString("OSVersion", m_osVersion); + } + if (m_systemModel[0] != '\0') + { + m_jsonWriter.WriteString("SystemModel", m_systemModel); + } + m_jsonWriter.WriteString("SystemManufacturer", "apple"); +#endif + m_jsonWriter.CloseObject(); // parameters + + m_jsonWriter.CloseObject(); // root +} diff --git a/src/coreclr/debug/crashreport/inproccrashreporter.h b/src/coreclr/debug/crashreport/inproccrashreporter.h index 5018f3b0d10793..c9bedf46e8243c 100644 --- a/src/coreclr/debug/crashreport/inproccrashreporter.h +++ b/src/coreclr/debug/crashreport/inproccrashreporter.h @@ -88,6 +88,12 @@ class InProcCrashReporter void* context, bool walkStack); + void EmitConsoleHeader(int signal); + void EmitConsoleFooter(); + + void EmitJsonHeader(); + void EmitJsonFooter(int signal); + SignalSafeJsonWriter m_jsonWriter; InProcCrashReportIsManagedThreadCallback m_isManagedThreadCallback = nullptr; InProcCrashReportWalkStackCallback m_walkStackCallback = nullptr; diff --git a/src/coreclr/debug/crashreport/signalsafeconsolewriter.cpp b/src/coreclr/debug/crashreport/signalsafeconsolewriter.cpp new file mode 100644 index 00000000000000..8d952c6b81017a --- /dev/null +++ b/src/coreclr/debug/crashreport/signalsafeconsolewriter.cpp @@ -0,0 +1,142 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +#include "signalsafeconsolewriter.h" +#include "signalsafeformat.h" + +#include +#include + +#if defined(__ANDROID__) +#include +static const char CRASHREPORT_LOG_TAG[] = "DOTNET_CRASH"; +#endif + +static const char CRASHREPORT_LINE_SEPARATOR[] = "*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***"; + +void +SignalSafeConsoleWriter::AppendStr(const char* s) +{ + if (s == nullptr || m_pos + 1 >= sizeof(m_buffer)) + { + return; + } + + size_t available = sizeof(m_buffer) - 1 - m_pos; + size_t toCopy = strnlen(s, available); + if (toCopy != 0) + { + memcpy(m_buffer + m_pos, s, toCopy); + m_pos += toCopy; + } +} + +void +SignalSafeConsoleWriter::AppendChar(char c) +{ + if (m_pos + 1 < sizeof(m_buffer)) + { + m_buffer[m_pos++] = c; + } +} + +void +SignalSafeConsoleWriter::AppendHex(uint64_t v) +{ + char buf[SignalSafeFormat::MAX_HEX_BUFFER_SIZE]; + SignalSafeFormat::FormatHex(buf, sizeof(buf), v); + // Skip the leading "0x" so callers control whether the prefix appears + // (the compact format inserts it verbatim around the value). + const char* p = buf; + if (p[0] == '0' && p[1] == 'x') + { + p += 2; + } + AppendStr(p); +} + +void +SignalSafeConsoleWriter::AppendDecimal(uint64_t v) +{ + char buf[SignalSafeFormat::MAX_UNSIGNED_DECIMAL_BUFFER_SIZE]; + SignalSafeFormat::FormatUnsignedDecimal(buf, sizeof(buf), v); + AppendStr(buf); +} + +void +SignalSafeConsoleWriter::AppendSignedDecimal(int64_t v) +{ + char buf[SignalSafeFormat::MAX_SIGNED_DECIMAL_BUFFER_SIZE]; + SignalSafeFormat::FormatSignedDecimal(buf, sizeof(buf), v); + AppendStr(buf); +} + +void +SignalSafeConsoleWriter::EndLine() +{ + Flush(); +} + +void +SignalSafeConsoleWriter::WriteLine(const char* s) +{ + AppendStr(s); + EndLine(); +} + +void +SignalSafeConsoleWriter::WriteKeyValueStr(const char* key, const char* value) +{ + AppendStr(key); + AppendStr(": "); + AppendStr(value != nullptr ? value : ""); + EndLine(); +} + +void +SignalSafeConsoleWriter::WriteKeyValueDecimal(const char* key, uint64_t value) +{ + AppendStr(key); + AppendStr(": "); + AppendDecimal(value); + EndLine(); +} + +void +SignalSafeConsoleWriter::WriteSeparator() +{ + WriteLine(CRASHREPORT_LINE_SEPARATOR); +} + +void +SignalSafeConsoleWriter::Flush() +{ + // Always null-terminate so the platform write APIs see a proper C string. + if (m_pos < sizeof(m_buffer)) + { + m_buffer[m_pos] = '\0'; + } + else + { + m_buffer[sizeof(m_buffer) - 1] = '\0'; + } + +#if defined(__ANDROID__) + // __android_log_write expects a tag + null-terminated message; it adds its + // own line discipline so we deliberately do not append '\n'. Each call + // becomes one logcat entry, which is what makes per-line filtering useful. + __android_log_write(ANDROID_LOG_FATAL, CRASHREPORT_LOG_TAG, m_buffer); +#else + // On Apple/Linux the report goes to stderr; explicitly newline-terminate + // each line so log readers split entries the same way logcat would. + if (m_pos + 1 < sizeof(m_buffer)) + { + m_buffer[m_pos++] = '\n'; + m_buffer[m_pos] = '\0'; + } + minipal_log_write_error(m_buffer); +#endif + + m_pos = 0; + m_buffer[0] = '\0'; +} diff --git a/src/coreclr/debug/crashreport/signalsafeconsolewriter.h b/src/coreclr/debug/crashreport/signalsafeconsolewriter.h new file mode 100644 index 00000000000000..0a66d2b6bf76cb --- /dev/null +++ b/src/coreclr/debug/crashreport/signalsafeconsolewriter.h @@ -0,0 +1,75 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +// Bounded, signal-safe line-oriented console writer. Paired with +// SignalSafeJsonWriter as the second crash-report output sink: +// SignalSafeJsonWriter streams JSON to a file callback (compact, no +// line concept); SignalSafeConsoleWriter emits one logical line at a +// time to the platform console (Android logcat under the "DOTNET_CRASH" +// tag, stderr elsewhere). All public members are async-signal-safe: no +// heap allocation, no stdio, no locale or variadic formatting. +// +// Design choices below are driven by the prescribed compact crash report +// log format (specified at the top of inproccrashreporter.cpp): +// +// * One Flush per logical line (triggered by EndLine() / WriteLine()) +// instead of stream-buffer-fill flushing. Each call becomes exactly one +// __android_log_write entry on Android, so the format's line-oriented +// "header / per-thread block / modules / footer" structure maps 1:1 +// to logcat entries that filter cleanly under a single tag (`adb +// logcat *:S DOTNET_CRASH:F`) without cutting fields in half. On +// Apple/Linux each Flush adds an explicit '\n' for the same reason. +// +// * Unique "DOTNET_CRASH" logcat tag (distinct from the runtime's +// general "DOTNET" tag) so consumers can isolate the crash report from +// an otherwise noisy logcat with a single per-tag filter. +// +// * Best-effort silent truncation on per-line buffer overflow (Append* +// helpers all guard with `m_pos + 1 < sizeof(m_buffer)`). 512 bytes +// leaves comfortable headroom over the longest line the format +// produces (a fully-qualified Class.Method line at roughly +// CRASHREPORT_STRING_BUFFER_SIZE + line decoration), so truncation is +// reserved for unforeseen overrun and never fails any other +// crash-report output. + +#pragma once + +#include +#include + +static constexpr size_t SIGNAL_SAFE_CONSOLE_BUFFER_SIZE = 512; + +class SignalSafeConsoleWriter +{ +public: + SignalSafeConsoleWriter() + : m_pos(0) + { + m_buffer[0] = '\0'; + } + + SignalSafeConsoleWriter(const SignalSafeConsoleWriter&) = delete; + SignalSafeConsoleWriter& operator=(const SignalSafeConsoleWriter&) = delete; + + void AppendStr(const char* s); + void AppendChar(char c); + void AppendHex(uint64_t v); + void AppendDecimal(uint64_t v); + void AppendSignedDecimal(int64_t v); + void EndLine(); + + // Convenience for the many fixed strings emitted during the report. + void WriteLine(const char* s); + // "key: value" line shortcut (no string-escaping; values are trusted CLR strings). + void WriteKeyValueStr(const char* key, const char* value); + void WriteKeyValueDecimal(const char* key, uint64_t value); + + void WriteSeparator(); + void WriteBlank() { WriteLine(""); } + +private: + void Flush(); + + char m_buffer[SIGNAL_SAFE_CONSOLE_BUFFER_SIZE]; + size_t m_pos; +}; diff --git a/src/coreclr/pal/src/include/pal/process.h b/src/coreclr/pal/src/include/pal/process.h index e3f26bde875a03..6d4336a3a05720 100644 --- a/src/coreclr/pal/src/include/pal/process.h +++ b/src/coreclr/pal/src/include/pal/process.h @@ -172,6 +172,18 @@ VOID PROCCreateCrashDumpIfEnabled(int signal, siginfo_t* siginfo, void* context, --*/ VOID PROCLogManagedCallstackForSignal(int signal); +/*++ +Function: + PROCGetSignalNameAscii + + Returns the ASCII name for the given POSIX signal (e.g. "SIGABRT"), or + "Unknown signal" if not recognized. Async-signal-safe. + +Parameters: + signal - POSIX signal number +--*/ +const char* PROCGetSignalNameAscii(int signal); + #ifdef __cplusplus } #endif // __cplusplus diff --git a/src/coreclr/pal/src/thread/process.cpp b/src/coreclr/pal/src/thread/process.cpp index 25902fcea08b8c..f150f54644003f 100644 --- a/src/coreclr/pal/src/thread/process.cpp +++ b/src/coreclr/pal/src/thread/process.cpp @@ -1882,6 +1882,21 @@ static LPCWSTR GetSignalName(int signal) } } +const char* PROCGetSignalNameAscii(int signal) +{ + switch (signal) + { + case SIGSEGV: return "SIGSEGV"; + case SIGBUS: return "SIGBUS"; + case SIGFPE: return "SIGFPE"; + case SIGILL: return "SIGILL"; + case SIGABRT: return "SIGABRT"; + case SIGTRAP: return "SIGTRAP"; + case SIGTERM: return "SIGTERM"; + default: return "Unknown signal"; + } +} + /*++ Function: PROCLogManagedCallstackForSignal diff --git a/src/coreclr/vm/crashreportstackwalker.cpp b/src/coreclr/vm/crashreportstackwalker.cpp index 1670ec970d91ff..02c3bd59de2f86 100644 --- a/src/coreclr/vm/crashreportstackwalker.cpp +++ b/src/coreclr/vm/crashreportstackwalker.cpp @@ -427,10 +427,6 @@ CrashReportConfigure() CLRConfigNoCache dmpNameCfg = CLRConfigNoCache::Get("DbgMiniDumpName", /*noprefix*/ false, &getenv); const char* dumpName = dmpNameCfg.IsSet() ? dmpNameCfg.AsString() : nullptr; - if (dumpName == nullptr || dumpName[0] == '\0') - { - return; - } InProcCrashReporterSettings settings = {}; settings.reportPath = dumpName; From 70e99c8f98009859c8957cfc576d93646f0106a2 Mon Sep 17 00:00:00 2001 From: Mitchell Hwang Date: Mon, 11 May 2026 22:08:42 -0400 Subject: [PATCH 094/109] Emit per-thread frame stacks to the compact crash report log Adds shared frame-sink plumbing so each walked frame can feed both the JSON writer and the compact console writer. The compact log now emits per-thread headers, managed exception info, managed frame lines with IL offset/token, native frame lines with module offsets, and a marker when no managed frames were reported. Both normal thread enumeration and the synthesized crash-thread fallback use the same console block helpers, keeping per-thread compact-log structure in one place. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../debug/crashreport/inproccrashreporter.cpp | 287 +++++++++++++++++- 1 file changed, 278 insertions(+), 9 deletions(-) diff --git a/src/coreclr/debug/crashreport/inproccrashreporter.cpp b/src/coreclr/debug/crashreport/inproccrashreporter.cpp index b80333121371dd..43199996ec9dff 100644 --- a/src/coreclr/debug/crashreport/inproccrashreporter.cpp +++ b/src/coreclr/debug/crashreport/inproccrashreporter.cpp @@ -53,7 +53,7 @@ static const char CRASHREPORT_ARCHITECTURE_NAME[] = "arm"; // managed exception: (0x) (only if EE provided one) // #NN [M] Class.Method + 0xILOFFSET (token=0xTOKEN) (managed frame; WriteFrameToConsole) // #NN [M] 0xIP (module + 0xOFFSET) (native frame; WriteFrameToConsole) -// (no managed frames) | ... +N more frames (FinishCurrentThreadCompactBlock) +// (no managed frames) (FinishCurrentThreadCompactBlock) // (blank between threads) // modules: (EmitConsoleModulesAndFooter) // [N] {} (one per ModuleTable entry) @@ -94,10 +94,15 @@ class ThreadEnumerationContext public: ThreadEnumerationContext( SignalSafeJsonWriter* writer, + SignalSafeConsoleWriter* consoleWriter, + uint64_t crashingTid, void* signalContext) : m_writer(writer), + m_consoleWriter(consoleWriter), m_signalContext(signalContext), m_threadCount(0), + m_crashingTid(crashingTid), + m_currentThreadFrameCount(0), m_sawCrashThread(false) { } @@ -108,8 +113,9 @@ class ThreadEnumerationContext size_t ThreadCount() const { return m_threadCount; } bool SawCrashThread() const { return m_sawCrashThread; } SignalSafeJsonWriter* Writer() const { return m_writer; } + SignalSafeConsoleWriter* ConsoleWriter() const { return m_consoleWriter; } - void EnumerateThreads(InProcCrashReportEnumerateThreadsCallback callback, uint64_t crashingTid); + void EnumerateThreads(InProcCrashReportEnumerateThreadsCallback callback); static void ThreadCallback( uint64_t osThreadId, @@ -152,9 +158,14 @@ class ThreadEnumerationContext uint32_t moduleSize, const char* moduleGuid); + void FinishCurrentThreadCompactBlock(); + SignalSafeJsonWriter* m_writer; + SignalSafeConsoleWriter* m_consoleWriter; void* m_signalContext; size_t m_threadCount; + uint64_t m_crashingTid; + uint32_t m_currentThreadFrameCount; bool m_sawCrashThread; }; @@ -185,6 +196,13 @@ class CrashReportOutputContext class CrashReportHelpers { public: + struct FrameSinks + { + SignalSafeJsonWriter* writer; + SignalSafeConsoleWriter* consoleWriter; + uint32_t* currentThreadFrameCount; + }; + static void GetVersionString( char* buffer, size_t bufferSize); @@ -240,6 +258,54 @@ class CrashReportHelpers const char* moduleGuid, void* ctx); + static void WriteFrameToJson( + SignalSafeJsonWriter* writer, + uint64_t ip, + uint64_t stackPointer, + const char* methodName, + const char* className, + const char* moduleName, + uint32_t nativeOffset, + uint32_t token, + uint32_t ilOffset, + uint32_t moduleTimestamp, + uint32_t moduleSize, + const char* moduleGuid); + + static void WriteFrameToConsole( + SignalSafeConsoleWriter* consoleWriter, + uint32_t frameIndex, + uint64_t ip, + const char* methodName, + const char* className, + const char* moduleName, + uint32_t nativeOffset, + uint32_t token, + uint32_t ilOffset); + + static void WriteThreadBlockHeaderToConsole( + SignalSafeConsoleWriter* consoleWriter, + uint64_t osThreadId, + bool isCrashThread); + + static void WriteThreadBlockCloserToConsole( + SignalSafeConsoleWriter* consoleWriter, + uint32_t frameCount); + + static void FrameSinkCallback( + uint64_t ip, + uint64_t stackPointer, + const char* methodName, + const char* className, + const char* moduleName, + uint32_t nativeOffset, + uint32_t token, + uint32_t ilOffset, + uint32_t moduleTimestamp, + uint32_t moduleSize, + const char* moduleGuid, + void* ctx); + static bool WriteToFile( int fd, const char* buffer, @@ -318,10 +384,10 @@ InProcCrashReporter::CreateReport( m_jsonWriter.OpenArray("threads"); if (m_enumerateThreadsCallback != nullptr) { - ThreadEnumerationContext threadContext(&m_jsonWriter, context); uint64_t crashingTid = static_cast(minipal_get_current_thread_id()); + ThreadEnumerationContext threadContext(&m_jsonWriter, &s_consoleWriter, crashingTid, context); - threadContext.EnumerateThreads(m_enumerateThreadsCallback, crashingTid); + threadContext.EnumerateThreads(m_enumerateThreadsCallback); if (threadContext.ThreadCount() == 0 || !threadContext.SawCrashThread()) { @@ -945,6 +1011,30 @@ CrashReportHelpers::JsonFrameCallback( return; } + WriteFrameToJson(writer, ip, stackPointer, methodName, className, moduleName, + nativeOffset, token, ilOffset, moduleTimestamp, moduleSize, moduleGuid); +} + +void +CrashReportHelpers::WriteFrameToJson( + SignalSafeJsonWriter* writer, + uint64_t ip, + uint64_t stackPointer, + const char* methodName, + const char* className, + const char* moduleName, + uint32_t nativeOffset, + uint32_t token, + uint32_t ilOffset, + uint32_t moduleTimestamp, + uint32_t moduleSize, + const char* moduleGuid) +{ + if (writer == nullptr) + { + return; + } + writer->OpenObject(); writer->WriteHexAsString("stack_pointer", stackPointer); writer->WriteHexAsString("native_address", ip); @@ -987,6 +1077,134 @@ CrashReportHelpers::JsonFrameCallback( writer->CloseObject(); // frame } +void +CrashReportHelpers::WriteFrameToConsole( + SignalSafeConsoleWriter* consoleWriter, + uint32_t frameIndex, + uint64_t ip, + const char* methodName, + const char* className, + const char* moduleName, + uint32_t nativeOffset, + uint32_t token, + uint32_t ilOffset) +{ + if (consoleWriter == nullptr) + { + return; + } + + // Frame index always two digits ("#04 ..."); matches Android/AOSP debuggerd. + consoleWriter->AppendStr(" #"); + if (frameIndex < 10) + { + consoleWriter->AppendChar('0'); + } + consoleWriter->AppendDecimal(static_cast(frameIndex)); + consoleWriter->AppendChar(' '); + + if (methodName != nullptr) + { + char fullName[CRASHREPORT_STRING_BUFFER_SIZE]; + BuildMethodName(fullName, sizeof(fullName), className, methodName); + consoleWriter->AppendStr(fullName); + consoleWriter->AppendStr(" + 0x"); + consoleWriter->AppendHex(static_cast(ilOffset)); + consoleWriter->AppendStr(" (token=0x"); + consoleWriter->AppendHex(static_cast(token)); + consoleWriter->AppendChar(')'); + } + else + { + consoleWriter->AppendStr("0x"); + consoleWriter->AppendHex(ip); + if (moduleName != nullptr && moduleName[0] != '\0') + { + consoleWriter->AppendStr(" ("); + consoleWriter->AppendStr(GetFilename(moduleName)); + consoleWriter->AppendStr(" + 0x"); + consoleWriter->AppendHex(static_cast(nativeOffset)); + consoleWriter->AppendChar(')'); + } + } + consoleWriter->EndLine(); +} + +void +CrashReportHelpers::WriteThreadBlockHeaderToConsole( + SignalSafeConsoleWriter* consoleWriter, + uint64_t osThreadId, + bool isCrashThread) +{ + if (consoleWriter == nullptr) + { + return; + } + + consoleWriter->WriteBlank(); + consoleWriter->AppendStr("--- thread 0x"); + consoleWriter->AppendHex(osThreadId); + if (isCrashThread) + { + consoleWriter->AppendStr(" (crashed)"); + } + consoleWriter->AppendStr(" ---"); + consoleWriter->EndLine(); +} + +void +CrashReportHelpers::WriteThreadBlockCloserToConsole( + SignalSafeConsoleWriter* consoleWriter, + uint32_t frameCount) +{ + if (consoleWriter == nullptr) + { + return; + } + + if (frameCount == 0) + { + consoleWriter->WriteLine(" (no managed frames)"); + } +} + +void +CrashReportHelpers::FrameSinkCallback( + uint64_t ip, + uint64_t stackPointer, + const char* methodName, + const char* className, + const char* moduleName, + uint32_t nativeOffset, + uint32_t token, + uint32_t ilOffset, + uint32_t moduleTimestamp, + uint32_t moduleSize, + const char* moduleGuid, + void* ctx) +{ + FrameSinks* sinks = reinterpret_cast(ctx); + if (sinks == nullptr) + { + return; + } + + uint32_t frameIndex = sinks->currentThreadFrameCount != nullptr + ? *sinks->currentThreadFrameCount + : 0; + + WriteFrameToJson(sinks->writer, ip, stackPointer, methodName, className, moduleName, + nativeOffset, token, ilOffset, moduleTimestamp, moduleSize, moduleGuid); + + WriteFrameToConsole(sinks->consoleWriter, frameIndex, ip, methodName, className, moduleName, + nativeOffset, token, ilOffset); + + if (sinks->currentThreadFrameCount != nullptr) + { + ++*sinks->currentThreadFrameCount; + } +} + void ThreadEnumerationContext::OnFrame( uint64_t ip, @@ -1001,7 +1219,14 @@ ThreadEnumerationContext::OnFrame( uint32_t moduleSize, const char* moduleGuid) { - CrashReportHelpers::JsonFrameCallback(ip, stackPointer, methodName, className, moduleName, nativeOffset, token, ilOffset, moduleTimestamp, moduleSize, moduleGuid, m_writer); + CrashReportHelpers::FrameSinks sinks = + { + m_writer, + m_consoleWriter, + &m_currentThreadFrameCount, + }; + CrashReportHelpers::FrameSinkCallback(ip, stackPointer, methodName, className, moduleName, + nativeOffset, token, ilOffset, moduleTimestamp, moduleSize, moduleGuid, &sinks); } void @@ -1026,6 +1251,18 @@ ThreadEnumerationContext::FrameCallback( reinterpret_cast(ctx)->OnFrame(ip, stackPointer, methodName, className, moduleName, nativeOffset, token, ilOffset, moduleTimestamp, moduleSize, moduleGuid); } +void +ThreadEnumerationContext::FinishCurrentThreadCompactBlock() +{ + if (m_threadCount == 0) + { + return; + } + + CrashReportHelpers::WriteThreadBlockCloserToConsole(m_consoleWriter, + m_currentThreadFrameCount); +} + void ThreadEnumerationContext::OnThread( uint64_t osThreadId, @@ -1035,6 +1272,8 @@ ThreadEnumerationContext::OnThread( { if (m_threadCount > 0) { + FinishCurrentThreadCompactBlock(); + m_writer->CloseArray(); // stack_frames m_writer->CloseObject(); // thread @@ -1046,6 +1285,7 @@ ThreadEnumerationContext::OnThread( m_sawCrashThread = true; } m_threadCount++; + m_currentThreadFrameCount = 0; m_writer->OpenObject(); m_writer->WriteString("is_managed", "true"); @@ -1068,6 +1308,21 @@ ThreadEnumerationContext::OnThread( { CrashReportHelpers::WriteCrashSiteFrameToJson(m_writer, m_signalContext); } + + if (m_consoleWriter != nullptr) + { + CrashReportHelpers::WriteThreadBlockHeaderToConsole(m_consoleWriter, osThreadId, isCrashThread); + + if (exceptionType != nullptr && exceptionType[0] != '\0') + { + m_consoleWriter->AppendStr(" managed exception: "); + m_consoleWriter->AppendStr(exceptionType); + m_consoleWriter->AppendStr(" (0x"); + m_consoleWriter->AppendHex(static_cast(exceptionHResult)); + m_consoleWriter->AppendChar(')'); + m_consoleWriter->EndLine(); + } + } } void @@ -1087,21 +1342,22 @@ ThreadEnumerationContext::ThreadCallback( void ThreadEnumerationContext::EnumerateThreads( - InProcCrashReportEnumerateThreadsCallback callback, - uint64_t crashingTid) + InProcCrashReportEnumerateThreadsCallback callback) { if (callback == nullptr) { return; } - callback(crashingTid, &ThreadCallback, &FrameCallback, this); + callback(m_crashingTid, &ThreadCallback, &FrameCallback, this); if (m_threadCount == 0) { return; } + FinishCurrentThreadCompactBlock(); + // Close the last thread's stack_frames + thread objects opened by OnThread. m_writer->CloseArray(); // stack_frames m_writer->CloseObject(); // thread @@ -1127,10 +1383,23 @@ InProcCrashReporter::EmitSynthesizedCrashThread( CrashReportHelpers::WriteRegistersToJson(&m_jsonWriter, context); m_jsonWriter.OpenArray("stack_frames"); CrashReportHelpers::WriteCrashSiteFrameToJson(&m_jsonWriter, context); + + CrashReportHelpers::WriteThreadBlockHeaderToConsole(&s_consoleWriter, crashingTid, /*isCrashThread*/ true); + + uint32_t synthesizedFrameCount = 0; if (walkStack && m_walkStackCallback != nullptr) { - m_walkStackCallback(&CrashReportHelpers::JsonFrameCallback, &m_jsonWriter); + CrashReportHelpers::FrameSinks sinks = + { + &m_jsonWriter, + &s_consoleWriter, + &synthesizedFrameCount, + }; + m_walkStackCallback(&CrashReportHelpers::FrameSinkCallback, &sinks); } + CrashReportHelpers::WriteThreadBlockCloserToConsole(&s_consoleWriter, + synthesizedFrameCount); + m_jsonWriter.CloseArray(); // stack_frames m_jsonWriter.CloseObject(); // thread } From ea0570077f7e973df15cba2cc5e83113bd1e3353 Mon Sep 17 00:00:00 2001 From: Mitchell Hwang Date: Tue, 5 May 2026 12:51:33 -0400 Subject: [PATCH 095/109] Deduplicate modules into a fixed-size table and render frames with module-index references Adds ModuleTable, a 64-entry fixed-capacity table keyed by MVID for one crash report. Compact-log frames can refer to modules by short [N] indices, and the footer emits a modules block that maps each index back to the module filename and MVID. If a managed frame's module cannot be stored because the table is full or the GUID is missing, the frame renders the module name inline as (in ) instead of using a lossy placeholder. JSON output is unchanged; module indices are only a compact-log representation detail. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../debug/crashreport/inproccrashreporter.cpp | 110 +++++++++++++++++- .../debug/crashreport/inproccrashreporter.h | 2 +- 2 files changed, 107 insertions(+), 5 deletions(-) diff --git a/src/coreclr/debug/crashreport/inproccrashreporter.cpp b/src/coreclr/debug/crashreport/inproccrashreporter.cpp index 43199996ec9dff..51a330f8651b56 100644 --- a/src/coreclr/debug/crashreport/inproccrashreporter.cpp +++ b/src/coreclr/debug/crashreport/inproccrashreporter.cpp @@ -19,6 +19,7 @@ #include #include #include +#include #include #ifdef __APPLE__ #include @@ -52,7 +53,9 @@ static const char CRASHREPORT_ARCHITECTURE_NAME[] = "arm"; // --- thread 0xTID [(crashed)] --- (per thread; OnThread) // managed exception: (0x) (only if EE provided one) // #NN [M] Class.Method + 0xILOFFSET (token=0xTOKEN) (managed frame; WriteFrameToConsole) +// #NN (in ) Class.Method + 0xILOFFSET (token=0xTOKEN) (overflow form: module didn't fit the table) // #NN [M] 0xIP (module + 0xOFFSET) (native frame; WriteFrameToConsole) +// #NN 0xIP (module + 0xOFFSET) (native frame not in module table) // (no managed frames) (FinishCurrentThreadCompactBlock) // (blank between threads) // modules: (EmitConsoleModulesAndFooter) @@ -89,6 +92,73 @@ static void CacheSysctlString(const char* sysctlName, char* buffer, size_t buffe } #endif // __APPLE__ +// Bounded module name/GUID table that deduplicates each unique module +// observed during a single crash report. Frames in the compact log refer to +// modules by short ``[N]`` indices instead of repeating the (often verbose) +// filename + GUID on every line; the matching ``modules:`` block at the end +// of the report maps each index back to the full data. +// +// Capacity is fixed at MAX_MODULES_IN_TABLE (no heap on the fatal-signal +// path). A managed frame whose module didn't fit (table full, or empty/null GUID) +// renders the module identity inline as ``(in ) `` so the frame stays +// self-describing — overflow is lossless, just less compact for that frame. +// +// Single-instance because CreateReport is one-shot per process (guarded by +// the ``s_generating`` InterlockedCompareExchange in CreateReport). + +static constexpr size_t MAX_MODULES_IN_TABLE = 64; + +class ModuleTable +{ +public: + int GetOrAddIndex(const char* moduleName, const char* moduleGuid) + { + if (moduleName == nullptr || moduleName[0] == '\0' || + moduleGuid == nullptr || moduleGuid[0] == '\0') + { + return -1; + } + + for (size_t i = 0; i < m_count; ++i) + { + if (strncmp(m_entries[i].guid, moduleGuid, MINIPAL_GUID_BUFFER_LEN) == 0) + { + return static_cast(i); + } + } + + if (m_count >= MAX_MODULES_IN_TABLE) + { + return -1; + } + + Entry& entry = m_entries[m_count]; + size_t nameLen = strnlen(moduleName, sizeof(entry.name) - 1); + memcpy(entry.name, moduleName, nameLen); + entry.name[nameLen] = '\0'; + size_t guidLen = strnlen(moduleGuid, sizeof(entry.guid) - 1); + memcpy(entry.guid, moduleGuid, guidLen); + entry.guid[guidLen] = '\0'; + return static_cast(m_count++); + } + + size_t Count() const { return m_count; } + const char* Name(size_t i) const { return m_entries[i].name; } + const char* Guid(size_t i) const { return m_entries[i].guid; } + +private: + struct Entry + { + char name[CRASHREPORT_STRING_BUFFER_SIZE]; + char guid[MINIPAL_GUID_BUFFER_LEN]; + }; + + Entry m_entries[MAX_MODULES_IN_TABLE]; + size_t m_count = 0; +}; + +static ModuleTable s_moduleTable; + class ThreadEnumerationContext { public: @@ -275,6 +345,7 @@ class CrashReportHelpers static void WriteFrameToConsole( SignalSafeConsoleWriter* consoleWriter, uint32_t frameIndex, + int moduleIndex, uint64_t ip, const char* methodName, const char* className, @@ -402,7 +473,7 @@ InProcCrashReporter::CreateReport( EmitJsonFooter(signal); - EmitConsoleFooter(); + EmitConsoleModulesAndFooter(); if (jsonEnabled) { @@ -1081,6 +1152,7 @@ void CrashReportHelpers::WriteFrameToConsole( SignalSafeConsoleWriter* consoleWriter, uint32_t frameIndex, + int moduleIndex, uint64_t ip, const char* methodName, const char* className, @@ -1094,7 +1166,6 @@ CrashReportHelpers::WriteFrameToConsole( return; } - // Frame index always two digits ("#04 ..."); matches Android/AOSP debuggerd. consoleWriter->AppendStr(" #"); if (frameIndex < 10) { @@ -1103,6 +1174,19 @@ CrashReportHelpers::WriteFrameToConsole( consoleWriter->AppendDecimal(static_cast(frameIndex)); consoleWriter->AppendChar(' '); + if (moduleIndex >= 0) + { + consoleWriter->AppendChar('['); + consoleWriter->AppendDecimal(static_cast(moduleIndex)); + consoleWriter->AppendStr("] "); + } + else if (methodName != nullptr && moduleName != nullptr && moduleName[0] != '\0') + { + consoleWriter->AppendStr("(in "); + consoleWriter->AppendStr(GetFilename(moduleName)); + consoleWriter->AppendStr(") "); + } + if (methodName != nullptr) { char fullName[CRASHREPORT_STRING_BUFFER_SIZE]; @@ -1193,10 +1277,12 @@ CrashReportHelpers::FrameSinkCallback( ? *sinks->currentThreadFrameCount : 0; + int moduleIndex = s_moduleTable.GetOrAddIndex(moduleName, moduleGuid); + WriteFrameToJson(sinks->writer, ip, stackPointer, methodName, className, moduleName, nativeOffset, token, ilOffset, moduleTimestamp, moduleSize, moduleGuid); - WriteFrameToConsole(sinks->consoleWriter, frameIndex, ip, methodName, className, moduleName, + WriteFrameToConsole(sinks->consoleWriter, frameIndex, moduleIndex, ip, methodName, className, moduleName, nativeOffset, token, ilOffset); if (sinks->currentThreadFrameCount != nullptr) @@ -1439,8 +1525,24 @@ InProcCrashReporter::EmitConsoleHeader(int signal) } void -InProcCrashReporter::EmitConsoleFooter() +InProcCrashReporter::EmitConsoleModulesAndFooter() { + if (s_moduleTable.Count() != 0) + { + s_consoleWriter.WriteBlank(); + s_consoleWriter.WriteLine("modules:"); + for (size_t i = 0; i < s_moduleTable.Count(); ++i) + { + s_consoleWriter.AppendStr(" ["); + s_consoleWriter.AppendDecimal(static_cast(i)); + s_consoleWriter.AppendStr("] "); + s_consoleWriter.AppendStr(CrashReportHelpers::GetFilename(s_moduleTable.Name(i))); + s_consoleWriter.AppendChar(' '); + s_consoleWriter.AppendStr(s_moduleTable.Guid(i)); + s_consoleWriter.EndLine(); + } + } + s_consoleWriter.WriteSeparator(); } diff --git a/src/coreclr/debug/crashreport/inproccrashreporter.h b/src/coreclr/debug/crashreport/inproccrashreporter.h index c9bedf46e8243c..8b3e0352f581f6 100644 --- a/src/coreclr/debug/crashreport/inproccrashreporter.h +++ b/src/coreclr/debug/crashreport/inproccrashreporter.h @@ -89,7 +89,7 @@ class InProcCrashReporter bool walkStack); void EmitConsoleHeader(int signal); - void EmitConsoleFooter(); + void EmitConsoleModulesAndFooter(); void EmitJsonHeader(); void EmitJsonFooter(int signal); From 86f46592db8a38de959eab4dc139f24f22b26def Mon Sep 17 00:00:00 2001 From: Mitchell Hwang Date: Tue, 5 May 2026 12:54:34 -0400 Subject: [PATCH 096/109] Cap frames per thread in the compact crash report log Adds DOTNET_CrashReportFrameLimitPerThread, parsed as base 10 with default 32, to cap the number of frames written per thread to the compact log. Setting the value to 0 disables the limit. Frames past the cap are still emitted to the JSON report. The compact log skips only the console frame line, tracks how many frames were omitted for the current thread, and emits an "... +N more frames" summary in the thread footer. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../debug/crashreport/inproccrashreporter.cpp | 50 ++++++++++++++++--- .../debug/crashreport/inproccrashreporter.h | 2 + src/coreclr/inc/clrconfigvalues.h | 1 + src/coreclr/vm/crashreportstackwalker.cpp | 1 + 4 files changed, 46 insertions(+), 8 deletions(-) diff --git a/src/coreclr/debug/crashreport/inproccrashreporter.cpp b/src/coreclr/debug/crashreport/inproccrashreporter.cpp index 51a330f8651b56..51304b2a86a505 100644 --- a/src/coreclr/debug/crashreport/inproccrashreporter.cpp +++ b/src/coreclr/debug/crashreport/inproccrashreporter.cpp @@ -56,7 +56,7 @@ static const char CRASHREPORT_ARCHITECTURE_NAME[] = "arm"; // #NN (in ) Class.Method + 0xILOFFSET (token=0xTOKEN) (overflow form: module didn't fit the table) // #NN [M] 0xIP (module + 0xOFFSET) (native frame; WriteFrameToConsole) // #NN 0xIP (module + 0xOFFSET) (native frame not in module table) -// (no managed frames) (FinishCurrentThreadCompactBlock) +// (no managed frames) | ... +N more frames (FinishCurrentThreadCompactBlock) // (blank between threads) // modules: (EmitConsoleModulesAndFooter) // [N] {} (one per ModuleTable entry) @@ -166,6 +166,7 @@ class ThreadEnumerationContext SignalSafeJsonWriter* writer, SignalSafeConsoleWriter* consoleWriter, uint64_t crashingTid, + uint32_t frameLimitPerThread, void* signalContext) : m_writer(writer), m_consoleWriter(consoleWriter), @@ -173,6 +174,8 @@ class ThreadEnumerationContext m_threadCount(0), m_crashingTid(crashingTid), m_currentThreadFrameCount(0), + m_currentThreadDroppedCount(0), + m_frameLimitPerThread(frameLimitPerThread), m_sawCrashThread(false) { } @@ -236,6 +239,8 @@ class ThreadEnumerationContext size_t m_threadCount; uint64_t m_crashingTid; uint32_t m_currentThreadFrameCount; + uint32_t m_currentThreadDroppedCount; + uint32_t m_frameLimitPerThread; bool m_sawCrashThread; }; @@ -271,6 +276,8 @@ class CrashReportHelpers SignalSafeJsonWriter* writer; SignalSafeConsoleWriter* consoleWriter; uint32_t* currentThreadFrameCount; + uint32_t* currentThreadDroppedCount; + uint32_t frameLimitPerThread; }; static void GetVersionString( @@ -361,7 +368,8 @@ class CrashReportHelpers static void WriteThreadBlockCloserToConsole( SignalSafeConsoleWriter* consoleWriter, - uint32_t frameCount); + uint32_t frameCount, + uint32_t droppedCount); static void FrameSinkCallback( uint64_t ip, @@ -456,7 +464,7 @@ InProcCrashReporter::CreateReport( if (m_enumerateThreadsCallback != nullptr) { uint64_t crashingTid = static_cast(minipal_get_current_thread_id()); - ThreadEnumerationContext threadContext(&m_jsonWriter, &s_consoleWriter, crashingTid, context); + ThreadEnumerationContext threadContext(&m_jsonWriter, &s_consoleWriter, crashingTid, m_frameLimitPerThread, context); threadContext.EnumerateThreads(m_enumerateThreadsCallback); @@ -506,6 +514,7 @@ InProcCrashReporter::Initialize( m_isManagedThreadCallback = settings.isManagedThreadCallback; m_walkStackCallback = settings.walkStackCallback; m_enumerateThreadsCallback = settings.enumerateThreadsCallback; + m_frameLimitPerThread = settings.frameLimitPerThread; CrashReportHelpers::CopyString(m_reportPath, sizeof(m_reportPath), settings.reportPath); m_processName[0] = '\0'; @@ -1239,7 +1248,8 @@ CrashReportHelpers::WriteThreadBlockHeaderToConsole( void CrashReportHelpers::WriteThreadBlockCloserToConsole( SignalSafeConsoleWriter* consoleWriter, - uint32_t frameCount) + uint32_t frameCount, + uint32_t droppedCount) { if (consoleWriter == nullptr) { @@ -1250,6 +1260,13 @@ CrashReportHelpers::WriteThreadBlockCloserToConsole( { consoleWriter->WriteLine(" (no managed frames)"); } + else if (droppedCount != 0) + { + consoleWriter->AppendStr(" ... +"); + consoleWriter->AppendDecimal(static_cast(droppedCount)); + consoleWriter->AppendStr(" more frames"); + consoleWriter->EndLine(); + } } void @@ -1279,11 +1296,22 @@ CrashReportHelpers::FrameSinkCallback( int moduleIndex = s_moduleTable.GetOrAddIndex(moduleName, moduleGuid); + // Always feed the JSON sink: the file output is the authoritative, + // post-mortem data store and the cap is a compact-log triage knob. WriteFrameToJson(sinks->writer, ip, stackPointer, methodName, className, moduleName, nativeOffset, token, ilOffset, moduleTimestamp, moduleSize, moduleGuid); - WriteFrameToConsole(sinks->consoleWriter, frameIndex, moduleIndex, ip, methodName, className, moduleName, - nativeOffset, token, ilOffset); + bool consoleCapped = sinks->frameLimitPerThread != 0 && + frameIndex >= sinks->frameLimitPerThread; + if (!consoleCapped) + { + WriteFrameToConsole(sinks->consoleWriter, frameIndex, moduleIndex, ip, methodName, className, moduleName, + nativeOffset, token, ilOffset); + } + else if (sinks->currentThreadDroppedCount != nullptr) + { + ++*sinks->currentThreadDroppedCount; + } if (sinks->currentThreadFrameCount != nullptr) { @@ -1310,6 +1338,8 @@ ThreadEnumerationContext::OnFrame( m_writer, m_consoleWriter, &m_currentThreadFrameCount, + &m_currentThreadDroppedCount, + m_frameLimitPerThread, }; CrashReportHelpers::FrameSinkCallback(ip, stackPointer, methodName, className, moduleName, nativeOffset, token, ilOffset, moduleTimestamp, moduleSize, moduleGuid, &sinks); @@ -1346,7 +1376,7 @@ ThreadEnumerationContext::FinishCurrentThreadCompactBlock() } CrashReportHelpers::WriteThreadBlockCloserToConsole(m_consoleWriter, - m_currentThreadFrameCount); + m_currentThreadFrameCount, m_currentThreadDroppedCount); } void @@ -1372,6 +1402,7 @@ ThreadEnumerationContext::OnThread( } m_threadCount++; m_currentThreadFrameCount = 0; + m_currentThreadDroppedCount = 0; m_writer->OpenObject(); m_writer->WriteString("is_managed", "true"); @@ -1473,6 +1504,7 @@ InProcCrashReporter::EmitSynthesizedCrashThread( CrashReportHelpers::WriteThreadBlockHeaderToConsole(&s_consoleWriter, crashingTid, /*isCrashThread*/ true); uint32_t synthesizedFrameCount = 0; + uint32_t synthesizedDroppedCount = 0; if (walkStack && m_walkStackCallback != nullptr) { CrashReportHelpers::FrameSinks sinks = @@ -1480,11 +1512,13 @@ InProcCrashReporter::EmitSynthesizedCrashThread( &m_jsonWriter, &s_consoleWriter, &synthesizedFrameCount, + &synthesizedDroppedCount, + m_frameLimitPerThread, }; m_walkStackCallback(&CrashReportHelpers::FrameSinkCallback, &sinks); } CrashReportHelpers::WriteThreadBlockCloserToConsole(&s_consoleWriter, - synthesizedFrameCount); + synthesizedFrameCount, synthesizedDroppedCount); m_jsonWriter.CloseArray(); // stack_frames m_jsonWriter.CloseObject(); // thread diff --git a/src/coreclr/debug/crashreport/inproccrashreporter.h b/src/coreclr/debug/crashreport/inproccrashreporter.h index 8b3e0352f581f6..e395a581856ecf 100644 --- a/src/coreclr/debug/crashreport/inproccrashreporter.h +++ b/src/coreclr/debug/crashreport/inproccrashreporter.h @@ -63,6 +63,7 @@ struct InProcCrashReporterSettings InProcCrashReportIsManagedThreadCallback isManagedThreadCallback; InProcCrashReportWalkStackCallback walkStackCallback; InProcCrashReportEnumerateThreadsCallback enumerateThreadsCallback; + uint32_t frameLimitPerThread; }; class InProcCrashReporter @@ -105,6 +106,7 @@ class InProcCrashReporter char m_osVersion[CRASHREPORT_STRING_BUFFER_SIZE] = {}; char m_systemModel[CRASHREPORT_STRING_BUFFER_SIZE] = {}; #endif + uint32_t m_frameLimitPerThread = 0; }; // Free-function entry point used by the runtime to wire the in-proc crash diff --git a/src/coreclr/inc/clrconfigvalues.h b/src/coreclr/inc/clrconfigvalues.h index c9dd7c485c99c0..d37be482afd0c1 100644 --- a/src/coreclr/inc/clrconfigvalues.h +++ b/src/coreclr/inc/clrconfigvalues.h @@ -578,6 +578,7 @@ RETAIL_CONFIG_STRING_INFO(INTERNAL_DbgMiniDumpName, W("DbgMiniDumpName"), "Crash RETAIL_CONFIG_DWORD_INFO(INTERNAL_DbgMiniDumpType, W("DbgMiniDumpType"), 0, "Crash dump type: 1 normal, 2 withheap, 3 triage, 4 full") RETAIL_CONFIG_DWORD_INFO(INTERNAL_CreateDumpDiagnostics, W("CreateDumpDiagnostics"), 0, "Enable crash dump generation diagnostic logging") RETAIL_CONFIG_DWORD_INFO(INTERNAL_CrashReportBeforeSignalChaining, W("CrashReportBeforeSignalChaining"), 0, "Enable crash report generation before chaining to previous signal handler") +RETAIL_CONFIG_DWORD_INFO_EX(INTERNAL_CrashReportFrameLimitPerThread, W("CrashReportFrameLimitPerThread"), 32, "Maximum number of managed stack frames per thread to emit in the in-proc crash report's compact log; 0 disables the limit; remaining frames are summarized as '... +N more frames'", CLRConfig::LookupOptions::ParseIntegerAsBase10) /// /// R2R diff --git a/src/coreclr/vm/crashreportstackwalker.cpp b/src/coreclr/vm/crashreportstackwalker.cpp index 02c3bd59de2f86..0509cc6e836c85 100644 --- a/src/coreclr/vm/crashreportstackwalker.cpp +++ b/src/coreclr/vm/crashreportstackwalker.cpp @@ -433,6 +433,7 @@ CrashReportConfigure() settings.isManagedThreadCallback = CrashReportIsCurrentThreadManaged; settings.walkStackCallback = CrashReportWalkStack; settings.enumerateThreadsCallback = CrashReportEnumerateThreads; + settings.frameLimitPerThread = CLRConfig::GetConfigValue(CLRConfig::INTERNAL_CrashReportFrameLimitPerThread); // Initialize the reporter and register the PAL signal-path callback last // so PAL only observes the reporter after all VM callbacks are wired in. From fab652b7d777065f56e88b0f9b304f5e2e264fe8 Mon Sep 17 00:00:00 2001 From: Mitchell Hwang Date: Wed, 13 May 2026 15:57:45 -0400 Subject: [PATCH 097/109] Include stack overflow traces in in-proc crash reports Preserve the fatal stack-overflow reason across the PAL abort path so the in-proc crash reporter does not try to run the generic managed thread walk on the constrained stack-overflow handler path. Reuse the runtime stack-overflow helper thread's compressed managed stack trace and render it directly in the in-proc crash report JSON and compact log output. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../debug/crashreport/inproccrashreporter.cpp | 308 ++++++++++++++++-- .../debug/crashreport/inproccrashreporter.h | 22 ++ src/coreclr/vm/eepolicy.cpp | 44 ++- 3 files changed, 353 insertions(+), 21 deletions(-) diff --git a/src/coreclr/debug/crashreport/inproccrashreporter.cpp b/src/coreclr/debug/crashreport/inproccrashreporter.cpp index 51304b2a86a505..cef80fba450ab1 100644 --- a/src/coreclr/debug/crashreport/inproccrashreporter.cpp +++ b/src/coreclr/debug/crashreport/inproccrashreporter.cpp @@ -29,6 +29,10 @@ extern "C" const char* PROCGetSignalNameAscii(int signal); static const char CRASHREPORT_PROTOCOL_VERSION[] = "1.0.0"; +static constexpr uint32_t CRASHREPORT_COR_E_STACKOVERFLOW = 0x800703E9; +static const char CRASHREPORT_STACK_OVERFLOW_EXCEPTION_TYPE[] = "System.StackOverflowException"; +static const char CRASHREPORT_STACK_OVERFLOW_TRACE_UNAVAILABLE_REASON[] = "stack_overflow_trace_unavailable"; +static constexpr uint32_t CRASHREPORT_STACK_OVERFLOW_MAX_TRACE_FRAMES = 128; #if defined(__x86_64__) static const char CRASHREPORT_ARCHITECTURE_NAME[] = "amd64"; @@ -63,6 +67,26 @@ static const char CRASHREPORT_ARCHITECTURE_NAME[] = "arm"; // *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** (closing separator) static SignalSafeConsoleWriter s_consoleWriter; +static volatile LONG s_crashKind = static_cast(InProcCrashReportCrashKind::Unknown); + +struct StackOverflowTraceFrame +{ + char methodName[CRASHREPORT_STRING_BUFFER_SIZE]; + uint32_t repeatCount; + uint32_t repeatSequenceLength; +}; + +struct StackOverflowTraceSnapshot +{ + uint64_t crashingTid; + uint32_t totalFrameCount; + uint32_t frameCount; + uint32_t truncatedFrameCount; + StackOverflowTraceFrame frames[CRASHREPORT_STACK_OVERFLOW_MAX_TRACE_FRAMES]; + volatile LONG available; +}; + +static StackOverflowTraceSnapshot s_stackOverflowTrace; // Include the .NET version string instead of linking because it is "static". #if __has_include("_version.c") @@ -71,6 +95,28 @@ static SignalSafeConsoleWriter s_consoleWriter; static char sccsid[] = "@(#)Version N/A"; #endif +static void CopyStringToBuffer(char* buffer, size_t bufferSize, const char* value) +{ + if (buffer == nullptr || bufferSize == 0) + { + return; + } + + if (value == nullptr) + { + buffer[0] = '\0'; + return; + } + + size_t toCopy = strnlen(value, bufferSize - 1); + if (toCopy != 0) + { + memcpy(buffer, value, toCopy); + } + + buffer[toCopy] = '\0'; +} + #ifdef __APPLE__ // Query a sysctl by name into a caller-supplied buffer. Called from Initialize, NOT from the // signal handler -- sysctl/sysctlbyname is not on POSIX's async-signal-safe list, so the @@ -361,6 +407,16 @@ class CrashReportHelpers uint32_t token, uint32_t ilOffset); + static void WriteStackOverflowFrameToJson( + SignalSafeJsonWriter* writer, + const StackOverflowTraceFrame& frame, + bool includeRepeatMetadata); + + static void WriteStackOverflowFrameToConsole( + SignalSafeConsoleWriter* consoleWriter, + uint32_t frameIndex, + const StackOverflowTraceFrame& frame); + static void WriteThreadBlockHeaderToConsole( SignalSafeConsoleWriter* consoleWriter, uint64_t osThreadId, @@ -446,6 +502,9 @@ InProcCrashReporter::CreateReport( (void)siginfo; + InProcCrashReportCrashKind crashKind = static_cast( + InterlockedExchange(&s_crashKind, static_cast(InProcCrashReportCrashKind::Unknown))); + EmitConsoleHeader(signal); CrashReportOutputContext outputContext(fd); @@ -461,7 +520,11 @@ InProcCrashReporter::CreateReport( EmitJsonHeader(); m_jsonWriter.OpenArray("threads"); - if (m_enumerateThreadsCallback != nullptr) + if (crashKind == InProcCrashReportCrashKind::StackOverflow) + { + EmitStackOverflowCrashThread(); + } + else if (m_enumerateThreadsCallback != nullptr) { uint64_t crashingTid = static_cast(minipal_get_current_thread_id()); ThreadEnumerationContext threadContext(&m_jsonWriter, &s_consoleWriter, crashingTid, m_frameLimitPerThread, context); @@ -584,6 +647,49 @@ InProcCrashReportInitialize(const InProcCrashReporterSettings& settings) PAL_SetInProcCrashReportCallback(&InProcCrashReportSignalDispatcher); } +void +InProcCrashReportSetCrashKind(InProcCrashReportCrashKind crashKind) +{ + InterlockedExchange(&s_crashKind, static_cast(crashKind)); +} + +void +InProcCrashReportBeginStackOverflowTrace( + uint64_t crashingTid, + uint32_t totalFrameCount) +{ + InterlockedExchange(&s_stackOverflowTrace.available, 0); + s_stackOverflowTrace.crashingTid = crashingTid; + s_stackOverflowTrace.totalFrameCount = totalFrameCount; + s_stackOverflowTrace.frameCount = 0; + s_stackOverflowTrace.truncatedFrameCount = 0; +} + +void +InProcCrashReportAddStackOverflowTraceFrame( + const char* methodName, + uint32_t repeatCount, + uint32_t repeatSequenceLength) +{ + if (s_stackOverflowTrace.frameCount >= CRASHREPORT_STACK_OVERFLOW_MAX_TRACE_FRAMES) + { + ++s_stackOverflowTrace.truncatedFrameCount; + return; + } + + StackOverflowTraceFrame& frame = s_stackOverflowTrace.frames[s_stackOverflowTrace.frameCount++]; + CopyStringToBuffer(frame.methodName, sizeof(frame.methodName), methodName); + frame.repeatCount = repeatCount; + frame.repeatSequenceLength = repeatSequenceLength; +} + +void +InProcCrashReportCompleteStackOverflowTrace(uint32_t truncatedFrameCount) +{ + s_stackOverflowTrace.truncatedFrameCount += truncatedFrameCount; + InterlockedExchange(&s_stackOverflowTrace.available, 1); +} + bool CrashReportHelpers::WriteToFile( int fd, @@ -1050,24 +1156,7 @@ CrashReportHelpers::CopyString( size_t bufferSize, const char* value) { - if (buffer == nullptr || bufferSize == 0) - { - return; - } - - if (value == nullptr) - { - buffer[0] = '\0'; - return; - } - - size_t toCopy = strnlen(value, bufferSize - 1); - if (toCopy != 0) - { - memcpy(buffer, value, toCopy); - } - - buffer[toCopy] = '\0'; + CopyStringToBuffer(buffer, bufferSize, value); } void @@ -1223,6 +1312,50 @@ CrashReportHelpers::WriteFrameToConsole( consoleWriter->EndLine(); } +void +CrashReportHelpers::WriteStackOverflowFrameToJson( + SignalSafeJsonWriter* writer, + const StackOverflowTraceFrame& frame, + bool includeRepeatMetadata) +{ + if (writer == nullptr) + { + return; + } + + writer->OpenObject(); + writer->WriteString("method_name", frame.methodName); + writer->WriteString("is_managed", "true"); + if (includeRepeatMetadata) + { + writer->WriteDecimalAsString("stack_overflow_repeat_count", frame.repeatCount); + writer->WriteDecimalAsString("stack_overflow_repeat_sequence_length", frame.repeatSequenceLength); + } + writer->CloseObject(); // frame +} + +void +CrashReportHelpers::WriteStackOverflowFrameToConsole( + SignalSafeConsoleWriter* consoleWriter, + uint32_t frameIndex, + const StackOverflowTraceFrame& frame) +{ + if (consoleWriter == nullptr) + { + return; + } + + consoleWriter->AppendStr(" #"); + if (frameIndex < 10) + { + consoleWriter->AppendChar('0'); + } + consoleWriter->AppendDecimal(static_cast(frameIndex)); + consoleWriter->AppendChar(' '); + consoleWriter->AppendStr(frame.methodName); + consoleWriter->EndLine(); +} + void CrashReportHelpers::WriteThreadBlockHeaderToConsole( SignalSafeConsoleWriter* consoleWriter, @@ -1524,6 +1657,143 @@ InProcCrashReporter::EmitSynthesizedCrashThread( m_jsonWriter.CloseObject(); // thread } +void +InProcCrashReporter::EmitStackOverflowCrashThread() +{ + bool stackOverflowTraceAvailable = s_stackOverflowTrace.available != 0; + uint64_t crashingTid = stackOverflowTraceAvailable && s_stackOverflowTrace.crashingTid != 0 + ? s_stackOverflowTrace.crashingTid + : static_cast(minipal_get_current_thread_id()); + + m_jsonWriter.OpenObject(); + m_jsonWriter.WriteString("is_managed", "true"); + m_jsonWriter.WriteString("crashed", "true"); + m_jsonWriter.WriteHexAsString("native_thread_id", crashingTid); + m_jsonWriter.WriteString("managed_exception_type", CRASHREPORT_STACK_OVERFLOW_EXCEPTION_TYPE); + m_jsonWriter.WriteHexAsString("managed_exception_hresult", CRASHREPORT_COR_E_STACKOVERFLOW); + if (stackOverflowTraceAvailable) + { + m_jsonWriter.WriteDecimalAsString("stack_overflow_total_frames", s_stackOverflowTrace.totalFrameCount); + if (s_stackOverflowTrace.truncatedFrameCount != 0) + { + m_jsonWriter.WriteDecimalAsString("stack_overflow_trace_truncated_frames", s_stackOverflowTrace.truncatedFrameCount); + } + } + else + { + m_jsonWriter.WriteString("stack_frames_unavailable_reason", CRASHREPORT_STACK_OVERFLOW_TRACE_UNAVAILABLE_REASON); + } + + m_jsonWriter.OpenArray("stack_frames"); + if (stackOverflowTraceAvailable) + { + for (uint32_t i = 0; i < s_stackOverflowTrace.frameCount;) + { + StackOverflowTraceFrame& frame = s_stackOverflowTrace.frames[i]; + uint32_t repeatSequenceLength = frame.repeatSequenceLength; + bool isRepeatSequence = frame.repeatCount > 1 && repeatSequenceLength != 0; + CrashReportHelpers::WriteStackOverflowFrameToJson( + &m_jsonWriter, frame, isRepeatSequence); + ++i; + + if (!isRepeatSequence) + { + continue; + } + + uint32_t sequenceEnd = i + repeatSequenceLength - 1; + if (sequenceEnd > s_stackOverflowTrace.frameCount) + { + sequenceEnd = s_stackOverflowTrace.frameCount; + } + + for (; i < sequenceEnd; ++i) + { + CrashReportHelpers::WriteStackOverflowFrameToJson( + &m_jsonWriter, s_stackOverflowTrace.frames[i], false); + } + } + } + m_jsonWriter.CloseArray(); // stack_frames + m_jsonWriter.CloseObject(); // thread + + CrashReportHelpers::WriteThreadBlockHeaderToConsole(&s_consoleWriter, crashingTid, /*isCrashThread*/ true); + s_consoleWriter.AppendStr(" managed exception: "); + s_consoleWriter.AppendStr(CRASHREPORT_STACK_OVERFLOW_EXCEPTION_TYPE); + s_consoleWriter.AppendStr(" (0x"); + s_consoleWriter.AppendHex(static_cast(CRASHREPORT_COR_E_STACKOVERFLOW)); + s_consoleWriter.AppendChar(')'); + s_consoleWriter.EndLine(); + + if (!stackOverflowTraceAvailable) + { + s_consoleWriter.WriteLine(" stack overflow trace unavailable"); + CrashReportHelpers::WriteThreadBlockCloserToConsole(&s_consoleWriter, 0, 0); + return; + } + + s_consoleWriter.AppendStr(" stack overflow frames: "); + s_consoleWriter.AppendDecimal(static_cast(s_stackOverflowTrace.totalFrameCount)); + s_consoleWriter.EndLine(); + + uint32_t consoleFrameCount = 0; + uint32_t consoleDroppedCount = s_stackOverflowTrace.truncatedFrameCount; + for (uint32_t i = 0; i < s_stackOverflowTrace.frameCount;) + { + StackOverflowTraceFrame& frame = s_stackOverflowTrace.frames[i]; + uint32_t repeatSequenceLength = frame.repeatSequenceLength; + if (frame.repeatCount > 1 && repeatSequenceLength != 0) + { + uint32_t sequenceEnd = i + repeatSequenceLength; + if (sequenceEnd > s_stackOverflowTrace.frameCount) + { + sequenceEnd = s_stackOverflowTrace.frameCount; + } + + if (m_frameLimitPerThread != 0 && consoleFrameCount >= m_frameLimitPerThread) + { + consoleDroppedCount += sequenceEnd - i; + i = sequenceEnd; + continue; + } + + s_consoleWriter.AppendStr(" repeated "); + s_consoleWriter.AppendDecimal(static_cast(frame.repeatCount)); + s_consoleWriter.AppendStr(" times:"); + s_consoleWriter.EndLine(); + + for (; i < sequenceEnd; ++i) + { + if (m_frameLimitPerThread != 0 && consoleFrameCount >= m_frameLimitPerThread) + { + ++consoleDroppedCount; + continue; + } + + CrashReportHelpers::WriteStackOverflowFrameToConsole( + &s_consoleWriter, consoleFrameCount, s_stackOverflowTrace.frames[i]); + ++consoleFrameCount; + } + + continue; + } + + if (m_frameLimitPerThread != 0 && consoleFrameCount >= m_frameLimitPerThread) + { + ++consoleDroppedCount; + } + else + { + CrashReportHelpers::WriteStackOverflowFrameToConsole(&s_consoleWriter, consoleFrameCount, frame); + ++consoleFrameCount; + } + ++i; + } + + CrashReportHelpers::WriteThreadBlockCloserToConsole(&s_consoleWriter, + consoleFrameCount, consoleDroppedCount); +} + // --- InProcCrashReporter: console header and footer ------------------------ void diff --git a/src/coreclr/debug/crashreport/inproccrashreporter.h b/src/coreclr/debug/crashreport/inproccrashreporter.h index e395a581856ecf..9050ca7578f118 100644 --- a/src/coreclr/debug/crashreport/inproccrashreporter.h +++ b/src/coreclr/debug/crashreport/inproccrashreporter.h @@ -24,6 +24,12 @@ static constexpr size_t CRASHREPORT_PATH_BUFFER_SIZE = 1024; static constexpr size_t CRASHREPORT_STRING_BUFFER_SIZE = 256; static constexpr size_t CRASHREPORT_NUMBER_BUFFER_SIZE = 32; +enum class InProcCrashReportCrashKind : uint32_t +{ + Unknown = 0, + StackOverflow = 1, +}; + using InProcCrashReportIsManagedThreadCallback = bool (*)(); using InProcCrashReportFrameCallback = void (*)( @@ -89,6 +95,8 @@ class InProcCrashReporter void* context, bool walkStack); + void EmitStackOverflowCrashThread(); + void EmitConsoleHeader(int signal); void EmitConsoleModulesAndFooter(); @@ -115,3 +123,17 @@ class InProcCrashReporter // PAL_SetInProcCrashReportCallback. PAL has no direct dependency on the // reporter; the only coupling is through this registered callback. void InProcCrashReportInitialize(const InProcCrashReporterSettings& settings); + +// Records crash kind hints from VM fatal paths that later terminate through PAL +// as a generic signal (for example stack overflow -> SIGABRT). +void InProcCrashReportSetCrashKind(InProcCrashReportCrashKind crashKind); + +// Captures the compressed stack-overflow trace built by the runtime SO helper +// thread so the later in-proc crash reporter can include the same managed stack +// without trying to walk from the exhausted crashing stack. +void InProcCrashReportBeginStackOverflowTrace(uint64_t crashingTid, uint32_t totalFrameCount); +void InProcCrashReportAddStackOverflowTraceFrame( + const char* methodName, + uint32_t repeatCount, + uint32_t repeatSequenceLength); +void InProcCrashReportCompleteStackOverflowTrace(uint32_t truncatedFrameCount); diff --git a/src/coreclr/vm/eepolicy.cpp b/src/coreclr/vm/eepolicy.cpp index 1462aeb827f681..19b23bf3c9a927 100644 --- a/src/coreclr/vm/eepolicy.cpp +++ b/src/coreclr/vm/eepolicy.cpp @@ -16,6 +16,10 @@ #include "typestring.h" +#ifdef FEATURE_INPROC_CRASHREPORT +#include "inproccrashreporter.h" +#endif + #ifndef TARGET_UNIX #include "dwreport.h" #endif // !TARGET_UNIX @@ -210,6 +214,20 @@ class CallStackLogger PrintToStdErrW(str.GetUnicode()); } +#ifdef FEATURE_INPROC_CRASHREPORT + void CaptureFrameForCrashReport(int index, uint32_t repeatCount, uint32_t repeatSequenceLength) + { + WRAPPER_NO_CONTRACT; + + SString str; + + MethodDesc* pMD = m_frames[index]; + TypeString::AppendMethodInternal(str, pMD, TypeString::FormatNamespace|TypeString::FormatFullInst|TypeString::FormatSignature); + + InProcCrashReportAddStackOverflowTraceFrame(str.GetUTF8(), repeatCount, repeatSequenceLength); + } +#endif // FEATURE_INPROC_CRASHREPORT + public: CallStackLogger(PEXCEPTION_POINTERS pExceptionInfo) @@ -228,7 +246,7 @@ class CallStackLogger return logger->LogCallstackForLogCallbackWorker(pCF); } - void PrintStackTrace(const WCHAR* pWordAt) + void PrintStackTrace(const WCHAR* pWordAt, uint64_t crashingTid) { WRAPPER_NO_CONTRACT; @@ -302,8 +320,15 @@ class CallStackLogger largestCommonLength = 0; } +#ifdef FEATURE_INPROC_CRASHREPORT + InProcCrashReportBeginStackOverflowTrace(crashingTid, static_cast(m_frames.Count())); +#endif // FEATURE_INPROC_CRASHREPORT + for (int i = 0; i < largestCommonStartOffset; i++) { +#ifdef FEATURE_INPROC_CRASHREPORT + CaptureFrameForCrashReport(i, 0, 0); +#endif // FEATURE_INPROC_CRASHREPORT PrintFrame(i, pWordAt); } @@ -317,6 +342,11 @@ class CallStackLogger PrintToStdErrA("--------------------------------\n"); for (int i = largestCommonStartOffset; i < largestCommonStartOffset + largestCommonLength; i++) { +#ifdef FEATURE_INPROC_CRASHREPORT + CaptureFrameForCrashReport(i, + static_cast(largestCommonRepeat), + static_cast(largestCommonLength)); +#endif // FEATURE_INPROC_CRASHREPORT PrintFrame(i, pWordAt); } PrintToStdErrA("--------------------------------\n"); @@ -324,8 +354,15 @@ class CallStackLogger for (int i = largestCommonLength * largestCommonRepeat + largestCommonStartOffset; i < m_frames.Count(); i++) { +#ifdef FEATURE_INPROC_CRASHREPORT + CaptureFrameForCrashReport(i, 0, 0); +#endif // FEATURE_INPROC_CRASHREPORT PrintFrame(i, pWordAt); } + +#ifdef FEATURE_INPROC_CRASHREPORT + InProcCrashReportCompleteStackOverflowTrace(0); +#endif // FEATURE_INPROC_CRASHREPORT } }; @@ -365,7 +402,7 @@ inline void LogCallstackForLogWorker(Thread* pThread, PEXCEPTION_POINTERS pExcep pThread->StackWalkFrames(&CallStackLogger::LogCallstackForLogCallback, &logger, QUICKUNWIND | FUNCTIONSONLY | ALLOW_ASYNC_STACK_WALK); - logger.PrintStackTrace(WordAt.GetUnicode()); + logger.PrintStackTrace(WordAt.GetUnicode(), static_cast(pThread->GetOSThreadId())); #ifdef _DEBUG if (g_LogStackOverflowExit) PrintToStdErrA("@Exiting stack trace printing thread.\n"); @@ -819,6 +856,9 @@ void DECLSPEC_NORETURN EEPolicy::HandleFatalStackOverflow(EXCEPTION_POINTERS *pE #ifdef _DEBUG if (g_LogStackOverflowExit) PrintToStdErrA("@Terminating the process.\n"); +#endif +#ifdef FEATURE_INPROC_CRASHREPORT + InProcCrashReportSetCrashKind(InProcCrashReportCrashKind::StackOverflow); #endif CrashDumpAndTerminateProcess(COR_E_STACKOVERFLOW); UNREACHABLE(); From 03683bd8277abac9ff746bd704fe1b33fc1366a4 Mon Sep 17 00:00:00 2001 From: Mitchell Hwang Date: Wed, 13 May 2026 16:00:38 -0400 Subject: [PATCH 098/109] Preallocate in-proc crash report scratch buffers Move reporter-owned temporary buffers and VM callback scratch out of crash-time stack locals so fatal signal paths do not depend on large stack allocations for report paths, method names, module IDs, and thread enumeration state. Keep the existing one-report-at-a-time guard as the synchronization boundary for the reusable scratch storage. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../debug/crashreport/inproccrashreporter.cpp | 198 +++++++++++++----- .../debug/crashreport/inproccrashreporter.h | 5 + src/coreclr/vm/crashreportstackwalker.cpp | 38 ++-- 3 files changed, 176 insertions(+), 65 deletions(-) diff --git a/src/coreclr/debug/crashreport/inproccrashreporter.cpp b/src/coreclr/debug/crashreport/inproccrashreporter.cpp index cef80fba450ab1..22b5801ac1b940 100644 --- a/src/coreclr/debug/crashreport/inproccrashreporter.cpp +++ b/src/coreclr/debug/crashreport/inproccrashreporter.cpp @@ -95,6 +95,9 @@ static StackOverflowTraceSnapshot s_stackOverflowTrace; static char sccsid[] = "@(#)Version N/A"; #endif +static char s_versionScratch[sizeof(sccsid)]; +static char s_jsonFrameCallbackMethodNameScratch[CRASHREPORT_STRING_BUFFER_SIZE]; + static void CopyStringToBuffer(char* buffer, size_t bufferSize, const char* value) { if (buffer == nullptr || bufferSize == 0) @@ -208,22 +211,19 @@ static ModuleTable s_moduleTable; class ThreadEnumerationContext { public: + ThreadEnumerationContext() + { + Init(nullptr, nullptr, 0, 0, nullptr); + } + ThreadEnumerationContext( SignalSafeJsonWriter* writer, SignalSafeConsoleWriter* consoleWriter, uint64_t crashingTid, uint32_t frameLimitPerThread, void* signalContext) - : m_writer(writer), - m_consoleWriter(consoleWriter), - m_signalContext(signalContext), - m_threadCount(0), - m_crashingTid(crashingTid), - m_currentThreadFrameCount(0), - m_currentThreadDroppedCount(0), - m_frameLimitPerThread(frameLimitPerThread), - m_sawCrashThread(false) { + Init(writer, consoleWriter, crashingTid, frameLimitPerThread, signalContext); } ThreadEnumerationContext(const ThreadEnumerationContext&) = delete; @@ -234,6 +234,25 @@ class ThreadEnumerationContext SignalSafeJsonWriter* Writer() const { return m_writer; } SignalSafeConsoleWriter* ConsoleWriter() const { return m_consoleWriter; } + void Init( + SignalSafeJsonWriter* writer, + SignalSafeConsoleWriter* consoleWriter, + uint64_t crashingTid, + uint32_t frameLimitPerThread, + void* signalContext) + { + m_writer = writer; + m_consoleWriter = consoleWriter; + m_signalContext = signalContext; + m_threadCount = 0; + m_crashingTid = crashingTid; + m_currentThreadFrameCount = 0; + m_currentThreadDroppedCount = 0; + m_frameLimitPerThread = frameLimitPerThread; + m_sawCrashThread = false; + m_methodNameScratch[0] = '\0'; + } + void EnumerateThreads(InProcCrashReportEnumerateThreadsCallback callback); static void ThreadCallback( @@ -288,23 +307,37 @@ class ThreadEnumerationContext uint32_t m_currentThreadDroppedCount; uint32_t m_frameLimitPerThread; bool m_sawCrashThread; + char m_methodNameScratch[CRASHREPORT_STRING_BUFFER_SIZE]; }; +static ThreadEnumerationContext s_threadContext; + class CrashReportOutputContext { public: - explicit CrashReportOutputContext(int fd) - : m_fd(fd), + CrashReportOutputContext() + : m_fd(-1), m_writeFailed(false) { } + explicit CrashReportOutputContext(int fd) + { + Init(fd); + } + CrashReportOutputContext(const CrashReportOutputContext&) = delete; CrashReportOutputContext& operator=(const CrashReportOutputContext&) = delete; int Fd() const { return m_fd; } bool WriteFailed() const { return m_writeFailed; } + void Init(int fd) + { + m_fd = fd; + m_writeFailed = false; + } + static bool ChunkCallback(const char* buffer, size_t len, void* ctx); private: @@ -314,6 +347,8 @@ class CrashReportOutputContext bool m_writeFailed; }; +static CrashReportOutputContext s_outputContext; + class CrashReportHelpers { public: @@ -324,6 +359,8 @@ class CrashReportHelpers uint32_t* currentThreadFrameCount; uint32_t* currentThreadDroppedCount; uint32_t frameLimitPerThread; + char* methodNameBuffer; + size_t methodNameBufferSize; }; static void GetVersionString( @@ -383,6 +420,8 @@ class CrashReportHelpers static void WriteFrameToJson( SignalSafeJsonWriter* writer, + char* methodNameBuffer, + size_t methodNameBufferSize, uint64_t ip, uint64_t stackPointer, const char* methodName, @@ -397,6 +436,8 @@ class CrashReportHelpers static void WriteFrameToConsole( SignalSafeConsoleWriter* consoleWriter, + char* methodNameBuffer, + size_t methodNameBufferSize, uint32_t frameIndex, int moduleIndex, uint64_t ip, @@ -455,6 +496,10 @@ class CrashReportHelpers static bool BuildReportPath( char* buffer, size_t bufferSize, + char* expandedBuffer, + size_t expandedBufferSize, + char* numberBuffer, + size_t numberBufferSize, const char* dumpPath, const char* processName, const char* hostName); @@ -462,6 +507,8 @@ class CrashReportHelpers static size_t ExpandDumpTemplate( char* buffer, size_t bufferSize, + char* numberBuffer, + size_t numberBufferSize, const char* pattern, const char* processName, const char* hostName); @@ -479,8 +526,7 @@ InProcCrashReporter::CreateReport( return; } - char reportPath[CRASHREPORT_PATH_BUFFER_SIZE]; - reportPath[0] = '\0'; + m_reportFilePathScratch[0] = '\0'; // The JSON file sink is only enabled when DbgMiniDumpName supplied a // template AND the template expanded to a valid path. Otherwise the @@ -488,12 +534,21 @@ InProcCrashReporter::CreateReport( // executes (so it can keep its bookkeeping consistent) but writes go // to a no-op DiscardOutputCallback instead of an open fd. bool jsonEnabled = m_reportPath[0] != '\0' && - CrashReportHelpers::BuildReportPath(reportPath, sizeof(reportPath), m_reportPath, m_processName, m_hostName); + CrashReportHelpers::BuildReportPath( + m_reportFilePathScratch, + sizeof(m_reportFilePathScratch), + m_expandedReportPathScratch, + sizeof(m_expandedReportPathScratch), + m_numberScratch, + sizeof(m_numberScratch), + m_reportPath, + m_processName, + m_hostName); int fd = -1; if (jsonEnabled) { - fd = open(reportPath, O_WRONLY | O_CREAT | O_TRUNC, 0600); + fd = open(m_reportFilePathScratch, O_WRONLY | O_CREAT | O_TRUNC, 0600); if (fd == -1) { jsonEnabled = false; @@ -507,10 +562,10 @@ InProcCrashReporter::CreateReport( EmitConsoleHeader(signal); - CrashReportOutputContext outputContext(fd); + s_outputContext.Init(fd); if (jsonEnabled) { - m_jsonWriter.Init(&CrashReportOutputContext::ChunkCallback, &outputContext); + m_jsonWriter.Init(&CrashReportOutputContext::ChunkCallback, &s_outputContext); } else { @@ -527,11 +582,11 @@ InProcCrashReporter::CreateReport( else if (m_enumerateThreadsCallback != nullptr) { uint64_t crashingTid = static_cast(minipal_get_current_thread_id()); - ThreadEnumerationContext threadContext(&m_jsonWriter, &s_consoleWriter, crashingTid, m_frameLimitPerThread, context); + s_threadContext.Init(&m_jsonWriter, &s_consoleWriter, crashingTid, m_frameLimitPerThread, context); - threadContext.EnumerateThreads(m_enumerateThreadsCallback); + s_threadContext.EnumerateThreads(m_enumerateThreadsCallback); - if (threadContext.ThreadCount() == 0 || !threadContext.SawCrashThread()) + if (s_threadContext.ThreadCount() == 0 || !s_threadContext.SawCrashThread()) { EmitSynthesizedCrashThread(context, /*walkStack*/ false); } @@ -549,12 +604,12 @@ InProcCrashReporter::CreateReport( if (jsonEnabled) { bool writeSucceeded = m_jsonWriter.Finish() && - !outputContext.WriteFailed() && + !s_outputContext.WriteFailed() && CrashReportHelpers::WriteToFile(fd, "\n", 1); if (close(fd) != 0 || !writeSucceeded) { - unlink(reportPath); + unlink(m_reportFilePathScratch); } } else @@ -589,13 +644,12 @@ InProcCrashReporter::Initialize( int cmdlineFd = open("/proc/self/cmdline", O_RDONLY | O_CLOEXEC); if (cmdlineFd >= 0) { - char buf[CRASHREPORT_STRING_BUFFER_SIZE]; - ssize_t n = read(cmdlineFd, buf, sizeof(buf) - 1); + ssize_t n = read(cmdlineFd, m_processNameScratch, sizeof(m_processNameScratch) - 1); close(cmdlineFd); if (n > 0) { - buf[n] = '\0'; - CrashReportHelpers::CopyString(m_processName, sizeof(m_processName), CrashReportHelpers::GetFilename(buf)); + m_processNameScratch[n] = '\0'; + CrashReportHelpers::CopyString(m_processName, sizeof(m_processName), CrashReportHelpers::GetFilename(m_processNameScratch)); } } #endif @@ -775,11 +829,15 @@ size_t CrashReportHelpers::ExpandDumpTemplate( char* buffer, size_t bufferSize, + char* numberBuffer, + size_t numberBufferSize, const char* pattern, const char* processName, const char* hostName) { - if (buffer == nullptr || bufferSize == 0 || pattern == nullptr) + if (buffer == nullptr || bufferSize == 0 || + numberBuffer == nullptr || numberBufferSize == 0 || + pattern == nullptr) { return 0; } @@ -799,7 +857,7 @@ CrashReportHelpers::ExpandDumpTemplate( char specifier = *pattern; const char* substitution = nullptr; - char numberBuf[CRASHREPORT_NUMBER_BUFFER_SIZE]; + numberBuffer[0] = '\0'; switch (specifier) { @@ -813,11 +871,11 @@ CrashReportHelpers::ExpandDumpTemplate( case 'p': case 'd': - if (SignalSafeFormat::FormatUnsignedDecimal(numberBuf, sizeof(numberBuf), pid) == 0) + if (SignalSafeFormat::FormatUnsignedDecimal(numberBuffer, numberBufferSize, pid) == 0) { return 0; } - substitution = numberBuf; + substitution = numberBuffer; break; case 'e': @@ -830,11 +888,11 @@ CrashReportHelpers::ExpandDumpTemplate( case 't': if (SignalSafeFormat::FormatUnsignedDecimal( - numberBuf, sizeof(numberBuf), static_cast(time(nullptr))) == 0) + numberBuffer, numberBufferSize, static_cast(time(nullptr))) == 0) { return 0; } - substitution = numberBuf; + substitution = numberBuffer; break; default: @@ -881,24 +939,37 @@ bool CrashReportHelpers::BuildReportPath( char* buffer, size_t bufferSize, + char* expandedBuffer, + size_t expandedBufferSize, + char* numberBuffer, + size_t numberBufferSize, const char* dumpPath, const char* processName, const char* hostName) { - if (buffer == nullptr || bufferSize == 0 || dumpPath == nullptr || dumpPath[0] == '\0') + if (buffer == nullptr || bufferSize == 0 || + expandedBuffer == nullptr || expandedBufferSize == 0 || + numberBuffer == nullptr || numberBufferSize == 0 || + dumpPath == nullptr || dumpPath[0] == '\0') { return false; } - char expanded[CRASHREPORT_PATH_BUFFER_SIZE]; - size_t expandedLen = ExpandDumpTemplate(expanded, sizeof(expanded), dumpPath, processName, hostName); + size_t expandedLen = ExpandDumpTemplate( + expandedBuffer, + expandedBufferSize, + numberBuffer, + numberBufferSize, + dumpPath, + processName, + hostName); if (expandedLen == 0) { return false; } size_t pos = 0; - if (!AppendString(buffer, bufferSize, &pos, expanded)) + if (!AppendString(buffer, bufferSize, &pos, expandedBuffer)) { return false; } @@ -1180,13 +1251,18 @@ CrashReportHelpers::JsonFrameCallback( return; } - WriteFrameToJson(writer, ip, stackPointer, methodName, className, moduleName, + WriteFrameToJson(writer, + s_jsonFrameCallbackMethodNameScratch, + sizeof(s_jsonFrameCallbackMethodNameScratch), + ip, stackPointer, methodName, className, moduleName, nativeOffset, token, ilOffset, moduleTimestamp, moduleSize, moduleGuid); } void CrashReportHelpers::WriteFrameToJson( SignalSafeJsonWriter* writer, + char* methodNameBuffer, + size_t methodNameBufferSize, uint64_t ip, uint64_t stackPointer, const char* methodName, @@ -1211,9 +1287,13 @@ CrashReportHelpers::WriteFrameToJson( if (methodName != nullptr) { - char fullName[CRASHREPORT_STRING_BUFFER_SIZE]; - BuildMethodName(fullName, sizeof(fullName), className, methodName); - writer->WriteString("method_name", fullName); + const char* fullMethodName = methodName; + if (methodNameBuffer != nullptr && methodNameBufferSize != 0) + { + BuildMethodName(methodNameBuffer, methodNameBufferSize, className, methodName); + fullMethodName = methodNameBuffer; + } + writer->WriteString("method_name", fullMethodName); writer->WriteString("is_managed", "true"); writer->WriteHexAsString("token", token); writer->WriteHexAsString("il_offset", ilOffset); @@ -1249,6 +1329,8 @@ CrashReportHelpers::WriteFrameToJson( void CrashReportHelpers::WriteFrameToConsole( SignalSafeConsoleWriter* consoleWriter, + char* methodNameBuffer, + size_t methodNameBufferSize, uint32_t frameIndex, int moduleIndex, uint64_t ip, @@ -1287,9 +1369,13 @@ CrashReportHelpers::WriteFrameToConsole( if (methodName != nullptr) { - char fullName[CRASHREPORT_STRING_BUFFER_SIZE]; - BuildMethodName(fullName, sizeof(fullName), className, methodName); - consoleWriter->AppendStr(fullName); + const char* fullMethodName = methodName; + if (methodNameBuffer != nullptr && methodNameBufferSize != 0) + { + BuildMethodName(methodNameBuffer, methodNameBufferSize, className, methodName); + fullMethodName = methodNameBuffer; + } + consoleWriter->AppendStr(fullMethodName); consoleWriter->AppendStr(" + 0x"); consoleWriter->AppendHex(static_cast(ilOffset)); consoleWriter->AppendStr(" (token=0x"); @@ -1431,14 +1517,20 @@ CrashReportHelpers::FrameSinkCallback( // Always feed the JSON sink: the file output is the authoritative, // post-mortem data store and the cap is a compact-log triage knob. - WriteFrameToJson(sinks->writer, ip, stackPointer, methodName, className, moduleName, + WriteFrameToJson(sinks->writer, + sinks->methodNameBuffer, + sinks->methodNameBufferSize, + ip, stackPointer, methodName, className, moduleName, nativeOffset, token, ilOffset, moduleTimestamp, moduleSize, moduleGuid); bool consoleCapped = sinks->frameLimitPerThread != 0 && frameIndex >= sinks->frameLimitPerThread; if (!consoleCapped) { - WriteFrameToConsole(sinks->consoleWriter, frameIndex, moduleIndex, ip, methodName, className, moduleName, + WriteFrameToConsole(sinks->consoleWriter, + sinks->methodNameBuffer, + sinks->methodNameBufferSize, + frameIndex, moduleIndex, ip, methodName, className, moduleName, nativeOffset, token, ilOffset); } else if (sinks->currentThreadDroppedCount != nullptr) @@ -1473,6 +1565,8 @@ ThreadEnumerationContext::OnFrame( &m_currentThreadFrameCount, &m_currentThreadDroppedCount, m_frameLimitPerThread, + m_methodNameScratch, + sizeof(m_methodNameScratch), }; CrashReportHelpers::FrameSinkCallback(ip, stackPointer, methodName, className, moduleName, nativeOffset, token, ilOffset, moduleTimestamp, moduleSize, moduleGuid, &sinks); @@ -1647,6 +1741,8 @@ InProcCrashReporter::EmitSynthesizedCrashThread( &synthesizedFrameCount, &synthesizedDroppedCount, m_frameLimitPerThread, + m_methodNameScratch, + sizeof(m_methodNameScratch), }; m_walkStackCallback(&CrashReportHelpers::FrameSinkCallback, &sinks); } @@ -1804,11 +1900,10 @@ InProcCrashReporter::EmitConsoleHeader(int signal) s_consoleWriter.AppendStr(CRASHREPORT_PROTOCOL_VERSION); s_consoleWriter.EndLine(); - char version[sizeof(sccsid)]; - CrashReportHelpers::GetVersionString(version, sizeof(version)); - if (version[0] != '\0') + CrashReportHelpers::GetVersionString(s_versionScratch, sizeof(s_versionScratch)); + if (s_versionScratch[0] != '\0') { - s_consoleWriter.WriteKeyValueStr("Build", version); + s_consoleWriter.WriteKeyValueStr("Build", s_versionScratch); } s_consoleWriter.WriteKeyValueStr("ABI", CRASHREPORT_ARCHITECTURE_NAME); @@ -1861,9 +1956,8 @@ InProcCrashReporter::EmitJsonHeader() m_jsonWriter.OpenObject("configuration"); m_jsonWriter.WriteString("architecture", CRASHREPORT_ARCHITECTURE_NAME); - char version[sizeof(sccsid)]; - CrashReportHelpers::GetVersionString(version, sizeof(version)); - m_jsonWriter.WriteString("version", version); + CrashReportHelpers::GetVersionString(s_versionScratch, sizeof(s_versionScratch)); + m_jsonWriter.WriteString("version", s_versionScratch); m_jsonWriter.CloseObject(); // configuration if (m_processName[0] != '\0') diff --git a/src/coreclr/debug/crashreport/inproccrashreporter.h b/src/coreclr/debug/crashreport/inproccrashreporter.h index 9050ca7578f118..38ba35cd4f8cfc 100644 --- a/src/coreclr/debug/crashreport/inproccrashreporter.h +++ b/src/coreclr/debug/crashreport/inproccrashreporter.h @@ -108,7 +108,12 @@ class InProcCrashReporter InProcCrashReportWalkStackCallback m_walkStackCallback = nullptr; InProcCrashReportEnumerateThreadsCallback m_enumerateThreadsCallback = nullptr; char m_reportPath[CRASHREPORT_PATH_BUFFER_SIZE] = {}; + char m_reportFilePathScratch[CRASHREPORT_PATH_BUFFER_SIZE] = {}; + char m_expandedReportPathScratch[CRASHREPORT_PATH_BUFFER_SIZE] = {}; + char m_numberScratch[CRASHREPORT_NUMBER_BUFFER_SIZE] = {}; + char m_methodNameScratch[CRASHREPORT_STRING_BUFFER_SIZE] = {}; char m_processName[CRASHREPORT_STRING_BUFFER_SIZE] = {}; + char m_processNameScratch[CRASHREPORT_STRING_BUFFER_SIZE] = {}; char m_hostName[CRASHREPORT_STRING_BUFFER_SIZE] = {}; #ifdef __APPLE__ char m_osVersion[CRASHREPORT_STRING_BUFFER_SIZE] = {}; diff --git a/src/coreclr/vm/crashreportstackwalker.cpp b/src/coreclr/vm/crashreportstackwalker.cpp index 0509cc6e836c85..6a04b8df9452de 100644 --- a/src/coreclr/vm/crashreportstackwalker.cpp +++ b/src/coreclr/vm/crashreportstackwalker.cpp @@ -23,6 +23,16 @@ struct WalkContext void* userCtx; }; +struct CrashReportStackWalkerScratch +{ + char crashExceptionType[CRASHREPORT_STRING_BUFFER_SIZE]; + char className[CRASHREPORT_STRING_BUFFER_SIZE]; + char moduleGuid[MINIPAL_GUID_BUFFER_LEN]; +}; + +static CrashReportStackWalkerScratch s_crashReportScratch; +static WalkContext s_walkContext; + static void BuildTypeName(LPUTF8 buffer, size_t bufferSize, LPCUTF8 namespaceName, LPCUTF8 className); static @@ -68,8 +78,8 @@ FrameCallbackAdapter( } } - char classNameBuf[CRASHREPORT_STRING_BUFFER_SIZE]; - BuildTypeName(classNameBuf, sizeof(classNameBuf), namespaceName, className); + s_crashReportScratch.className[0] = '\0'; + BuildTypeName(s_crashReportScratch.className, sizeof(s_crashReportScratch.className), namespaceName, className); LPCUTF8 moduleName = nullptr; Module* pModule = pMD->GetModule(); @@ -124,8 +134,7 @@ FrameCallbackAdapter( uint32_t moduleTimestamp = 0; uint32_t moduleSize = 0; - char moduleGuid[MINIPAL_GUID_BUFFER_LEN]; - moduleGuid[0] = '\0'; + s_crashReportScratch.moduleGuid[0] = '\0'; if (pModule != nullptr) { @@ -142,13 +151,13 @@ FrameCallbackAdapter( GUID mvid; if (SUCCEEDED(pImport->GetScopeProps(nullptr, &mvid))) { - minipal_guid_as_string(mvid, moduleGuid, MINIPAL_GUID_BUFFER_LEN); + minipal_guid_as_string(mvid, s_crashReportScratch.moduleGuid, sizeof(s_crashReportScratch.moduleGuid)); } } } - className = classNameBuf[0] == '\0' ? nullptr : classNameBuf; - ctx->callback(static_cast(ip), static_cast(stackPointer), methodName, className, moduleName, nativeOffset, static_cast(token), ilOffset, moduleTimestamp, moduleSize, moduleGuid, ctx->userCtx); + className = s_crashReportScratch.className[0] == '\0' ? nullptr : s_crashReportScratch.className; + ctx->callback(static_cast(ip), static_cast(stackPointer), methodName, className, moduleName, nativeOffset, static_cast(token), ilOffset, moduleTimestamp, moduleSize, s_crashReportScratch.moduleGuid, ctx->userCtx); return SWA_CONTINUE; } @@ -164,8 +173,9 @@ CrashReportWalkThread( return; } - WalkContext walkContext = { frameCallback, ctx }; - pThread->StackWalkFrames(FrameCallbackAdapter, &walkContext, + s_walkContext.callback = frameCallback; + s_walkContext.userCtx = ctx; + pThread->StackWalkFrames(FrameCallbackAdapter, &s_walkContext, QUICKUNWIND | FUNCTIONSONLY | ALLOW_ASYNC_STACK_WALK); } @@ -359,8 +369,7 @@ CrashReportEnumerateThreads( // so the throwable inspection runs in the thread's natural EE-live context, // outside the suspended window which exists for safe-point operations on // other threads. - char crashExceptionType[CRASHREPORT_STRING_BUFFER_SIZE]; - crashExceptionType[0] = '\0'; + s_crashReportScratch.crashExceptionType[0] = '\0'; uint32_t crashHresult = 0; bool crashHasException = false; bool isCrashingThread = pCrashThread != nullptr @@ -368,7 +377,10 @@ CrashReportEnumerateThreads( if (isCrashingThread) { crashHasException = CrashReportGetExceptionForThread( - pCrashThread, crashExceptionType, sizeof(crashExceptionType), &crashHresult); + pCrashThread, + s_crashReportScratch.crashExceptionType, + sizeof(s_crashReportScratch.crashExceptionType), + &crashHresult); } bool runtimeSuspended = CrashReportSuspendThreads(pCrashThread); @@ -378,7 +390,7 @@ CrashReportEnumerateThreads( if (isCrashingThread) { uint64_t crashOsId = static_cast(pCrashThread->GetOSThreadId()); - threadCallback(crashOsId, true, crashHasException ? crashExceptionType : "", crashHresult, ctx); + threadCallback(crashOsId, true, crashHasException ? s_crashReportScratch.crashExceptionType : "", crashHresult, ctx); CrashReportWalkThread(pCrashThread, frameCallback, ctx); } From ef3f9c0765e70c1b72d482cc10ae75143e361adc Mon Sep 17 00:00:00 2001 From: Mitchell Hwang Date: Thu, 14 May 2026 17:09:14 -0400 Subject: [PATCH 099/109] Keep compact crash log lines newline-terminated Ensure full and truncated compact crash log lines end with a newline on non-Android sinks instead of relying on later writes for line framing. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/coreclr/debug/crashreport/signalsafeconsolewriter.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/coreclr/debug/crashreport/signalsafeconsolewriter.cpp b/src/coreclr/debug/crashreport/signalsafeconsolewriter.cpp index 8d952c6b81017a..ccb9bd7fc983ae 100644 --- a/src/coreclr/debug/crashreport/signalsafeconsolewriter.cpp +++ b/src/coreclr/debug/crashreport/signalsafeconsolewriter.cpp @@ -129,11 +129,9 @@ SignalSafeConsoleWriter::Flush() #else // On Apple/Linux the report goes to stderr; explicitly newline-terminate // each line so log readers split entries the same way logcat would. - if (m_pos + 1 < sizeof(m_buffer)) - { - m_buffer[m_pos++] = '\n'; - m_buffer[m_pos] = '\0'; - } + size_t newlinePos = m_pos < sizeof(m_buffer) - 1 ? m_pos : sizeof(m_buffer) - 2; + m_buffer[newlinePos++] = '\n'; + m_buffer[newlinePos] = '\0'; minipal_log_write_error(m_buffer); #endif From c7a3608de9e2c545316505abd7ed2ab56cd06d49 Mon Sep 17 00:00:00 2001 From: Mitchell Hwang Date: Thu, 14 May 2026 17:11:06 -0400 Subject: [PATCH 100/109] Localize in-proc crash report signal names Keep signal-name formatting in the crash reporter instead of exposing a PAL helper only used by this path. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../debug/crashreport/inproccrashreporter.cpp | 19 +++++++++++++++++-- src/coreclr/pal/src/include/pal/process.h | 12 ------------ src/coreclr/pal/src/thread/process.cpp | 15 --------------- 3 files changed, 17 insertions(+), 29 deletions(-) diff --git a/src/coreclr/debug/crashreport/inproccrashreporter.cpp b/src/coreclr/debug/crashreport/inproccrashreporter.cpp index 22b5801ac1b940..1b6c37e95e7e3e 100644 --- a/src/coreclr/debug/crashreport/inproccrashreporter.cpp +++ b/src/coreclr/debug/crashreport/inproccrashreporter.cpp @@ -26,7 +26,6 @@ #include #endif -extern "C" const char* PROCGetSignalNameAscii(int signal); static const char CRASHREPORT_PROTOCOL_VERSION[] = "1.0.0"; static constexpr uint32_t CRASHREPORT_COR_E_STACKOVERFLOW = 0x800703E9; @@ -98,6 +97,22 @@ static char sccsid[] = "@(#)Version N/A"; static char s_versionScratch[sizeof(sccsid)]; static char s_jsonFrameCallbackMethodNameScratch[CRASHREPORT_STRING_BUFFER_SIZE]; +static const char* +GetSignalNameAscii(int signal) +{ + switch (signal) + { + case SIGSEGV: return "SIGSEGV"; + case SIGBUS: return "SIGBUS"; + case SIGFPE: return "SIGFPE"; + case SIGILL: return "SIGILL"; + case SIGABRT: return "SIGABRT"; + case SIGTRAP: return "SIGTRAP"; + case SIGTERM: return "SIGTERM"; + default: return "Unknown signal"; + } +} + static void CopyStringToBuffer(char* buffer, size_t bufferSize, const char* value) { if (buffer == nullptr || bufferSize == 0) @@ -1918,7 +1933,7 @@ InProcCrashReporter::EmitConsoleHeader(int signal) s_consoleWriter.AppendStr("signal "); s_consoleWriter.AppendSignedDecimal(signal); s_consoleWriter.AppendStr(" ("); - s_consoleWriter.AppendStr(PROCGetSignalNameAscii(signal)); + s_consoleWriter.AppendStr(GetSignalNameAscii(signal)); s_consoleWriter.AppendChar(')'); s_consoleWriter.EndLine(); } diff --git a/src/coreclr/pal/src/include/pal/process.h b/src/coreclr/pal/src/include/pal/process.h index 6d4336a3a05720..e3f26bde875a03 100644 --- a/src/coreclr/pal/src/include/pal/process.h +++ b/src/coreclr/pal/src/include/pal/process.h @@ -172,18 +172,6 @@ VOID PROCCreateCrashDumpIfEnabled(int signal, siginfo_t* siginfo, void* context, --*/ VOID PROCLogManagedCallstackForSignal(int signal); -/*++ -Function: - PROCGetSignalNameAscii - - Returns the ASCII name for the given POSIX signal (e.g. "SIGABRT"), or - "Unknown signal" if not recognized. Async-signal-safe. - -Parameters: - signal - POSIX signal number ---*/ -const char* PROCGetSignalNameAscii(int signal); - #ifdef __cplusplus } #endif // __cplusplus diff --git a/src/coreclr/pal/src/thread/process.cpp b/src/coreclr/pal/src/thread/process.cpp index f150f54644003f..25902fcea08b8c 100644 --- a/src/coreclr/pal/src/thread/process.cpp +++ b/src/coreclr/pal/src/thread/process.cpp @@ -1882,21 +1882,6 @@ static LPCWSTR GetSignalName(int signal) } } -const char* PROCGetSignalNameAscii(int signal) -{ - switch (signal) - { - case SIGSEGV: return "SIGSEGV"; - case SIGBUS: return "SIGBUS"; - case SIGFPE: return "SIGFPE"; - case SIGILL: return "SIGILL"; - case SIGABRT: return "SIGABRT"; - case SIGTRAP: return "SIGTRAP"; - case SIGTERM: return "SIGTERM"; - default: return "Unknown signal"; - } -} - /*++ Function: PROCLogManagedCallstackForSignal From 1ebc7ad9c35cce8cb09cfc0c1f3531533b6ea979 Mon Sep 17 00:00:00 2001 From: Mitchell Hwang Date: Thu, 14 May 2026 17:29:06 -0400 Subject: [PATCH 101/109] Refactor in-proc crash report lifecycle helpers Separate report-level begin/end flow from per-thread formatting helpers so JSON and compact console lifecycles are easier to review independently. Keep behavior unchanged while centralizing JSON finalization in EndJsonReport. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../debug/crashreport/inproccrashreporter.cpp | 284 ++++++++++++------ .../debug/crashreport/inproccrashreporter.h | 15 +- 2 files changed, 196 insertions(+), 103 deletions(-) diff --git a/src/coreclr/debug/crashreport/inproccrashreporter.cpp b/src/coreclr/debug/crashreport/inproccrashreporter.cpp index 1b6c37e95e7e3e..a8f64a2a48c216 100644 --- a/src/coreclr/debug/crashreport/inproccrashreporter.cpp +++ b/src/coreclr/debug/crashreport/inproccrashreporter.cpp @@ -45,7 +45,7 @@ static const char CRASHREPORT_ARCHITECTURE_NAME[] = "arm"; // __android_log_write entry under tag "DOTNET_CRASH" on Android, one // '\n'-terminated stderr write elsewhere. // -// *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** (EmitConsoleHeader) +// *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** (BeginConsoleReport) // .NET Crash Report v // Build: (omitted if empty) // ABI: amd64|arm64|arm @@ -53,15 +53,15 @@ static const char CRASHREPORT_ARCHITECTURE_NAME[] = "arm"; // pid: // signal () // (blank between sections) -// --- thread 0xTID [(crashed)] --- (per thread; OnThread) +// --- thread 0xTID [(crashed)] --- (BeginConsoleThreadBlock) // managed exception: (0x) (only if EE provided one) // #NN [M] Class.Method + 0xILOFFSET (token=0xTOKEN) (managed frame; WriteFrameToConsole) // #NN (in ) Class.Method + 0xILOFFSET (token=0xTOKEN) (overflow form: module didn't fit the table) // #NN [M] 0xIP (module + 0xOFFSET) (native frame; WriteFrameToConsole) // #NN 0xIP (module + 0xOFFSET) (native frame not in module table) -// (no managed frames) | ... +N more frames (FinishCurrentThreadCompactBlock) +// (no managed frames) | ... +N more frames (EndConsoleThreadBlock) // (blank between threads) -// modules: (EmitConsoleModulesAndFooter) +// modules: (EndConsoleReport) // [N] {} (one per ModuleTable entry) // *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** (closing separator) @@ -246,7 +246,7 @@ class ThreadEnumerationContext size_t ThreadCount() const { return m_threadCount; } bool SawCrashThread() const { return m_sawCrashThread; } - SignalSafeJsonWriter* Writer() const { return m_writer; } + SignalSafeJsonWriter* JsonWriter() const { return m_jsonWriter; } SignalSafeConsoleWriter* ConsoleWriter() const { return m_consoleWriter; } void Init( @@ -256,7 +256,7 @@ class ThreadEnumerationContext uint32_t frameLimitPerThread, void* signalContext) { - m_writer = writer; + m_jsonWriter = writer; m_consoleWriter = consoleWriter; m_signalContext = signalContext; m_threadCount = 0; @@ -311,9 +311,10 @@ class ThreadEnumerationContext uint32_t moduleSize, const char* moduleGuid); - void FinishCurrentThreadCompactBlock(); + void EndCurrentConsoleThreadBlock(); + void EndCurrentJsonThreadBlock(); - SignalSafeJsonWriter* m_writer; + SignalSafeJsonWriter* m_jsonWriter; SignalSafeConsoleWriter* m_consoleWriter; void* m_signalContext; size_t m_threadCount; @@ -473,12 +474,31 @@ class CrashReportHelpers uint32_t frameIndex, const StackOverflowTraceFrame& frame); - static void WriteThreadBlockHeaderToConsole( + static void BeginJsonThreadBlock( + SignalSafeJsonWriter* jsonWriter, + uint64_t osThreadId, + bool isManagedThread, + bool isCrashThread, + const char* exceptionType, + uint32_t exceptionHResult); + + static void BeginJsonStackFrames( + SignalSafeJsonWriter* jsonWriter, + bool writeCrashSiteFrame, + void* signalContext); + + static void EndJsonStackFrames( + SignalSafeJsonWriter* jsonWriter); + + static void EndJsonThreadBlock( + SignalSafeJsonWriter* jsonWriter); + + static void BeginConsoleThreadBlock( SignalSafeConsoleWriter* consoleWriter, uint64_t osThreadId, bool isCrashThread); - static void WriteThreadBlockCloserToConsole( + static void EndConsoleThreadBlock( SignalSafeConsoleWriter* consoleWriter, uint32_t frameCount, uint32_t droppedCount); @@ -575,8 +595,6 @@ InProcCrashReporter::CreateReport( InProcCrashReportCrashKind crashKind = static_cast( InterlockedExchange(&s_crashKind, static_cast(InProcCrashReportCrashKind::Unknown))); - EmitConsoleHeader(signal); - s_outputContext.Init(fd); if (jsonEnabled) { @@ -587,8 +605,18 @@ InProcCrashReporter::CreateReport( m_jsonWriter.Init(&CrashReportHelpers::DiscardOutputCallback, nullptr); } - EmitJsonHeader(); + BeginConsoleReport(signal); + BeginJsonReport(); + EmitThreads(crashKind, context); + EndJsonReport(signal, jsonEnabled, fd); + EndConsoleReport(); +} +void +InProcCrashReporter::EmitThreads( + InProcCrashReportCrashKind crashKind, + void* context) +{ m_jsonWriter.OpenArray("threads"); if (crashKind == InProcCrashReportCrashKind::StackOverflow) { @@ -611,26 +639,6 @@ InProcCrashReporter::CreateReport( EmitSynthesizedCrashThread(context, /*walkStack*/ true); } m_jsonWriter.CloseArray(); // threads - - EmitJsonFooter(signal); - - EmitConsoleModulesAndFooter(); - - if (jsonEnabled) - { - bool writeSucceeded = m_jsonWriter.Finish() && - !s_outputContext.WriteFailed() && - CrashReportHelpers::WriteToFile(fd, "\n", 1); - - if (close(fd) != 0 || !writeSucceeded) - { - unlink(m_reportFilePathScratch); - } - } - else - { - (void)m_jsonWriter.Finish(); - } } InProcCrashReporter& @@ -1458,7 +1466,75 @@ CrashReportHelpers::WriteStackOverflowFrameToConsole( } void -CrashReportHelpers::WriteThreadBlockHeaderToConsole( +CrashReportHelpers::BeginJsonThreadBlock( + SignalSafeJsonWriter* jsonWriter, + uint64_t osThreadId, + bool isManagedThread, + bool isCrashThread, + const char* exceptionType, + uint32_t exceptionHResult) +{ + if (jsonWriter == nullptr) + { + return; + } + + jsonWriter->OpenObject(); + jsonWriter->WriteString("is_managed", isManagedThread ? "true" : "false"); + jsonWriter->WriteString("crashed", isCrashThread ? "true" : "false"); + jsonWriter->WriteHexAsString("native_thread_id", osThreadId); + + if (exceptionType != nullptr && exceptionType[0] != '\0') + { + jsonWriter->WriteString("managed_exception_type", exceptionType); + jsonWriter->WriteHexAsString("managed_exception_hresult", exceptionHResult); + } +} + +void +CrashReportHelpers::BeginJsonStackFrames( + SignalSafeJsonWriter* jsonWriter, + bool writeCrashSiteFrame, + void* signalContext) +{ + if (jsonWriter == nullptr) + { + return; + } + + jsonWriter->OpenArray("stack_frames"); + if (writeCrashSiteFrame) + { + WriteCrashSiteFrameToJson(jsonWriter, signalContext); + } +} + +void +CrashReportHelpers::EndJsonStackFrames( + SignalSafeJsonWriter* jsonWriter) +{ + if (jsonWriter == nullptr) + { + return; + } + + jsonWriter->CloseArray(); // stack_frames +} + +void +CrashReportHelpers::EndJsonThreadBlock( + SignalSafeJsonWriter* jsonWriter) +{ + if (jsonWriter == nullptr) + { + return; + } + + jsonWriter->CloseObject(); // thread +} + +void +CrashReportHelpers::BeginConsoleThreadBlock( SignalSafeConsoleWriter* consoleWriter, uint64_t osThreadId, bool isCrashThread) @@ -1480,7 +1556,7 @@ CrashReportHelpers::WriteThreadBlockHeaderToConsole( } void -CrashReportHelpers::WriteThreadBlockCloserToConsole( +CrashReportHelpers::EndConsoleThreadBlock( SignalSafeConsoleWriter* consoleWriter, uint32_t frameCount, uint32_t droppedCount) @@ -1575,7 +1651,7 @@ ThreadEnumerationContext::OnFrame( { CrashReportHelpers::FrameSinks sinks = { - m_writer, + m_jsonWriter, m_consoleWriter, &m_currentThreadFrameCount, &m_currentThreadDroppedCount, @@ -1610,17 +1686,31 @@ ThreadEnumerationContext::FrameCallback( } void -ThreadEnumerationContext::FinishCurrentThreadCompactBlock() +ThreadEnumerationContext::EndCurrentConsoleThreadBlock() { if (m_threadCount == 0) { return; } - CrashReportHelpers::WriteThreadBlockCloserToConsole(m_consoleWriter, + CrashReportHelpers::EndConsoleThreadBlock(m_consoleWriter, m_currentThreadFrameCount, m_currentThreadDroppedCount); } +void +ThreadEnumerationContext::EndCurrentJsonThreadBlock() +{ + if (m_threadCount == 0) + { + return; + } + + CrashReportHelpers::EndJsonStackFrames(m_jsonWriter); + CrashReportHelpers::EndJsonThreadBlock(m_jsonWriter); + + (void)m_jsonWriter->Flush(); +} + void ThreadEnumerationContext::OnThread( uint64_t osThreadId, @@ -1630,12 +1720,8 @@ ThreadEnumerationContext::OnThread( { if (m_threadCount > 0) { - FinishCurrentThreadCompactBlock(); - - m_writer->CloseArray(); // stack_frames - m_writer->CloseObject(); // thread - - (void)m_writer->Flush(); + EndCurrentConsoleThreadBlock(); + EndCurrentJsonThreadBlock(); } if (isCrashThread) @@ -1646,31 +1732,19 @@ ThreadEnumerationContext::OnThread( m_currentThreadFrameCount = 0; m_currentThreadDroppedCount = 0; - m_writer->OpenObject(); - m_writer->WriteString("is_managed", "true"); - m_writer->WriteString("crashed", isCrashThread ? "true" : "false"); - m_writer->WriteHexAsString("native_thread_id", osThreadId); - - if (exceptionType != nullptr && exceptionType[0] != '\0') - { - m_writer->WriteString("managed_exception_type", exceptionType); - m_writer->WriteHexAsString("managed_exception_hresult", exceptionHResult); - } + CrashReportHelpers::BeginJsonThreadBlock(m_jsonWriter, + osThreadId, /*isManagedThread*/ true, isCrashThread, exceptionType, exceptionHResult); if (isCrashThread) { - CrashReportHelpers::WriteRegistersToJson(m_writer, m_signalContext); + CrashReportHelpers::WriteRegistersToJson(m_jsonWriter, m_signalContext); } - m_writer->OpenArray("stack_frames"); - if (isCrashThread) - { - CrashReportHelpers::WriteCrashSiteFrameToJson(m_writer, m_signalContext); - } + CrashReportHelpers::BeginJsonStackFrames(m_jsonWriter, isCrashThread, m_signalContext); if (m_consoleWriter != nullptr) { - CrashReportHelpers::WriteThreadBlockHeaderToConsole(m_consoleWriter, osThreadId, isCrashThread); + CrashReportHelpers::BeginConsoleThreadBlock(m_consoleWriter, osThreadId, isCrashThread); if (exceptionType != nullptr && exceptionType[0] != '\0') { @@ -1715,15 +1789,8 @@ ThreadEnumerationContext::EnumerateThreads( return; } - FinishCurrentThreadCompactBlock(); - - // Close the last thread's stack_frames + thread objects opened by OnThread. - m_writer->CloseArray(); // stack_frames - m_writer->CloseObject(); // thread - - // Flush the final thread so it reaches the crash report file even if any - // later work (e.g. synthesizing a crash thread fallback) hangs or faults. - (void)m_writer->Flush(); + EndCurrentConsoleThreadBlock(); + EndCurrentJsonThreadBlock(); } void @@ -1733,17 +1800,14 @@ InProcCrashReporter::EmitSynthesizedCrashThread( { uint64_t crashingTid = static_cast(minipal_get_current_thread_id()); - m_jsonWriter.OpenObject(); - m_jsonWriter.WriteString("is_managed", - m_isManagedThreadCallback != nullptr && m_isManagedThreadCallback() ? "true" : "false"); - m_jsonWriter.WriteString("crashed", "true"); - m_jsonWriter.WriteHexAsString("native_thread_id", crashingTid); + bool isManagedThread = m_isManagedThreadCallback != nullptr && m_isManagedThreadCallback(); + CrashReportHelpers::BeginJsonThreadBlock(&m_jsonWriter, + crashingTid, isManagedThread, /*isCrashThread*/ true, nullptr, 0); CrashReportHelpers::WriteRegistersToJson(&m_jsonWriter, context); - m_jsonWriter.OpenArray("stack_frames"); - CrashReportHelpers::WriteCrashSiteFrameToJson(&m_jsonWriter, context); + CrashReportHelpers::BeginJsonStackFrames(&m_jsonWriter, /*writeCrashSiteFrame*/ true, context); - CrashReportHelpers::WriteThreadBlockHeaderToConsole(&s_consoleWriter, crashingTid, /*isCrashThread*/ true); + CrashReportHelpers::BeginConsoleThreadBlock(&s_consoleWriter, crashingTid, /*isCrashThread*/ true); uint32_t synthesizedFrameCount = 0; uint32_t synthesizedDroppedCount = 0; @@ -1761,11 +1825,11 @@ InProcCrashReporter::EmitSynthesizedCrashThread( }; m_walkStackCallback(&CrashReportHelpers::FrameSinkCallback, &sinks); } - CrashReportHelpers::WriteThreadBlockCloserToConsole(&s_consoleWriter, + CrashReportHelpers::EndConsoleThreadBlock(&s_consoleWriter, synthesizedFrameCount, synthesizedDroppedCount); - m_jsonWriter.CloseArray(); // stack_frames - m_jsonWriter.CloseObject(); // thread + CrashReportHelpers::EndJsonStackFrames(&m_jsonWriter); + CrashReportHelpers::EndJsonThreadBlock(&m_jsonWriter); } void @@ -1776,12 +1840,12 @@ InProcCrashReporter::EmitStackOverflowCrashThread() ? s_stackOverflowTrace.crashingTid : static_cast(minipal_get_current_thread_id()); - m_jsonWriter.OpenObject(); - m_jsonWriter.WriteString("is_managed", "true"); - m_jsonWriter.WriteString("crashed", "true"); - m_jsonWriter.WriteHexAsString("native_thread_id", crashingTid); - m_jsonWriter.WriteString("managed_exception_type", CRASHREPORT_STACK_OVERFLOW_EXCEPTION_TYPE); - m_jsonWriter.WriteHexAsString("managed_exception_hresult", CRASHREPORT_COR_E_STACKOVERFLOW); + CrashReportHelpers::BeginJsonThreadBlock(&m_jsonWriter, + crashingTid, + /*isManagedThread*/ true, + /*isCrashThread*/ true, + CRASHREPORT_STACK_OVERFLOW_EXCEPTION_TYPE, + CRASHREPORT_COR_E_STACKOVERFLOW); if (stackOverflowTraceAvailable) { m_jsonWriter.WriteDecimalAsString("stack_overflow_total_frames", s_stackOverflowTrace.totalFrameCount); @@ -1795,7 +1859,7 @@ InProcCrashReporter::EmitStackOverflowCrashThread() m_jsonWriter.WriteString("stack_frames_unavailable_reason", CRASHREPORT_STACK_OVERFLOW_TRACE_UNAVAILABLE_REASON); } - m_jsonWriter.OpenArray("stack_frames"); + CrashReportHelpers::BeginJsonStackFrames(&m_jsonWriter, /*writeCrashSiteFrame*/ false, nullptr); if (stackOverflowTraceAvailable) { for (uint32_t i = 0; i < s_stackOverflowTrace.frameCount;) @@ -1825,10 +1889,10 @@ InProcCrashReporter::EmitStackOverflowCrashThread() } } } - m_jsonWriter.CloseArray(); // stack_frames - m_jsonWriter.CloseObject(); // thread + CrashReportHelpers::EndJsonStackFrames(&m_jsonWriter); + CrashReportHelpers::EndJsonThreadBlock(&m_jsonWriter); - CrashReportHelpers::WriteThreadBlockHeaderToConsole(&s_consoleWriter, crashingTid, /*isCrashThread*/ true); + CrashReportHelpers::BeginConsoleThreadBlock(&s_consoleWriter, crashingTid, /*isCrashThread*/ true); s_consoleWriter.AppendStr(" managed exception: "); s_consoleWriter.AppendStr(CRASHREPORT_STACK_OVERFLOW_EXCEPTION_TYPE); s_consoleWriter.AppendStr(" (0x"); @@ -1839,7 +1903,7 @@ InProcCrashReporter::EmitStackOverflowCrashThread() if (!stackOverflowTraceAvailable) { s_consoleWriter.WriteLine(" stack overflow trace unavailable"); - CrashReportHelpers::WriteThreadBlockCloserToConsole(&s_consoleWriter, 0, 0); + CrashReportHelpers::EndConsoleThreadBlock(&s_consoleWriter, 0, 0); return; } @@ -1901,14 +1965,14 @@ InProcCrashReporter::EmitStackOverflowCrashThread() ++i; } - CrashReportHelpers::WriteThreadBlockCloserToConsole(&s_consoleWriter, + CrashReportHelpers::EndConsoleThreadBlock(&s_consoleWriter, consoleFrameCount, consoleDroppedCount); } -// --- InProcCrashReporter: console header and footer ------------------------ +// --- InProcCrashReporter: console report lifecycle ------------------------- void -InProcCrashReporter::EmitConsoleHeader(int signal) +InProcCrashReporter::BeginConsoleReport(int signal) { s_consoleWriter.WriteSeparator(); s_consoleWriter.AppendStr(".NET Crash Report v"); @@ -1939,7 +2003,7 @@ InProcCrashReporter::EmitConsoleHeader(int signal) } void -InProcCrashReporter::EmitConsoleModulesAndFooter() +InProcCrashReporter::EndConsoleReport() { if (s_moduleTable.Count() != 0) { @@ -1960,10 +2024,10 @@ InProcCrashReporter::EmitConsoleModulesAndFooter() s_consoleWriter.WriteSeparator(); } -// --- InProcCrashReporter: JSON header and footer --------------------------- +// --- InProcCrashReporter: JSON report lifecycle ---------------------------- void -InProcCrashReporter::EmitJsonHeader() +InProcCrashReporter::BeginJsonReport() { m_jsonWriter.OpenObject(); m_jsonWriter.OpenObject("payload"); @@ -1984,7 +2048,10 @@ InProcCrashReporter::EmitJsonHeader() } void -InProcCrashReporter::EmitJsonFooter(int signal) +InProcCrashReporter::EndJsonReport( + int signal, + bool jsonEnabled, + int fd) { m_jsonWriter.CloseObject(); // payload @@ -2004,4 +2071,23 @@ InProcCrashReporter::EmitJsonFooter(int signal) m_jsonWriter.CloseObject(); // parameters m_jsonWriter.CloseObject(); // root + + if (jsonEnabled) + { + bool finishSucceeded = m_jsonWriter.Finish(); + bool writeFailed = s_outputContext.WriteFailed(); + if (!CrashReportHelpers::WriteToFile(fd, "\n", 1)) + { + writeFailed = true; + } + + if (close(fd) != 0 || !finishSucceeded || writeFailed) + { + unlink(m_reportFilePathScratch); + } + } + else + { + (void)m_jsonWriter.Finish(); + } } diff --git a/src/coreclr/debug/crashreport/inproccrashreporter.h b/src/coreclr/debug/crashreport/inproccrashreporter.h index 38ba35cd4f8cfc..006385e1e152fb 100644 --- a/src/coreclr/debug/crashreport/inproccrashreporter.h +++ b/src/coreclr/debug/crashreport/inproccrashreporter.h @@ -97,11 +97,18 @@ class InProcCrashReporter void EmitStackOverflowCrashThread(); - void EmitConsoleHeader(int signal); - void EmitConsoleModulesAndFooter(); + void EmitThreads( + InProcCrashReportCrashKind crashKind, + void* context); + + void BeginConsoleReport(int signal); + void EndConsoleReport(); - void EmitJsonHeader(); - void EmitJsonFooter(int signal); + void BeginJsonReport(); + void EndJsonReport( + int signal, + bool jsonEnabled, + int fd); SignalSafeJsonWriter m_jsonWriter; InProcCrashReportIsManagedThreadCallback m_isManagedThreadCallback = nullptr; From 45c56f54a38ec168958bdc9d25fb283c3e388a08 Mon Sep 17 00:00:00 2001 From: Mitchell Hwang Date: Thu, 14 May 2026 17:31:00 -0400 Subject: [PATCH 102/109] Resolve compact crash report modules lazily Store only Module handles in the compact module table and resolve name/GUID when formatting the modules footer. Preserve the existing per-frame JSON module metadata while making the compact console table follow the review feedback. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../debug/crashreport/inproccrashreporter.cpp | 121 ++++++++------ .../debug/crashreport/inproccrashreporter.h | 12 +- src/coreclr/vm/crashreportstackwalker.cpp | 158 ++++++++++++++---- 3 files changed, 207 insertions(+), 84 deletions(-) diff --git a/src/coreclr/debug/crashreport/inproccrashreporter.cpp b/src/coreclr/debug/crashreport/inproccrashreporter.cpp index a8f64a2a48c216..50cc8013a9caf8 100644 --- a/src/coreclr/debug/crashreport/inproccrashreporter.cpp +++ b/src/coreclr/debug/crashreport/inproccrashreporter.cpp @@ -96,6 +96,7 @@ static char sccsid[] = "@(#)Version N/A"; static char s_versionScratch[sizeof(sccsid)]; static char s_jsonFrameCallbackMethodNameScratch[CRASHREPORT_STRING_BUFFER_SIZE]; +static char s_moduleGuidScratch[MINIPAL_GUID_BUFFER_LEN]; static const char* GetSignalNameAscii(int signal) @@ -156,36 +157,35 @@ static void CacheSysctlString(const char* sysctlName, char* buffer, size_t buffe } #endif // __APPLE__ -// Bounded module name/GUID table that deduplicates each unique module -// observed during a single crash report. Frames in the compact log refer to -// modules by short ``[N]`` indices instead of repeating the (often verbose) -// filename + GUID on every line; the matching ``modules:`` block at the end -// of the report maps each index back to the full data. +// Bounded module table that deduplicates each unique module observed during a +// single crash report. Frames in the compact log refer to modules by short +// ``[N]`` indices instead of repeating module identity on every line; the +// matching ``modules:`` block resolves the module handles back to full data. // // Capacity is fixed at MAX_MODULES_IN_TABLE (no heap on the fatal-signal -// path). A managed frame whose module didn't fit (table full, or empty/null GUID) -// renders the module identity inline as ``(in ) `` so the frame stays -// self-describing — overflow is lossless, just less compact for that frame. +// path). A managed frame whose module didn't fit (table full, missing handle, +// or unresolved module identity) renders the module identity inline as +// ``(in ) `` so the frame stays self-describing — overflow is lossless, +// just less compact for that frame. // // Single-instance because CreateReport is one-shot per process (guarded by // the ``s_generating`` InterlockedCompareExchange in CreateReport). -static constexpr size_t MAX_MODULES_IN_TABLE = 64; +static constexpr size_t MAX_MODULES_IN_TABLE = 256; class ModuleTable { public: - int GetOrAddIndex(const char* moduleName, const char* moduleGuid) + int GetOrAddIndex(const void* moduleHandle) { - if (moduleName == nullptr || moduleName[0] == '\0' || - moduleGuid == nullptr || moduleGuid[0] == '\0') + if (moduleHandle == nullptr) { return -1; } for (size_t i = 0; i < m_count; ++i) { - if (strncmp(m_entries[i].guid, moduleGuid, MINIPAL_GUID_BUFFER_LEN) == 0) + if (m_moduleHandles[i] == moduleHandle) { return static_cast(i); } @@ -196,28 +196,15 @@ class ModuleTable return -1; } - Entry& entry = m_entries[m_count]; - size_t nameLen = strnlen(moduleName, sizeof(entry.name) - 1); - memcpy(entry.name, moduleName, nameLen); - entry.name[nameLen] = '\0'; - size_t guidLen = strnlen(moduleGuid, sizeof(entry.guid) - 1); - memcpy(entry.guid, moduleGuid, guidLen); - entry.guid[guidLen] = '\0'; + m_moduleHandles[m_count] = moduleHandle; return static_cast(m_count++); } size_t Count() const { return m_count; } - const char* Name(size_t i) const { return m_entries[i].name; } - const char* Guid(size_t i) const { return m_entries[i].guid; } + const void* ModuleHandle(size_t i) const { return m_moduleHandles[i]; } private: - struct Entry - { - char name[CRASHREPORT_STRING_BUFFER_SIZE]; - char guid[MINIPAL_GUID_BUFFER_LEN]; - }; - - Entry m_entries[MAX_MODULES_IN_TABLE]; + const void* m_moduleHandles[MAX_MODULES_IN_TABLE]; size_t m_count = 0; }; @@ -228,17 +215,18 @@ class ThreadEnumerationContext public: ThreadEnumerationContext() { - Init(nullptr, nullptr, 0, 0, nullptr); + Init(nullptr, nullptr, nullptr, 0, 0, nullptr); } ThreadEnumerationContext( SignalSafeJsonWriter* writer, SignalSafeConsoleWriter* consoleWriter, + InProcCrashReportModuleInfoCallback moduleInfoCallback, uint64_t crashingTid, uint32_t frameLimitPerThread, void* signalContext) { - Init(writer, consoleWriter, crashingTid, frameLimitPerThread, signalContext); + Init(writer, consoleWriter, moduleInfoCallback, crashingTid, frameLimitPerThread, signalContext); } ThreadEnumerationContext(const ThreadEnumerationContext&) = delete; @@ -252,12 +240,14 @@ class ThreadEnumerationContext void Init( SignalSafeJsonWriter* writer, SignalSafeConsoleWriter* consoleWriter, + InProcCrashReportModuleInfoCallback moduleInfoCallback, uint64_t crashingTid, uint32_t frameLimitPerThread, void* signalContext) { m_jsonWriter = writer; m_consoleWriter = consoleWriter; + m_moduleInfoCallback = moduleInfoCallback; m_signalContext = signalContext; m_threadCount = 0; m_crashingTid = crashingTid; @@ -283,12 +273,13 @@ class ThreadEnumerationContext const char* methodName, const char* className, const char* moduleName, + const void* moduleHandle, uint32_t nativeOffset, uint32_t token, uint32_t ilOffset, uint32_t moduleTimestamp, uint32_t moduleSize, - const char* moduleGuid, + const GUID* moduleGuid, void* ctx); private: @@ -304,18 +295,20 @@ class ThreadEnumerationContext const char* methodName, const char* className, const char* moduleName, + const void* moduleHandle, uint32_t nativeOffset, uint32_t token, uint32_t ilOffset, uint32_t moduleTimestamp, uint32_t moduleSize, - const char* moduleGuid); + const GUID* moduleGuid); void EndCurrentConsoleThreadBlock(); void EndCurrentJsonThreadBlock(); SignalSafeJsonWriter* m_jsonWriter; SignalSafeConsoleWriter* m_consoleWriter; + InProcCrashReportModuleInfoCallback m_moduleInfoCallback; void* m_signalContext; size_t m_threadCount; uint64_t m_crashingTid; @@ -372,6 +365,7 @@ class CrashReportHelpers { SignalSafeJsonWriter* writer; SignalSafeConsoleWriter* consoleWriter; + InProcCrashReportModuleInfoCallback moduleInfoCallback; uint32_t* currentThreadFrameCount; uint32_t* currentThreadDroppedCount; uint32_t frameLimitPerThread; @@ -426,12 +420,13 @@ class CrashReportHelpers const char* methodName, const char* className, const char* moduleName, + const void* moduleHandle, uint32_t nativeOffset, uint32_t token, uint32_t ilOffset, uint32_t moduleTimestamp, uint32_t moduleSize, - const char* moduleGuid, + const GUID* moduleGuid, void* ctx); static void WriteFrameToJson( @@ -448,7 +443,7 @@ class CrashReportHelpers uint32_t ilOffset, uint32_t moduleTimestamp, uint32_t moduleSize, - const char* moduleGuid); + const GUID* moduleGuid); static void WriteFrameToConsole( SignalSafeConsoleWriter* consoleWriter, @@ -509,12 +504,13 @@ class CrashReportHelpers const char* methodName, const char* className, const char* moduleName, + const void* moduleHandle, uint32_t nativeOffset, uint32_t token, uint32_t ilOffset, uint32_t moduleTimestamp, uint32_t moduleSize, - const char* moduleGuid, + const GUID* moduleGuid, void* ctx); static bool WriteToFile( @@ -625,7 +621,7 @@ InProcCrashReporter::EmitThreads( else if (m_enumerateThreadsCallback != nullptr) { uint64_t crashingTid = static_cast(minipal_get_current_thread_id()); - s_threadContext.Init(&m_jsonWriter, &s_consoleWriter, crashingTid, m_frameLimitPerThread, context); + s_threadContext.Init(&m_jsonWriter, &s_consoleWriter, m_moduleInfoCallback, crashingTid, m_frameLimitPerThread, context); s_threadContext.EnumerateThreads(m_enumerateThreadsCallback); @@ -655,6 +651,7 @@ InProcCrashReporter::Initialize( m_isManagedThreadCallback = settings.isManagedThreadCallback; m_walkStackCallback = settings.walkStackCallback; m_enumerateThreadsCallback = settings.enumerateThreadsCallback; + m_moduleInfoCallback = settings.moduleInfoCallback; m_frameLimitPerThread = settings.frameLimitPerThread; CrashReportHelpers::CopyString(m_reportPath, sizeof(m_reportPath), settings.reportPath); @@ -1260,14 +1257,17 @@ CrashReportHelpers::JsonFrameCallback( const char* methodName, const char* className, const char* moduleName, + const void* moduleHandle, uint32_t nativeOffset, uint32_t token, uint32_t ilOffset, uint32_t moduleTimestamp, uint32_t moduleSize, - const char* moduleGuid, + const GUID* moduleGuid, void* ctx) { + (void)moduleHandle; + SignalSafeJsonWriter* writer = reinterpret_cast(ctx); if (writer == nullptr) { @@ -1296,7 +1296,7 @@ CrashReportHelpers::WriteFrameToJson( uint32_t ilOffset, uint32_t moduleTimestamp, uint32_t moduleSize, - const char* moduleGuid) + const GUID* moduleGuid) { if (writer == nullptr) { @@ -1332,9 +1332,10 @@ CrashReportHelpers::WriteFrameToJson( { writer->WriteHexAsString("sizeofimage", moduleSize); } - if (moduleGuid != nullptr && moduleGuid[0] != '\0') + if (moduleGuid != nullptr) { - writer->WriteString("guid", moduleGuid); + minipal_guid_as_string(*moduleGuid, s_moduleGuidScratch, sizeof(s_moduleGuidScratch)); + writer->WriteString("guid", s_moduleGuidScratch); } } else @@ -1586,12 +1587,13 @@ CrashReportHelpers::FrameSinkCallback( const char* methodName, const char* className, const char* moduleName, + const void* moduleHandle, uint32_t nativeOffset, uint32_t token, uint32_t ilOffset, uint32_t moduleTimestamp, uint32_t moduleSize, - const char* moduleGuid, + const GUID* moduleGuid, void* ctx) { FrameSinks* sinks = reinterpret_cast(ctx); @@ -1604,8 +1606,6 @@ CrashReportHelpers::FrameSinkCallback( ? *sinks->currentThreadFrameCount : 0; - int moduleIndex = s_moduleTable.GetOrAddIndex(moduleName, moduleGuid); - // Always feed the JSON sink: the file output is the authoritative, // post-mortem data store and the cap is a compact-log triage knob. WriteFrameToJson(sinks->writer, @@ -1618,6 +1618,9 @@ CrashReportHelpers::FrameSinkCallback( frameIndex >= sinks->frameLimitPerThread; if (!consoleCapped) { + int moduleIndex = sinks->moduleInfoCallback != nullptr && moduleHandle != nullptr + ? s_moduleTable.GetOrAddIndex(moduleHandle) + : -1; WriteFrameToConsole(sinks->consoleWriter, sinks->methodNameBuffer, sinks->methodNameBufferSize, @@ -1642,24 +1645,26 @@ ThreadEnumerationContext::OnFrame( const char* methodName, const char* className, const char* moduleName, + const void* moduleHandle, uint32_t nativeOffset, uint32_t token, uint32_t ilOffset, uint32_t moduleTimestamp, uint32_t moduleSize, - const char* moduleGuid) + const GUID* moduleGuid) { CrashReportHelpers::FrameSinks sinks = { m_jsonWriter, m_consoleWriter, + m_moduleInfoCallback, &m_currentThreadFrameCount, &m_currentThreadDroppedCount, m_frameLimitPerThread, m_methodNameScratch, sizeof(m_methodNameScratch), }; - CrashReportHelpers::FrameSinkCallback(ip, stackPointer, methodName, className, moduleName, + CrashReportHelpers::FrameSinkCallback(ip, stackPointer, methodName, className, moduleName, moduleHandle, nativeOffset, token, ilOffset, moduleTimestamp, moduleSize, moduleGuid, &sinks); } @@ -1670,19 +1675,20 @@ ThreadEnumerationContext::FrameCallback( const char* methodName, const char* className, const char* moduleName, + const void* moduleHandle, uint32_t nativeOffset, uint32_t token, uint32_t ilOffset, uint32_t moduleTimestamp, uint32_t moduleSize, - const char* moduleGuid, + const GUID* moduleGuid, void* ctx) { if (ctx == nullptr) { return; } - reinterpret_cast(ctx)->OnFrame(ip, stackPointer, methodName, className, moduleName, nativeOffset, token, ilOffset, moduleTimestamp, moduleSize, moduleGuid); + reinterpret_cast(ctx)->OnFrame(ip, stackPointer, methodName, className, moduleName, moduleHandle, nativeOffset, token, ilOffset, moduleTimestamp, moduleSize, moduleGuid); } void @@ -1817,6 +1823,7 @@ InProcCrashReporter::EmitSynthesizedCrashThread( { &m_jsonWriter, &s_consoleWriter, + m_moduleInfoCallback, &synthesizedFrameCount, &synthesizedDroppedCount, m_frameLimitPerThread, @@ -2014,9 +2021,21 @@ InProcCrashReporter::EndConsoleReport() s_consoleWriter.AppendStr(" ["); s_consoleWriter.AppendDecimal(static_cast(i)); s_consoleWriter.AppendStr("] "); - s_consoleWriter.AppendStr(CrashReportHelpers::GetFilename(s_moduleTable.Name(i))); - s_consoleWriter.AppendChar(' '); - s_consoleWriter.AppendStr(s_moduleTable.Guid(i)); + const char* moduleName = nullptr; + GUID moduleGuid; + if (m_moduleInfoCallback != nullptr && + m_moduleInfoCallback(s_moduleTable.ModuleHandle(i), &moduleName, &moduleGuid) && + moduleName != nullptr && moduleName[0] != '\0') + { + s_consoleWriter.AppendStr(CrashReportHelpers::GetFilename(moduleName)); + s_consoleWriter.AppendChar(' '); + minipal_guid_as_string(moduleGuid, s_moduleGuidScratch, sizeof(s_moduleGuidScratch)); + s_consoleWriter.AppendStr(s_moduleGuidScratch); + } + else + { + s_consoleWriter.AppendStr(""); + } s_consoleWriter.EndLine(); } } diff --git a/src/coreclr/debug/crashreport/inproccrashreporter.h b/src/coreclr/debug/crashreport/inproccrashreporter.h index 006385e1e152fb..9cdcd46a7f9f23 100644 --- a/src/coreclr/debug/crashreport/inproccrashreporter.h +++ b/src/coreclr/debug/crashreport/inproccrashreporter.h @@ -11,6 +11,8 @@ #include #include +#include + #include "signalsafejsonwriter.h" // Scratch-buffer sizes used throughout the in-proc crash reporter: @@ -38,12 +40,13 @@ using InProcCrashReportFrameCallback = void (*)( const char* methodName, const char* className, const char* moduleName, + const void* moduleHandle, uint32_t nativeOffset, uint32_t token, uint32_t ilOffset, uint32_t moduleTimestamp, uint32_t moduleSize, - const char* moduleGuid, + const GUID* moduleGuid, void* ctx); using InProcCrashReportWalkStackCallback = void (*)( @@ -63,12 +66,18 @@ using InProcCrashReportEnumerateThreadsCallback = void (*)( InProcCrashReportFrameCallback frameCallback, void* ctx); +using InProcCrashReportModuleInfoCallback = bool (*)( + const void* moduleHandle, + const char** moduleName, + GUID* moduleGuid); + struct InProcCrashReporterSettings { const char* reportPath; InProcCrashReportIsManagedThreadCallback isManagedThreadCallback; InProcCrashReportWalkStackCallback walkStackCallback; InProcCrashReportEnumerateThreadsCallback enumerateThreadsCallback; + InProcCrashReportModuleInfoCallback moduleInfoCallback; uint32_t frameLimitPerThread; }; @@ -114,6 +123,7 @@ class InProcCrashReporter InProcCrashReportIsManagedThreadCallback m_isManagedThreadCallback = nullptr; InProcCrashReportWalkStackCallback m_walkStackCallback = nullptr; InProcCrashReportEnumerateThreadsCallback m_enumerateThreadsCallback = nullptr; + InProcCrashReportModuleInfoCallback m_moduleInfoCallback = nullptr; char m_reportPath[CRASHREPORT_PATH_BUFFER_SIZE] = {}; char m_reportFilePathScratch[CRASHREPORT_PATH_BUFFER_SIZE] = {}; char m_expandedReportPathScratch[CRASHREPORT_PATH_BUFFER_SIZE] = {}; diff --git a/src/coreclr/vm/crashreportstackwalker.cpp b/src/coreclr/vm/crashreportstackwalker.cpp index 6a04b8df9452de..df4213686f5b1b 100644 --- a/src/coreclr/vm/crashreportstackwalker.cpp +++ b/src/coreclr/vm/crashreportstackwalker.cpp @@ -27,7 +27,8 @@ struct CrashReportStackWalkerScratch { char crashExceptionType[CRASHREPORT_STRING_BUFFER_SIZE]; char className[CRASHREPORT_STRING_BUFFER_SIZE]; - char moduleGuid[MINIPAL_GUID_BUFFER_LEN]; + GUID moduleGuid; + bool hasModuleGuid; }; static CrashReportStackWalkerScratch s_crashReportScratch; @@ -35,6 +36,119 @@ static WalkContext s_walkContext; static void BuildTypeName(LPUTF8 buffer, size_t bufferSize, LPCUTF8 namespaceName, LPCUTF8 className); +static +void +CrashReportGetModuleDetails( + Module* pModule, + LPCUTF8* moduleName, + GUID* moduleGuid, + bool* hasModuleGuid, + uint32_t* moduleTimestamp, + uint32_t* moduleSize) +{ + CONTRACTL + { + NOTHROW; + GC_NOTRIGGER; + CANNOT_TAKE_LOCK; + MODE_ANY; + } + CONTRACTL_END; + + if (moduleName != nullptr) + { + *moduleName = nullptr; + } + if (hasModuleGuid != nullptr) + { + *hasModuleGuid = false; + } + if (moduleTimestamp != nullptr) + { + *moduleTimestamp = 0; + } + if (moduleSize != nullptr) + { + *moduleSize = 0; + } + + if (pModule == nullptr) + { + return; + } + + if (moduleName != nullptr) + { + Assembly* pAssembly = pModule->GetAssembly(); + if (pAssembly != nullptr) + { + *moduleName = pAssembly->GetSimpleName(); + } + } + + if (moduleTimestamp != nullptr || moduleSize != nullptr) + { + PEAssembly* pPEAssembly = pModule->GetPEAssembly(); + if (pPEAssembly != nullptr && pPEAssembly->HasLoadedPEImage()) + { + if (moduleTimestamp != nullptr) + { + *moduleTimestamp = pPEAssembly->GetLoadedLayout()->GetTimeDateStamp(); + } + if (moduleSize != nullptr) + { + *moduleSize = static_cast(pPEAssembly->GetLoadedLayout()->GetSize()); + } + } + } + + if (moduleGuid != nullptr) + { + IMDInternalImport* pImport = pModule->GetMDImport(); + if (pImport != nullptr && SUCCEEDED(pImport->GetScopeProps(nullptr, moduleGuid))) + { + if (hasModuleGuid != nullptr) + { + *hasModuleGuid = true; + } + } + } +} + +static +bool +CrashReportGetModuleInfo( + const void* moduleHandle, + const char** moduleName, + GUID* moduleGuid) +{ + CONTRACTL + { + NOTHROW; + GC_NOTRIGGER; + CANNOT_TAKE_LOCK; + MODE_ANY; + } + CONTRACTL_END; + + if (moduleName == nullptr || moduleGuid == nullptr || moduleHandle == nullptr) + { + return false; + } + + LPCUTF8 resolvedModuleName = nullptr; + bool hasModuleGuid = false; + Module* pModule = reinterpret_cast(const_cast(moduleHandle)); + CrashReportGetModuleDetails(pModule, &resolvedModuleName, moduleGuid, &hasModuleGuid, nullptr, nullptr); + if (resolvedModuleName == nullptr || resolvedModuleName[0] == '\0' || !hasModuleGuid) + { + return false; + } + + *moduleName = resolvedModuleName; + return true; +} + static StackWalkAction FrameCallbackAdapter( @@ -81,16 +195,7 @@ FrameCallbackAdapter( s_crashReportScratch.className[0] = '\0'; BuildTypeName(s_crashReportScratch.className, sizeof(s_crashReportScratch.className), namespaceName, className); - LPCUTF8 moduleName = nullptr; Module* pModule = pMD->GetModule(); - if (pModule != nullptr) - { - Assembly* pAssembly = pModule->GetAssembly(); - if (pAssembly != nullptr) - { - moduleName = pAssembly->GetSimpleName(); - } - } uint32_t nativeOffset = pCF->HasFaulted() ? 0 : pCF->GetRelOffset(); uint32_t ilOffset = 0; @@ -134,30 +239,18 @@ FrameCallbackAdapter( uint32_t moduleTimestamp = 0; uint32_t moduleSize = 0; - s_crashReportScratch.moduleGuid[0] = '\0'; - - if (pModule != nullptr) - { - PEAssembly* pPEAssembly = pModule->GetPEAssembly(); - if (pPEAssembly != nullptr && pPEAssembly->HasLoadedPEImage()) - { - moduleTimestamp = pPEAssembly->GetLoadedLayout()->GetTimeDateStamp(); - moduleSize = static_cast(pPEAssembly->GetLoadedLayout()->GetSize()); - } - - IMDInternalImport* pImport = pModule->GetMDImport(); - if (pImport != nullptr) - { - GUID mvid; - if (SUCCEEDED(pImport->GetScopeProps(nullptr, &mvid))) - { - minipal_guid_as_string(mvid, s_crashReportScratch.moduleGuid, sizeof(s_crashReportScratch.moduleGuid)); - } - } - } + LPCUTF8 moduleName = nullptr; + s_crashReportScratch.hasModuleGuid = false; + CrashReportGetModuleDetails( + pModule, + &moduleName, + &s_crashReportScratch.moduleGuid, + &s_crashReportScratch.hasModuleGuid, + &moduleTimestamp, + &moduleSize); className = s_crashReportScratch.className[0] == '\0' ? nullptr : s_crashReportScratch.className; - ctx->callback(static_cast(ip), static_cast(stackPointer), methodName, className, moduleName, nativeOffset, static_cast(token), ilOffset, moduleTimestamp, moduleSize, s_crashReportScratch.moduleGuid, ctx->userCtx); + ctx->callback(static_cast(ip), static_cast(stackPointer), methodName, className, moduleName, pModule, nativeOffset, static_cast(token), ilOffset, moduleTimestamp, moduleSize, s_crashReportScratch.hasModuleGuid ? &s_crashReportScratch.moduleGuid : nullptr, ctx->userCtx); return SWA_CONTINUE; } @@ -445,6 +538,7 @@ CrashReportConfigure() settings.isManagedThreadCallback = CrashReportIsCurrentThreadManaged; settings.walkStackCallback = CrashReportWalkStack; settings.enumerateThreadsCallback = CrashReportEnumerateThreads; + settings.moduleInfoCallback = CrashReportGetModuleInfo; settings.frameLimitPerThread = CLRConfig::GetConfigValue(CLRConfig::INTERNAL_CrashReportFrameLimitPerThread); // Initialize the reporter and register the PAL signal-path callback last From e96645672cfb7701fcd5df3894585eaf23ed4af3 Mon Sep 17 00:00:00 2001 From: Mitchell Hwang Date: Thu, 14 May 2026 17:31:51 -0400 Subject: [PATCH 103/109] Clean up in-proc crash report frame emission Remove the dead JSON-only frame callback and route walked frames through one JSON-plus-console emission path. Also preserve token/IL identity when method names are unavailable and drop unused siginfo plumbing. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../debug/crashreport/inproccrashreporter.cpp | 267 +++++++++++------- .../debug/crashreport/inproccrashreporter.h | 1 - src/coreclr/vm/crashreportstackwalker.cpp | 2 +- 3 files changed, 163 insertions(+), 107 deletions(-) diff --git a/src/coreclr/debug/crashreport/inproccrashreporter.cpp b/src/coreclr/debug/crashreport/inproccrashreporter.cpp index 50cc8013a9caf8..b18088165aeadb 100644 --- a/src/coreclr/debug/crashreport/inproccrashreporter.cpp +++ b/src/coreclr/debug/crashreport/inproccrashreporter.cpp @@ -26,7 +26,6 @@ #include #endif - static const char CRASHREPORT_PROTOCOL_VERSION[] = "1.0.0"; static constexpr uint32_t CRASHREPORT_COR_E_STACKOVERFLOW = 0x800703E9; static const char CRASHREPORT_STACK_OVERFLOW_EXCEPTION_TYPE[] = "System.StackOverflowException"; @@ -95,7 +94,6 @@ static char sccsid[] = "@(#)Version N/A"; #endif static char s_versionScratch[sizeof(sccsid)]; -static char s_jsonFrameCallbackMethodNameScratch[CRASHREPORT_STRING_BUFFER_SIZE]; static char s_moduleGuidScratch[MINIPAL_GUID_BUFFER_LEN]; static const char* @@ -176,7 +174,8 @@ static constexpr size_t MAX_MODULES_IN_TABLE = 256; class ModuleTable { public: - int GetOrAddIndex(const void* moduleHandle) + int GetOrAddIndex( + const void* moduleHandle) { if (moduleHandle == nullptr) { @@ -361,9 +360,9 @@ static CrashReportOutputContext s_outputContext; class CrashReportHelpers { public: - struct FrameSinks + struct FrameContext { - SignalSafeJsonWriter* writer; + SignalSafeJsonWriter* jsonWriter; SignalSafeConsoleWriter* consoleWriter; InProcCrashReportModuleInfoCallback moduleInfoCallback; uint32_t* currentThreadFrameCount; @@ -414,21 +413,6 @@ class CrashReportHelpers size_t bufferSize, const char* value); - static void JsonFrameCallback( - uint64_t ip, - uint64_t stackPointer, - const char* methodName, - const char* className, - const char* moduleName, - const void* moduleHandle, - uint32_t nativeOffset, - uint32_t token, - uint32_t ilOffset, - uint32_t moduleTimestamp, - uint32_t moduleSize, - const GUID* moduleGuid, - void* ctx); - static void WriteFrameToJson( SignalSafeJsonWriter* writer, char* methodNameBuffer, @@ -454,7 +438,7 @@ class CrashReportHelpers uint64_t ip, const char* methodName, const char* className, - const char* moduleName, + const char* fallbackModuleName, uint32_t nativeOffset, uint32_t token, uint32_t ilOffset); @@ -498,7 +482,7 @@ class CrashReportHelpers uint32_t frameCount, uint32_t droppedCount); - static void FrameSinkCallback( + static void WriteFrame( uint64_t ip, uint64_t stackPointer, const char* methodName, @@ -513,6 +497,28 @@ class CrashReportHelpers const GUID* moduleGuid, void* ctx); + static void WriteFrameToReport( + SignalSafeJsonWriter* jsonWriter, + SignalSafeConsoleWriter* consoleWriter, + InProcCrashReportModuleInfoCallback moduleInfoCallback, + char* methodNameBuffer, + size_t methodNameBufferSize, + uint32_t* currentThreadFrameCount, + uint32_t* currentThreadDroppedCount, + uint32_t frameLimitPerThread, + uint64_t ip, + uint64_t stackPointer, + const char* methodName, + const char* className, + const char* moduleName, + const void* moduleHandle, + uint32_t nativeOffset, + uint32_t token, + uint32_t ilOffset, + uint32_t moduleTimestamp, + uint32_t moduleSize, + const GUID* moduleGuid); + static bool WriteToFile( int fd, const char* buffer, @@ -548,7 +554,6 @@ class CrashReportHelpers void InProcCrashReporter::CreateReport( int signal, - siginfo_t* siginfo, void* context) { static LONG s_generating = 0; @@ -586,8 +591,6 @@ InProcCrashReporter::CreateReport( } } - (void)siginfo; - InProcCrashReportCrashKind crashKind = static_cast( InterlockedExchange(&s_crashKind, static_cast(InProcCrashReportCrashKind::Unknown))); @@ -706,8 +709,10 @@ InProcCrashReporter::Initialize( void InProcCrashReportSignalDispatcher(int signal, void* siginfo, void* context) { + (void)siginfo; + InProcCrashReporter& reporter = InProcCrashReporter::GetInstance(); - reporter.CreateReport(signal, static_cast(siginfo), context); + reporter.CreateReport(signal, context); } void @@ -1241,44 +1246,29 @@ CrashReportHelpers::GetFilename( return path; } -void -CrashReportHelpers::CopyString( - char* buffer, - size_t bufferSize, - const char* value) +static bool +HasModuleName(const char* moduleName) { - CopyStringToBuffer(buffer, bufferSize, value); + return moduleName != nullptr && moduleName[0] != '\0'; } -void -CrashReportHelpers::JsonFrameCallback( - uint64_t ip, - uint64_t stackPointer, +static bool +HasManagedIdentity( const char* methodName, - const char* className, const char* moduleName, - const void* moduleHandle, - uint32_t nativeOffset, - uint32_t token, - uint32_t ilOffset, - uint32_t moduleTimestamp, - uint32_t moduleSize, - const GUID* moduleGuid, - void* ctx) + uint32_t token) { - (void)moduleHandle; - - SignalSafeJsonWriter* writer = reinterpret_cast(ctx); - if (writer == nullptr) - { - return; - } + return methodName != nullptr || + (token != 0 && HasModuleName(moduleName)); +} - WriteFrameToJson(writer, - s_jsonFrameCallbackMethodNameScratch, - sizeof(s_jsonFrameCallbackMethodNameScratch), - ip, stackPointer, methodName, className, moduleName, - nativeOffset, token, ilOffset, moduleTimestamp, moduleSize, moduleGuid); +void +CrashReportHelpers::CopyString( + char* buffer, + size_t bufferSize, + const char* value) +{ + CopyStringToBuffer(buffer, bufferSize, value); } void @@ -1308,19 +1298,25 @@ CrashReportHelpers::WriteFrameToJson( writer->WriteHexAsString("native_address", ip); writer->WriteHexAsString("native_offset", nativeOffset); - if (methodName != nullptr) + if (HasManagedIdentity(methodName, moduleName, token)) { - const char* fullMethodName = methodName; - if (methodNameBuffer != nullptr && methodNameBufferSize != 0) + writer->WriteString("is_managed", "true"); + if (methodName != nullptr) { - BuildMethodName(methodNameBuffer, methodNameBufferSize, className, methodName); - fullMethodName = methodNameBuffer; + const char* fullMethodName = methodName; + if (methodNameBuffer != nullptr && methodNameBufferSize != 0) + { + BuildMethodName(methodNameBuffer, methodNameBufferSize, className, methodName); + fullMethodName = methodNameBuffer; + } + writer->WriteString("method_name", fullMethodName); } - writer->WriteString("method_name", fullMethodName); - writer->WriteString("is_managed", "true"); - writer->WriteHexAsString("token", token); - writer->WriteHexAsString("il_offset", ilOffset); - if (moduleName != nullptr) + if (methodName != nullptr || token != 0) + { + writer->WriteHexAsString("token", token); + writer->WriteHexAsString("il_offset", ilOffset); + } + if (HasModuleName(moduleName)) { writer->WriteString("filename", moduleName); } @@ -1341,7 +1337,7 @@ CrashReportHelpers::WriteFrameToJson( else { writer->WriteString("is_managed", "false"); - if (moduleName != nullptr) + if (HasModuleName(moduleName)) { writer->WriteString("native_module", moduleName); } @@ -1360,7 +1356,7 @@ CrashReportHelpers::WriteFrameToConsole( uint64_t ip, const char* methodName, const char* className, - const char* moduleName, + const char* fallbackModuleName, uint32_t nativeOffset, uint32_t token, uint32_t ilOffset) @@ -1384,10 +1380,10 @@ CrashReportHelpers::WriteFrameToConsole( consoleWriter->AppendDecimal(static_cast(moduleIndex)); consoleWriter->AppendStr("] "); } - else if (methodName != nullptr && moduleName != nullptr && moduleName[0] != '\0') + else if ((methodName != nullptr || (token != 0 && HasModuleName(fallbackModuleName))) && HasModuleName(fallbackModuleName)) { consoleWriter->AppendStr("(in "); - consoleWriter->AppendStr(GetFilename(moduleName)); + consoleWriter->AppendStr(GetFilename(fallbackModuleName)); consoleWriter->AppendStr(") "); } @@ -1406,14 +1402,21 @@ CrashReportHelpers::WriteFrameToConsole( consoleWriter->AppendHex(static_cast(token)); consoleWriter->AppendChar(')'); } + else if (token != 0 && HasModuleName(fallbackModuleName)) + { + consoleWriter->AppendStr("token=0x"); + consoleWriter->AppendHex(static_cast(token)); + consoleWriter->AppendStr(" + 0x"); + consoleWriter->AppendHex(static_cast(ilOffset)); + } else { consoleWriter->AppendStr("0x"); consoleWriter->AppendHex(ip); - if (moduleName != nullptr && moduleName[0] != '\0') + if (HasModuleName(fallbackModuleName)) { consoleWriter->AppendStr(" ("); - consoleWriter->AppendStr(GetFilename(moduleName)); + consoleWriter->AppendStr(GetFilename(fallbackModuleName)); consoleWriter->AppendStr(" + 0x"); consoleWriter->AppendHex(static_cast(nativeOffset)); consoleWriter->AppendChar(')'); @@ -1581,7 +1584,7 @@ CrashReportHelpers::EndConsoleThreadBlock( } void -CrashReportHelpers::FrameSinkCallback( +CrashReportHelpers::WriteFrame( uint64_t ip, uint64_t stackPointer, const char* methodName, @@ -1596,45 +1599,91 @@ CrashReportHelpers::FrameSinkCallback( const GUID* moduleGuid, void* ctx) { - FrameSinks* sinks = reinterpret_cast(ctx); - if (sinks == nullptr) + FrameContext* frameContext = reinterpret_cast(ctx); + if (frameContext == nullptr) { return; } - uint32_t frameIndex = sinks->currentThreadFrameCount != nullptr - ? *sinks->currentThreadFrameCount + WriteFrameToReport( + frameContext->jsonWriter, + frameContext->consoleWriter, + frameContext->moduleInfoCallback, + frameContext->methodNameBuffer, + frameContext->methodNameBufferSize, + frameContext->currentThreadFrameCount, + frameContext->currentThreadDroppedCount, + frameContext->frameLimitPerThread, + ip, + stackPointer, + methodName, + className, + moduleName, + moduleHandle, + nativeOffset, + token, + ilOffset, + moduleTimestamp, + moduleSize, + moduleGuid); +} + +void +CrashReportHelpers::WriteFrameToReport( + SignalSafeJsonWriter* jsonWriter, + SignalSafeConsoleWriter* consoleWriter, + InProcCrashReportModuleInfoCallback moduleInfoCallback, + char* methodNameBuffer, + size_t methodNameBufferSize, + uint32_t* currentThreadFrameCount, + uint32_t* currentThreadDroppedCount, + uint32_t frameLimitPerThread, + uint64_t ip, + uint64_t stackPointer, + const char* methodName, + const char* className, + const char* moduleName, + const void* moduleHandle, + uint32_t nativeOffset, + uint32_t token, + uint32_t ilOffset, + uint32_t moduleTimestamp, + uint32_t moduleSize, + const GUID* moduleGuid) +{ + uint32_t frameIndex = currentThreadFrameCount != nullptr + ? *currentThreadFrameCount : 0; // Always feed the JSON sink: the file output is the authoritative, // post-mortem data store and the cap is a compact-log triage knob. - WriteFrameToJson(sinks->writer, - sinks->methodNameBuffer, - sinks->methodNameBufferSize, + WriteFrameToJson(jsonWriter, + methodNameBuffer, + methodNameBufferSize, ip, stackPointer, methodName, className, moduleName, nativeOffset, token, ilOffset, moduleTimestamp, moduleSize, moduleGuid); - bool consoleCapped = sinks->frameLimitPerThread != 0 && - frameIndex >= sinks->frameLimitPerThread; + bool consoleCapped = frameLimitPerThread != 0 && + frameIndex >= frameLimitPerThread; if (!consoleCapped) { - int moduleIndex = sinks->moduleInfoCallback != nullptr && moduleHandle != nullptr + int moduleIndex = moduleInfoCallback != nullptr && moduleHandle != nullptr ? s_moduleTable.GetOrAddIndex(moduleHandle) : -1; - WriteFrameToConsole(sinks->consoleWriter, - sinks->methodNameBuffer, - sinks->methodNameBufferSize, + WriteFrameToConsole(consoleWriter, + methodNameBuffer, + methodNameBufferSize, frameIndex, moduleIndex, ip, methodName, className, moduleName, nativeOffset, token, ilOffset); } - else if (sinks->currentThreadDroppedCount != nullptr) + else if (currentThreadDroppedCount != nullptr) { - ++*sinks->currentThreadDroppedCount; + (*currentThreadDroppedCount)++; } - if (sinks->currentThreadFrameCount != nullptr) + if (currentThreadFrameCount != nullptr) { - ++*sinks->currentThreadFrameCount; + (*currentThreadFrameCount)++; } } @@ -1653,19 +1702,27 @@ ThreadEnumerationContext::OnFrame( uint32_t moduleSize, const GUID* moduleGuid) { - CrashReportHelpers::FrameSinks sinks = - { + CrashReportHelpers::WriteFrameToReport( m_jsonWriter, m_consoleWriter, m_moduleInfoCallback, + m_methodNameScratch, + sizeof(m_methodNameScratch), &m_currentThreadFrameCount, &m_currentThreadDroppedCount, m_frameLimitPerThread, - m_methodNameScratch, - sizeof(m_methodNameScratch), - }; - CrashReportHelpers::FrameSinkCallback(ip, stackPointer, methodName, className, moduleName, moduleHandle, - nativeOffset, token, ilOffset, moduleTimestamp, moduleSize, moduleGuid, &sinks); + ip, + stackPointer, + methodName, + className, + moduleName, + moduleHandle, + nativeOffset, + token, + ilOffset, + moduleTimestamp, + moduleSize, + moduleGuid); } void @@ -1819,7 +1876,7 @@ InProcCrashReporter::EmitSynthesizedCrashThread( uint32_t synthesizedDroppedCount = 0; if (walkStack && m_walkStackCallback != nullptr) { - CrashReportHelpers::FrameSinks sinks = + CrashReportHelpers::FrameContext frameContext = { &m_jsonWriter, &s_consoleWriter, @@ -1830,7 +1887,7 @@ InProcCrashReporter::EmitSynthesizedCrashThread( m_methodNameScratch, sizeof(m_methodNameScratch), }; - m_walkStackCallback(&CrashReportHelpers::FrameSinkCallback, &sinks); + m_walkStackCallback(&CrashReportHelpers::WriteFrame, &frameContext); } CrashReportHelpers::EndConsoleThreadBlock(&s_consoleWriter, synthesizedFrameCount, synthesizedDroppedCount); @@ -1948,13 +2005,13 @@ InProcCrashReporter::EmitStackOverflowCrashThread() { if (m_frameLimitPerThread != 0 && consoleFrameCount >= m_frameLimitPerThread) { - ++consoleDroppedCount; + consoleDroppedCount++; continue; } CrashReportHelpers::WriteStackOverflowFrameToConsole( &s_consoleWriter, consoleFrameCount, s_stackOverflowTrace.frames[i]); - ++consoleFrameCount; + consoleFrameCount++; } continue; @@ -1962,12 +2019,12 @@ InProcCrashReporter::EmitStackOverflowCrashThread() if (m_frameLimitPerThread != 0 && consoleFrameCount >= m_frameLimitPerThread) { - ++consoleDroppedCount; + consoleDroppedCount++; } else { CrashReportHelpers::WriteStackOverflowFrameToConsole(&s_consoleWriter, consoleFrameCount, frame); - ++consoleFrameCount; + consoleFrameCount++; } ++i; } @@ -2025,7 +2082,7 @@ InProcCrashReporter::EndConsoleReport() GUID moduleGuid; if (m_moduleInfoCallback != nullptr && m_moduleInfoCallback(s_moduleTable.ModuleHandle(i), &moduleName, &moduleGuid) && - moduleName != nullptr && moduleName[0] != '\0') + HasModuleName(moduleName)) { s_consoleWriter.AppendStr(CrashReportHelpers::GetFilename(moduleName)); s_consoleWriter.AppendChar(' '); diff --git a/src/coreclr/debug/crashreport/inproccrashreporter.h b/src/coreclr/debug/crashreport/inproccrashreporter.h index 9cdcd46a7f9f23..3b051f21d60e1d 100644 --- a/src/coreclr/debug/crashreport/inproccrashreporter.h +++ b/src/coreclr/debug/crashreport/inproccrashreporter.h @@ -92,7 +92,6 @@ class InProcCrashReporter void CreateReport( int signal, - siginfo_t* siginfo, void* context); private: diff --git a/src/coreclr/vm/crashreportstackwalker.cpp b/src/coreclr/vm/crashreportstackwalker.cpp index df4213686f5b1b..f1c20201097d81 100644 --- a/src/coreclr/vm/crashreportstackwalker.cpp +++ b/src/coreclr/vm/crashreportstackwalker.cpp @@ -237,9 +237,9 @@ FrameCallbackAdapter( } } + LPCUTF8 moduleName = nullptr; uint32_t moduleTimestamp = 0; uint32_t moduleSize = 0; - LPCUTF8 moduleName = nullptr; s_crashReportScratch.hasModuleGuid = false; CrashReportGetModuleDetails( pModule, From 4684fa2c8d43ac7835f99aead2572a9000ee2500 Mon Sep 17 00:00:00 2001 From: Mitchell Hwang Date: Tue, 19 May 2026 16:47:54 -0400 Subject: [PATCH 104/109] Refine in-proc crash report feedback Move compact log line completion into EndLine, allocate crash report scratch state at initialization, group frame callback module fields, clean up stack-overflow capture plumbing, log initialization allocation failures, and scope Apple-specific reporter code to iOS/tvOS/MacCatalyst. Also make init-time storage publication race-safe, share the Android crash-report log tag through the reporter header, and remove the redundant module-table reset plus the single-use stack-overflow frame-formatting helper. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../debug/crashreport/inproccrashreporter.cpp | 779 ++++++++++-------- .../debug/crashreport/inproccrashreporter.h | 52 +- .../crashreport/signalsafeconsolewriter.cpp | 34 +- .../crashreport/signalsafeconsolewriter.h | 17 +- .../debug/crashreport/signalsafeformat.cpp | 42 +- .../debug/crashreport/signalsafeformat.h | 41 +- .../crashreport/signalsafejsonwriter.cpp | 13 +- .../debug/crashreport/signalsafejsonwriter.h | 3 + src/coreclr/vm/crashreportstackwalker.cpp | 92 ++- src/coreclr/vm/eepolicy.cpp | 47 +- src/coreclr/vm/excep.cpp | 11 + 11 files changed, 657 insertions(+), 474 deletions(-) diff --git a/src/coreclr/debug/crashreport/inproccrashreporter.cpp b/src/coreclr/debug/crashreport/inproccrashreporter.cpp index b18088165aeadb..37cd42834be954 100644 --- a/src/coreclr/debug/crashreport/inproccrashreporter.cpp +++ b/src/coreclr/debug/crashreport/inproccrashreporter.cpp @@ -14,14 +14,18 @@ #include #include +#include #include #include #include #include #include #include +#include #include -#ifdef __APPLE__ +#if defined(__ANDROID__) +#include +#elif defined(TARGET_IOS) || defined(TARGET_TVOS) || defined(TARGET_MACCATALYST) #include #include #endif @@ -31,7 +35,6 @@ static constexpr uint32_t CRASHREPORT_COR_E_STACKOVERFLOW = 0x800703E9; static const char CRASHREPORT_STACK_OVERFLOW_EXCEPTION_TYPE[] = "System.StackOverflowException"; static const char CRASHREPORT_STACK_OVERFLOW_TRACE_UNAVAILABLE_REASON[] = "stack_overflow_trace_unavailable"; static constexpr uint32_t CRASHREPORT_STACK_OVERFLOW_MAX_TRACE_FRAMES = 128; - #if defined(__x86_64__) static const char CRASHREPORT_ARCHITECTURE_NAME[] = "amd64"; #elif defined(__aarch64__) @@ -41,8 +44,8 @@ static const char CRASHREPORT_ARCHITECTURE_NAME[] = "arm"; #endif // Prescribed compact crash report log format. One logical line == one -// __android_log_write entry under tag "DOTNET_CRASH" on Android, one -// '\n'-terminated stderr write elsewhere. +// __android_log_write entry under CRASHREPORT_LOG_TAG on Android, one +// '\n'-terminated stderr write on Apple mobile platforms. // // *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** (BeginConsoleReport) // .NET Crash Report v @@ -64,9 +67,6 @@ static const char CRASHREPORT_ARCHITECTURE_NAME[] = "arm"; // [N] {} (one per ModuleTable entry) // *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** (closing separator) -static SignalSafeConsoleWriter s_consoleWriter; -static volatile LONG s_crashKind = static_cast(InProcCrashReportCrashKind::Unknown); - struct StackOverflowTraceFrame { char methodName[CRASHREPORT_STRING_BUFFER_SIZE]; @@ -84,8 +84,6 @@ struct StackOverflowTraceSnapshot volatile LONG available; }; -static StackOverflowTraceSnapshot s_stackOverflowTrace; - // Include the .NET version string instead of linking because it is "static". #if __has_include("_version.c") #include "_version.c" @@ -93,25 +91,6 @@ static StackOverflowTraceSnapshot s_stackOverflowTrace; static char sccsid[] = "@(#)Version N/A"; #endif -static char s_versionScratch[sizeof(sccsid)]; -static char s_moduleGuidScratch[MINIPAL_GUID_BUFFER_LEN]; - -static const char* -GetSignalNameAscii(int signal) -{ - switch (signal) - { - case SIGSEGV: return "SIGSEGV"; - case SIGBUS: return "SIGBUS"; - case SIGFPE: return "SIGFPE"; - case SIGILL: return "SIGILL"; - case SIGABRT: return "SIGABRT"; - case SIGTRAP: return "SIGTRAP"; - case SIGTERM: return "SIGTERM"; - default: return "Unknown signal"; - } -} - static void CopyStringToBuffer(char* buffer, size_t bufferSize, const char* value) { if (buffer == nullptr || bufferSize == 0) @@ -134,10 +113,10 @@ static void CopyStringToBuffer(char* buffer, size_t bufferSize, const char* valu buffer[toCopy] = '\0'; } -#ifdef __APPLE__ +#if defined(TARGET_IOS) || defined(TARGET_TVOS) || defined(TARGET_MACCATALYST) // Query a sysctl by name into a caller-supplied buffer. Called from Initialize, NOT from the // signal handler -- sysctl/sysctlbyname is not on POSIX's async-signal-safe list, so the -// queried values are cached for use during crash reporting (mirrors the m_hostName / +// queried values are cached for use during crash reporting (mirrors the hostName / // gethostname pattern). static void CacheSysctlString(const char* sysctlName, char* buffer, size_t bufferSize) { @@ -153,7 +132,7 @@ static void CacheSysctlString(const char* sysctlName, char* buffer, size_t buffe buffer[0] = '\0'; } } -#endif // __APPLE__ +#endif // defined(TARGET_IOS) || defined(TARGET_TVOS) || defined(TARGET_MACCATALYST) // Bounded module table that deduplicates each unique module observed during a // single crash report. Frames in the compact log refer to modules by short @@ -201,14 +180,11 @@ class ModuleTable size_t Count() const { return m_count; } const void* ModuleHandle(size_t i) const { return m_moduleHandles[i]; } - private: const void* m_moduleHandles[MAX_MODULES_IN_TABLE]; size_t m_count = 0; }; -static ModuleTable s_moduleTable; - class ThreadEnumerationContext { public: @@ -273,12 +249,12 @@ class ThreadEnumerationContext const char* className, const char* moduleName, const void* moduleHandle, - uint32_t nativeOffset, - uint32_t token, - uint32_t ilOffset, uint32_t moduleTimestamp, uint32_t moduleSize, const GUID* moduleGuid, + uint32_t nativeOffset, + uint32_t token, + uint32_t ilOffset, void* ctx); private: @@ -295,12 +271,12 @@ class ThreadEnumerationContext const char* className, const char* moduleName, const void* moduleHandle, - uint32_t nativeOffset, - uint32_t token, - uint32_t ilOffset, uint32_t moduleTimestamp, uint32_t moduleSize, - const GUID* moduleGuid); + const GUID* moduleGuid, + uint32_t nativeOffset, + uint32_t token, + uint32_t ilOffset); void EndCurrentConsoleThreadBlock(); void EndCurrentJsonThreadBlock(); @@ -318,8 +294,6 @@ class ThreadEnumerationContext char m_methodNameScratch[CRASHREPORT_STRING_BUFFER_SIZE]; }; -static ThreadEnumerationContext s_threadContext; - class CrashReportOutputContext { public: @@ -355,7 +329,62 @@ class CrashReportOutputContext bool m_writeFailed; }; -static CrashReportOutputContext s_outputContext; +// Holds the reporter's preallocated mutable state. Keeping this separate from +// InProcCrashReporter lets disabled processes avoid the large buffers entirely, +// while Initialize can allocate and publish the state before registering the PAL +// signal callback. +struct InProcCrashReporterStorage +{ + SignalSafeJsonWriter jsonWriter; + SignalSafeConsoleWriter consoleWriter; + StackOverflowTraceSnapshot stackOverflowTrace; + ModuleTable moduleTable; + ThreadEnumerationContext threadContext; + CrashReportOutputContext outputContext; + SignalSafeFormatter formatter; + InProcCrashReportIsManagedThreadCallback isManagedThreadCallback = nullptr; + InProcCrashReportWalkStackCallback walkStackCallback = nullptr; + InProcCrashReportEnumerateThreadsCallback enumerateThreadsCallback = nullptr; + InProcCrashReportModuleInfoCallback moduleInfoCallback = nullptr; + volatile LONG crashKind = static_cast(InProcCrashReportCrashKind::Unknown); + uint32_t frameLimitPerThread = 0; + char reportPath[CRASHREPORT_PATH_BUFFER_SIZE]; + char reportFilePathScratch[CRASHREPORT_PATH_BUFFER_SIZE]; + char expandedReportPathScratch[CRASHREPORT_PATH_BUFFER_SIZE]; + char methodNameScratch[CRASHREPORT_STRING_BUFFER_SIZE]; + char processName[CRASHREPORT_STRING_BUFFER_SIZE]; + char processNameScratch[CRASHREPORT_STRING_BUFFER_SIZE]; + char hostName[CRASHREPORT_STRING_BUFFER_SIZE]; + char versionScratch[sizeof(sccsid)]; + char moduleGuidScratch[MINIPAL_GUID_BUFFER_LEN]; +#if defined(TARGET_IOS) || defined(TARGET_TVOS) || defined(TARGET_MACCATALYST) + char osVersion[CRASHREPORT_STRING_BUFFER_SIZE]; + char systemModel[CRASHREPORT_STRING_BUFFER_SIZE]; +#endif +}; + +static InProcCrashReporterStorage* volatile s_storage = nullptr; + +static bool EnsureCrashReportStorage() +{ + if (s_storage != nullptr) + { + return true; + } + + InProcCrashReporterStorage* storage = new (std::nothrow) InProcCrashReporterStorage(); + if (storage == nullptr) + { + return false; + } + + if (InterlockedCompareExchangePointer(&s_storage, storage, nullptr) != nullptr) + { + delete storage; + } + + return true; +} class CrashReportHelpers { @@ -422,12 +451,12 @@ class CrashReportHelpers const char* methodName, const char* className, const char* moduleName, - uint32_t nativeOffset, - uint32_t token, - uint32_t ilOffset, uint32_t moduleTimestamp, uint32_t moduleSize, - const GUID* moduleGuid); + const GUID* moduleGuid, + uint32_t nativeOffset, + uint32_t token, + uint32_t ilOffset); static void WriteFrameToConsole( SignalSafeConsoleWriter* consoleWriter, @@ -489,12 +518,12 @@ class CrashReportHelpers const char* className, const char* moduleName, const void* moduleHandle, - uint32_t nativeOffset, - uint32_t token, - uint32_t ilOffset, uint32_t moduleTimestamp, uint32_t moduleSize, const GUID* moduleGuid, + uint32_t nativeOffset, + uint32_t token, + uint32_t ilOffset, void* ctx); static void WriteFrameToReport( @@ -512,12 +541,12 @@ class CrashReportHelpers const char* className, const char* moduleName, const void* moduleHandle, - uint32_t nativeOffset, - uint32_t token, - uint32_t ilOffset, uint32_t moduleTimestamp, uint32_t moduleSize, - const GUID* moduleGuid); + const GUID* moduleGuid, + uint32_t nativeOffset, + uint32_t token, + uint32_t ilOffset); static bool WriteToFile( int fd, @@ -530,25 +559,6 @@ class CrashReportHelpers // emitting bytes anywhere. static bool DiscardOutputCallback(const char* buffer, size_t len, void* ctx); - static bool BuildReportPath( - char* buffer, - size_t bufferSize, - char* expandedBuffer, - size_t expandedBufferSize, - char* numberBuffer, - size_t numberBufferSize, - const char* dumpPath, - const char* processName, - const char* hostName); - - static size_t ExpandDumpTemplate( - char* buffer, - size_t bufferSize, - char* numberBuffer, - size_t numberBufferSize, - const char* pattern, - const char* processName, - const char* hostName); }; void @@ -556,35 +566,30 @@ InProcCrashReporter::CreateReport( int signal, void* context) { + InProcCrashReporterStorage* storage = s_storage; + if (storage == nullptr) + { + return; + } + static LONG s_generating = 0; if (InterlockedCompareExchange(&s_generating, 1, 0) != 0) { return; } - m_reportFilePathScratch[0] = '\0'; - + storage->reportFilePathScratch[0] = '\0'; // The JSON file sink is only enabled when DbgMiniDumpName supplied a // template AND the template expanded to a valid path. Otherwise the // crash report runs in compact-log-only mode: the JSON emitter still // executes (so it can keep its bookkeeping consistent) but writes go // to a no-op DiscardOutputCallback instead of an open fd. - bool jsonEnabled = m_reportPath[0] != '\0' && - CrashReportHelpers::BuildReportPath( - m_reportFilePathScratch, - sizeof(m_reportFilePathScratch), - m_expandedReportPathScratch, - sizeof(m_expandedReportPathScratch), - m_numberScratch, - sizeof(m_numberScratch), - m_reportPath, - m_processName, - m_hostName); + bool jsonEnabled = storage->reportPath[0] != '\0' && BuildReportPath(); int fd = -1; if (jsonEnabled) { - fd = open(m_reportFilePathScratch, O_WRONLY | O_CREAT | O_TRUNC, 0600); + fd = open(storage->reportFilePathScratch, O_WRONLY | O_CREAT | O_TRUNC, 0600); if (fd == -1) { jsonEnabled = false; @@ -592,16 +597,16 @@ InProcCrashReporter::CreateReport( } InProcCrashReportCrashKind crashKind = static_cast( - InterlockedExchange(&s_crashKind, static_cast(InProcCrashReportCrashKind::Unknown))); + InterlockedExchange(&storage->crashKind, static_cast(InProcCrashReportCrashKind::Unknown))); - s_outputContext.Init(fd); + storage->outputContext.Init(fd); if (jsonEnabled) { - m_jsonWriter.Init(&CrashReportOutputContext::ChunkCallback, &s_outputContext); + storage->jsonWriter.Init(&CrashReportOutputContext::ChunkCallback, &storage->outputContext); } else { - m_jsonWriter.Init(&CrashReportHelpers::DiscardOutputCallback, nullptr); + storage->jsonWriter.Init(&CrashReportHelpers::DiscardOutputCallback, nullptr); } BeginConsoleReport(signal); @@ -616,19 +621,25 @@ InProcCrashReporter::EmitThreads( InProcCrashReportCrashKind crashKind, void* context) { - m_jsonWriter.OpenArray("threads"); + InProcCrashReporterStorage* storage = s_storage; + if (storage == nullptr) + { + return; + } + + storage->jsonWriter.OpenArray("threads"); if (crashKind == InProcCrashReportCrashKind::StackOverflow) { EmitStackOverflowCrashThread(); } - else if (m_enumerateThreadsCallback != nullptr) + else if (storage->enumerateThreadsCallback != nullptr) { uint64_t crashingTid = static_cast(minipal_get_current_thread_id()); - s_threadContext.Init(&m_jsonWriter, &s_consoleWriter, m_moduleInfoCallback, crashingTid, m_frameLimitPerThread, context); + storage->threadContext.Init(&storage->jsonWriter, &storage->consoleWriter, storage->moduleInfoCallback, crashingTid, storage->frameLimitPerThread, context); - s_threadContext.EnumerateThreads(m_enumerateThreadsCallback); + storage->threadContext.EnumerateThreads(storage->enumerateThreadsCallback); - if (s_threadContext.ThreadCount() == 0 || !s_threadContext.SawCrashThread()) + if (storage->threadContext.ThreadCount() == 0 || !storage->threadContext.SawCrashThread()) { EmitSynthesizedCrashThread(context, /*walkStack*/ false); } @@ -637,7 +648,7 @@ InProcCrashReporter::EmitThreads( { EmitSynthesizedCrashThread(context, /*walkStack*/ true); } - m_jsonWriter.CloseArray(); // threads + storage->jsonWriter.CloseArray(); // threads } InProcCrashReporter& @@ -647,18 +658,43 @@ InProcCrashReporter::GetInstance() return s_instance; } -void +const char* +InProcCrashReporter::GetSignalNameAscii(int signal) +{ + switch (signal) + { + case SIGSEGV: return "SIGSEGV"; + case SIGBUS: return "SIGBUS"; + case SIGFPE: return "SIGFPE"; + case SIGILL: return "SIGILL"; + case SIGABRT: return "SIGABRT"; + case SIGTRAP: return "SIGTRAP"; + case SIGTERM: return "SIGTERM"; + default: return "Unknown signal"; + } +} + +bool InProcCrashReporter::Initialize( const InProcCrashReporterSettings& settings) { - m_isManagedThreadCallback = settings.isManagedThreadCallback; - m_walkStackCallback = settings.walkStackCallback; - m_enumerateThreadsCallback = settings.enumerateThreadsCallback; - m_moduleInfoCallback = settings.moduleInfoCallback; - m_frameLimitPerThread = settings.frameLimitPerThread; - CrashReportHelpers::CopyString(m_reportPath, sizeof(m_reportPath), settings.reportPath); + if (!EnsureCrashReportStorage()) + { + InProcCrashReportLogInitializationFailure(".NET crash report disabled: failed to allocate reporter storage"); + return false; + } + + InProcCrashReporterStorage* storage = s_storage; + storage->isManagedThreadCallback = settings.isManagedThreadCallback; + storage->walkStackCallback = settings.walkStackCallback; + storage->enumerateThreadsCallback = settings.enumerateThreadsCallback; + storage->moduleInfoCallback = settings.moduleInfoCallback; + storage->frameLimitPerThread = settings.frameLimitPerThread; + storage->crashKind = static_cast(InProcCrashReportCrashKind::Unknown); + storage->stackOverflowTrace.available = 0; + CrashReportHelpers::CopyString(storage->reportPath, sizeof(storage->reportPath), settings.reportPath); - m_processName[0] = '\0'; + storage->processName[0] = '\0'; #if defined(__ANDROID__) // On Android every app forks from the Zygote, so /proc/self/exe always // resolves to /system/bin/app_process64. /proc/self/cmdline holds the @@ -667,20 +703,20 @@ InProcCrashReporter::Initialize( int cmdlineFd = open("/proc/self/cmdline", O_RDONLY | O_CLOEXEC); if (cmdlineFd >= 0) { - ssize_t n = read(cmdlineFd, m_processNameScratch, sizeof(m_processNameScratch) - 1); + ssize_t n = read(cmdlineFd, storage->processNameScratch, sizeof(storage->processNameScratch) - 1); close(cmdlineFd); if (n > 0) { - m_processNameScratch[n] = '\0'; - CrashReportHelpers::CopyString(m_processName, sizeof(m_processName), CrashReportHelpers::GetFilename(m_processNameScratch)); + storage->processNameScratch[n] = '\0'; + CrashReportHelpers::CopyString(storage->processName, sizeof(storage->processName), CrashReportHelpers::GetFilename(storage->processNameScratch)); } } #endif - if (m_processName[0] == '\0') + if (storage->processName[0] == '\0') { if (char* exePath = minipal_getexepath()) { - CrashReportHelpers::CopyString(m_processName, sizeof(m_processName), CrashReportHelpers::GetFilename(exePath)); + CrashReportHelpers::CopyString(storage->processName, sizeof(storage->processName), CrashReportHelpers::GetFilename(exePath)); free(exePath); } } @@ -688,22 +724,23 @@ InProcCrashReporter::Initialize( // Cache hostname here because gethostname is not on the POSIX // async-signal-safe list; the dump-template expander needs it for %h // expansion at crash time. - m_hostName[0] = '\0'; - if (gethostname(m_hostName, sizeof(m_hostName) - 1) == 0) + storage->hostName[0] = '\0'; + if (gethostname(storage->hostName, sizeof(storage->hostName) - 1) == 0) { - m_hostName[sizeof(m_hostName) - 1] = '\0'; + storage->hostName[sizeof(storage->hostName) - 1] = '\0'; } else { - m_hostName[0] = '\0'; + storage->hostName[0] = '\0'; } -#ifdef __APPLE__ +#if defined(TARGET_IOS) || defined(TARGET_TVOS) || defined(TARGET_MACCATALYST) // Cache sysctl values at Initialize because sysctl/sysctlbyname is not on POSIX's // async-signal-safe list; CreateReport reads these from the signal-handler path. - CacheSysctlString("kern.osproductversion", m_osVersion, sizeof(m_osVersion)); - CacheSysctlString("hw.model", m_systemModel, sizeof(m_systemModel)); + CacheSysctlString("kern.osproductversion", storage->osVersion, sizeof(storage->osVersion)); + CacheSysctlString("hw.model", storage->systemModel, sizeof(storage->systemModel)); #endif + return true; } void @@ -718,7 +755,10 @@ InProcCrashReportSignalDispatcher(int signal, void* siginfo, void* context) void InProcCrashReportInitialize(const InProcCrashReporterSettings& settings) { - InProcCrashReporter::GetInstance().Initialize(settings); + if (!InProcCrashReporter::GetInstance().Initialize(settings)) + { + return; + } // Register last so PAL only observes the dispatcher after the reporter // singleton is fully populated (mirrors the publication ordering used by @@ -726,10 +766,34 @@ InProcCrashReportInitialize(const InProcCrashReporterSettings& settings) PAL_SetInProcCrashReportCallback(&InProcCrashReportSignalDispatcher); } +void +InProcCrashReportLogInitializationFailure(const char* message) +{ + if (message == nullptr) + { + return; + } + +#if defined(__ANDROID__) + __android_log_write(ANDROID_LOG_ERROR, CRASHREPORT_LOG_TAG, message); +#elif defined(TARGET_IOS) || defined(TARGET_TVOS) || defined(TARGET_MACCATALYST) + minipal_log_write_error(message); + minipal_log_write_error("\n"); +#else + (void)message; +#endif +} + void InProcCrashReportSetCrashKind(InProcCrashReportCrashKind crashKind) { - InterlockedExchange(&s_crashKind, static_cast(crashKind)); + InProcCrashReporterStorage* storage = s_storage; + if (storage == nullptr) + { + return; + } + + InterlockedExchange(&storage->crashKind, static_cast(crashKind)); } void @@ -737,11 +801,18 @@ InProcCrashReportBeginStackOverflowTrace( uint64_t crashingTid, uint32_t totalFrameCount) { - InterlockedExchange(&s_stackOverflowTrace.available, 0); - s_stackOverflowTrace.crashingTid = crashingTid; - s_stackOverflowTrace.totalFrameCount = totalFrameCount; - s_stackOverflowTrace.frameCount = 0; - s_stackOverflowTrace.truncatedFrameCount = 0; + InProcCrashReporterStorage* storage = s_storage; + if (storage == nullptr) + { + return; + } + + StackOverflowTraceSnapshot& trace = storage->stackOverflowTrace; + InterlockedExchange(&trace.available, 0); + trace.crashingTid = crashingTid; + trace.totalFrameCount = totalFrameCount; + trace.frameCount = 0; + trace.truncatedFrameCount = 0; } void @@ -750,23 +821,35 @@ InProcCrashReportAddStackOverflowTraceFrame( uint32_t repeatCount, uint32_t repeatSequenceLength) { - if (s_stackOverflowTrace.frameCount >= CRASHREPORT_STACK_OVERFLOW_MAX_TRACE_FRAMES) + InProcCrashReporterStorage* storage = s_storage; + if (storage == nullptr) + { + return; + } + + StackOverflowTraceSnapshot& trace = storage->stackOverflowTrace; + if (trace.frameCount >= CRASHREPORT_STACK_OVERFLOW_MAX_TRACE_FRAMES) { - ++s_stackOverflowTrace.truncatedFrameCount; + trace.truncatedFrameCount++; return; } - StackOverflowTraceFrame& frame = s_stackOverflowTrace.frames[s_stackOverflowTrace.frameCount++]; + StackOverflowTraceFrame& frame = trace.frames[trace.frameCount++]; CopyStringToBuffer(frame.methodName, sizeof(frame.methodName), methodName); frame.repeatCount = repeatCount; frame.repeatSequenceLength = repeatSequenceLength; } void -InProcCrashReportCompleteStackOverflowTrace(uint32_t truncatedFrameCount) +InProcCrashReportEndStackOverflowTrace() { - s_stackOverflowTrace.truncatedFrameCount += truncatedFrameCount; - InterlockedExchange(&s_stackOverflowTrace.available, 1); + InProcCrashReporterStorage* storage = s_storage; + if (storage == nullptr) + { + return; + } + + InterlockedExchange(&storage->stackOverflowTrace.available, 1); } bool @@ -851,17 +934,14 @@ CrashReportOutputContext::ChunkCallback( // specifiers are rejected (return 0) to match createdump and to avoid // silently producing diverging file names from the same template. size_t -CrashReportHelpers::ExpandDumpTemplate( +InProcCrashReporter::ExpandDumpTemplate( char* buffer, size_t bufferSize, - char* numberBuffer, - size_t numberBufferSize, - const char* pattern, - const char* processName, - const char* hostName) -{ - if (buffer == nullptr || bufferSize == 0 || - numberBuffer == nullptr || numberBufferSize == 0 || + const char* pattern) +{ + InProcCrashReporterStorage* storage = s_storage; + if (storage == nullptr || + buffer == nullptr || bufferSize == 0 || pattern == nullptr) { return 0; @@ -882,7 +962,6 @@ CrashReportHelpers::ExpandDumpTemplate( char specifier = *pattern; const char* substitution = nullptr; - numberBuffer[0] = '\0'; switch (specifier) { @@ -896,28 +975,19 @@ CrashReportHelpers::ExpandDumpTemplate( case 'p': case 'd': - if (SignalSafeFormat::FormatUnsignedDecimal(numberBuffer, numberBufferSize, pid) == 0) - { - return 0; - } - substitution = numberBuffer; + substitution = storage->formatter.FormatUnsignedDecimal(pid); break; case 'e': - substitution = (processName != nullptr && processName[0] != '\0') ? processName : nullptr; + substitution = (storage->processName[0] != '\0') ? storage->processName : nullptr; break; case 'h': - substitution = (hostName != nullptr && hostName[0] != '\0') ? hostName : nullptr; + substitution = (storage->hostName[0] != '\0') ? storage->hostName : nullptr; break; case 't': - if (SignalSafeFormat::FormatUnsignedDecimal( - numberBuffer, numberBufferSize, static_cast(time(nullptr))) == 0) - { - return 0; - } - substitution = numberBuffer; + substitution = storage->formatter.FormatUnsignedDecimal(static_cast(time(nullptr))); break; default: @@ -961,44 +1031,29 @@ CrashReportHelpers::ExpandDumpTemplate( } bool -CrashReportHelpers::BuildReportPath( - char* buffer, - size_t bufferSize, - char* expandedBuffer, - size_t expandedBufferSize, - char* numberBuffer, - size_t numberBufferSize, - const char* dumpPath, - const char* processName, - const char* hostName) -{ - if (buffer == nullptr || bufferSize == 0 || - expandedBuffer == nullptr || expandedBufferSize == 0 || - numberBuffer == nullptr || numberBufferSize == 0 || - dumpPath == nullptr || dumpPath[0] == '\0') +InProcCrashReporter::BuildReportPath() +{ + InProcCrashReporterStorage* storage = s_storage; + if (storage == nullptr || storage->reportPath[0] == '\0') { return false; } size_t expandedLen = ExpandDumpTemplate( - expandedBuffer, - expandedBufferSize, - numberBuffer, - numberBufferSize, - dumpPath, - processName, - hostName); + storage->expandedReportPathScratch, + sizeof(storage->expandedReportPathScratch), + storage->reportPath); if (expandedLen == 0) { return false; } size_t pos = 0; - if (!AppendString(buffer, bufferSize, &pos, expandedBuffer)) + if (!CrashReportHelpers::AppendString(storage->reportFilePathScratch, sizeof(storage->reportFilePathScratch), &pos, storage->expandedReportPathScratch)) { return false; } - if (!AppendString(buffer, bufferSize, &pos, ".crashreport.json")) + if (!CrashReportHelpers::AppendString(storage->reportFilePathScratch, sizeof(storage->reportFilePathScratch), &pos, ".crashreport.json")) { return false; } @@ -1093,9 +1148,9 @@ CrashReportHelpers::GetInstructionPointer( } ucontext_t* ucontext = reinterpret_cast(context); -#if defined(__APPLE__) && defined(__x86_64__) +#if (defined(TARGET_IOS) || defined(TARGET_TVOS) || defined(TARGET_MACCATALYST)) && defined(__x86_64__) return static_cast(ucontext->uc_mcontext->__ss.__rip); -#elif defined(__APPLE__) && defined(__aarch64__) +#elif (defined(TARGET_IOS) || defined(TARGET_TVOS) || defined(TARGET_MACCATALYST)) && defined(__aarch64__) return reinterpret_cast(arm_thread_state64_get_pc_fptr(ucontext->uc_mcontext->__ss)); #elif defined(__x86_64__) return static_cast(ucontext->uc_mcontext.gregs[REG_RIP]); @@ -1118,9 +1173,9 @@ CrashReportHelpers::GetStackPointer( } ucontext_t* ucontext = reinterpret_cast(context); -#if defined(__APPLE__) && defined(__x86_64__) +#if (defined(TARGET_IOS) || defined(TARGET_TVOS) || defined(TARGET_MACCATALYST)) && defined(__x86_64__) return static_cast(ucontext->uc_mcontext->__ss.__rsp); -#elif defined(__APPLE__) && defined(__aarch64__) +#elif (defined(TARGET_IOS) || defined(TARGET_TVOS) || defined(TARGET_MACCATALYST)) && defined(__aarch64__) return static_cast(arm_thread_state64_get_sp(ucontext->uc_mcontext->__ss)); #elif defined(__x86_64__) return static_cast(ucontext->uc_mcontext.gregs[REG_RSP]); @@ -1143,9 +1198,9 @@ CrashReportHelpers::GetFramePointer( } ucontext_t* ucontext = reinterpret_cast(context); -#if defined(__APPLE__) && defined(__x86_64__) +#if (defined(TARGET_IOS) || defined(TARGET_TVOS) || defined(TARGET_MACCATALYST)) && defined(__x86_64__) return static_cast(ucontext->uc_mcontext->__ss.__rbp); -#elif defined(__APPLE__) && defined(__aarch64__) +#elif (defined(TARGET_IOS) || defined(TARGET_TVOS) || defined(TARGET_MACCATALYST)) && defined(__aarch64__) return static_cast(arm_thread_state64_get_fp(ucontext->uc_mcontext->__ss)); #elif defined(__x86_64__) return static_cast(ucontext->uc_mcontext.gregs[REG_RBP]); @@ -1281,12 +1336,12 @@ CrashReportHelpers::WriteFrameToJson( const char* methodName, const char* className, const char* moduleName, - uint32_t nativeOffset, - uint32_t token, - uint32_t ilOffset, uint32_t moduleTimestamp, uint32_t moduleSize, - const GUID* moduleGuid) + const GUID* moduleGuid, + uint32_t nativeOffset, + uint32_t token, + uint32_t ilOffset) { if (writer == nullptr) { @@ -1330,8 +1385,12 @@ CrashReportHelpers::WriteFrameToJson( } if (moduleGuid != nullptr) { - minipal_guid_as_string(*moduleGuid, s_moduleGuidScratch, sizeof(s_moduleGuidScratch)); - writer->WriteString("guid", s_moduleGuidScratch); + InProcCrashReporterStorage* storage = s_storage; + if (storage != nullptr) + { + minipal_guid_as_string(*moduleGuid, storage->moduleGuidScratch, sizeof(storage->moduleGuidScratch)); + writer->WriteString("guid", storage->moduleGuidScratch); + } } } else @@ -1591,12 +1650,12 @@ CrashReportHelpers::WriteFrame( const char* className, const char* moduleName, const void* moduleHandle, - uint32_t nativeOffset, - uint32_t token, - uint32_t ilOffset, uint32_t moduleTimestamp, uint32_t moduleSize, const GUID* moduleGuid, + uint32_t nativeOffset, + uint32_t token, + uint32_t ilOffset, void* ctx) { FrameContext* frameContext = reinterpret_cast(ctx); @@ -1620,12 +1679,12 @@ CrashReportHelpers::WriteFrame( className, moduleName, moduleHandle, - nativeOffset, - token, - ilOffset, moduleTimestamp, moduleSize, - moduleGuid); + moduleGuid, + nativeOffset, + token, + ilOffset); } void @@ -1644,12 +1703,12 @@ CrashReportHelpers::WriteFrameToReport( const char* className, const char* moduleName, const void* moduleHandle, - uint32_t nativeOffset, - uint32_t token, - uint32_t ilOffset, uint32_t moduleTimestamp, uint32_t moduleSize, - const GUID* moduleGuid) + const GUID* moduleGuid, + uint32_t nativeOffset, + uint32_t token, + uint32_t ilOffset) { uint32_t frameIndex = currentThreadFrameCount != nullptr ? *currentThreadFrameCount @@ -1661,14 +1720,15 @@ CrashReportHelpers::WriteFrameToReport( methodNameBuffer, methodNameBufferSize, ip, stackPointer, methodName, className, moduleName, - nativeOffset, token, ilOffset, moduleTimestamp, moduleSize, moduleGuid); + moduleTimestamp, moduleSize, moduleGuid, nativeOffset, token, ilOffset); bool consoleCapped = frameLimitPerThread != 0 && frameIndex >= frameLimitPerThread; if (!consoleCapped) { - int moduleIndex = moduleInfoCallback != nullptr && moduleHandle != nullptr - ? s_moduleTable.GetOrAddIndex(moduleHandle) + InProcCrashReporterStorage* storage = s_storage; + int moduleIndex = storage != nullptr && moduleInfoCallback != nullptr && moduleHandle != nullptr + ? storage->moduleTable.GetOrAddIndex(moduleHandle) : -1; WriteFrameToConsole(consoleWriter, methodNameBuffer, @@ -1695,12 +1755,12 @@ ThreadEnumerationContext::OnFrame( const char* className, const char* moduleName, const void* moduleHandle, - uint32_t nativeOffset, - uint32_t token, - uint32_t ilOffset, uint32_t moduleTimestamp, uint32_t moduleSize, - const GUID* moduleGuid) + const GUID* moduleGuid, + uint32_t nativeOffset, + uint32_t token, + uint32_t ilOffset) { CrashReportHelpers::WriteFrameToReport( m_jsonWriter, @@ -1717,12 +1777,12 @@ ThreadEnumerationContext::OnFrame( className, moduleName, moduleHandle, - nativeOffset, - token, - ilOffset, moduleTimestamp, moduleSize, - moduleGuid); + moduleGuid, + nativeOffset, + token, + ilOffset); } void @@ -1733,19 +1793,31 @@ ThreadEnumerationContext::FrameCallback( const char* className, const char* moduleName, const void* moduleHandle, - uint32_t nativeOffset, - uint32_t token, - uint32_t ilOffset, uint32_t moduleTimestamp, uint32_t moduleSize, const GUID* moduleGuid, + uint32_t nativeOffset, + uint32_t token, + uint32_t ilOffset, void* ctx) { if (ctx == nullptr) { return; } - reinterpret_cast(ctx)->OnFrame(ip, stackPointer, methodName, className, moduleName, moduleHandle, nativeOffset, token, ilOffset, moduleTimestamp, moduleSize, moduleGuid); + reinterpret_cast(ctx)->OnFrame( + ip, + stackPointer, + methodName, + className, + moduleName, + moduleHandle, + moduleTimestamp, + moduleSize, + moduleGuid, + nativeOffset, + token, + ilOffset); } void @@ -1861,50 +1933,63 @@ InProcCrashReporter::EmitSynthesizedCrashThread( void* context, bool walkStack) { + InProcCrashReporterStorage* storage = s_storage; + if (storage == nullptr) + { + return; + } + uint64_t crashingTid = static_cast(minipal_get_current_thread_id()); - bool isManagedThread = m_isManagedThreadCallback != nullptr && m_isManagedThreadCallback(); - CrashReportHelpers::BeginJsonThreadBlock(&m_jsonWriter, + bool isManagedThread = storage->isManagedThreadCallback != nullptr && storage->isManagedThreadCallback(); + CrashReportHelpers::BeginJsonThreadBlock(&storage->jsonWriter, crashingTid, isManagedThread, /*isCrashThread*/ true, nullptr, 0); - CrashReportHelpers::WriteRegistersToJson(&m_jsonWriter, context); - CrashReportHelpers::BeginJsonStackFrames(&m_jsonWriter, /*writeCrashSiteFrame*/ true, context); + CrashReportHelpers::WriteRegistersToJson(&storage->jsonWriter, context); + CrashReportHelpers::BeginJsonStackFrames(&storage->jsonWriter, /*writeCrashSiteFrame*/ true, context); - CrashReportHelpers::BeginConsoleThreadBlock(&s_consoleWriter, crashingTid, /*isCrashThread*/ true); + CrashReportHelpers::BeginConsoleThreadBlock(&storage->consoleWriter, crashingTid, /*isCrashThread*/ true); uint32_t synthesizedFrameCount = 0; uint32_t synthesizedDroppedCount = 0; - if (walkStack && m_walkStackCallback != nullptr) + if (walkStack && storage->walkStackCallback != nullptr) { CrashReportHelpers::FrameContext frameContext = { - &m_jsonWriter, - &s_consoleWriter, - m_moduleInfoCallback, + &storage->jsonWriter, + &storage->consoleWriter, + storage->moduleInfoCallback, &synthesizedFrameCount, &synthesizedDroppedCount, - m_frameLimitPerThread, - m_methodNameScratch, - sizeof(m_methodNameScratch), + storage->frameLimitPerThread, + storage->methodNameScratch, + sizeof(storage->methodNameScratch), }; - m_walkStackCallback(&CrashReportHelpers::WriteFrame, &frameContext); + storage->walkStackCallback(&CrashReportHelpers::WriteFrame, &frameContext); } - CrashReportHelpers::EndConsoleThreadBlock(&s_consoleWriter, + CrashReportHelpers::EndConsoleThreadBlock(&storage->consoleWriter, synthesizedFrameCount, synthesizedDroppedCount); - CrashReportHelpers::EndJsonStackFrames(&m_jsonWriter); - CrashReportHelpers::EndJsonThreadBlock(&m_jsonWriter); + CrashReportHelpers::EndJsonStackFrames(&storage->jsonWriter); + CrashReportHelpers::EndJsonThreadBlock(&storage->jsonWriter); } void InProcCrashReporter::EmitStackOverflowCrashThread() { - bool stackOverflowTraceAvailable = s_stackOverflowTrace.available != 0; - uint64_t crashingTid = stackOverflowTraceAvailable && s_stackOverflowTrace.crashingTid != 0 - ? s_stackOverflowTrace.crashingTid + InProcCrashReporterStorage* storage = s_storage; + if (storage == nullptr) + { + return; + } + + StackOverflowTraceSnapshot& trace = storage->stackOverflowTrace; + bool stackOverflowTraceAvailable = trace.available != 0; + uint64_t crashingTid = stackOverflowTraceAvailable && trace.crashingTid != 0 + ? trace.crashingTid : static_cast(minipal_get_current_thread_id()); - CrashReportHelpers::BeginJsonThreadBlock(&m_jsonWriter, + CrashReportHelpers::BeginJsonThreadBlock(&storage->jsonWriter, crashingTid, /*isManagedThread*/ true, /*isCrashThread*/ true, @@ -1912,27 +1997,27 @@ InProcCrashReporter::EmitStackOverflowCrashThread() CRASHREPORT_COR_E_STACKOVERFLOW); if (stackOverflowTraceAvailable) { - m_jsonWriter.WriteDecimalAsString("stack_overflow_total_frames", s_stackOverflowTrace.totalFrameCount); - if (s_stackOverflowTrace.truncatedFrameCount != 0) + storage->jsonWriter.WriteDecimalAsString("stack_overflow_total_frames", trace.totalFrameCount); + if (trace.truncatedFrameCount != 0) { - m_jsonWriter.WriteDecimalAsString("stack_overflow_trace_truncated_frames", s_stackOverflowTrace.truncatedFrameCount); + storage->jsonWriter.WriteDecimalAsString("stack_overflow_trace_truncated_frames", trace.truncatedFrameCount); } } else { - m_jsonWriter.WriteString("stack_frames_unavailable_reason", CRASHREPORT_STACK_OVERFLOW_TRACE_UNAVAILABLE_REASON); + storage->jsonWriter.WriteString("stack_frames_unavailable_reason", CRASHREPORT_STACK_OVERFLOW_TRACE_UNAVAILABLE_REASON); } - CrashReportHelpers::BeginJsonStackFrames(&m_jsonWriter, /*writeCrashSiteFrame*/ false, nullptr); + CrashReportHelpers::BeginJsonStackFrames(&storage->jsonWriter, /*writeCrashSiteFrame*/ false, nullptr); if (stackOverflowTraceAvailable) { - for (uint32_t i = 0; i < s_stackOverflowTrace.frameCount;) + for (uint32_t i = 0; i < trace.frameCount;) { - StackOverflowTraceFrame& frame = s_stackOverflowTrace.frames[i]; + StackOverflowTraceFrame& frame = trace.frames[i]; uint32_t repeatSequenceLength = frame.repeatSequenceLength; bool isRepeatSequence = frame.repeatCount > 1 && repeatSequenceLength != 0; CrashReportHelpers::WriteStackOverflowFrameToJson( - &m_jsonWriter, frame, isRepeatSequence); + &storage->jsonWriter, frame, isRepeatSequence); ++i; if (!isRepeatSequence) @@ -1941,95 +2026,95 @@ InProcCrashReporter::EmitStackOverflowCrashThread() } uint32_t sequenceEnd = i + repeatSequenceLength - 1; - if (sequenceEnd > s_stackOverflowTrace.frameCount) + if (sequenceEnd > trace.frameCount) { - sequenceEnd = s_stackOverflowTrace.frameCount; + sequenceEnd = trace.frameCount; } for (; i < sequenceEnd; ++i) { CrashReportHelpers::WriteStackOverflowFrameToJson( - &m_jsonWriter, s_stackOverflowTrace.frames[i], false); + &storage->jsonWriter, trace.frames[i], false); } } } - CrashReportHelpers::EndJsonStackFrames(&m_jsonWriter); - CrashReportHelpers::EndJsonThreadBlock(&m_jsonWriter); + CrashReportHelpers::EndJsonStackFrames(&storage->jsonWriter); + CrashReportHelpers::EndJsonThreadBlock(&storage->jsonWriter); - CrashReportHelpers::BeginConsoleThreadBlock(&s_consoleWriter, crashingTid, /*isCrashThread*/ true); - s_consoleWriter.AppendStr(" managed exception: "); - s_consoleWriter.AppendStr(CRASHREPORT_STACK_OVERFLOW_EXCEPTION_TYPE); - s_consoleWriter.AppendStr(" (0x"); - s_consoleWriter.AppendHex(static_cast(CRASHREPORT_COR_E_STACKOVERFLOW)); - s_consoleWriter.AppendChar(')'); - s_consoleWriter.EndLine(); + CrashReportHelpers::BeginConsoleThreadBlock(&storage->consoleWriter, crashingTid, /*isCrashThread*/ true); + storage->consoleWriter.AppendStr(" managed exception: "); + storage->consoleWriter.AppendStr(CRASHREPORT_STACK_OVERFLOW_EXCEPTION_TYPE); + storage->consoleWriter.AppendStr(" (0x"); + storage->consoleWriter.AppendHex(static_cast(CRASHREPORT_COR_E_STACKOVERFLOW)); + storage->consoleWriter.AppendChar(')'); + storage->consoleWriter.EndLine(); if (!stackOverflowTraceAvailable) { - s_consoleWriter.WriteLine(" stack overflow trace unavailable"); - CrashReportHelpers::EndConsoleThreadBlock(&s_consoleWriter, 0, 0); + storage->consoleWriter.WriteLine(" stack overflow trace unavailable"); + CrashReportHelpers::EndConsoleThreadBlock(&storage->consoleWriter, 0, 0); return; } - s_consoleWriter.AppendStr(" stack overflow frames: "); - s_consoleWriter.AppendDecimal(static_cast(s_stackOverflowTrace.totalFrameCount)); - s_consoleWriter.EndLine(); + storage->consoleWriter.AppendStr(" stack overflow frames: "); + storage->consoleWriter.AppendDecimal(static_cast(trace.totalFrameCount)); + storage->consoleWriter.EndLine(); uint32_t consoleFrameCount = 0; - uint32_t consoleDroppedCount = s_stackOverflowTrace.truncatedFrameCount; - for (uint32_t i = 0; i < s_stackOverflowTrace.frameCount;) + uint32_t consoleDroppedCount = trace.truncatedFrameCount; + for (uint32_t i = 0; i < trace.frameCount;) { - StackOverflowTraceFrame& frame = s_stackOverflowTrace.frames[i]; + StackOverflowTraceFrame& frame = trace.frames[i]; uint32_t repeatSequenceLength = frame.repeatSequenceLength; if (frame.repeatCount > 1 && repeatSequenceLength != 0) { uint32_t sequenceEnd = i + repeatSequenceLength; - if (sequenceEnd > s_stackOverflowTrace.frameCount) + if (sequenceEnd > trace.frameCount) { - sequenceEnd = s_stackOverflowTrace.frameCount; + sequenceEnd = trace.frameCount; } - if (m_frameLimitPerThread != 0 && consoleFrameCount >= m_frameLimitPerThread) + if (storage->frameLimitPerThread != 0 && consoleFrameCount >= storage->frameLimitPerThread) { consoleDroppedCount += sequenceEnd - i; i = sequenceEnd; continue; } - s_consoleWriter.AppendStr(" repeated "); - s_consoleWriter.AppendDecimal(static_cast(frame.repeatCount)); - s_consoleWriter.AppendStr(" times:"); - s_consoleWriter.EndLine(); + storage->consoleWriter.AppendStr(" repeated "); + storage->consoleWriter.AppendDecimal(static_cast(frame.repeatCount)); + storage->consoleWriter.AppendStr(" times:"); + storage->consoleWriter.EndLine(); for (; i < sequenceEnd; ++i) { - if (m_frameLimitPerThread != 0 && consoleFrameCount >= m_frameLimitPerThread) + if (storage->frameLimitPerThread != 0 && consoleFrameCount >= storage->frameLimitPerThread) { consoleDroppedCount++; continue; } CrashReportHelpers::WriteStackOverflowFrameToConsole( - &s_consoleWriter, consoleFrameCount, s_stackOverflowTrace.frames[i]); + &storage->consoleWriter, consoleFrameCount, trace.frames[i]); consoleFrameCount++; } continue; } - if (m_frameLimitPerThread != 0 && consoleFrameCount >= m_frameLimitPerThread) + if (storage->frameLimitPerThread != 0 && consoleFrameCount >= storage->frameLimitPerThread) { consoleDroppedCount++; } else { - CrashReportHelpers::WriteStackOverflowFrameToConsole(&s_consoleWriter, consoleFrameCount, frame); + CrashReportHelpers::WriteStackOverflowFrameToConsole(&storage->consoleWriter, consoleFrameCount, frame); consoleFrameCount++; } ++i; } - CrashReportHelpers::EndConsoleThreadBlock(&s_consoleWriter, + CrashReportHelpers::EndConsoleThreadBlock(&storage->consoleWriter, consoleFrameCount, consoleDroppedCount); } @@ -2038,66 +2123,78 @@ InProcCrashReporter::EmitStackOverflowCrashThread() void InProcCrashReporter::BeginConsoleReport(int signal) { - s_consoleWriter.WriteSeparator(); - s_consoleWriter.AppendStr(".NET Crash Report v"); - s_consoleWriter.AppendStr(CRASHREPORT_PROTOCOL_VERSION); - s_consoleWriter.EndLine(); + InProcCrashReporterStorage* storage = s_storage; + if (storage == nullptr) + { + return; + } - CrashReportHelpers::GetVersionString(s_versionScratch, sizeof(s_versionScratch)); - if (s_versionScratch[0] != '\0') + storage->consoleWriter.WriteSeparator(); + storage->consoleWriter.AppendStr(".NET Crash Report v"); + storage->consoleWriter.AppendStr(CRASHREPORT_PROTOCOL_VERSION); + storage->consoleWriter.EndLine(); + + CrashReportHelpers::GetVersionString(storage->versionScratch, sizeof(storage->versionScratch)); + if (storage->versionScratch[0] != '\0') { - s_consoleWriter.WriteKeyValueStr("Build", s_versionScratch); + storage->consoleWriter.WriteKeyValueStr("Build", storage->versionScratch); } - s_consoleWriter.WriteKeyValueStr("ABI", CRASHREPORT_ARCHITECTURE_NAME); + storage->consoleWriter.WriteKeyValueStr("ABI", CRASHREPORT_ARCHITECTURE_NAME); - if (m_processName[0] != '\0') + if (storage->processName[0] != '\0') { - s_consoleWriter.WriteKeyValueStr("Cmdline", m_processName); + storage->consoleWriter.WriteKeyValueStr("Cmdline", storage->processName); } - s_consoleWriter.WriteKeyValueDecimal("pid", static_cast(GetCurrentProcessId())); + storage->consoleWriter.WriteKeyValueDecimal("pid", static_cast(GetCurrentProcessId())); - s_consoleWriter.AppendStr("signal "); - s_consoleWriter.AppendSignedDecimal(signal); - s_consoleWriter.AppendStr(" ("); - s_consoleWriter.AppendStr(GetSignalNameAscii(signal)); - s_consoleWriter.AppendChar(')'); - s_consoleWriter.EndLine(); + storage->consoleWriter.AppendStr("signal "); + storage->consoleWriter.AppendSignedDecimal(signal); + storage->consoleWriter.AppendStr(" ("); + storage->consoleWriter.AppendStr(GetSignalNameAscii(signal)); + storage->consoleWriter.AppendChar(')'); + storage->consoleWriter.EndLine(); } void InProcCrashReporter::EndConsoleReport() { - if (s_moduleTable.Count() != 0) + InProcCrashReporterStorage* storage = s_storage; + if (storage == nullptr) { - s_consoleWriter.WriteBlank(); - s_consoleWriter.WriteLine("modules:"); - for (size_t i = 0; i < s_moduleTable.Count(); ++i) + return; + } + + if (storage->moduleTable.Count() != 0) + { + storage->consoleWriter.WriteBlank(); + storage->consoleWriter.WriteLine("modules:"); + for (size_t i = 0; i < storage->moduleTable.Count(); ++i) { - s_consoleWriter.AppendStr(" ["); - s_consoleWriter.AppendDecimal(static_cast(i)); - s_consoleWriter.AppendStr("] "); + storage->consoleWriter.AppendStr(" ["); + storage->consoleWriter.AppendDecimal(static_cast(i)); + storage->consoleWriter.AppendStr("] "); const char* moduleName = nullptr; GUID moduleGuid; - if (m_moduleInfoCallback != nullptr && - m_moduleInfoCallback(s_moduleTable.ModuleHandle(i), &moduleName, &moduleGuid) && + if (storage->moduleInfoCallback != nullptr && + storage->moduleInfoCallback(storage->moduleTable.ModuleHandle(i), &moduleName, &moduleGuid) && HasModuleName(moduleName)) { - s_consoleWriter.AppendStr(CrashReportHelpers::GetFilename(moduleName)); - s_consoleWriter.AppendChar(' '); - minipal_guid_as_string(moduleGuid, s_moduleGuidScratch, sizeof(s_moduleGuidScratch)); - s_consoleWriter.AppendStr(s_moduleGuidScratch); + storage->consoleWriter.AppendStr(CrashReportHelpers::GetFilename(moduleName)); + storage->consoleWriter.AppendChar(' '); + minipal_guid_as_string(moduleGuid, storage->moduleGuidScratch, sizeof(storage->moduleGuidScratch)); + storage->consoleWriter.AppendStr(storage->moduleGuidScratch); } else { - s_consoleWriter.AppendStr(""); + storage->consoleWriter.AppendStr(""); } - s_consoleWriter.EndLine(); + storage->consoleWriter.EndLine(); } } - s_consoleWriter.WriteSeparator(); + storage->consoleWriter.WriteSeparator(); } // --- InProcCrashReporter: JSON report lifecycle ---------------------------- @@ -2105,22 +2202,28 @@ InProcCrashReporter::EndConsoleReport() void InProcCrashReporter::BeginJsonReport() { - m_jsonWriter.OpenObject(); - m_jsonWriter.OpenObject("payload"); - m_jsonWriter.WriteString("protocol_version", CRASHREPORT_PROTOCOL_VERSION); + InProcCrashReporterStorage* storage = s_storage; + if (storage == nullptr) + { + return; + } + + storage->jsonWriter.OpenObject(); + storage->jsonWriter.OpenObject("payload"); + storage->jsonWriter.WriteString("protocol_version", CRASHREPORT_PROTOCOL_VERSION); - m_jsonWriter.OpenObject("configuration"); - m_jsonWriter.WriteString("architecture", CRASHREPORT_ARCHITECTURE_NAME); - CrashReportHelpers::GetVersionString(s_versionScratch, sizeof(s_versionScratch)); - m_jsonWriter.WriteString("version", s_versionScratch); - m_jsonWriter.CloseObject(); // configuration + storage->jsonWriter.OpenObject("configuration"); + storage->jsonWriter.WriteString("architecture", CRASHREPORT_ARCHITECTURE_NAME); + CrashReportHelpers::GetVersionString(storage->versionScratch, sizeof(storage->versionScratch)); + storage->jsonWriter.WriteString("version", storage->versionScratch); + storage->jsonWriter.CloseObject(); // configuration - if (m_processName[0] != '\0') + if (storage->processName[0] != '\0') { - m_jsonWriter.WriteString("process_name", m_processName); + storage->jsonWriter.WriteString("process_name", storage->processName); } - m_jsonWriter.WriteDecimalAsString("pid", static_cast(GetCurrentProcessId())); + storage->jsonWriter.WriteDecimalAsString("pid", static_cast(GetCurrentProcessId())); } void @@ -2129,29 +2232,35 @@ InProcCrashReporter::EndJsonReport( bool jsonEnabled, int fd) { - m_jsonWriter.CloseObject(); // payload + InProcCrashReporterStorage* storage = s_storage; + if (storage == nullptr) + { + return; + } + + storage->jsonWriter.CloseObject(); // payload - m_jsonWriter.OpenObject("parameters"); - m_jsonWriter.WriteSignedDecimalAsString("signal", static_cast(signal)); -#ifdef __APPLE__ - if (m_osVersion[0] != '\0') + storage->jsonWriter.OpenObject("parameters"); + storage->jsonWriter.WriteSignedDecimalAsString("signal", static_cast(signal)); +#if defined(TARGET_IOS) || defined(TARGET_TVOS) || defined(TARGET_MACCATALYST) + if (storage->osVersion[0] != '\0') { - m_jsonWriter.WriteString("OSVersion", m_osVersion); + storage->jsonWriter.WriteString("OSVersion", storage->osVersion); } - if (m_systemModel[0] != '\0') + if (storage->systemModel[0] != '\0') { - m_jsonWriter.WriteString("SystemModel", m_systemModel); + storage->jsonWriter.WriteString("SystemModel", storage->systemModel); } - m_jsonWriter.WriteString("SystemManufacturer", "apple"); + storage->jsonWriter.WriteString("SystemManufacturer", "apple"); #endif - m_jsonWriter.CloseObject(); // parameters + storage->jsonWriter.CloseObject(); // parameters - m_jsonWriter.CloseObject(); // root + storage->jsonWriter.CloseObject(); // root if (jsonEnabled) { - bool finishSucceeded = m_jsonWriter.Finish(); - bool writeFailed = s_outputContext.WriteFailed(); + bool finishSucceeded = storage->jsonWriter.Finish(); + bool writeFailed = storage->outputContext.WriteFailed(); if (!CrashReportHelpers::WriteToFile(fd, "\n", 1)) { writeFailed = true; @@ -2159,11 +2268,11 @@ InProcCrashReporter::EndJsonReport( if (close(fd) != 0 || !finishSucceeded || writeFailed) { - unlink(m_reportFilePathScratch); + unlink(storage->reportFilePathScratch); } } else { - (void)m_jsonWriter.Finish(); + (void)storage->jsonWriter.Finish(); } } diff --git a/src/coreclr/debug/crashreport/inproccrashreporter.h b/src/coreclr/debug/crashreport/inproccrashreporter.h index 3b051f21d60e1d..c26d81aff735f2 100644 --- a/src/coreclr/debug/crashreport/inproccrashreporter.h +++ b/src/coreclr/debug/crashreport/inproccrashreporter.h @@ -9,22 +9,22 @@ #pragma once #include +#include #include #include -#include "signalsafejsonwriter.h" - // Scratch-buffer sizes used throughout the in-proc crash reporter: // - 1024 (matching createdump's MAX_LONGPATH) for paths (report paths and // expanded dump templates), so DOTNET_DbgMiniDumpName values that work // with createdump also work here. // - 256 for identifiers (process name, type/class/exception names). -// - 32 for a single hex-or-decimal integer formatted as a C string -// (addresses, thread IDs, hresults). static constexpr size_t CRASHREPORT_PATH_BUFFER_SIZE = 1024; static constexpr size_t CRASHREPORT_STRING_BUFFER_SIZE = 256; -static constexpr size_t CRASHREPORT_NUMBER_BUFFER_SIZE = 32; + +#if defined(__ANDROID__) +static const char CRASHREPORT_LOG_TAG[] = "DOTNET_CRASH"; +#endif enum class InProcCrashReportCrashKind : uint32_t { @@ -41,12 +41,12 @@ using InProcCrashReportFrameCallback = void (*)( const char* className, const char* moduleName, const void* moduleHandle, - uint32_t nativeOffset, - uint32_t token, - uint32_t ilOffset, uint32_t moduleTimestamp, uint32_t moduleSize, const GUID* moduleGuid, + uint32_t nativeOffset, + uint32_t token, + uint32_t ilOffset, void* ctx); using InProcCrashReportWalkStackCallback = void (*)( @@ -88,7 +88,7 @@ class InProcCrashReporter // Capture configuration and the crash-report template path. Must be called // before the PAL enables signal-handler dispatch to CreateReport. - void Initialize(const InProcCrashReporterSettings& settings); + bool Initialize(const InProcCrashReporterSettings& settings); void CreateReport( int signal, @@ -118,33 +118,25 @@ class InProcCrashReporter bool jsonEnabled, int fd); - SignalSafeJsonWriter m_jsonWriter; - InProcCrashReportIsManagedThreadCallback m_isManagedThreadCallback = nullptr; - InProcCrashReportWalkStackCallback m_walkStackCallback = nullptr; - InProcCrashReportEnumerateThreadsCallback m_enumerateThreadsCallback = nullptr; - InProcCrashReportModuleInfoCallback m_moduleInfoCallback = nullptr; - char m_reportPath[CRASHREPORT_PATH_BUFFER_SIZE] = {}; - char m_reportFilePathScratch[CRASHREPORT_PATH_BUFFER_SIZE] = {}; - char m_expandedReportPathScratch[CRASHREPORT_PATH_BUFFER_SIZE] = {}; - char m_numberScratch[CRASHREPORT_NUMBER_BUFFER_SIZE] = {}; - char m_methodNameScratch[CRASHREPORT_STRING_BUFFER_SIZE] = {}; - char m_processName[CRASHREPORT_STRING_BUFFER_SIZE] = {}; - char m_processNameScratch[CRASHREPORT_STRING_BUFFER_SIZE] = {}; - char m_hostName[CRASHREPORT_STRING_BUFFER_SIZE] = {}; -#ifdef __APPLE__ - char m_osVersion[CRASHREPORT_STRING_BUFFER_SIZE] = {}; - char m_systemModel[CRASHREPORT_STRING_BUFFER_SIZE] = {}; -#endif - uint32_t m_frameLimitPerThread = 0; + bool BuildReportPath(); + size_t ExpandDumpTemplate( + char* buffer, + size_t bufferSize, + const char* pattern); + + static const char* GetSignalNameAscii(int signal); }; // Free-function entry point used by the runtime to wire the in-proc crash -// reporter into the PAL signal-handler path. Captures `settings` into the -// singleton and registers a signal-safe dispatcher with PAL via +// reporter into the PAL signal-handler path. Captures `settings` into +// init-time allocated storage and registers a signal-safe dispatcher with PAL via // PAL_SetInProcCrashReportCallback. PAL has no direct dependency on the // reporter; the only coupling is through this registered callback. void InProcCrashReportInitialize(const InProcCrashReporterSettings& settings); +// Emits initialization failures before crash-report storage exists. +void InProcCrashReportLogInitializationFailure(const char* message); + // Records crash kind hints from VM fatal paths that later terminate through PAL // as a generic signal (for example stack overflow -> SIGABRT). void InProcCrashReportSetCrashKind(InProcCrashReportCrashKind crashKind); @@ -157,4 +149,4 @@ void InProcCrashReportAddStackOverflowTraceFrame( const char* methodName, uint32_t repeatCount, uint32_t repeatSequenceLength); -void InProcCrashReportCompleteStackOverflowTrace(uint32_t truncatedFrameCount); +void InProcCrashReportEndStackOverflowTrace(); diff --git a/src/coreclr/debug/crashreport/signalsafeconsolewriter.cpp b/src/coreclr/debug/crashreport/signalsafeconsolewriter.cpp index ccb9bd7fc983ae..8903fea10661e5 100644 --- a/src/coreclr/debug/crashreport/signalsafeconsolewriter.cpp +++ b/src/coreclr/debug/crashreport/signalsafeconsolewriter.cpp @@ -2,14 +2,13 @@ // The .NET Foundation licenses this file to you under the MIT license. #include "signalsafeconsolewriter.h" -#include "signalsafeformat.h" +#include "inproccrashreporter.h" #include #include #if defined(__ANDROID__) #include -static const char CRASHREPORT_LOG_TAG[] = "DOTNET_CRASH"; #endif static const char CRASHREPORT_LINE_SEPARATOR[] = "*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***"; @@ -43,11 +42,9 @@ SignalSafeConsoleWriter::AppendChar(char c) void SignalSafeConsoleWriter::AppendHex(uint64_t v) { - char buf[SignalSafeFormat::MAX_HEX_BUFFER_SIZE]; - SignalSafeFormat::FormatHex(buf, sizeof(buf), v); // Skip the leading "0x" so callers control whether the prefix appears // (the compact format inserts it verbatim around the value). - const char* p = buf; + const char* p = m_formatter.FormatHex(v); if (p[0] == '0' && p[1] == 'x') { p += 2; @@ -58,22 +55,32 @@ SignalSafeConsoleWriter::AppendHex(uint64_t v) void SignalSafeConsoleWriter::AppendDecimal(uint64_t v) { - char buf[SignalSafeFormat::MAX_UNSIGNED_DECIMAL_BUFFER_SIZE]; - SignalSafeFormat::FormatUnsignedDecimal(buf, sizeof(buf), v); - AppendStr(buf); + AppendStr(m_formatter.FormatUnsignedDecimal(v)); } void SignalSafeConsoleWriter::AppendSignedDecimal(int64_t v) { - char buf[SignalSafeFormat::MAX_SIGNED_DECIMAL_BUFFER_SIZE]; - SignalSafeFormat::FormatSignedDecimal(buf, sizeof(buf), v); - AppendStr(buf); + AppendStr(m_formatter.FormatSignedDecimal(v)); } void SignalSafeConsoleWriter::EndLine() { +#if defined(TARGET_IOS) || defined(TARGET_TVOS) || defined(TARGET_MACCATALYST) + // Apple mobile platforms write the report to stderr; explicitly + // newline-terminate each logical line so log readers split entries the + // same way logcat would. + if (m_pos + 1 < sizeof(m_buffer)) + { + m_buffer[m_pos++] = '\n'; + } + else + { + m_buffer[sizeof(m_buffer) - 2] = '\n'; + m_pos = sizeof(m_buffer) - 1; + } +#endif // TARGET_IOS || TARGET_TVOS || TARGET_MACCATALYST Flush(); } @@ -127,11 +134,6 @@ SignalSafeConsoleWriter::Flush() // becomes one logcat entry, which is what makes per-line filtering useful. __android_log_write(ANDROID_LOG_FATAL, CRASHREPORT_LOG_TAG, m_buffer); #else - // On Apple/Linux the report goes to stderr; explicitly newline-terminate - // each line so log readers split entries the same way logcat would. - size_t newlinePos = m_pos < sizeof(m_buffer) - 1 ? m_pos : sizeof(m_buffer) - 2; - m_buffer[newlinePos++] = '\n'; - m_buffer[newlinePos] = '\0'; minipal_log_write_error(m_buffer); #endif diff --git a/src/coreclr/debug/crashreport/signalsafeconsolewriter.h b/src/coreclr/debug/crashreport/signalsafeconsolewriter.h index 0a66d2b6bf76cb..ade4416c0e30ba 100644 --- a/src/coreclr/debug/crashreport/signalsafeconsolewriter.h +++ b/src/coreclr/debug/crashreport/signalsafeconsolewriter.h @@ -5,8 +5,8 @@ // SignalSafeJsonWriter as the second crash-report output sink: // SignalSafeJsonWriter streams JSON to a file callback (compact, no // line concept); SignalSafeConsoleWriter emits one logical line at a -// time to the platform console (Android logcat under the "DOTNET_CRASH" -// tag, stderr elsewhere). All public members are async-signal-safe: no +// time to the platform console (Android logcat under CRASHREPORT_LOG_TAG +// tag, stderr on Apple mobile platforms). All public members are async-signal-safe: no // heap allocation, no stdio, no locale or variadic formatting. // // Design choices below are driven by the prescribed compact crash report @@ -16,12 +16,12 @@ // instead of stream-buffer-fill flushing. Each call becomes exactly one // __android_log_write entry on Android, so the format's line-oriented // "header / per-thread block / modules / footer" structure maps 1:1 -// to logcat entries that filter cleanly under a single tag (`adb -// logcat *:S DOTNET_CRASH:F`) without cutting fields in half. On -// Apple/Linux each Flush adds an explicit '\n' for the same reason. +// to logcat entries that filter cleanly under the crash-report tag without +// cutting fields in half. On +// iOS, tvOS, and MacCatalyst each EndLine adds an explicit '\n' for the same reason. // -// * Unique "DOTNET_CRASH" logcat tag (distinct from the runtime's -// general "DOTNET" tag) so consumers can isolate the crash report from +// * Unique crash-report logcat tag (distinct from the runtime's general +// "DOTNET" tag) so consumers can isolate the crash report from // an otherwise noisy logcat with a single per-tag filter. // // * Best-effort silent truncation on per-line buffer overflow (Append* @@ -37,6 +37,8 @@ #include #include +#include "signalsafeformat.h" + static constexpr size_t SIGNAL_SAFE_CONSOLE_BUFFER_SIZE = 512; class SignalSafeConsoleWriter @@ -70,6 +72,7 @@ class SignalSafeConsoleWriter private: void Flush(); + SignalSafeFormatter m_formatter; char m_buffer[SIGNAL_SAFE_CONSOLE_BUFFER_SIZE]; size_t m_pos; }; diff --git a/src/coreclr/debug/crashreport/signalsafeformat.cpp b/src/coreclr/debug/crashreport/signalsafeformat.cpp index 9efed80e982a22..a633c988a13979 100644 --- a/src/coreclr/debug/crashreport/signalsafeformat.cpp +++ b/src/coreclr/debug/crashreport/signalsafeformat.cpp @@ -3,11 +3,29 @@ #include "signalsafeformat.h" -namespace SignalSafeFormat +const char* +SignalSafeFormatter::FormatHex(uint64_t value) { + FormatHex(m_hexBuffer, sizeof(m_hexBuffer), value); + return m_hexBuffer; +} + +const char* +SignalSafeFormatter::FormatUnsignedDecimal(uint64_t value) +{ + (void)FormatUnsignedDecimal(m_unsignedDecimalBuffer, sizeof(m_unsignedDecimalBuffer), value); + return m_unsignedDecimalBuffer; +} + +const char* +SignalSafeFormatter::FormatSignedDecimal(int64_t value) +{ + (void)FormatSignedDecimal(m_signedDecimalBuffer, sizeof(m_signedDecimalBuffer), value); + return m_signedDecimalBuffer; +} void -FormatHex( +SignalSafeFormatter::FormatHex( char* buffer, size_t bufferSize, uint64_t value) @@ -17,14 +35,13 @@ FormatHex( return; } - char reverse[MAX_HEX_DIGITS_UINT64]; size_t reverseLength = 0; do { unsigned digit = static_cast(value & 0xf); - reverse[reverseLength++] = static_cast(digit < 10 ? ('0' + digit) : ('a' + digit - 10)); + m_reverse[reverseLength++] = static_cast(digit < 10 ? ('0' + digit) : ('a' + digit - 10)); value >>= 4; - } while (value != 0 && reverseLength < sizeof(reverse)); + } while (value != 0 && reverseLength < MAX_HEX_DIGITS_UINT64); if (bufferSize < HEX_PREFIX_LEN + reverseLength + NULL_TERMINATOR_LEN) { @@ -38,13 +55,13 @@ FormatHex( size_t index = HEX_PREFIX_LEN; while (reverseLength > 0) { - buffer[index++] = reverse[--reverseLength]; + buffer[index++] = m_reverse[--reverseLength]; } buffer[index] = '\0'; } size_t -FormatUnsignedDecimal( +SignalSafeFormatter::FormatUnsignedDecimal( char* buffer, size_t bufferSize, uint64_t value) @@ -54,13 +71,12 @@ FormatUnsignedDecimal( return 0; } - char reverse[MAX_DECIMAL_DIGITS_UINT64]; size_t reverseLength = 0; do { - reverse[reverseLength++] = static_cast('0' + (value % 10)); + m_reverse[reverseLength++] = static_cast('0' + (value % 10)); value /= 10; - } while (value != 0 && reverseLength < sizeof(reverse)); + } while (value != 0 && reverseLength < sizeof(m_reverse)); if (bufferSize < reverseLength + NULL_TERMINATOR_LEN) { @@ -71,14 +87,14 @@ FormatUnsignedDecimal( size_t pos = 0; while (reverseLength > 0) { - buffer[pos++] = reverse[--reverseLength]; + buffer[pos++] = m_reverse[--reverseLength]; } buffer[pos] = '\0'; return pos; } size_t -FormatSignedDecimal( +SignalSafeFormatter::FormatSignedDecimal( char* buffer, size_t bufferSize, int64_t value) @@ -110,5 +126,3 @@ FormatSignedDecimal( } return written + 1; } - -} // namespace SignalSafeFormat diff --git a/src/coreclr/debug/crashreport/signalsafeformat.h b/src/coreclr/debug/crashreport/signalsafeformat.h index 2bf40cf963dfe1..9e2effcd69bc96 100644 --- a/src/coreclr/debug/crashreport/signalsafeformat.h +++ b/src/coreclr/debug/crashreport/signalsafeformat.h @@ -12,18 +12,28 @@ #include #include -namespace SignalSafeFormat +class SignalSafeFormatter { - constexpr size_t MAX_HEX_DIGITS_UINT64 = 16; - constexpr size_t MAX_DECIMAL_DIGITS_UINT64 = 20; - constexpr size_t HEX_PREFIX_LEN = 2; // "0x" - constexpr size_t SIGN_LEN = 1; // '-' for signed decimals - constexpr size_t NULL_TERMINATOR_LEN = 1; - - constexpr size_t MAX_HEX_BUFFER_SIZE = HEX_PREFIX_LEN + MAX_HEX_DIGITS_UINT64 + NULL_TERMINATOR_LEN; - constexpr size_t MAX_UNSIGNED_DECIMAL_BUFFER_SIZE = MAX_DECIMAL_DIGITS_UINT64 + NULL_TERMINATOR_LEN; - constexpr size_t MAX_SIGNED_DECIMAL_BUFFER_SIZE = SIGN_LEN + MAX_DECIMAL_DIGITS_UINT64 + NULL_TERMINATOR_LEN; - +public: + static constexpr size_t MAX_HEX_DIGITS_UINT64 = 16; + static constexpr size_t MAX_DECIMAL_DIGITS_UINT64 = 20; + static constexpr size_t HEX_PREFIX_LEN = 2; // "0x" + static constexpr size_t SIGN_LEN = 1; // '-' for signed decimals + static constexpr size_t NULL_TERMINATOR_LEN = 1; + + static constexpr size_t MAX_HEX_BUFFER_SIZE = HEX_PREFIX_LEN + MAX_HEX_DIGITS_UINT64 + NULL_TERMINATOR_LEN; + static constexpr size_t MAX_UNSIGNED_DECIMAL_BUFFER_SIZE = MAX_DECIMAL_DIGITS_UINT64 + NULL_TERMINATOR_LEN; + static constexpr size_t MAX_SIGNED_DECIMAL_BUFFER_SIZE = SIGN_LEN + MAX_DECIMAL_DIGITS_UINT64 + NULL_TERMINATOR_LEN; + + SignalSafeFormatter() = default; + SignalSafeFormatter(const SignalSafeFormatter&) = delete; + SignalSafeFormatter& operator=(const SignalSafeFormatter&) = delete; + + const char* FormatHex(uint64_t value); + const char* FormatUnsignedDecimal(uint64_t value); + const char* FormatSignedDecimal(int64_t value); + +private: // Writes "0x"-prefixed hex (lowercase) of `value` into `buffer`. On // success the buffer is null-terminated. If `buffer` is null, `bufferSize` // is zero, or the buffer is too small to hold the formatted value, the @@ -32,11 +42,16 @@ namespace SignalSafeFormat // Writes the unsigned-decimal representation of `value` into `buffer` and // returns the number of bytes written (excluding the null terminator). - // Returns 0 on failure with the same buffer-state guarantees as FormatHex. + // Returns 0 on failure with the buffer null-terminated at index 0 when possible. size_t FormatUnsignedDecimal(char* buffer, size_t bufferSize, uint64_t value); // Writes the signed-decimal representation of `value` into `buffer` and // returns the number of bytes written (excluding the null terminator). // Returns 0 on failure. Handles INT64_MIN without signed overflow. size_t FormatSignedDecimal(char* buffer, size_t bufferSize, int64_t value); -} + + char m_hexBuffer[MAX_HEX_BUFFER_SIZE]; + char m_unsignedDecimalBuffer[MAX_UNSIGNED_DECIMAL_BUFFER_SIZE]; + char m_signedDecimalBuffer[MAX_SIGNED_DECIMAL_BUFFER_SIZE]; + char m_reverse[MAX_DECIMAL_DIGITS_UINT64]; +}; diff --git a/src/coreclr/debug/crashreport/signalsafejsonwriter.cpp b/src/coreclr/debug/crashreport/signalsafejsonwriter.cpp index 44adea0af9b321..2c1b9c4cc81174 100644 --- a/src/coreclr/debug/crashreport/signalsafejsonwriter.cpp +++ b/src/coreclr/debug/crashreport/signalsafejsonwriter.cpp @@ -2,7 +2,6 @@ // The .NET Foundation licenses this file to you under the MIT license. #include "signalsafejsonwriter.h" -#include "signalsafeformat.h" #include #include @@ -263,9 +262,7 @@ SignalSafeJsonWriter::WriteHexAsString( const char* key, uint64_t value) { - char scratch[SignalSafeFormat::MAX_HEX_BUFFER_SIZE]; - SignalSafeFormat::FormatHex(scratch, sizeof(scratch), value); - return WriteString(key, scratch); + return WriteString(key, m_formatter.FormatHex(value)); } bool @@ -273,9 +270,7 @@ SignalSafeJsonWriter::WriteDecimalAsString( const char* key, uint64_t value) { - char scratch[SignalSafeFormat::MAX_UNSIGNED_DECIMAL_BUFFER_SIZE]; - (void)SignalSafeFormat::FormatUnsignedDecimal(scratch, sizeof(scratch), value); - return WriteString(key, scratch); + return WriteString(key, m_formatter.FormatUnsignedDecimal(value)); } bool @@ -283,7 +278,5 @@ SignalSafeJsonWriter::WriteSignedDecimalAsString( const char* key, int64_t value) { - char scratch[SignalSafeFormat::MAX_SIGNED_DECIMAL_BUFFER_SIZE]; - (void)SignalSafeFormat::FormatSignedDecimal(scratch, sizeof(scratch), value); - return WriteString(key, scratch); + return WriteString(key, m_formatter.FormatSignedDecimal(value)); } diff --git a/src/coreclr/debug/crashreport/signalsafejsonwriter.h b/src/coreclr/debug/crashreport/signalsafejsonwriter.h index 650e1edcb82802..8d2de1fda3dc8a 100644 --- a/src/coreclr/debug/crashreport/signalsafejsonwriter.h +++ b/src/coreclr/debug/crashreport/signalsafejsonwriter.h @@ -12,6 +12,8 @@ #include #include +#include "signalsafeformat.h" + using SignalSafeJsonOutputCallback = bool (*)(const char* buffer, size_t len, void* ctx); static constexpr size_t SIGNAL_SAFE_JSON_BUFFER_SIZE = 4 * 1024; @@ -52,6 +54,7 @@ class SignalSafeJsonWriter void WriteSeparator(); void WriteEscapedString(const char* str); + SignalSafeFormatter m_formatter; char m_buffer[SIGNAL_SAFE_JSON_BUFFER_SIZE]; size_t m_pos; bool m_commaNeeded; diff --git a/src/coreclr/vm/crashreportstackwalker.cpp b/src/coreclr/vm/crashreportstackwalker.cpp index f1c20201097d81..928edd3cb3e5d1 100644 --- a/src/coreclr/vm/crashreportstackwalker.cpp +++ b/src/coreclr/vm/crashreportstackwalker.cpp @@ -10,6 +10,7 @@ #include "peassembly.h" #include #include +#include #ifdef FEATURE_INPROC_CRASHREPORT @@ -31,8 +32,34 @@ struct CrashReportStackWalkerScratch bool hasModuleGuid; }; -static CrashReportStackWalkerScratch s_crashReportScratch; -static WalkContext s_walkContext; +struct CrashReportStackWalkerState +{ + CrashReportStackWalkerScratch scratch; + WalkContext walkContext; +}; + +static CrashReportStackWalkerState* volatile s_crashReportStackWalkerState = nullptr; + +static bool EnsureCrashReportStackWalkerState() +{ + if (s_crashReportStackWalkerState != nullptr) + { + return true; + } + + CrashReportStackWalkerState* state = new (std::nothrow) CrashReportStackWalkerState(); + if (state == nullptr) + { + return false; + } + + if (InterlockedCompareExchangeT(&s_crashReportStackWalkerState, state, nullptr) != nullptr) + { + delete state; + } + + return true; +} static void BuildTypeName(LPUTF8 buffer, size_t bufferSize, LPCUTF8 namespaceName, LPCUTF8 className); @@ -165,7 +192,8 @@ FrameCallbackAdapter( CONTRACTL_END; WalkContext* ctx = static_cast(pData); - if (ctx == nullptr) + CrashReportStackWalkerState* state = s_crashReportStackWalkerState; + if (ctx == nullptr || state == nullptr) { return SWA_CONTINUE; } @@ -192,8 +220,9 @@ FrameCallbackAdapter( } } - s_crashReportScratch.className[0] = '\0'; - BuildTypeName(s_crashReportScratch.className, sizeof(s_crashReportScratch.className), namespaceName, className); + CrashReportStackWalkerScratch& scratch = state->scratch; + scratch.className[0] = '\0'; + BuildTypeName(scratch.className, sizeof(scratch.className), namespaceName, className); Module* pModule = pMD->GetModule(); @@ -240,17 +269,30 @@ FrameCallbackAdapter( LPCUTF8 moduleName = nullptr; uint32_t moduleTimestamp = 0; uint32_t moduleSize = 0; - s_crashReportScratch.hasModuleGuid = false; + scratch.hasModuleGuid = false; CrashReportGetModuleDetails( pModule, &moduleName, - &s_crashReportScratch.moduleGuid, - &s_crashReportScratch.hasModuleGuid, + &scratch.moduleGuid, + &scratch.hasModuleGuid, &moduleTimestamp, &moduleSize); - className = s_crashReportScratch.className[0] == '\0' ? nullptr : s_crashReportScratch.className; - ctx->callback(static_cast(ip), static_cast(stackPointer), methodName, className, moduleName, pModule, nativeOffset, static_cast(token), ilOffset, moduleTimestamp, moduleSize, s_crashReportScratch.hasModuleGuid ? &s_crashReportScratch.moduleGuid : nullptr, ctx->userCtx); + className = scratch.className[0] == '\0' ? nullptr : scratch.className; + ctx->callback( + static_cast(ip), + static_cast(stackPointer), + methodName, + className, + moduleName, + pModule, + moduleTimestamp, + moduleSize, + scratch.hasModuleGuid ? &scratch.moduleGuid : nullptr, + nativeOffset, + static_cast(token), + ilOffset, + ctx->userCtx); return SWA_CONTINUE; } @@ -261,14 +303,15 @@ CrashReportWalkThread( InProcCrashReportFrameCallback frameCallback, void* ctx) { - if (pThread == nullptr || frameCallback == nullptr) + CrashReportStackWalkerState* state = s_crashReportStackWalkerState; + if (pThread == nullptr || frameCallback == nullptr || state == nullptr) { return; } - s_walkContext.callback = frameCallback; - s_walkContext.userCtx = ctx; - pThread->StackWalkFrames(FrameCallbackAdapter, &s_walkContext, + state->walkContext.callback = frameCallback; + state->walkContext.userCtx = ctx; + pThread->StackWalkFrames(FrameCallbackAdapter, &state->walkContext, QUICKUNWIND | FUNCTIONSONLY | ALLOW_ASYNC_STACK_WALK); } @@ -456,13 +499,20 @@ CrashReportEnumerateThreads( InProcCrashReportFrameCallback frameCallback, void* ctx) { + CrashReportStackWalkerState* state = s_crashReportStackWalkerState; + if (state == nullptr) + { + return; + } + Thread* pCrashThread = GetThreadAsyncSafe(); + CrashReportStackWalkerScratch& scratch = state->scratch; // Capture the crashing thread's exception state BEFORE suspending the EE // so the throwable inspection runs in the thread's natural EE-live context, // outside the suspended window which exists for safe-point operations on // other threads. - s_crashReportScratch.crashExceptionType[0] = '\0'; + scratch.crashExceptionType[0] = '\0'; uint32_t crashHresult = 0; bool crashHasException = false; bool isCrashingThread = pCrashThread != nullptr @@ -471,8 +521,8 @@ CrashReportEnumerateThreads( { crashHasException = CrashReportGetExceptionForThread( pCrashThread, - s_crashReportScratch.crashExceptionType, - sizeof(s_crashReportScratch.crashExceptionType), + scratch.crashExceptionType, + sizeof(scratch.crashExceptionType), &crashHresult); } @@ -483,7 +533,7 @@ CrashReportEnumerateThreads( if (isCrashingThread) { uint64_t crashOsId = static_cast(pCrashThread->GetOSThreadId()); - threadCallback(crashOsId, true, crashHasException ? s_crashReportScratch.crashExceptionType : "", crashHresult, ctx); + threadCallback(crashOsId, true, crashHasException ? scratch.crashExceptionType : "", crashHresult, ctx); CrashReportWalkThread(pCrashThread, frameCallback, ctx); } @@ -530,6 +580,12 @@ CrashReportConfigure() return; } + if (!EnsureCrashReportStackWalkerState()) + { + InProcCrashReportLogInitializationFailure(".NET crash report disabled: failed to allocate stack walker storage"); + return; + } + CLRConfigNoCache dmpNameCfg = CLRConfigNoCache::Get("DbgMiniDumpName", /*noprefix*/ false, &getenv); const char* dumpName = dmpNameCfg.IsSet() ? dmpNameCfg.AsString() : nullptr; diff --git a/src/coreclr/vm/eepolicy.cpp b/src/coreclr/vm/eepolicy.cpp index 19b23bf3c9a927..4089af8a4a0475 100644 --- a/src/coreclr/vm/eepolicy.cpp +++ b/src/coreclr/vm/eepolicy.cpp @@ -201,32 +201,28 @@ class CallStackLogger return SWA_CONTINUE; } - void PrintFrame(int index, const WCHAR* pWordAt) + void PrintFrame( + int index, + const WCHAR* pWordAt, + uint32_t repeatCount = 0, + uint32_t repeatSequenceLength = 0) { WRAPPER_NO_CONTRACT; - SString str(pWordAt); - + SString frame; MethodDesc* pMD = m_frames[index]; - TypeString::AppendMethodInternal(str, pMD, TypeString::FormatNamespace|TypeString::FormatFullInst|TypeString::FormatSignature); - str.Append(W("\n")); - - PrintToStdErrW(str.GetUnicode()); - } + TypeString::AppendMethodInternal(frame, pMD, TypeString::FormatNamespace|TypeString::FormatFullInst|TypeString::FormatSignature); #ifdef FEATURE_INPROC_CRASHREPORT - void CaptureFrameForCrashReport(int index, uint32_t repeatCount, uint32_t repeatSequenceLength) - { - WRAPPER_NO_CONTRACT; - - SString str; + InProcCrashReportAddStackOverflowTraceFrame(frame.GetUTF8(), repeatCount, repeatSequenceLength); +#endif // FEATURE_INPROC_CRASHREPORT - MethodDesc* pMD = m_frames[index]; - TypeString::AppendMethodInternal(str, pMD, TypeString::FormatNamespace|TypeString::FormatFullInst|TypeString::FormatSignature); + SString str(pWordAt); + str.Append(frame); + str.Append(W("\n")); - InProcCrashReportAddStackOverflowTraceFrame(str.GetUTF8(), repeatCount, repeatSequenceLength); + PrintToStdErrW(str.GetUnicode()); } -#endif // FEATURE_INPROC_CRASHREPORT public: @@ -326,9 +322,6 @@ class CallStackLogger for (int i = 0; i < largestCommonStartOffset; i++) { -#ifdef FEATURE_INPROC_CRASHREPORT - CaptureFrameForCrashReport(i, 0, 0); -#endif // FEATURE_INPROC_CRASHREPORT PrintFrame(i, pWordAt); } @@ -342,26 +335,21 @@ class CallStackLogger PrintToStdErrA("--------------------------------\n"); for (int i = largestCommonStartOffset; i < largestCommonStartOffset + largestCommonLength; i++) { -#ifdef FEATURE_INPROC_CRASHREPORT - CaptureFrameForCrashReport(i, + PrintFrame(i, + pWordAt, static_cast(largestCommonRepeat), static_cast(largestCommonLength)); -#endif // FEATURE_INPROC_CRASHREPORT - PrintFrame(i, pWordAt); } PrintToStdErrA("--------------------------------\n"); } for (int i = largestCommonLength * largestCommonRepeat + largestCommonStartOffset; i < m_frames.Count(); i++) { -#ifdef FEATURE_INPROC_CRASHREPORT - CaptureFrameForCrashReport(i, 0, 0); -#endif // FEATURE_INPROC_CRASHREPORT PrintFrame(i, pWordAt); } #ifdef FEATURE_INPROC_CRASHREPORT - InProcCrashReportCompleteStackOverflowTrace(0); + InProcCrashReportEndStackOverflowTrace(); #endif // FEATURE_INPROC_CRASHREPORT } }; @@ -856,9 +844,6 @@ void DECLSPEC_NORETURN EEPolicy::HandleFatalStackOverflow(EXCEPTION_POINTERS *pE #ifdef _DEBUG if (g_LogStackOverflowExit) PrintToStdErrA("@Terminating the process.\n"); -#endif -#ifdef FEATURE_INPROC_CRASHREPORT - InProcCrashReportSetCrashKind(InProcCrashReportCrashKind::StackOverflow); #endif CrashDumpAndTerminateProcess(COR_E_STACKOVERFLOW); UNREACHABLE(); diff --git a/src/coreclr/vm/excep.cpp b/src/coreclr/vm/excep.cpp index 5e87f606da0be9..fafc3bc5219aad 100644 --- a/src/coreclr/vm/excep.cpp +++ b/src/coreclr/vm/excep.cpp @@ -20,6 +20,10 @@ #include "virtualcallstub.h" #include "typestring.h" +#ifdef FEATURE_INPROC_CRASHREPORT +#include "inproccrashreporter.h" +#endif + #ifndef TARGET_UNIX #include "dwreport.h" #endif // !TARGET_UNIX @@ -3481,6 +3485,13 @@ bool GenerateDump( void CrashDumpAndTerminateProcess(UINT exitCode) { +#ifdef FEATURE_INPROC_CRASHREPORT + if (exitCode == COR_E_STACKOVERFLOW) + { + InProcCrashReportSetCrashKind(InProcCrashReportCrashKind::StackOverflow); + } +#endif + #ifdef HOST_WINDOWS CreateCrashDumpIfEnabled(exitCode == COR_E_STACKOVERFLOW); #endif From 30b51e3232ae333fdf5087989b49b8d5b7c5856b Mon Sep 17 00:00:00 2001 From: Mitchell Hwang Date: Tue, 19 May 2026 23:24:32 -0400 Subject: [PATCH 105/109] Address crash report reviewer feedback Read frame-limit configuration through the late Android getenv path, keep architecture naming defined for every compiled target, guard compact module-table references with resolvable module identity, synchronize stack-overflow snapshot publication reads, and keep GUID formatting on the async-signal-safe formatter path. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../debug/crashreport/inproccrashreporter.cpp | 29 ++++++--- .../debug/crashreport/signalsafeformat.cpp | 65 +++++++++++++++++++ .../debug/crashreport/signalsafeformat.h | 13 +++- src/coreclr/vm/crashreportstackwalker.cpp | 25 ++++++- 4 files changed, 118 insertions(+), 14 deletions(-) diff --git a/src/coreclr/debug/crashreport/inproccrashreporter.cpp b/src/coreclr/debug/crashreport/inproccrashreporter.cpp index 37cd42834be954..71b7101f5413b6 100644 --- a/src/coreclr/debug/crashreport/inproccrashreporter.cpp +++ b/src/coreclr/debug/crashreport/inproccrashreporter.cpp @@ -41,6 +41,10 @@ static const char CRASHREPORT_ARCHITECTURE_NAME[] = "amd64"; static const char CRASHREPORT_ARCHITECTURE_NAME[] = "arm64"; #elif defined(__arm__) static const char CRASHREPORT_ARCHITECTURE_NAME[] = "arm"; +#elif defined(__i386__) +static const char CRASHREPORT_ARCHITECTURE_NAME[] = "x86"; +#else +static const char CRASHREPORT_ARCHITECTURE_NAME[] = "unknown"; #endif // Prescribed compact crash report log format. One logical line == one @@ -50,7 +54,7 @@ static const char CRASHREPORT_ARCHITECTURE_NAME[] = "arm"; // *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** (BeginConsoleReport) // .NET Crash Report v // Build: (omitted if empty) -// ABI: amd64|arm64|arm +// ABI: // Cmdline: (omitted if empty) // pid: // signal () @@ -356,7 +360,6 @@ struct InProcCrashReporterStorage char processNameScratch[CRASHREPORT_STRING_BUFFER_SIZE]; char hostName[CRASHREPORT_STRING_BUFFER_SIZE]; char versionScratch[sizeof(sccsid)]; - char moduleGuidScratch[MINIPAL_GUID_BUFFER_LEN]; #if defined(TARGET_IOS) || defined(TARGET_TVOS) || defined(TARGET_MACCATALYST) char osVersion[CRASHREPORT_STRING_BUFFER_SIZE]; char systemModel[CRASHREPORT_STRING_BUFFER_SIZE]; @@ -1388,8 +1391,7 @@ CrashReportHelpers::WriteFrameToJson( InProcCrashReporterStorage* storage = s_storage; if (storage != nullptr) { - minipal_guid_as_string(*moduleGuid, storage->moduleGuidScratch, sizeof(storage->moduleGuidScratch)); - writer->WriteString("guid", storage->moduleGuidScratch); + writer->WriteString("guid", storage->formatter.FormatGuid(*moduleGuid)); } } } @@ -1727,9 +1729,17 @@ CrashReportHelpers::WriteFrameToReport( if (!consoleCapped) { InProcCrashReporterStorage* storage = s_storage; - int moduleIndex = storage != nullptr && moduleInfoCallback != nullptr && moduleHandle != nullptr - ? storage->moduleTable.GetOrAddIndex(moduleHandle) - : -1; + int moduleIndex = -1; + if (storage != nullptr && moduleInfoCallback != nullptr && moduleHandle != nullptr) + { + const char* resolvedModuleName = nullptr; + GUID resolvedModuleGuid; + if (moduleInfoCallback(moduleHandle, &resolvedModuleName, &resolvedModuleGuid) && + HasModuleName(resolvedModuleName)) + { + moduleIndex = storage->moduleTable.GetOrAddIndex(moduleHandle); + } + } WriteFrameToConsole(consoleWriter, methodNameBuffer, methodNameBufferSize, @@ -1984,7 +1994,7 @@ InProcCrashReporter::EmitStackOverflowCrashThread() } StackOverflowTraceSnapshot& trace = storage->stackOverflowTrace; - bool stackOverflowTraceAvailable = trace.available != 0; + bool stackOverflowTraceAvailable = InterlockedCompareExchange(&trace.available, 0, 0) != 0; uint64_t crashingTid = stackOverflowTraceAvailable && trace.crashingTid != 0 ? trace.crashingTid : static_cast(minipal_get_current_thread_id()); @@ -2183,8 +2193,7 @@ InProcCrashReporter::EndConsoleReport() { storage->consoleWriter.AppendStr(CrashReportHelpers::GetFilename(moduleName)); storage->consoleWriter.AppendChar(' '); - minipal_guid_as_string(moduleGuid, storage->moduleGuidScratch, sizeof(storage->moduleGuidScratch)); - storage->consoleWriter.AppendStr(storage->moduleGuidScratch); + storage->consoleWriter.AppendStr(storage->formatter.FormatGuid(moduleGuid)); } else { diff --git a/src/coreclr/debug/crashreport/signalsafeformat.cpp b/src/coreclr/debug/crashreport/signalsafeformat.cpp index a633c988a13979..5f9027fe5ad14f 100644 --- a/src/coreclr/debug/crashreport/signalsafeformat.cpp +++ b/src/coreclr/debug/crashreport/signalsafeformat.cpp @@ -24,6 +24,13 @@ SignalSafeFormatter::FormatSignedDecimal(int64_t value) return m_signedDecimalBuffer; } +const char* +SignalSafeFormatter::FormatGuid(const GUID& guid) +{ + FormatGuid(m_guidBuffer, sizeof(m_guidBuffer), guid); + return m_guidBuffer; +} + void SignalSafeFormatter::FormatHex( char* buffer, @@ -126,3 +133,61 @@ SignalSafeFormatter::FormatSignedDecimal( } return written + 1; } + +void +SignalSafeFormatter::FormatGuid( + char* buffer, + size_t bufferSize, + const GUID& guid) +{ + if (buffer == nullptr || bufferSize == 0) + { + return; + } + + if (bufferSize < MAX_GUID_BUFFER_SIZE) + { + buffer[0] = '\0'; + return; + } + + size_t pos = 0; + buffer[pos++] = '{'; + AppendFixedHex(buffer, &pos, guid.Data1, 8); + buffer[pos++] = '-'; + AppendFixedHex(buffer, &pos, guid.Data2, 4); + buffer[pos++] = '-'; + AppendFixedHex(buffer, &pos, guid.Data3, 4); + buffer[pos++] = '-'; + AppendFixedHex(buffer, &pos, guid.Data4[0], 2); + AppendFixedHex(buffer, &pos, guid.Data4[1], 2); + buffer[pos++] = '-'; + AppendFixedHex(buffer, &pos, guid.Data4[2], 2); + AppendFixedHex(buffer, &pos, guid.Data4[3], 2); + AppendFixedHex(buffer, &pos, guid.Data4[4], 2); + AppendFixedHex(buffer, &pos, guid.Data4[5], 2); + AppendFixedHex(buffer, &pos, guid.Data4[6], 2); + AppendFixedHex(buffer, &pos, guid.Data4[7], 2); + buffer[pos++] = '}'; + buffer[pos] = '\0'; +} + +char +SignalSafeFormatter::GetHexDigit(uint32_t value) +{ + value &= 0xf; + return static_cast(value < 10 ? ('0' + value) : ('a' + value - 10)); +} + +void +SignalSafeFormatter::AppendFixedHex( + char* buffer, + size_t* pos, + uint32_t value, + uint32_t digits) +{ + for (uint32_t i = digits; i != 0; --i) + { + buffer[(*pos)++] = GetHexDigit(value >> ((i - 1) * 4)); + } +} diff --git a/src/coreclr/debug/crashreport/signalsafeformat.h b/src/coreclr/debug/crashreport/signalsafeformat.h index 9e2effcd69bc96..39542634147995 100644 --- a/src/coreclr/debug/crashreport/signalsafeformat.h +++ b/src/coreclr/debug/crashreport/signalsafeformat.h @@ -1,9 +1,9 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -// Async-signal-safe integer-to-string format primitives shared across the +// Async-signal-safe format primitives shared across the // signal-safe writer family (SignalSafeJsonWriter, SignalSafeConsoleWriter, -// and any other consumer that needs to render integers without stdio, +// and any other consumer that needs to render values without stdio, // locale, or heap allocation). Bounded buffer-size constants document the // minimum buffer required for each formatter. @@ -12,6 +12,8 @@ #include #include +#include + class SignalSafeFormatter { public: @@ -24,6 +26,7 @@ class SignalSafeFormatter static constexpr size_t MAX_HEX_BUFFER_SIZE = HEX_PREFIX_LEN + MAX_HEX_DIGITS_UINT64 + NULL_TERMINATOR_LEN; static constexpr size_t MAX_UNSIGNED_DECIMAL_BUFFER_SIZE = MAX_DECIMAL_DIGITS_UINT64 + NULL_TERMINATOR_LEN; static constexpr size_t MAX_SIGNED_DECIMAL_BUFFER_SIZE = SIGN_LEN + MAX_DECIMAL_DIGITS_UINT64 + NULL_TERMINATOR_LEN; + static constexpr size_t MAX_GUID_BUFFER_SIZE = MINIPAL_GUID_BUFFER_LEN; SignalSafeFormatter() = default; SignalSafeFormatter(const SignalSafeFormatter&) = delete; @@ -32,6 +35,7 @@ class SignalSafeFormatter const char* FormatHex(uint64_t value); const char* FormatUnsignedDecimal(uint64_t value); const char* FormatSignedDecimal(int64_t value); + const char* FormatGuid(const GUID& guid); private: // Writes "0x"-prefixed hex (lowercase) of `value` into `buffer`. On @@ -50,8 +54,13 @@ class SignalSafeFormatter // Returns 0 on failure. Handles INT64_MIN without signed overflow. size_t FormatSignedDecimal(char* buffer, size_t bufferSize, int64_t value); + void FormatGuid(char* buffer, size_t bufferSize, const GUID& guid); + static char GetHexDigit(uint32_t value); + static void AppendFixedHex(char* buffer, size_t* pos, uint32_t value, uint32_t digits); + char m_hexBuffer[MAX_HEX_BUFFER_SIZE]; char m_unsignedDecimalBuffer[MAX_UNSIGNED_DECIMAL_BUFFER_SIZE]; char m_signedDecimalBuffer[MAX_SIGNED_DECIMAL_BUFFER_SIZE]; + char m_guidBuffer[MAX_GUID_BUFFER_SIZE]; char m_reverse[MAX_DECIMAL_DIGITS_UINT64]; }; diff --git a/src/coreclr/vm/crashreportstackwalker.cpp b/src/coreclr/vm/crashreportstackwalker.cpp index 928edd3cb3e5d1..44b49d9b5ca767 100644 --- a/src/coreclr/vm/crashreportstackwalker.cpp +++ b/src/coreclr/vm/crashreportstackwalker.cpp @@ -40,7 +40,9 @@ struct CrashReportStackWalkerState static CrashReportStackWalkerState* volatile s_crashReportStackWalkerState = nullptr; -static bool EnsureCrashReportStackWalkerState() +static +bool +EnsureCrashReportStackWalkerState() { if (s_crashReportStackWalkerState != nullptr) { @@ -61,6 +63,25 @@ static bool EnsureCrashReportStackWalkerState() return true; } +static +DWORD +GetCrashReportFrameLimitPerThread() +{ + DWORD frameLimitPerThread = CLRConfig::INTERNAL_CrashReportFrameLimitPerThread.defaultValue; + + CLRConfigNoCache frameLimitCfg = CLRConfigNoCache::Get("CrashReportFrameLimitPerThread", /*noprefix*/ false, &getenv); + if (frameLimitCfg.IsSet()) + { + DWORD configuredFrameLimitPerThread = 0; + if (frameLimitCfg.TryAsInteger(10, configuredFrameLimitPerThread)) + { + frameLimitPerThread = configuredFrameLimitPerThread; + } + } + + return frameLimitPerThread; +} + static void BuildTypeName(LPUTF8 buffer, size_t bufferSize, LPCUTF8 namespaceName, LPCUTF8 className); static @@ -595,7 +616,7 @@ CrashReportConfigure() settings.walkStackCallback = CrashReportWalkStack; settings.enumerateThreadsCallback = CrashReportEnumerateThreads; settings.moduleInfoCallback = CrashReportGetModuleInfo; - settings.frameLimitPerThread = CLRConfig::GetConfigValue(CLRConfig::INTERNAL_CrashReportFrameLimitPerThread); + settings.frameLimitPerThread = GetCrashReportFrameLimitPerThread(); // Initialize the reporter and register the PAL signal-path callback last // so PAL only observes the reporter after all VM callbacks are wired in. From 56feca9c83f56b5fb05e18a895993c9acb2c8c3f Mon Sep 17 00:00:00 2001 From: Mitchell Hwang Date: Wed, 20 May 2026 20:54:40 -0400 Subject: [PATCH 106/109] Refine in-proc crash report feedback Rename the signal-safe formatter files, use compact module indexes in crash report output, and route initialization failure logging through portable platform logging. Move crash reporter state onto the init-time allocated reporter and minimize persistent scratch buffers by reusing temporary scratch storage where lifetimes do not overlap. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/coreclr/debug/crashreport/CMakeLists.txt | 2 +- .../debug/crashreport/inproccrashreporter.cpp | 701 ++++++++++-------- .../debug/crashreport/inproccrashreporter.h | 52 +- .../crashreport/signalsafeconsolewriter.h | 2 +- ...safeformat.cpp => signalsafeformatter.cpp} | 2 +- ...gnalsafeformat.h => signalsafeformatter.h} | 0 .../debug/crashreport/signalsafejsonwriter.h | 2 +- 7 files changed, 386 insertions(+), 375 deletions(-) rename src/coreclr/debug/crashreport/{signalsafeformat.cpp => signalsafeformatter.cpp} (99%) rename src/coreclr/debug/crashreport/{signalsafeformat.h => signalsafeformatter.h} (100%) diff --git a/src/coreclr/debug/crashreport/CMakeLists.txt b/src/coreclr/debug/crashreport/CMakeLists.txt index f23dd004846df5..22c66d611422ba 100644 --- a/src/coreclr/debug/crashreport/CMakeLists.txt +++ b/src/coreclr/debug/crashreport/CMakeLists.txt @@ -1,7 +1,7 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CRASHREPORT_SOURCES - signalsafeformat.cpp + signalsafeformatter.cpp signalsafejsonwriter.cpp signalsafeconsolewriter.cpp inproccrashreporter.cpp diff --git a/src/coreclr/debug/crashreport/inproccrashreporter.cpp b/src/coreclr/debug/crashreport/inproccrashreporter.cpp index 71b7101f5413b6..2ceb790a313b3e 100644 --- a/src/coreclr/debug/crashreport/inproccrashreporter.cpp +++ b/src/coreclr/debug/crashreport/inproccrashreporter.cpp @@ -8,7 +8,7 @@ #include "inproccrashreporter.h" #include "signalsafeconsolewriter.h" #include "signalsafejsonwriter.h" -#include "signalsafeformat.h" +#include "signalsafeformatter.h" #include "pal.h" @@ -152,7 +152,7 @@ static void CacheSysctlString(const char* sysctlName, char* buffer, size_t buffe // Single-instance because CreateReport is one-shot per process (guarded by // the ``s_generating`` InterlockedCompareExchange in CreateReport). -static constexpr size_t MAX_MODULES_IN_TABLE = 256; +static constexpr int MAX_MODULES_IN_TABLE = 256; class ModuleTable { @@ -165,11 +165,11 @@ class ModuleTable return -1; } - for (size_t i = 0; i < m_count; ++i) + for (int i = 0; i < m_count; ++i) { if (m_moduleHandles[i] == moduleHandle) { - return static_cast(i); + return i; } } @@ -179,14 +179,14 @@ class ModuleTable } m_moduleHandles[m_count] = moduleHandle; - return static_cast(m_count++); + return m_count++; } - size_t Count() const { return m_count; } - const void* ModuleHandle(size_t i) const { return m_moduleHandles[i]; } + int Count() const { return m_count; } + const void* ModuleHandle(int i) const { return m_moduleHandles[i]; } private: const void* m_moduleHandles[MAX_MODULES_IN_TABLE]; - size_t m_count = 0; + int m_count = 0; }; class ThreadEnumerationContext @@ -194,18 +194,22 @@ class ThreadEnumerationContext public: ThreadEnumerationContext() { - Init(nullptr, nullptr, nullptr, 0, 0, nullptr); + Init(nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, 0, 0, 0, nullptr); } ThreadEnumerationContext( SignalSafeJsonWriter* writer, SignalSafeConsoleWriter* consoleWriter, InProcCrashReportModuleInfoCallback moduleInfoCallback, + ModuleTable* moduleTable, + SignalSafeFormatter* formatter, + char* methodNameScratch, + size_t methodNameScratchSize, uint64_t crashingTid, uint32_t frameLimitPerThread, void* signalContext) { - Init(writer, consoleWriter, moduleInfoCallback, crashingTid, frameLimitPerThread, signalContext); + Init(writer, consoleWriter, moduleInfoCallback, moduleTable, formatter, methodNameScratch, methodNameScratchSize, crashingTid, frameLimitPerThread, signalContext); } ThreadEnumerationContext(const ThreadEnumerationContext&) = delete; @@ -220,6 +224,10 @@ class ThreadEnumerationContext SignalSafeJsonWriter* writer, SignalSafeConsoleWriter* consoleWriter, InProcCrashReportModuleInfoCallback moduleInfoCallback, + ModuleTable* moduleTable, + SignalSafeFormatter* formatter, + char* methodNameScratch, + size_t methodNameScratchSize, uint64_t crashingTid, uint32_t frameLimitPerThread, void* signalContext) @@ -227,6 +235,10 @@ class ThreadEnumerationContext m_jsonWriter = writer; m_consoleWriter = consoleWriter; m_moduleInfoCallback = moduleInfoCallback; + m_moduleTable = moduleTable; + m_formatter = formatter; + m_methodNameScratch = methodNameScratch; + m_methodNameScratchSize = methodNameScratchSize; m_signalContext = signalContext; m_threadCount = 0; m_crashingTid = crashingTid; @@ -234,7 +246,10 @@ class ThreadEnumerationContext m_currentThreadDroppedCount = 0; m_frameLimitPerThread = frameLimitPerThread; m_sawCrashThread = false; - m_methodNameScratch[0] = '\0'; + if (m_methodNameScratch != nullptr && m_methodNameScratchSize != 0) + { + m_methodNameScratch[0] = '\0'; + } } void EnumerateThreads(InProcCrashReportEnumerateThreadsCallback callback); @@ -288,6 +303,10 @@ class ThreadEnumerationContext SignalSafeJsonWriter* m_jsonWriter; SignalSafeConsoleWriter* m_consoleWriter; InProcCrashReportModuleInfoCallback m_moduleInfoCallback; + ModuleTable* m_moduleTable; + SignalSafeFormatter* m_formatter; + char* m_methodNameScratch; + size_t m_methodNameScratchSize; void* m_signalContext; size_t m_threadCount; uint64_t m_crashingTid; @@ -295,7 +314,6 @@ class ThreadEnumerationContext uint32_t m_currentThreadDroppedCount; uint32_t m_frameLimitPerThread; bool m_sawCrashThread; - char m_methodNameScratch[CRASHREPORT_STRING_BUFFER_SIZE]; }; class CrashReportOutputContext @@ -333,61 +351,85 @@ class CrashReportOutputContext bool m_writeFailed; }; -// Holds the reporter's preallocated mutable state. Keeping this separate from -// InProcCrashReporter lets disabled processes avoid the large buffers entirely, -// while Initialize can allocate and publish the state before registering the PAL -// signal callback. -struct InProcCrashReporterStorage -{ - SignalSafeJsonWriter jsonWriter; - SignalSafeConsoleWriter consoleWriter; - StackOverflowTraceSnapshot stackOverflowTrace; - ModuleTable moduleTable; - ThreadEnumerationContext threadContext; - CrashReportOutputContext outputContext; - SignalSafeFormatter formatter; - InProcCrashReportIsManagedThreadCallback isManagedThreadCallback = nullptr; - InProcCrashReportWalkStackCallback walkStackCallback = nullptr; - InProcCrashReportEnumerateThreadsCallback enumerateThreadsCallback = nullptr; - InProcCrashReportModuleInfoCallback moduleInfoCallback = nullptr; - volatile LONG crashKind = static_cast(InProcCrashReportCrashKind::Unknown); - uint32_t frameLimitPerThread = 0; - char reportPath[CRASHREPORT_PATH_BUFFER_SIZE]; - char reportFilePathScratch[CRASHREPORT_PATH_BUFFER_SIZE]; - char expandedReportPathScratch[CRASHREPORT_PATH_BUFFER_SIZE]; - char methodNameScratch[CRASHREPORT_STRING_BUFFER_SIZE]; - char processName[CRASHREPORT_STRING_BUFFER_SIZE]; - char processNameScratch[CRASHREPORT_STRING_BUFFER_SIZE]; - char hostName[CRASHREPORT_STRING_BUFFER_SIZE]; - char versionScratch[sizeof(sccsid)]; -#if defined(TARGET_IOS) || defined(TARGET_TVOS) || defined(TARGET_MACCATALYST) - char osVersion[CRASHREPORT_STRING_BUFFER_SIZE]; - char systemModel[CRASHREPORT_STRING_BUFFER_SIZE]; -#endif -}; +class InProcCrashReporter +{ +public: + static InProcCrashReporter* GetInstance(); + static bool InitializeInstance(const InProcCrashReporterSettings& settings); -static InProcCrashReporterStorage* volatile s_storage = nullptr; + // Capture configuration and the crash-report template path. Must run before + // the instance is published to the PAL signal-handler path. + void Initialize(const InProcCrashReporterSettings& settings); -static bool EnsureCrashReportStorage() -{ - if (s_storage != nullptr) - { - return true; - } + void CreateReport( + int signal, + void* context); - InProcCrashReporterStorage* storage = new (std::nothrow) InProcCrashReporterStorage(); - if (storage == nullptr) - { - return false; - } + void SetCrashKind(InProcCrashReportCrashKind crashKind); + void BeginStackOverflowTrace(uint64_t crashingTid, uint32_t totalFrameCount); + void AddStackOverflowTraceFrame( + const char* methodName, + uint32_t repeatCount, + uint32_t repeatSequenceLength); + void EndStackOverflowTrace(); - if (InterlockedCompareExchangePointer(&s_storage, storage, nullptr) != nullptr) - { - delete storage; - } +private: + InProcCrashReporter() = default; + InProcCrashReporter(const InProcCrashReporter&) = delete; + InProcCrashReporter& operator=(const InProcCrashReporter&) = delete; - return true; -} + void EmitSynthesizedCrashThread( + void* context, + bool walkStack); + + void EmitStackOverflowCrashThread(); + + void EmitThreads( + InProcCrashReportCrashKind crashKind, + void* context); + + void BeginConsoleReport(int signal); + void EndConsoleReport(); + + void BeginJsonReport(); + void EndJsonReport( + int signal, + bool jsonEnabled, + int fd); + + bool BuildReportPath(); + size_t ExpandDumpTemplate( + char* buffer, + size_t bufferSize, + const char* pattern); + + static const char* GetSignalNameAscii(int signal); + + SignalSafeJsonWriter m_jsonWriter; + SignalSafeConsoleWriter m_consoleWriter; + StackOverflowTraceSnapshot m_stackOverflowTrace; + ModuleTable m_moduleTable; + ThreadEnumerationContext m_threadContext; + CrashReportOutputContext m_outputContext; + SignalSafeFormatter m_formatter; + InProcCrashReportIsManagedThreadCallback m_isManagedThreadCallback = nullptr; + InProcCrashReportWalkStackCallback m_walkStackCallback = nullptr; + InProcCrashReportEnumerateThreadsCallback m_enumerateThreadsCallback = nullptr; + InProcCrashReportModuleInfoCallback m_moduleInfoCallback = nullptr; + volatile LONG m_crashKind = static_cast(InProcCrashReportCrashKind::Unknown); + uint32_t m_frameLimitPerThread = 0; + char m_reportPath[CRASHREPORT_PATH_BUFFER_SIZE]; + char m_reportFilePath[CRASHREPORT_PATH_BUFFER_SIZE]; + char m_processName[CRASHREPORT_STRING_BUFFER_SIZE]; + char m_hostName[CRASHREPORT_STRING_BUFFER_SIZE]; + char m_stringScratch[CRASHREPORT_STRING_BUFFER_SIZE]; +#if defined(TARGET_IOS) || defined(TARGET_TVOS) || defined(TARGET_MACCATALYST) + char m_osVersion[CRASHREPORT_STRING_BUFFER_SIZE]; + char m_systemModel[CRASHREPORT_STRING_BUFFER_SIZE]; +#endif +}; + +static InProcCrashReporter* volatile s_reporter = nullptr; class CrashReportHelpers { @@ -397,6 +439,8 @@ class CrashReportHelpers SignalSafeJsonWriter* jsonWriter; SignalSafeConsoleWriter* consoleWriter; InProcCrashReportModuleInfoCallback moduleInfoCallback; + ModuleTable* moduleTable; + SignalSafeFormatter* formatter; uint32_t* currentThreadFrameCount; uint32_t* currentThreadDroppedCount; uint32_t frameLimitPerThread; @@ -447,6 +491,7 @@ class CrashReportHelpers static void WriteFrameToJson( SignalSafeJsonWriter* writer, + SignalSafeFormatter* formatter, char* methodNameBuffer, size_t methodNameBufferSize, uint64_t ip, @@ -533,6 +578,8 @@ class CrashReportHelpers SignalSafeJsonWriter* jsonWriter, SignalSafeConsoleWriter* consoleWriter, InProcCrashReportModuleInfoCallback moduleInfoCallback, + ModuleTable* moduleTable, + SignalSafeFormatter* formatter, char* methodNameBuffer, size_t methodNameBufferSize, uint32_t* currentThreadFrameCount, @@ -569,30 +616,24 @@ InProcCrashReporter::CreateReport( int signal, void* context) { - InProcCrashReporterStorage* storage = s_storage; - if (storage == nullptr) - { - return; - } - static LONG s_generating = 0; if (InterlockedCompareExchange(&s_generating, 1, 0) != 0) { return; } - storage->reportFilePathScratch[0] = '\0'; + m_reportFilePath[0] = '\0'; // The JSON file sink is only enabled when DbgMiniDumpName supplied a // template AND the template expanded to a valid path. Otherwise the // crash report runs in compact-log-only mode: the JSON emitter still // executes (so it can keep its bookkeeping consistent) but writes go // to a no-op DiscardOutputCallback instead of an open fd. - bool jsonEnabled = storage->reportPath[0] != '\0' && BuildReportPath(); + bool jsonEnabled = m_reportPath[0] != '\0' && BuildReportPath(); int fd = -1; if (jsonEnabled) { - fd = open(storage->reportFilePathScratch, O_WRONLY | O_CREAT | O_TRUNC, 0600); + fd = open(m_reportFilePath, O_WRONLY | O_CREAT | O_TRUNC, 0600); if (fd == -1) { jsonEnabled = false; @@ -600,16 +641,16 @@ InProcCrashReporter::CreateReport( } InProcCrashReportCrashKind crashKind = static_cast( - InterlockedExchange(&storage->crashKind, static_cast(InProcCrashReportCrashKind::Unknown))); + InterlockedExchange(&m_crashKind, static_cast(InProcCrashReportCrashKind::Unknown))); - storage->outputContext.Init(fd); + m_outputContext.Init(fd); if (jsonEnabled) { - storage->jsonWriter.Init(&CrashReportOutputContext::ChunkCallback, &storage->outputContext); + m_jsonWriter.Init(&CrashReportOutputContext::ChunkCallback, &m_outputContext); } else { - storage->jsonWriter.Init(&CrashReportHelpers::DiscardOutputCallback, nullptr); + m_jsonWriter.Init(&CrashReportHelpers::DiscardOutputCallback, nullptr); } BeginConsoleReport(signal); @@ -624,25 +665,29 @@ InProcCrashReporter::EmitThreads( InProcCrashReportCrashKind crashKind, void* context) { - InProcCrashReporterStorage* storage = s_storage; - if (storage == nullptr) - { - return; - } - - storage->jsonWriter.OpenArray("threads"); + m_jsonWriter.OpenArray("threads"); if (crashKind == InProcCrashReportCrashKind::StackOverflow) { EmitStackOverflowCrashThread(); } - else if (storage->enumerateThreadsCallback != nullptr) + else if (m_enumerateThreadsCallback != nullptr) { uint64_t crashingTid = static_cast(minipal_get_current_thread_id()); - storage->threadContext.Init(&storage->jsonWriter, &storage->consoleWriter, storage->moduleInfoCallback, crashingTid, storage->frameLimitPerThread, context); - - storage->threadContext.EnumerateThreads(storage->enumerateThreadsCallback); - - if (storage->threadContext.ThreadCount() == 0 || !storage->threadContext.SawCrashThread()) + m_threadContext.Init( + &m_jsonWriter, + &m_consoleWriter, + m_moduleInfoCallback, + &m_moduleTable, + &m_formatter, + m_stringScratch, + sizeof(m_stringScratch), + crashingTid, + m_frameLimitPerThread, + context); + + m_threadContext.EnumerateThreads(m_enumerateThreadsCallback); + + if (m_threadContext.ThreadCount() == 0 || !m_threadContext.SawCrashThread()) { EmitSynthesizedCrashThread(context, /*walkStack*/ false); } @@ -651,14 +696,38 @@ InProcCrashReporter::EmitThreads( { EmitSynthesizedCrashThread(context, /*walkStack*/ true); } - storage->jsonWriter.CloseArray(); // threads + m_jsonWriter.CloseArray(); // threads } -InProcCrashReporter& +InProcCrashReporter* InProcCrashReporter::GetInstance() { - static InProcCrashReporter s_instance; - return s_instance; + return s_reporter; +} + +bool +InProcCrashReporter::InitializeInstance( + const InProcCrashReporterSettings& settings) +{ + if (s_reporter != nullptr) + { + return true; + } + + InProcCrashReporter* reporter = new (std::nothrow) InProcCrashReporter(); + if (reporter == nullptr) + { + InProcCrashReportLogInitializationFailure(".NET crash report disabled: failed to allocate reporter storage"); + return false; + } + + reporter->Initialize(settings); + if (InterlockedCompareExchangePointer(&s_reporter, reporter, nullptr) != nullptr) + { + delete reporter; + } + + return true; } const char* @@ -677,27 +746,20 @@ InProcCrashReporter::GetSignalNameAscii(int signal) } } -bool +void InProcCrashReporter::Initialize( const InProcCrashReporterSettings& settings) { - if (!EnsureCrashReportStorage()) - { - InProcCrashReportLogInitializationFailure(".NET crash report disabled: failed to allocate reporter storage"); - return false; - } + m_isManagedThreadCallback = settings.isManagedThreadCallback; + m_walkStackCallback = settings.walkStackCallback; + m_enumerateThreadsCallback = settings.enumerateThreadsCallback; + m_moduleInfoCallback = settings.moduleInfoCallback; + m_frameLimitPerThread = settings.frameLimitPerThread; + m_crashKind = static_cast(InProcCrashReportCrashKind::Unknown); + m_stackOverflowTrace.available = 0; + CrashReportHelpers::CopyString(m_reportPath, sizeof(m_reportPath), settings.reportPath); - InProcCrashReporterStorage* storage = s_storage; - storage->isManagedThreadCallback = settings.isManagedThreadCallback; - storage->walkStackCallback = settings.walkStackCallback; - storage->enumerateThreadsCallback = settings.enumerateThreadsCallback; - storage->moduleInfoCallback = settings.moduleInfoCallback; - storage->frameLimitPerThread = settings.frameLimitPerThread; - storage->crashKind = static_cast(InProcCrashReportCrashKind::Unknown); - storage->stackOverflowTrace.available = 0; - CrashReportHelpers::CopyString(storage->reportPath, sizeof(storage->reportPath), settings.reportPath); - - storage->processName[0] = '\0'; + m_processName[0] = '\0'; #if defined(__ANDROID__) // On Android every app forks from the Zygote, so /proc/self/exe always // resolves to /system/bin/app_process64. /proc/self/cmdline holds the @@ -706,20 +768,20 @@ InProcCrashReporter::Initialize( int cmdlineFd = open("/proc/self/cmdline", O_RDONLY | O_CLOEXEC); if (cmdlineFd >= 0) { - ssize_t n = read(cmdlineFd, storage->processNameScratch, sizeof(storage->processNameScratch) - 1); + ssize_t n = read(cmdlineFd, m_stringScratch, sizeof(m_stringScratch) - 1); close(cmdlineFd); if (n > 0) { - storage->processNameScratch[n] = '\0'; - CrashReportHelpers::CopyString(storage->processName, sizeof(storage->processName), CrashReportHelpers::GetFilename(storage->processNameScratch)); + m_stringScratch[n] = '\0'; + CrashReportHelpers::CopyString(m_processName, sizeof(m_processName), CrashReportHelpers::GetFilename(m_stringScratch)); } } #endif - if (storage->processName[0] == '\0') + if (m_processName[0] == '\0') { if (char* exePath = minipal_getexepath()) { - CrashReportHelpers::CopyString(storage->processName, sizeof(storage->processName), CrashReportHelpers::GetFilename(exePath)); + CrashReportHelpers::CopyString(m_processName, sizeof(m_processName), CrashReportHelpers::GetFilename(exePath)); free(exePath); } } @@ -727,23 +789,66 @@ InProcCrashReporter::Initialize( // Cache hostname here because gethostname is not on the POSIX // async-signal-safe list; the dump-template expander needs it for %h // expansion at crash time. - storage->hostName[0] = '\0'; - if (gethostname(storage->hostName, sizeof(storage->hostName) - 1) == 0) + m_hostName[0] = '\0'; + if (gethostname(m_hostName, sizeof(m_hostName) - 1) == 0) { - storage->hostName[sizeof(storage->hostName) - 1] = '\0'; + m_hostName[sizeof(m_hostName) - 1] = '\0'; } else { - storage->hostName[0] = '\0'; + m_hostName[0] = '\0'; } #if defined(TARGET_IOS) || defined(TARGET_TVOS) || defined(TARGET_MACCATALYST) // Cache sysctl values at Initialize because sysctl/sysctlbyname is not on POSIX's // async-signal-safe list; CreateReport reads these from the signal-handler path. - CacheSysctlString("kern.osproductversion", storage->osVersion, sizeof(storage->osVersion)); - CacheSysctlString("hw.model", storage->systemModel, sizeof(storage->systemModel)); + CacheSysctlString("kern.osproductversion", m_osVersion, sizeof(m_osVersion)); + CacheSysctlString("hw.model", m_systemModel, sizeof(m_systemModel)); #endif - return true; +} + +void +InProcCrashReporter::SetCrashKind(InProcCrashReportCrashKind crashKind) +{ + InterlockedExchange(&m_crashKind, static_cast(crashKind)); +} + +void +InProcCrashReporter::BeginStackOverflowTrace( + uint64_t crashingTid, + uint32_t totalFrameCount) +{ + StackOverflowTraceSnapshot& trace = m_stackOverflowTrace; + InterlockedExchange(&trace.available, 0); + trace.crashingTid = crashingTid; + trace.totalFrameCount = totalFrameCount; + trace.frameCount = 0; + trace.truncatedFrameCount = 0; +} + +void +InProcCrashReporter::AddStackOverflowTraceFrame( + const char* methodName, + uint32_t repeatCount, + uint32_t repeatSequenceLength) +{ + StackOverflowTraceSnapshot& trace = m_stackOverflowTrace; + if (trace.frameCount >= CRASHREPORT_STACK_OVERFLOW_MAX_TRACE_FRAMES) + { + trace.truncatedFrameCount++; + return; + } + + StackOverflowTraceFrame& frame = trace.frames[trace.frameCount++]; + CopyStringToBuffer(frame.methodName, sizeof(frame.methodName), methodName); + frame.repeatCount = repeatCount; + frame.repeatSequenceLength = repeatSequenceLength; +} + +void +InProcCrashReporter::EndStackOverflowTrace() +{ + InterlockedExchange(&m_stackOverflowTrace.available, 1); } void @@ -751,14 +856,19 @@ InProcCrashReportSignalDispatcher(int signal, void* siginfo, void* context) { (void)siginfo; - InProcCrashReporter& reporter = InProcCrashReporter::GetInstance(); - reporter.CreateReport(signal, context); + InProcCrashReporter* reporter = InProcCrashReporter::GetInstance(); + if (reporter == nullptr) + { + return; + } + + reporter->CreateReport(signal, context); } void InProcCrashReportInitialize(const InProcCrashReporterSettings& settings) { - if (!InProcCrashReporter::GetInstance().Initialize(settings)) + if (!InProcCrashReporter::InitializeInstance(settings)) { return; } @@ -779,24 +889,22 @@ InProcCrashReportLogInitializationFailure(const char* message) #if defined(__ANDROID__) __android_log_write(ANDROID_LOG_ERROR, CRASHREPORT_LOG_TAG, message); -#elif defined(TARGET_IOS) || defined(TARGET_TVOS) || defined(TARGET_MACCATALYST) +#else minipal_log_write_error(message); minipal_log_write_error("\n"); -#else - (void)message; #endif } void InProcCrashReportSetCrashKind(InProcCrashReportCrashKind crashKind) { - InProcCrashReporterStorage* storage = s_storage; - if (storage == nullptr) + InProcCrashReporter* reporter = InProcCrashReporter::GetInstance(); + if (reporter == nullptr) { return; } - InterlockedExchange(&storage->crashKind, static_cast(crashKind)); + reporter->SetCrashKind(crashKind); } void @@ -804,18 +912,13 @@ InProcCrashReportBeginStackOverflowTrace( uint64_t crashingTid, uint32_t totalFrameCount) { - InProcCrashReporterStorage* storage = s_storage; - if (storage == nullptr) + InProcCrashReporter* reporter = InProcCrashReporter::GetInstance(); + if (reporter == nullptr) { return; } - StackOverflowTraceSnapshot& trace = storage->stackOverflowTrace; - InterlockedExchange(&trace.available, 0); - trace.crashingTid = crashingTid; - trace.totalFrameCount = totalFrameCount; - trace.frameCount = 0; - trace.truncatedFrameCount = 0; + reporter->BeginStackOverflowTrace(crashingTid, totalFrameCount); } void @@ -824,35 +927,25 @@ InProcCrashReportAddStackOverflowTraceFrame( uint32_t repeatCount, uint32_t repeatSequenceLength) { - InProcCrashReporterStorage* storage = s_storage; - if (storage == nullptr) + InProcCrashReporter* reporter = InProcCrashReporter::GetInstance(); + if (reporter == nullptr) { return; } - StackOverflowTraceSnapshot& trace = storage->stackOverflowTrace; - if (trace.frameCount >= CRASHREPORT_STACK_OVERFLOW_MAX_TRACE_FRAMES) - { - trace.truncatedFrameCount++; - return; - } - - StackOverflowTraceFrame& frame = trace.frames[trace.frameCount++]; - CopyStringToBuffer(frame.methodName, sizeof(frame.methodName), methodName); - frame.repeatCount = repeatCount; - frame.repeatSequenceLength = repeatSequenceLength; + reporter->AddStackOverflowTraceFrame(methodName, repeatCount, repeatSequenceLength); } void InProcCrashReportEndStackOverflowTrace() { - InProcCrashReporterStorage* storage = s_storage; - if (storage == nullptr) + InProcCrashReporter* reporter = InProcCrashReporter::GetInstance(); + if (reporter == nullptr) { return; } - InterlockedExchange(&storage->stackOverflowTrace.available, 1); + reporter->EndStackOverflowTrace(); } bool @@ -942,9 +1035,7 @@ InProcCrashReporter::ExpandDumpTemplate( size_t bufferSize, const char* pattern) { - InProcCrashReporterStorage* storage = s_storage; - if (storage == nullptr || - buffer == nullptr || bufferSize == 0 || + if (buffer == nullptr || bufferSize == 0 || pattern == nullptr) { return 0; @@ -978,19 +1069,19 @@ InProcCrashReporter::ExpandDumpTemplate( case 'p': case 'd': - substitution = storage->formatter.FormatUnsignedDecimal(pid); + substitution = m_formatter.FormatUnsignedDecimal(pid); break; case 'e': - substitution = (storage->processName[0] != '\0') ? storage->processName : nullptr; + substitution = (m_processName[0] != '\0') ? m_processName : nullptr; break; case 'h': - substitution = (storage->hostName[0] != '\0') ? storage->hostName : nullptr; + substitution = (m_hostName[0] != '\0') ? m_hostName : nullptr; break; case 't': - substitution = storage->formatter.FormatUnsignedDecimal(static_cast(time(nullptr))); + substitution = m_formatter.FormatUnsignedDecimal(static_cast(time(nullptr))); break; default: @@ -1036,27 +1127,21 @@ InProcCrashReporter::ExpandDumpTemplate( bool InProcCrashReporter::BuildReportPath() { - InProcCrashReporterStorage* storage = s_storage; - if (storage == nullptr || storage->reportPath[0] == '\0') + if (m_reportPath[0] == '\0') { return false; } - size_t expandedLen = ExpandDumpTemplate( - storage->expandedReportPathScratch, - sizeof(storage->expandedReportPathScratch), - storage->reportPath); - if (expandedLen == 0) + size_t pos = ExpandDumpTemplate( + m_reportFilePath, + sizeof(m_reportFilePath), + m_reportPath); + if (pos == 0) { return false; } - size_t pos = 0; - if (!CrashReportHelpers::AppendString(storage->reportFilePathScratch, sizeof(storage->reportFilePathScratch), &pos, storage->expandedReportPathScratch)) - { - return false; - } - if (!CrashReportHelpers::AppendString(storage->reportFilePathScratch, sizeof(storage->reportFilePathScratch), &pos, ".crashreport.json")) + if (!CrashReportHelpers::AppendString(m_reportFilePath, sizeof(m_reportFilePath), &pos, ".crashreport.json")) { return false; } @@ -1332,6 +1417,7 @@ CrashReportHelpers::CopyString( void CrashReportHelpers::WriteFrameToJson( SignalSafeJsonWriter* writer, + SignalSafeFormatter* formatter, char* methodNameBuffer, size_t methodNameBufferSize, uint64_t ip, @@ -1388,10 +1474,9 @@ CrashReportHelpers::WriteFrameToJson( } if (moduleGuid != nullptr) { - InProcCrashReporterStorage* storage = s_storage; - if (storage != nullptr) + if (formatter != nullptr) { - writer->WriteString("guid", storage->formatter.FormatGuid(*moduleGuid)); + writer->WriteString("guid", formatter->FormatGuid(*moduleGuid)); } } } @@ -1670,6 +1755,8 @@ CrashReportHelpers::WriteFrame( frameContext->jsonWriter, frameContext->consoleWriter, frameContext->moduleInfoCallback, + frameContext->moduleTable, + frameContext->formatter, frameContext->methodNameBuffer, frameContext->methodNameBufferSize, frameContext->currentThreadFrameCount, @@ -1694,6 +1781,8 @@ CrashReportHelpers::WriteFrameToReport( SignalSafeJsonWriter* jsonWriter, SignalSafeConsoleWriter* consoleWriter, InProcCrashReportModuleInfoCallback moduleInfoCallback, + ModuleTable* moduleTable, + SignalSafeFormatter* formatter, char* methodNameBuffer, size_t methodNameBufferSize, uint32_t* currentThreadFrameCount, @@ -1719,6 +1808,7 @@ CrashReportHelpers::WriteFrameToReport( // Always feed the JSON sink: the file output is the authoritative, // post-mortem data store and the cap is a compact-log triage knob. WriteFrameToJson(jsonWriter, + formatter, methodNameBuffer, methodNameBufferSize, ip, stackPointer, methodName, className, moduleName, @@ -1728,16 +1818,15 @@ CrashReportHelpers::WriteFrameToReport( frameIndex >= frameLimitPerThread; if (!consoleCapped) { - InProcCrashReporterStorage* storage = s_storage; int moduleIndex = -1; - if (storage != nullptr && moduleInfoCallback != nullptr && moduleHandle != nullptr) + if (moduleTable != nullptr && moduleInfoCallback != nullptr && moduleHandle != nullptr) { const char* resolvedModuleName = nullptr; GUID resolvedModuleGuid; if (moduleInfoCallback(moduleHandle, &resolvedModuleName, &resolvedModuleGuid) && HasModuleName(resolvedModuleName)) { - moduleIndex = storage->moduleTable.GetOrAddIndex(moduleHandle); + moduleIndex = moduleTable->GetOrAddIndex(moduleHandle); } } WriteFrameToConsole(consoleWriter, @@ -1776,8 +1865,10 @@ ThreadEnumerationContext::OnFrame( m_jsonWriter, m_consoleWriter, m_moduleInfoCallback, + m_moduleTable, + m_formatter, m_methodNameScratch, - sizeof(m_methodNameScratch), + m_methodNameScratchSize, &m_currentThreadFrameCount, &m_currentThreadDroppedCount, m_frameLimitPerThread, @@ -1943,63 +2034,53 @@ InProcCrashReporter::EmitSynthesizedCrashThread( void* context, bool walkStack) { - InProcCrashReporterStorage* storage = s_storage; - if (storage == nullptr) - { - return; - } - uint64_t crashingTid = static_cast(minipal_get_current_thread_id()); - bool isManagedThread = storage->isManagedThreadCallback != nullptr && storage->isManagedThreadCallback(); - CrashReportHelpers::BeginJsonThreadBlock(&storage->jsonWriter, + bool isManagedThread = m_isManagedThreadCallback != nullptr && m_isManagedThreadCallback(); + CrashReportHelpers::BeginJsonThreadBlock(&m_jsonWriter, crashingTid, isManagedThread, /*isCrashThread*/ true, nullptr, 0); - CrashReportHelpers::WriteRegistersToJson(&storage->jsonWriter, context); - CrashReportHelpers::BeginJsonStackFrames(&storage->jsonWriter, /*writeCrashSiteFrame*/ true, context); + CrashReportHelpers::WriteRegistersToJson(&m_jsonWriter, context); + CrashReportHelpers::BeginJsonStackFrames(&m_jsonWriter, /*writeCrashSiteFrame*/ true, context); - CrashReportHelpers::BeginConsoleThreadBlock(&storage->consoleWriter, crashingTid, /*isCrashThread*/ true); + CrashReportHelpers::BeginConsoleThreadBlock(&m_consoleWriter, crashingTid, /*isCrashThread*/ true); uint32_t synthesizedFrameCount = 0; uint32_t synthesizedDroppedCount = 0; - if (walkStack && storage->walkStackCallback != nullptr) + if (walkStack && m_walkStackCallback != nullptr) { CrashReportHelpers::FrameContext frameContext = { - &storage->jsonWriter, - &storage->consoleWriter, - storage->moduleInfoCallback, + &m_jsonWriter, + &m_consoleWriter, + m_moduleInfoCallback, + &m_moduleTable, + &m_formatter, &synthesizedFrameCount, &synthesizedDroppedCount, - storage->frameLimitPerThread, - storage->methodNameScratch, - sizeof(storage->methodNameScratch), + m_frameLimitPerThread, + m_stringScratch, + sizeof(m_stringScratch), }; - storage->walkStackCallback(&CrashReportHelpers::WriteFrame, &frameContext); + m_walkStackCallback(&CrashReportHelpers::WriteFrame, &frameContext); } - CrashReportHelpers::EndConsoleThreadBlock(&storage->consoleWriter, + CrashReportHelpers::EndConsoleThreadBlock(&m_consoleWriter, synthesizedFrameCount, synthesizedDroppedCount); - CrashReportHelpers::EndJsonStackFrames(&storage->jsonWriter); - CrashReportHelpers::EndJsonThreadBlock(&storage->jsonWriter); + CrashReportHelpers::EndJsonStackFrames(&m_jsonWriter); + CrashReportHelpers::EndJsonThreadBlock(&m_jsonWriter); } void InProcCrashReporter::EmitStackOverflowCrashThread() { - InProcCrashReporterStorage* storage = s_storage; - if (storage == nullptr) - { - return; - } - - StackOverflowTraceSnapshot& trace = storage->stackOverflowTrace; + StackOverflowTraceSnapshot& trace = m_stackOverflowTrace; bool stackOverflowTraceAvailable = InterlockedCompareExchange(&trace.available, 0, 0) != 0; uint64_t crashingTid = stackOverflowTraceAvailable && trace.crashingTid != 0 ? trace.crashingTid : static_cast(minipal_get_current_thread_id()); - CrashReportHelpers::BeginJsonThreadBlock(&storage->jsonWriter, + CrashReportHelpers::BeginJsonThreadBlock(&m_jsonWriter, crashingTid, /*isManagedThread*/ true, /*isCrashThread*/ true, @@ -2007,18 +2088,18 @@ InProcCrashReporter::EmitStackOverflowCrashThread() CRASHREPORT_COR_E_STACKOVERFLOW); if (stackOverflowTraceAvailable) { - storage->jsonWriter.WriteDecimalAsString("stack_overflow_total_frames", trace.totalFrameCount); + m_jsonWriter.WriteDecimalAsString("stack_overflow_total_frames", trace.totalFrameCount); if (trace.truncatedFrameCount != 0) { - storage->jsonWriter.WriteDecimalAsString("stack_overflow_trace_truncated_frames", trace.truncatedFrameCount); + m_jsonWriter.WriteDecimalAsString("stack_overflow_trace_truncated_frames", trace.truncatedFrameCount); } } else { - storage->jsonWriter.WriteString("stack_frames_unavailable_reason", CRASHREPORT_STACK_OVERFLOW_TRACE_UNAVAILABLE_REASON); + m_jsonWriter.WriteString("stack_frames_unavailable_reason", CRASHREPORT_STACK_OVERFLOW_TRACE_UNAVAILABLE_REASON); } - CrashReportHelpers::BeginJsonStackFrames(&storage->jsonWriter, /*writeCrashSiteFrame*/ false, nullptr); + CrashReportHelpers::BeginJsonStackFrames(&m_jsonWriter, /*writeCrashSiteFrame*/ false, nullptr); if (stackOverflowTraceAvailable) { for (uint32_t i = 0; i < trace.frameCount;) @@ -2027,7 +2108,7 @@ InProcCrashReporter::EmitStackOverflowCrashThread() uint32_t repeatSequenceLength = frame.repeatSequenceLength; bool isRepeatSequence = frame.repeatCount > 1 && repeatSequenceLength != 0; CrashReportHelpers::WriteStackOverflowFrameToJson( - &storage->jsonWriter, frame, isRepeatSequence); + &m_jsonWriter, frame, isRepeatSequence); ++i; if (!isRepeatSequence) @@ -2044,31 +2125,31 @@ InProcCrashReporter::EmitStackOverflowCrashThread() for (; i < sequenceEnd; ++i) { CrashReportHelpers::WriteStackOverflowFrameToJson( - &storage->jsonWriter, trace.frames[i], false); + &m_jsonWriter, trace.frames[i], false); } } } - CrashReportHelpers::EndJsonStackFrames(&storage->jsonWriter); - CrashReportHelpers::EndJsonThreadBlock(&storage->jsonWriter); + CrashReportHelpers::EndJsonStackFrames(&m_jsonWriter); + CrashReportHelpers::EndJsonThreadBlock(&m_jsonWriter); - CrashReportHelpers::BeginConsoleThreadBlock(&storage->consoleWriter, crashingTid, /*isCrashThread*/ true); - storage->consoleWriter.AppendStr(" managed exception: "); - storage->consoleWriter.AppendStr(CRASHREPORT_STACK_OVERFLOW_EXCEPTION_TYPE); - storage->consoleWriter.AppendStr(" (0x"); - storage->consoleWriter.AppendHex(static_cast(CRASHREPORT_COR_E_STACKOVERFLOW)); - storage->consoleWriter.AppendChar(')'); - storage->consoleWriter.EndLine(); + CrashReportHelpers::BeginConsoleThreadBlock(&m_consoleWriter, crashingTid, /*isCrashThread*/ true); + m_consoleWriter.AppendStr(" managed exception: "); + m_consoleWriter.AppendStr(CRASHREPORT_STACK_OVERFLOW_EXCEPTION_TYPE); + m_consoleWriter.AppendStr(" (0x"); + m_consoleWriter.AppendHex(static_cast(CRASHREPORT_COR_E_STACKOVERFLOW)); + m_consoleWriter.AppendChar(')'); + m_consoleWriter.EndLine(); if (!stackOverflowTraceAvailable) { - storage->consoleWriter.WriteLine(" stack overflow trace unavailable"); - CrashReportHelpers::EndConsoleThreadBlock(&storage->consoleWriter, 0, 0); + m_consoleWriter.WriteLine(" stack overflow trace unavailable"); + CrashReportHelpers::EndConsoleThreadBlock(&m_consoleWriter, 0, 0); return; } - storage->consoleWriter.AppendStr(" stack overflow frames: "); - storage->consoleWriter.AppendDecimal(static_cast(trace.totalFrameCount)); - storage->consoleWriter.EndLine(); + m_consoleWriter.AppendStr(" stack overflow frames: "); + m_consoleWriter.AppendDecimal(static_cast(trace.totalFrameCount)); + m_consoleWriter.EndLine(); uint32_t consoleFrameCount = 0; uint32_t consoleDroppedCount = trace.truncatedFrameCount; @@ -2084,47 +2165,47 @@ InProcCrashReporter::EmitStackOverflowCrashThread() sequenceEnd = trace.frameCount; } - if (storage->frameLimitPerThread != 0 && consoleFrameCount >= storage->frameLimitPerThread) + if (m_frameLimitPerThread != 0 && consoleFrameCount >= m_frameLimitPerThread) { consoleDroppedCount += sequenceEnd - i; i = sequenceEnd; continue; } - storage->consoleWriter.AppendStr(" repeated "); - storage->consoleWriter.AppendDecimal(static_cast(frame.repeatCount)); - storage->consoleWriter.AppendStr(" times:"); - storage->consoleWriter.EndLine(); + m_consoleWriter.AppendStr(" repeated "); + m_consoleWriter.AppendDecimal(static_cast(frame.repeatCount)); + m_consoleWriter.AppendStr(" times:"); + m_consoleWriter.EndLine(); for (; i < sequenceEnd; ++i) { - if (storage->frameLimitPerThread != 0 && consoleFrameCount >= storage->frameLimitPerThread) + if (m_frameLimitPerThread != 0 && consoleFrameCount >= m_frameLimitPerThread) { consoleDroppedCount++; continue; } CrashReportHelpers::WriteStackOverflowFrameToConsole( - &storage->consoleWriter, consoleFrameCount, trace.frames[i]); + &m_consoleWriter, consoleFrameCount, trace.frames[i]); consoleFrameCount++; } continue; } - if (storage->frameLimitPerThread != 0 && consoleFrameCount >= storage->frameLimitPerThread) + if (m_frameLimitPerThread != 0 && consoleFrameCount >= m_frameLimitPerThread) { consoleDroppedCount++; } else { - CrashReportHelpers::WriteStackOverflowFrameToConsole(&storage->consoleWriter, consoleFrameCount, frame); + CrashReportHelpers::WriteStackOverflowFrameToConsole(&m_consoleWriter, consoleFrameCount, frame); consoleFrameCount++; } ++i; } - CrashReportHelpers::EndConsoleThreadBlock(&storage->consoleWriter, + CrashReportHelpers::EndConsoleThreadBlock(&m_consoleWriter, consoleFrameCount, consoleDroppedCount); } @@ -2133,77 +2214,65 @@ InProcCrashReporter::EmitStackOverflowCrashThread() void InProcCrashReporter::BeginConsoleReport(int signal) { - InProcCrashReporterStorage* storage = s_storage; - if (storage == nullptr) - { - return; - } - - storage->consoleWriter.WriteSeparator(); - storage->consoleWriter.AppendStr(".NET Crash Report v"); - storage->consoleWriter.AppendStr(CRASHREPORT_PROTOCOL_VERSION); - storage->consoleWriter.EndLine(); + m_consoleWriter.WriteSeparator(); + m_consoleWriter.AppendStr(".NET Crash Report v"); + m_consoleWriter.AppendStr(CRASHREPORT_PROTOCOL_VERSION); + m_consoleWriter.EndLine(); - CrashReportHelpers::GetVersionString(storage->versionScratch, sizeof(storage->versionScratch)); - if (storage->versionScratch[0] != '\0') + CrashReportHelpers::GetVersionString(m_stringScratch, sizeof(m_stringScratch)); + if (m_stringScratch[0] != '\0') { - storage->consoleWriter.WriteKeyValueStr("Build", storage->versionScratch); + m_consoleWriter.WriteKeyValueStr("Build", m_stringScratch); } - storage->consoleWriter.WriteKeyValueStr("ABI", CRASHREPORT_ARCHITECTURE_NAME); + m_consoleWriter.WriteKeyValueStr("ABI", CRASHREPORT_ARCHITECTURE_NAME); - if (storage->processName[0] != '\0') + if (m_processName[0] != '\0') { - storage->consoleWriter.WriteKeyValueStr("Cmdline", storage->processName); + m_consoleWriter.WriteKeyValueStr("Cmdline", m_processName); } - storage->consoleWriter.WriteKeyValueDecimal("pid", static_cast(GetCurrentProcessId())); + m_consoleWriter.WriteKeyValueDecimal("pid", static_cast(GetCurrentProcessId())); - storage->consoleWriter.AppendStr("signal "); - storage->consoleWriter.AppendSignedDecimal(signal); - storage->consoleWriter.AppendStr(" ("); - storage->consoleWriter.AppendStr(GetSignalNameAscii(signal)); - storage->consoleWriter.AppendChar(')'); - storage->consoleWriter.EndLine(); + m_consoleWriter.AppendStr("signal "); + m_consoleWriter.AppendSignedDecimal(signal); + m_consoleWriter.AppendStr(" ("); + m_consoleWriter.AppendStr(GetSignalNameAscii(signal)); + m_consoleWriter.AppendChar(')'); + m_consoleWriter.EndLine(); } void InProcCrashReporter::EndConsoleReport() { - InProcCrashReporterStorage* storage = s_storage; - if (storage == nullptr) + if (m_moduleTable.Count() != 0) { - return; - } - - if (storage->moduleTable.Count() != 0) - { - storage->consoleWriter.WriteBlank(); - storage->consoleWriter.WriteLine("modules:"); - for (size_t i = 0; i < storage->moduleTable.Count(); ++i) + m_consoleWriter.WriteBlank(); + m_consoleWriter.WriteLine("modules:"); + for (int i = 0; i < m_moduleTable.Count(); ++i) { - storage->consoleWriter.AppendStr(" ["); - storage->consoleWriter.AppendDecimal(static_cast(i)); - storage->consoleWriter.AppendStr("] "); + m_consoleWriter.AppendStr(" ["); + m_consoleWriter.AppendDecimal(static_cast(i)); + m_consoleWriter.AppendStr("] "); const char* moduleName = nullptr; GUID moduleGuid; - if (storage->moduleInfoCallback != nullptr && - storage->moduleInfoCallback(storage->moduleTable.ModuleHandle(i), &moduleName, &moduleGuid) && + if (m_moduleInfoCallback != nullptr && + m_moduleInfoCallback(m_moduleTable.ModuleHandle(i), &moduleName, &moduleGuid) && HasModuleName(moduleName)) { - storage->consoleWriter.AppendStr(CrashReportHelpers::GetFilename(moduleName)); - storage->consoleWriter.AppendChar(' '); - storage->consoleWriter.AppendStr(storage->formatter.FormatGuid(moduleGuid)); + m_consoleWriter.AppendStr(CrashReportHelpers::GetFilename(moduleName)); + m_consoleWriter.AppendChar(' '); + m_consoleWriter.AppendStr(m_formatter.FormatGuid(moduleGuid)); } else { - storage->consoleWriter.AppendStr(""); + m_consoleWriter.AppendStr(""); } - storage->consoleWriter.EndLine(); + m_consoleWriter.EndLine(); } } - storage->consoleWriter.WriteSeparator(); + m_consoleWriter.WriteSeparator(); } // --- InProcCrashReporter: JSON report lifecycle ---------------------------- @@ -2211,28 +2280,22 @@ InProcCrashReporter::EndConsoleReport() void InProcCrashReporter::BeginJsonReport() { - InProcCrashReporterStorage* storage = s_storage; - if (storage == nullptr) - { - return; - } - - storage->jsonWriter.OpenObject(); - storage->jsonWriter.OpenObject("payload"); - storage->jsonWriter.WriteString("protocol_version", CRASHREPORT_PROTOCOL_VERSION); + m_jsonWriter.OpenObject(); + m_jsonWriter.OpenObject("payload"); + m_jsonWriter.WriteString("protocol_version", CRASHREPORT_PROTOCOL_VERSION); - storage->jsonWriter.OpenObject("configuration"); - storage->jsonWriter.WriteString("architecture", CRASHREPORT_ARCHITECTURE_NAME); - CrashReportHelpers::GetVersionString(storage->versionScratch, sizeof(storage->versionScratch)); - storage->jsonWriter.WriteString("version", storage->versionScratch); - storage->jsonWriter.CloseObject(); // configuration + m_jsonWriter.OpenObject("configuration"); + m_jsonWriter.WriteString("architecture", CRASHREPORT_ARCHITECTURE_NAME); + CrashReportHelpers::GetVersionString(m_stringScratch, sizeof(m_stringScratch)); + m_jsonWriter.WriteString("version", m_stringScratch); + m_jsonWriter.CloseObject(); // configuration - if (storage->processName[0] != '\0') + if (m_processName[0] != '\0') { - storage->jsonWriter.WriteString("process_name", storage->processName); + m_jsonWriter.WriteString("process_name", m_processName); } - storage->jsonWriter.WriteDecimalAsString("pid", static_cast(GetCurrentProcessId())); + m_jsonWriter.WriteDecimalAsString("pid", static_cast(GetCurrentProcessId())); } void @@ -2241,35 +2304,29 @@ InProcCrashReporter::EndJsonReport( bool jsonEnabled, int fd) { - InProcCrashReporterStorage* storage = s_storage; - if (storage == nullptr) - { - return; - } - - storage->jsonWriter.CloseObject(); // payload + m_jsonWriter.CloseObject(); // payload - storage->jsonWriter.OpenObject("parameters"); - storage->jsonWriter.WriteSignedDecimalAsString("signal", static_cast(signal)); + m_jsonWriter.OpenObject("parameters"); + m_jsonWriter.WriteSignedDecimalAsString("signal", static_cast(signal)); #if defined(TARGET_IOS) || defined(TARGET_TVOS) || defined(TARGET_MACCATALYST) - if (storage->osVersion[0] != '\0') + if (m_osVersion[0] != '\0') { - storage->jsonWriter.WriteString("OSVersion", storage->osVersion); + m_jsonWriter.WriteString("OSVersion", m_osVersion); } - if (storage->systemModel[0] != '\0') + if (m_systemModel[0] != '\0') { - storage->jsonWriter.WriteString("SystemModel", storage->systemModel); + m_jsonWriter.WriteString("SystemModel", m_systemModel); } - storage->jsonWriter.WriteString("SystemManufacturer", "apple"); + m_jsonWriter.WriteString("SystemManufacturer", "apple"); #endif - storage->jsonWriter.CloseObject(); // parameters + m_jsonWriter.CloseObject(); // parameters - storage->jsonWriter.CloseObject(); // root + m_jsonWriter.CloseObject(); // root if (jsonEnabled) { - bool finishSucceeded = storage->jsonWriter.Finish(); - bool writeFailed = storage->outputContext.WriteFailed(); + bool finishSucceeded = m_jsonWriter.Finish(); + bool writeFailed = m_outputContext.WriteFailed(); if (!CrashReportHelpers::WriteToFile(fd, "\n", 1)) { writeFailed = true; @@ -2277,11 +2334,11 @@ InProcCrashReporter::EndJsonReport( if (close(fd) != 0 || !finishSucceeded || writeFailed) { - unlink(storage->reportFilePathScratch); + unlink(m_reportFilePath); } } else { - (void)storage->jsonWriter.Finish(); + (void)m_jsonWriter.Finish(); } } diff --git a/src/coreclr/debug/crashreport/inproccrashreporter.h b/src/coreclr/debug/crashreport/inproccrashreporter.h index c26d81aff735f2..71e9148bec8a4d 100644 --- a/src/coreclr/debug/crashreport/inproccrashreporter.h +++ b/src/coreclr/debug/crashreport/inproccrashreporter.h @@ -81,56 +81,10 @@ struct InProcCrashReporterSettings uint32_t frameLimitPerThread; }; -class InProcCrashReporter -{ -public: - static InProcCrashReporter& GetInstance(); - - // Capture configuration and the crash-report template path. Must be called - // before the PAL enables signal-handler dispatch to CreateReport. - bool Initialize(const InProcCrashReporterSettings& settings); - - void CreateReport( - int signal, - void* context); - -private: - InProcCrashReporter() = default; - InProcCrashReporter(const InProcCrashReporter&) = delete; - InProcCrashReporter& operator=(const InProcCrashReporter&) = delete; - - void EmitSynthesizedCrashThread( - void* context, - bool walkStack); - - void EmitStackOverflowCrashThread(); - - void EmitThreads( - InProcCrashReportCrashKind crashKind, - void* context); - - void BeginConsoleReport(int signal); - void EndConsoleReport(); - - void BeginJsonReport(); - void EndJsonReport( - int signal, - bool jsonEnabled, - int fd); - - bool BuildReportPath(); - size_t ExpandDumpTemplate( - char* buffer, - size_t bufferSize, - const char* pattern); - - static const char* GetSignalNameAscii(int signal); -}; - // Free-function entry point used by the runtime to wire the in-proc crash -// reporter into the PAL signal-handler path. Captures `settings` into -// init-time allocated storage and registers a signal-safe dispatcher with PAL via -// PAL_SetInProcCrashReportCallback. PAL has no direct dependency on the +// reporter into the PAL signal-handler path. Captures `settings` into an +// init-time allocated reporter and registers a signal-safe dispatcher with PAL +// via PAL_SetInProcCrashReportCallback. PAL has no direct dependency on the // reporter; the only coupling is through this registered callback. void InProcCrashReportInitialize(const InProcCrashReporterSettings& settings); diff --git a/src/coreclr/debug/crashreport/signalsafeconsolewriter.h b/src/coreclr/debug/crashreport/signalsafeconsolewriter.h index ade4416c0e30ba..49da36950dcea6 100644 --- a/src/coreclr/debug/crashreport/signalsafeconsolewriter.h +++ b/src/coreclr/debug/crashreport/signalsafeconsolewriter.h @@ -37,7 +37,7 @@ #include #include -#include "signalsafeformat.h" +#include "signalsafeformatter.h" static constexpr size_t SIGNAL_SAFE_CONSOLE_BUFFER_SIZE = 512; diff --git a/src/coreclr/debug/crashreport/signalsafeformat.cpp b/src/coreclr/debug/crashreport/signalsafeformatter.cpp similarity index 99% rename from src/coreclr/debug/crashreport/signalsafeformat.cpp rename to src/coreclr/debug/crashreport/signalsafeformatter.cpp index 5f9027fe5ad14f..679276b252f650 100644 --- a/src/coreclr/debug/crashreport/signalsafeformat.cpp +++ b/src/coreclr/debug/crashreport/signalsafeformatter.cpp @@ -1,7 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -#include "signalsafeformat.h" +#include "signalsafeformatter.h" const char* SignalSafeFormatter::FormatHex(uint64_t value) diff --git a/src/coreclr/debug/crashreport/signalsafeformat.h b/src/coreclr/debug/crashreport/signalsafeformatter.h similarity index 100% rename from src/coreclr/debug/crashreport/signalsafeformat.h rename to src/coreclr/debug/crashreport/signalsafeformatter.h diff --git a/src/coreclr/debug/crashreport/signalsafejsonwriter.h b/src/coreclr/debug/crashreport/signalsafejsonwriter.h index 8d2de1fda3dc8a..f39a7a78bfc01f 100644 --- a/src/coreclr/debug/crashreport/signalsafejsonwriter.h +++ b/src/coreclr/debug/crashreport/signalsafejsonwriter.h @@ -12,7 +12,7 @@ #include #include -#include "signalsafeformat.h" +#include "signalsafeformatter.h" using SignalSafeJsonOutputCallback = bool (*)(const char* buffer, size_t len, void* ctx); From 8645aaa3f23b88c9b67d26dbc0b3c750d600c96f Mon Sep 17 00:00:00 2001 From: Mitchell Hwang <16830051+mdh1418@users.noreply.github.com> Date: Thu, 21 May 2026 00:05:30 -0400 Subject: [PATCH 107/109] Update prescribed crash report log format comment Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- src/coreclr/debug/crashreport/inproccrashreporter.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/coreclr/debug/crashreport/inproccrashreporter.cpp b/src/coreclr/debug/crashreport/inproccrashreporter.cpp index 2ceb790a313b3e..6bf387e68a803c 100644 --- a/src/coreclr/debug/crashreport/inproccrashreporter.cpp +++ b/src/coreclr/debug/crashreport/inproccrashreporter.cpp @@ -61,9 +61,9 @@ static const char CRASHREPORT_ARCHITECTURE_NAME[] = "unknown"; // (blank between sections) // --- thread 0xTID [(crashed)] --- (BeginConsoleThreadBlock) // managed exception: (0x) (only if EE provided one) -// #NN [M] Class.Method + 0xILOFFSET (token=0xTOKEN) (managed frame; WriteFrameToConsole) +// #NN [] Class.Method + 0xILOFFSET (token=0xTOKEN) (managed frame; WriteFrameToConsole) // #NN (in ) Class.Method + 0xILOFFSET (token=0xTOKEN) (overflow form: module didn't fit the table) -// #NN [M] 0xIP (module + 0xOFFSET) (native frame; WriteFrameToConsole) +// #NN [] 0xIP (module + 0xOFFSET) (native frame; WriteFrameToConsole) // #NN 0xIP (module + 0xOFFSET) (native frame not in module table) // (no managed frames) | ... +N more frames (EndConsoleThreadBlock) // (blank between threads) From fdb5b367167702cbe8cdc98ceb7fd39d6ed87814 Mon Sep 17 00:00:00 2001 From: Mitchell Hwang Date: Thu, 21 May 2026 00:51:53 -0400 Subject: [PATCH 108/109] Use volatile loads for crash report singleton state Read interlocked-published crash reporter and stack-walker singletons through VolatileLoad so crash-path callers observe fully initialized state. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/coreclr/debug/crashreport/inproccrashreporter.cpp | 7 ++++--- src/coreclr/vm/crashreportstackwalker.cpp | 10 +++++----- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/coreclr/debug/crashreport/inproccrashreporter.cpp b/src/coreclr/debug/crashreport/inproccrashreporter.cpp index 6bf387e68a803c..f9183a9509cb48 100644 --- a/src/coreclr/debug/crashreport/inproccrashreporter.cpp +++ b/src/coreclr/debug/crashreport/inproccrashreporter.cpp @@ -11,6 +11,7 @@ #include "signalsafeformatter.h" #include "pal.h" +#include "volatile.h" #include #include @@ -429,7 +430,7 @@ class InProcCrashReporter #endif }; -static InProcCrashReporter* volatile s_reporter = nullptr; +static InProcCrashReporter* s_reporter = nullptr; class CrashReportHelpers { @@ -702,14 +703,14 @@ InProcCrashReporter::EmitThreads( InProcCrashReporter* InProcCrashReporter::GetInstance() { - return s_reporter; + return VolatileLoad(&s_reporter); } bool InProcCrashReporter::InitializeInstance( const InProcCrashReporterSettings& settings) { - if (s_reporter != nullptr) + if (VolatileLoad(&s_reporter) != nullptr) { return true; } diff --git a/src/coreclr/vm/crashreportstackwalker.cpp b/src/coreclr/vm/crashreportstackwalker.cpp index 44b49d9b5ca767..3ee9a3a5fbde49 100644 --- a/src/coreclr/vm/crashreportstackwalker.cpp +++ b/src/coreclr/vm/crashreportstackwalker.cpp @@ -38,13 +38,13 @@ struct CrashReportStackWalkerState WalkContext walkContext; }; -static CrashReportStackWalkerState* volatile s_crashReportStackWalkerState = nullptr; +static CrashReportStackWalkerState* s_crashReportStackWalkerState = nullptr; static bool EnsureCrashReportStackWalkerState() { - if (s_crashReportStackWalkerState != nullptr) + if (VolatileLoad(&s_crashReportStackWalkerState) != nullptr) { return true; } @@ -213,7 +213,7 @@ FrameCallbackAdapter( CONTRACTL_END; WalkContext* ctx = static_cast(pData); - CrashReportStackWalkerState* state = s_crashReportStackWalkerState; + CrashReportStackWalkerState* state = VolatileLoad(&s_crashReportStackWalkerState); if (ctx == nullptr || state == nullptr) { return SWA_CONTINUE; @@ -324,7 +324,7 @@ CrashReportWalkThread( InProcCrashReportFrameCallback frameCallback, void* ctx) { - CrashReportStackWalkerState* state = s_crashReportStackWalkerState; + CrashReportStackWalkerState* state = VolatileLoad(&s_crashReportStackWalkerState); if (pThread == nullptr || frameCallback == nullptr || state == nullptr) { return; @@ -520,7 +520,7 @@ CrashReportEnumerateThreads( InProcCrashReportFrameCallback frameCallback, void* ctx) { - CrashReportStackWalkerState* state = s_crashReportStackWalkerState; + CrashReportStackWalkerState* state = VolatileLoad(&s_crashReportStackWalkerState); if (state == nullptr) { return; From e72d193d8bd619141ea70802e056046f97646587 Mon Sep 17 00:00:00 2001 From: Mitchell Hwang Date: Tue, 26 May 2026 12:51:18 -0400 Subject: [PATCH 109/109] Address feedback --- .../debug/crashreport/inproccrashreporter.cpp | 154 ++++++++---------- .../crashreport/signalsafeconsolewriter.cpp | 9 +- .../debug/crashreport/signalsafeformatter.cpp | 8 +- .../debug/crashreport/signalsafeformatter.h | 9 +- src/coreclr/vm/crashreportstackwalker.cpp | 13 +- 5 files changed, 84 insertions(+), 109 deletions(-) diff --git a/src/coreclr/debug/crashreport/inproccrashreporter.cpp b/src/coreclr/debug/crashreport/inproccrashreporter.cpp index f9183a9509cb48..95d62e95a38651 100644 --- a/src/coreclr/debug/crashreport/inproccrashreporter.cpp +++ b/src/coreclr/debug/crashreport/inproccrashreporter.cpp @@ -190,6 +190,20 @@ class ModuleTable int m_count = 0; }; +struct FrameContext +{ + SignalSafeJsonWriter* jsonWriter; + SignalSafeConsoleWriter* consoleWriter; + InProcCrashReportModuleInfoCallback moduleInfoCallback; + ModuleTable* moduleTable; + SignalSafeFormatter* formatter; + uint32_t* currentThreadFrameCount; + uint32_t* currentThreadDroppedCount; + uint32_t frameLimitPerThread; + char* methodNameBuffer; + size_t methodNameBufferSize; +}; + class ThreadEnumerationContext { public: @@ -218,8 +232,8 @@ class ThreadEnumerationContext size_t ThreadCount() const { return m_threadCount; } bool SawCrashThread() const { return m_sawCrashThread; } - SignalSafeJsonWriter* JsonWriter() const { return m_jsonWriter; } - SignalSafeConsoleWriter* ConsoleWriter() const { return m_consoleWriter; } + SignalSafeJsonWriter* JsonWriter() const { return m_frameContext.jsonWriter; } + SignalSafeConsoleWriter* ConsoleWriter() const { return m_frameContext.consoleWriter; } void Init( SignalSafeJsonWriter* writer, @@ -233,23 +247,25 @@ class ThreadEnumerationContext uint32_t frameLimitPerThread, void* signalContext) { - m_jsonWriter = writer; - m_consoleWriter = consoleWriter; - m_moduleInfoCallback = moduleInfoCallback; - m_moduleTable = moduleTable; - m_formatter = formatter; - m_methodNameScratch = methodNameScratch; - m_methodNameScratchSize = methodNameScratchSize; + m_frameContext.jsonWriter = writer; + m_frameContext.consoleWriter = consoleWriter; + m_frameContext.moduleInfoCallback = moduleInfoCallback; + m_frameContext.moduleTable = moduleTable; + m_frameContext.formatter = formatter; + m_frameContext.methodNameBuffer = methodNameScratch; + m_frameContext.methodNameBufferSize = methodNameScratchSize; + m_frameContext.currentThreadFrameCount = &m_currentThreadFrameCount; + m_frameContext.currentThreadDroppedCount = &m_currentThreadDroppedCount; + m_frameContext.frameLimitPerThread = frameLimitPerThread; m_signalContext = signalContext; m_threadCount = 0; m_crashingTid = crashingTid; m_currentThreadFrameCount = 0; m_currentThreadDroppedCount = 0; - m_frameLimitPerThread = frameLimitPerThread; m_sawCrashThread = false; - if (m_methodNameScratch != nullptr && m_methodNameScratchSize != 0) + if (methodNameScratch != nullptr && methodNameScratchSize != 0) { - m_methodNameScratch[0] = '\0'; + methodNameScratch[0] = '\0'; } } @@ -301,19 +317,12 @@ class ThreadEnumerationContext void EndCurrentConsoleThreadBlock(); void EndCurrentJsonThreadBlock(); - SignalSafeJsonWriter* m_jsonWriter; - SignalSafeConsoleWriter* m_consoleWriter; - InProcCrashReportModuleInfoCallback m_moduleInfoCallback; - ModuleTable* m_moduleTable; - SignalSafeFormatter* m_formatter; - char* m_methodNameScratch; - size_t m_methodNameScratchSize; + FrameContext m_frameContext; void* m_signalContext; size_t m_threadCount; uint64_t m_crashingTid; uint32_t m_currentThreadFrameCount; uint32_t m_currentThreadDroppedCount; - uint32_t m_frameLimitPerThread; bool m_sawCrashThread; }; @@ -435,20 +444,6 @@ static InProcCrashReporter* s_reporter = nullptr; class CrashReportHelpers { public: - struct FrameContext - { - SignalSafeJsonWriter* jsonWriter; - SignalSafeConsoleWriter* consoleWriter; - InProcCrashReportModuleInfoCallback moduleInfoCallback; - ModuleTable* moduleTable; - SignalSafeFormatter* formatter; - uint32_t* currentThreadFrameCount; - uint32_t* currentThreadDroppedCount; - uint32_t frameLimitPerThread; - char* methodNameBuffer; - size_t methodNameBufferSize; - }; - static void GetVersionString( char* buffer, size_t bufferSize); @@ -576,16 +571,7 @@ class CrashReportHelpers void* ctx); static void WriteFrameToReport( - SignalSafeJsonWriter* jsonWriter, - SignalSafeConsoleWriter* consoleWriter, - InProcCrashReportModuleInfoCallback moduleInfoCallback, - ModuleTable* moduleTable, - SignalSafeFormatter* formatter, - char* methodNameBuffer, - size_t methodNameBufferSize, - uint32_t* currentThreadFrameCount, - uint32_t* currentThreadDroppedCount, - uint32_t frameLimitPerThread, + FrameContext* frameContext, uint64_t ip, uint64_t stackPointer, const char* methodName, @@ -1753,16 +1739,7 @@ CrashReportHelpers::WriteFrame( } WriteFrameToReport( - frameContext->jsonWriter, - frameContext->consoleWriter, - frameContext->moduleInfoCallback, - frameContext->moduleTable, - frameContext->formatter, - frameContext->methodNameBuffer, - frameContext->methodNameBufferSize, - frameContext->currentThreadFrameCount, - frameContext->currentThreadDroppedCount, - frameContext->frameLimitPerThread, + frameContext, ip, stackPointer, methodName, @@ -1779,16 +1756,7 @@ CrashReportHelpers::WriteFrame( void CrashReportHelpers::WriteFrameToReport( - SignalSafeJsonWriter* jsonWriter, - SignalSafeConsoleWriter* consoleWriter, - InProcCrashReportModuleInfoCallback moduleInfoCallback, - ModuleTable* moduleTable, - SignalSafeFormatter* formatter, - char* methodNameBuffer, - size_t methodNameBufferSize, - uint32_t* currentThreadFrameCount, - uint32_t* currentThreadDroppedCount, - uint32_t frameLimitPerThread, + FrameContext* frameContext, uint64_t ip, uint64_t stackPointer, const char* methodName, @@ -1802,6 +1770,21 @@ CrashReportHelpers::WriteFrameToReport( uint32_t token, uint32_t ilOffset) { + if (frameContext == nullptr) + { + return; + } + + SignalSafeJsonWriter* jsonWriter = frameContext->jsonWriter; + SignalSafeConsoleWriter* consoleWriter = frameContext->consoleWriter; + InProcCrashReportModuleInfoCallback moduleInfoCallback = frameContext->moduleInfoCallback; + ModuleTable* moduleTable = frameContext->moduleTable; + SignalSafeFormatter* formatter = frameContext->formatter; + char* methodNameBuffer = frameContext->methodNameBuffer; + size_t methodNameBufferSize = frameContext->methodNameBufferSize; + uint32_t* currentThreadFrameCount = frameContext->currentThreadFrameCount; + uint32_t* currentThreadDroppedCount = frameContext->currentThreadDroppedCount; + uint32_t frameLimitPerThread = frameContext->frameLimitPerThread; uint32_t frameIndex = currentThreadFrameCount != nullptr ? *currentThreadFrameCount : 0; @@ -1863,16 +1846,7 @@ ThreadEnumerationContext::OnFrame( uint32_t ilOffset) { CrashReportHelpers::WriteFrameToReport( - m_jsonWriter, - m_consoleWriter, - m_moduleInfoCallback, - m_moduleTable, - m_formatter, - m_methodNameScratch, - m_methodNameScratchSize, - &m_currentThreadFrameCount, - &m_currentThreadDroppedCount, - m_frameLimitPerThread, + &m_frameContext, ip, stackPointer, methodName, @@ -1930,7 +1904,7 @@ ThreadEnumerationContext::EndCurrentConsoleThreadBlock() return; } - CrashReportHelpers::EndConsoleThreadBlock(m_consoleWriter, + CrashReportHelpers::EndConsoleThreadBlock(m_frameContext.consoleWriter, m_currentThreadFrameCount, m_currentThreadDroppedCount); } @@ -1942,10 +1916,10 @@ ThreadEnumerationContext::EndCurrentJsonThreadBlock() return; } - CrashReportHelpers::EndJsonStackFrames(m_jsonWriter); - CrashReportHelpers::EndJsonThreadBlock(m_jsonWriter); + CrashReportHelpers::EndJsonStackFrames(m_frameContext.jsonWriter); + CrashReportHelpers::EndJsonThreadBlock(m_frameContext.jsonWriter); - (void)m_jsonWriter->Flush(); + (void)m_frameContext.jsonWriter->Flush(); } void @@ -1969,28 +1943,28 @@ ThreadEnumerationContext::OnThread( m_currentThreadFrameCount = 0; m_currentThreadDroppedCount = 0; - CrashReportHelpers::BeginJsonThreadBlock(m_jsonWriter, + CrashReportHelpers::BeginJsonThreadBlock(m_frameContext.jsonWriter, osThreadId, /*isManagedThread*/ true, isCrashThread, exceptionType, exceptionHResult); if (isCrashThread) { - CrashReportHelpers::WriteRegistersToJson(m_jsonWriter, m_signalContext); + CrashReportHelpers::WriteRegistersToJson(m_frameContext.jsonWriter, m_signalContext); } - CrashReportHelpers::BeginJsonStackFrames(m_jsonWriter, isCrashThread, m_signalContext); + CrashReportHelpers::BeginJsonStackFrames(m_frameContext.jsonWriter, isCrashThread, m_signalContext); - if (m_consoleWriter != nullptr) + if (m_frameContext.consoleWriter != nullptr) { - CrashReportHelpers::BeginConsoleThreadBlock(m_consoleWriter, osThreadId, isCrashThread); + CrashReportHelpers::BeginConsoleThreadBlock(m_frameContext.consoleWriter, osThreadId, isCrashThread); if (exceptionType != nullptr && exceptionType[0] != '\0') { - m_consoleWriter->AppendStr(" managed exception: "); - m_consoleWriter->AppendStr(exceptionType); - m_consoleWriter->AppendStr(" (0x"); - m_consoleWriter->AppendHex(static_cast(exceptionHResult)); - m_consoleWriter->AppendChar(')'); - m_consoleWriter->EndLine(); + m_frameContext.consoleWriter->AppendStr(" managed exception: "); + m_frameContext.consoleWriter->AppendStr(exceptionType); + m_frameContext.consoleWriter->AppendStr(" (0x"); + m_frameContext.consoleWriter->AppendHex(static_cast(exceptionHResult)); + m_frameContext.consoleWriter->AppendChar(')'); + m_frameContext.consoleWriter->EndLine(); } } } @@ -2050,7 +2024,7 @@ InProcCrashReporter::EmitSynthesizedCrashThread( uint32_t synthesizedDroppedCount = 0; if (walkStack && m_walkStackCallback != nullptr) { - CrashReportHelpers::FrameContext frameContext = + FrameContext frameContext = { &m_jsonWriter, &m_consoleWriter, diff --git a/src/coreclr/debug/crashreport/signalsafeconsolewriter.cpp b/src/coreclr/debug/crashreport/signalsafeconsolewriter.cpp index 8903fea10661e5..99fc24a5dd9e1a 100644 --- a/src/coreclr/debug/crashreport/signalsafeconsolewriter.cpp +++ b/src/coreclr/debug/crashreport/signalsafeconsolewriter.cpp @@ -67,10 +67,9 @@ SignalSafeConsoleWriter::AppendSignedDecimal(int64_t v) void SignalSafeConsoleWriter::EndLine() { -#if defined(TARGET_IOS) || defined(TARGET_TVOS) || defined(TARGET_MACCATALYST) - // Apple mobile platforms write the report to stderr; explicitly - // newline-terminate each logical line so log readers split entries the - // same way logcat would. + // On Android, __android_log_write in Flush() adds its own line discipline. + // For other platforms, we still need to add a newline. +#if !defined(__ANDROID__) if (m_pos + 1 < sizeof(m_buffer)) { m_buffer[m_pos++] = '\n'; @@ -80,7 +79,7 @@ SignalSafeConsoleWriter::EndLine() m_buffer[sizeof(m_buffer) - 2] = '\n'; m_pos = sizeof(m_buffer) - 1; } -#endif // TARGET_IOS || TARGET_TVOS || TARGET_MACCATALYST +#endif // !__ANDROID__ Flush(); } diff --git a/src/coreclr/debug/crashreport/signalsafeformatter.cpp b/src/coreclr/debug/crashreport/signalsafeformatter.cpp index 679276b252f650..a6d08be345362b 100644 --- a/src/coreclr/debug/crashreport/signalsafeformatter.cpp +++ b/src/coreclr/debug/crashreport/signalsafeformatter.cpp @@ -50,7 +50,7 @@ SignalSafeFormatter::FormatHex( value >>= 4; } while (value != 0 && reverseLength < MAX_HEX_DIGITS_UINT64); - if (bufferSize < HEX_PREFIX_LEN + reverseLength + NULL_TERMINATOR_LEN) + if (bufferSize < 2 + reverseLength + 1) // "0x" + digits + '\0' { buffer[0] = '\0'; return; @@ -59,7 +59,7 @@ SignalSafeFormatter::FormatHex( buffer[0] = '0'; buffer[1] = 'x'; - size_t index = HEX_PREFIX_LEN; + size_t index = 2; // Skip past "0x" prefix while (reverseLength > 0) { buffer[index++] = m_reverse[--reverseLength]; @@ -85,7 +85,7 @@ SignalSafeFormatter::FormatUnsignedDecimal( value /= 10; } while (value != 0 && reverseLength < sizeof(m_reverse)); - if (bufferSize < reverseLength + NULL_TERMINATOR_LEN) + if (bufferSize < reverseLength + 1) // digits + '\0' { buffer[0] = '\0'; return 0; @@ -116,7 +116,7 @@ SignalSafeFormatter::FormatSignedDecimal( return FormatUnsignedDecimal(buffer, bufferSize, static_cast(value)); } - if (bufferSize < SIGN_LEN + NULL_TERMINATOR_LEN) + if (bufferSize < 1 + 1) // '-' + '\0' minimum { buffer[0] = '\0'; return 0; diff --git a/src/coreclr/debug/crashreport/signalsafeformatter.h b/src/coreclr/debug/crashreport/signalsafeformatter.h index 39542634147995..97066d1490897d 100644 --- a/src/coreclr/debug/crashreport/signalsafeformatter.h +++ b/src/coreclr/debug/crashreport/signalsafeformatter.h @@ -19,13 +19,10 @@ class SignalSafeFormatter public: static constexpr size_t MAX_HEX_DIGITS_UINT64 = 16; static constexpr size_t MAX_DECIMAL_DIGITS_UINT64 = 20; - static constexpr size_t HEX_PREFIX_LEN = 2; // "0x" - static constexpr size_t SIGN_LEN = 1; // '-' for signed decimals - static constexpr size_t NULL_TERMINATOR_LEN = 1; - static constexpr size_t MAX_HEX_BUFFER_SIZE = HEX_PREFIX_LEN + MAX_HEX_DIGITS_UINT64 + NULL_TERMINATOR_LEN; - static constexpr size_t MAX_UNSIGNED_DECIMAL_BUFFER_SIZE = MAX_DECIMAL_DIGITS_UINT64 + NULL_TERMINATOR_LEN; - static constexpr size_t MAX_SIGNED_DECIMAL_BUFFER_SIZE = SIGN_LEN + MAX_DECIMAL_DIGITS_UINT64 + NULL_TERMINATOR_LEN; + static constexpr size_t MAX_HEX_BUFFER_SIZE = 2 + MAX_HEX_DIGITS_UINT64 + 1; // "0x" + hex + '\0' + static constexpr size_t MAX_UNSIGNED_DECIMAL_BUFFER_SIZE = MAX_DECIMAL_DIGITS_UINT64 + 1; // digits + '\0' + static constexpr size_t MAX_SIGNED_DECIMAL_BUFFER_SIZE = 1 + MAX_DECIMAL_DIGITS_UINT64 + 1; // '-' + digits + '\0' static constexpr size_t MAX_GUID_BUFFER_SIZE = MINIPAL_GUID_BUFFER_LEN; SignalSafeFormatter() = default; diff --git a/src/coreclr/vm/crashreportstackwalker.cpp b/src/coreclr/vm/crashreportstackwalker.cpp index 3ee9a3a5fbde49..1a259cb2a23cec 100644 --- a/src/coreclr/vm/crashreportstackwalker.cpp +++ b/src/coreclr/vm/crashreportstackwalker.cpp @@ -40,11 +40,16 @@ struct CrashReportStackWalkerState static CrashReportStackWalkerState* s_crashReportStackWalkerState = nullptr; +inline CrashReportStackWalkerState* GetStackWalkerState() +{ + return VolatileLoad(&s_crashReportStackWalkerState); +} + static bool EnsureCrashReportStackWalkerState() { - if (VolatileLoad(&s_crashReportStackWalkerState) != nullptr) + if (GetStackWalkerState() != nullptr) { return true; } @@ -213,7 +218,7 @@ FrameCallbackAdapter( CONTRACTL_END; WalkContext* ctx = static_cast(pData); - CrashReportStackWalkerState* state = VolatileLoad(&s_crashReportStackWalkerState); + CrashReportStackWalkerState* state = GetStackWalkerState(); if (ctx == nullptr || state == nullptr) { return SWA_CONTINUE; @@ -324,7 +329,7 @@ CrashReportWalkThread( InProcCrashReportFrameCallback frameCallback, void* ctx) { - CrashReportStackWalkerState* state = VolatileLoad(&s_crashReportStackWalkerState); + CrashReportStackWalkerState* state = GetStackWalkerState(); if (pThread == nullptr || frameCallback == nullptr || state == nullptr) { return; @@ -520,7 +525,7 @@ CrashReportEnumerateThreads( InProcCrashReportFrameCallback frameCallback, void* ctx) { - CrashReportStackWalkerState* state = VolatileLoad(&s_crashReportStackWalkerState); + CrashReportStackWalkerState* state = GetStackWalkerState(); if (state == nullptr) { return;