Skip to content

Commit

Permalink
Addressing Review Comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
DeepakRajendrakumaran committed Mar 27, 2024
1 parent 39da22a commit 825bf75
Showing 1 changed file with 23 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2151,9 +2151,9 @@ internal static unsafe nuint WidenAsciiToUtf16(byte* pAsciiBuffer, char* pUtf16B
}

[MethodImpl(MethodImplOptions.AggressiveInlining)]
private static unsafe void WidenAsciiToUtf1_Vector<TVectorByte, TVectorUShort>(byte* pAsciiBuffer, char* pUtf16Buffer, ref nuint currentOffset, nuint elementCount)
private static unsafe void WidenAsciiToUtf1_Vector<TVectorByte, TVectorUInt16>(byte* pAsciiBuffer, char* pUtf16Buffer, ref nuint currentOffset, nuint elementCount)
where TVectorByte : unmanaged, ISimdVector<TVectorByte, byte>
where TVectorUShort : unmanaged, ISimdVector<TVectorUShort, ushort>
where TVectorUInt16 : unmanaged, ISimdVector<TVectorUInt16, ushort>
{
ushort* pCurrentWriteAddress = (ushort*)pUtf16Buffer;
// Calculating the destination address outside the loop results in significant
Expand All @@ -2163,14 +2163,15 @@ private static unsafe void WidenAsciiToUtf1_Vector<TVectorByte, TVectorUShort>(b
TVectorByte asciiVector = TVectorByte.Load(pAsciiBuffer + currentOffset);
if (!HasMatch<TVectorByte>(asciiVector))
{
(TVectorUShort utf16LowVector, TVectorUShort utf16HighVector) = Widen<TVectorByte, TVectorUShort>(asciiVector);
(TVectorUInt16 utf16LowVector, TVectorUInt16 utf16HighVector) = Widen<TVectorByte, TVectorUInt16>(asciiVector);
utf16LowVector.Store(pCurrentWriteAddress);
utf16HighVector.Store(pCurrentWriteAddress + TVectorUShort.Count);
pCurrentWriteAddress += (nuint)(TVectorUShort.Count * 2);
if (((int)pCurrentWriteAddress & 1) == 0)
utf16HighVector.Store(pCurrentWriteAddress + TVectorUInt16.Count);
pCurrentWriteAddress += (nuint)(TVectorUInt16.Count * 2);
bool canAlign = (((nuint)pCurrentWriteAddress % sizeof(char)) == 0);

Check failure on line 2170 in src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux-x86 checked CoreCLR_NoR2R)

src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs#L2170

src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs(2170,22): error IDE0059: (NETCORE_ENGINEERING_TELEMETRY=Build) Unnecessary assignment of a value to 'canAlign' (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0059)

Check failure on line 2170 in src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux-riscv64 checked CoreCLR)

src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs#L2170

src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs(2170,22): error IDE0059: (NETCORE_ENGINEERING_TELEMETRY=Build) Unnecessary assignment of a value to 'canAlign' (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0059)

Check failure on line 2170 in src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux-armel checked CoreCLR_NonPortable)

src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs#L2170

src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs(2170,22): error IDE0059: (NETCORE_ENGINEERING_TELEMETRY=Build) Unnecessary assignment of a value to 'canAlign' (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0059)

Check failure on line 2170 in src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux-arm64 debug Mono_Runtime)

src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs#L2170

src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs(2170,22): error IDE0059: (NETCORE_ENGINEERING_TELEMETRY=Build) Unnecessary assignment of a value to 'canAlign' (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0059)

Check failure on line 2170 in src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux-arm checked CoreCLR_ReleaseLibraries)

src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs#L2170

src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs(2170,22): error IDE0059: (NETCORE_ENGINEERING_TELEMETRY=Build) Unnecessary assignment of a value to 'canAlign' (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0059)

Check failure on line 2170 in src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux-x64 debug Mono_Runtime)

src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs#L2170

src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs(2170,22): error IDE0059: (NETCORE_ENGINEERING_TELEMETRY=Build) Unnecessary assignment of a value to 'canAlign' (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0059)

Check failure on line 2170 in src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux_musl-arm Debug AllSubsets_CoreCLR_ReleaseRuntimeLibs)

src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs#L2170

src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs(2170,22): error IDE0059: (NETCORE_ENGINEERING_TELEMETRY=Build) Unnecessary assignment of a value to 'canAlign' (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0059)

Check failure on line 2170 in src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs

View check run for this annotation

Azure Pipelines / runtime (Build freebsd-x64 Debug CoreCLR)

src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs#L2170

src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs(2170,22): error IDE0059: (NETCORE_ENGINEERING_TELEMETRY=Build) Unnecessary assignment of a value to 'canAlign' (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0059)

Check failure on line 2170 in src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux_musl-x64 Debug AllSubsets_CoreCLR)

src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs#L2170

src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs(2170,22): error IDE0059: (NETCORE_ENGINEERING_TELEMETRY=Build) Unnecessary assignment of a value to 'canAlign' (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0059)

Check failure on line 2170 in src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux-x64 Debug Libraries_CheckedCoreCLR)

src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs#L2170

src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs(2170,22): error IDE0059: (NETCORE_ENGINEERING_TELEMETRY=Build) Unnecessary assignment of a value to 'canAlign' (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0059)

Check failure on line 2170 in src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux_musl-arm64 Debug AllSubsets_CoreCLR_ReleaseRuntimeLibs)

src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs#L2170

src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs(2170,22): error IDE0059: (NETCORE_ENGINEERING_TELEMETRY=Build) Unnecessary assignment of a value to 'canAlign' (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0059)

Check failure on line 2170 in src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux-arm Debug AllSubsets_CoreCLR_ReleaseRuntimeLibs)

src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs#L2170

src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs(2170,22): error IDE0059: (NETCORE_ENGINEERING_TELEMETRY=Build) Unnecessary assignment of a value to 'canAlign' (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0059)

Check failure on line 2170 in src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs

View check run for this annotation

Azure Pipelines / runtime-dev-innerloop (Build linux-x64 debug Runtime_Release)

src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs#L2170

src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs(2170,22): error IDE0059: (NETCORE_ENGINEERING_TELEMETRY=Build) Unnecessary assignment of a value to 'canAlign' (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0059)

Check failure on line 2170 in src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux-arm Debug AllSubsets_Mono)

src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs#L2170

src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs(2170,22): error IDE0059: (NETCORE_ENGINEERING_TELEMETRY=Build) Unnecessary assignment of a value to 'canAlign' (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0059)

Check failure on line 2170 in src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux-arm64 Debug AllSubsets_CoreCLR)

src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs#L2170

src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs(2170,22): error IDE0059: (NETCORE_ENGINEERING_TELEMETRY=Build) Unnecessary assignment of a value to 'canAlign' (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0059)

Check failure on line 2170 in src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux_musl-arm checked CoreCLR_ReleaseLibraries)

src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs#L2170

src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs(2170,22): error IDE0059: (NETCORE_ENGINEERING_TELEMETRY=Build) Unnecessary assignment of a value to 'canAlign' (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0059)

Check failure on line 2170 in src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux-x64 Debug CoreCLR_Libraries)

src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs#L2170

src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs(2170,22): error IDE0059: (NETCORE_ENGINEERING_TELEMETRY=Build) Unnecessary assignment of a value to 'canAlign' (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0059)

Check failure on line 2170 in src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux-arm64 Debug Libraries_CheckedCoreCLR)

src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs#L2170

src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs(2170,22): error IDE0059: (NETCORE_ENGINEERING_TELEMETRY=Build) Unnecessary assignment of a value to 'canAlign' (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0059)

Check failure on line 2170 in src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux-x64 checked CoreCLR_ReleaseLibraries)

src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs#L2170

src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs(2170,22): error IDE0059: (NETCORE_ENGINEERING_TELEMETRY=Build) Unnecessary assignment of a value to 'canAlign' (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0059)

Check failure on line 2170 in src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux_musl-x64 Debug CoreCLR_Libraries)

src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs#L2170

src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs(2170,22): error IDE0059: (NETCORE_ENGINEERING_TELEMETRY=Build) Unnecessary assignment of a value to 'canAlign' (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0059)

Check failure on line 2170 in src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux-x64 Debug AllSubsets_Mono_LLVMJIT)

src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs#L2170

src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs(2170,22): error IDE0059: (NETCORE_ENGINEERING_TELEMETRY=Build) Unnecessary assignment of a value to 'canAlign' (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0059)

Check failure on line 2170 in src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux_musl-arm64 checked CoreCLR_ReleaseLibraries)

src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs#L2170

src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs(2170,22): error IDE0059: (NETCORE_ENGINEERING_TELEMETRY=Build) Unnecessary assignment of a value to 'canAlign' (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0059)

Check failure on line 2170 in src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs

View check run for this annotation

Azure Pipelines / dotnet-linker-tests (Build linux-x64 release Runtime_Release)

src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs#L2170

src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs(2170,22): error IDE0059: (NETCORE_ENGINEERING_TELEMETRY=Build) Unnecessary assignment of a value to 'canAlign' (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0059)

Check failure on line 2170 in src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux_musl-x64 Debug Libraries_CheckedCoreCLR)

src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs#L2170

src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs(2170,22): error IDE0059: (NETCORE_ENGINEERING_TELEMETRY=Build) Unnecessary assignment of a value to 'canAlign' (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0059)

Check failure on line 2170 in src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux-arm64 Debug AllSubsets_Mono_LLVMJIT)

src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs#L2170

src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs(2170,22): error IDE0059: (NETCORE_ENGINEERING_TELEMETRY=Build) Unnecessary assignment of a value to 'canAlign' (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0059)

Check failure on line 2170 in src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux_musl-x64 Release AllSubsets_Mono)

src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs#L2170

src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs(2170,22): error IDE0059: (NETCORE_ENGINEERING_TELEMETRY=Build) Unnecessary assignment of a value to 'canAlign' (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0059)

Check failure on line 2170 in src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs

View check run for this annotation

Azure Pipelines / runtime (Build wasi-wasm linux Release LibraryTests_Smoke_AOT)

src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs#L2170

src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs(2170,22): error IDE0059: (NETCORE_ENGINEERING_TELEMETRY=Build) Unnecessary assignment of a value to 'canAlign' (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0059)

Check failure on line 2170 in src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux-riscv64 Release AllSubsets_Mono)

src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs#L2170

src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs(2170,22): error IDE0059: (NETCORE_ENGINEERING_TELEMETRY=Build) Unnecessary assignment of a value to 'canAlign' (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0059)

Check failure on line 2170 in src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux-x64 Debug Mono_Interpreter_LibrariesTests)

src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs#L2170

src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs(2170,22): error IDE0059: (NETCORE_ENGINEERING_TELEMETRY=Build) Unnecessary assignment of a value to 'canAlign' (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0059)

Check failure on line 2170 in src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs

View check run for this annotation

Azure Pipelines / runtime-dev-innerloop (Build linux-x64 debug Libraries_AllConfigurations)

src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs#L2170

src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs(2170,22): error IDE0059: (NETCORE_ENGINEERING_TELEMETRY=Build) Unnecessary assignment of a value to 'canAlign' (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0059)

Check failure on line 2170 in src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs

View check run for this annotation

Azure Pipelines / runtime (Build wasi-wasm linux Release LibraryTests_Smoke)

src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs#L2170

src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs(2170,22): error IDE0059: (NETCORE_ENGINEERING_TELEMETRY=Build) Unnecessary assignment of a value to 'canAlign' (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0059)

Check failure on line 2170 in src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux-x64 Release AllSubsets_Mono_LLVMAOT)

src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs#L2170

src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs(2170,22): error IDE0059: (NETCORE_ENGINEERING_TELEMETRY=Build) Unnecessary assignment of a value to 'canAlign' (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0059)

Check failure on line 2170 in src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux-x64 Debug Mono_MiniJIT_LibrariesTests)

src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs#L2170

src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs(2170,22): error IDE0059: (NETCORE_ENGINEERING_TELEMETRY=Build) Unnecessary assignment of a value to 'canAlign' (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0059)

Check failure on line 2170 in src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs

View check run for this annotation

Azure Pipelines / runtime (Build android-arm64 Release AllSubsets_Mono)

src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs#L2170

src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs(2170,22): error IDE0059: (NETCORE_ENGINEERING_TELEMETRY=Build) Unnecessary assignment of a value to 'canAlign' (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0059)

Check failure on line 2170 in src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs

View check run for this annotation

Azure Pipelines / runtime (Build android-arm Release AllSubsets_Mono)

src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs#L2170

src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs(2170,22): error IDE0059: (NETCORE_ENGINEERING_TELEMETRY=Build) Unnecessary assignment of a value to 'canAlign' (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0059)

Check failure on line 2170 in src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux-arm64 Debug Mono_MiniJIT_LibrariesTests)

src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs#L2170

src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs(2170,22): error IDE0059: (NETCORE_ENGINEERING_TELEMETRY=Build) Unnecessary assignment of a value to 'canAlign' (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0059)

Check failure on line 2170 in src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux-arm64 Release AllSubsets_Mono_LLVMAOT)

src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs#L2170

src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs(2170,22): error IDE0059: (NETCORE_ENGINEERING_TELEMETRY=Build) Unnecessary assignment of a value to 'canAlign' (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0059)

Check failure on line 2170 in src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs

View check run for this annotation

Azure Pipelines / runtime (Build browser-wasm linux Release LibraryTests_Smoke_AOT)

src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs#L2170

src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs(2170,22): error IDE0059: (NETCORE_ENGINEERING_TELEMETRY=Build) Unnecessary assignment of a value to 'canAlign' (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0059)

Check failure on line 2170 in src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs

View check run for this annotation

Azure Pipelines / runtime (Build browser-wasm linux Release LibraryTests_EAT)

src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs#L2170

src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs(2170,22): error IDE0059: (NETCORE_ENGINEERING_TELEMETRY=Build) Unnecessary assignment of a value to 'canAlign' (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0059)

Check failure on line 2170 in src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs

View check run for this annotation

Azure Pipelines / runtime (Build coreclr Common Pri0 Test Build AnyOS AnyCPU checked)

src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs#L2170

src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs(2170,22): error IDE0059: (NETCORE_ENGINEERING_TELEMETRY=Build) Unnecessary assignment of a value to 'canAlign' (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0059)

Check failure on line 2170 in src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs

View check run for this annotation

Azure Pipelines / runtime (Build browser-wasm linux Release LibraryTests)

src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs#L2170

src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs(2170,22): error IDE0059: (NETCORE_ENGINEERING_TELEMETRY=Build) Unnecessary assignment of a value to 'canAlign' (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0059)

Check failure on line 2170 in src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs

View check run for this annotation

Azure Pipelines / runtime (Build browser-wasm linux Release LibraryTests_Threading)

src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs#L2170

src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs(2170,22): error IDE0059: (NETCORE_ENGINEERING_TELEMETRY=Build) Unnecessary assignment of a value to 'canAlign' (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0059)

Check failure on line 2170 in src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux-x64 Release AllSubsets_Mono_LLVMAot_RuntimeTests llvmaot)

src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs#L2170

src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs(2170,22): error IDE0059: (NETCORE_ENGINEERING_TELEMETRY=Build) Unnecessary assignment of a value to 'canAlign' (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0059)

Check failure on line 2170 in src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs

View check run for this annotation

Azure Pipelines / dotnet-linker-tests (Build browser-wasm linux release Runtime_Release)

src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs#L2170

src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs(2170,22): error IDE0059: (NETCORE_ENGINEERING_TELEMETRY=Build) Unnecessary assignment of a value to 'canAlign' (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0059)

Check failure on line 2170 in src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux-arm64 Release AllSubsets_Mono_Minijit_RuntimeTests minijit)

src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs#L2170

src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs(2170,22): error IDE0059: (NETCORE_ENGINEERING_TELEMETRY=Build) Unnecessary assignment of a value to 'canAlign' (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0059)

Check failure on line 2170 in src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux-x64 checked CLR_Tools_Tests)

src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs#L2170

src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs(2170,22): error IDE0059: (NETCORE_ENGINEERING_TELEMETRY=Build) Unnecessary assignment of a value to 'canAlign' (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0059)

Check failure on line 2170 in src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs

View check run for this annotation

Azure Pipelines / runtime (Build osx-arm64 Debug AllSubsets_CoreCLR)

src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs#L2170

src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs(2170,22): error IDE0059: (NETCORE_ENGINEERING_TELEMETRY=Build) Unnecessary assignment of a value to 'canAlign' (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0059)

Check failure on line 2170 in src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux_musl-arm64 release CrossAOT_Mono crossaot)

src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs#L2170

src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs(2170,22): error IDE0059: (NETCORE_ENGINEERING_TELEMETRY=Build) Unnecessary assignment of a value to 'canAlign' (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0059)

Check failure on line 2170 in src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux-x64 release CrossAOT_Mono crossaot)

src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs#L2170

src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs(2170,22): error IDE0059: (NETCORE_ENGINEERING_TELEMETRY=Build) Unnecessary assignment of a value to 'canAlign' (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0059)

Check failure on line 2170 in src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux_musl-x64 release CrossAOT_Mono crossaot)

src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs#L2170

src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs(2170,22): error IDE0059: (NETCORE_ENGINEERING_TELEMETRY=Build) Unnecessary assignment of a value to 'canAlign' (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0059)
if (((nuint)pCurrentWriteAddress % sizeof(char)) == 0)
{
// Bump write buffer up to the next aligned boundary
pCurrentWriteAddress = (ushort*)((nuint)pCurrentWriteAddress & ~(nuint)(TVectorUShort.Alignment - 1));
pCurrentWriteAddress = (ushort*)((nuint)pCurrentWriteAddress & ~(nuint)(TVectorUInt16.Alignment - 1));
nuint numBytesWritten = (nuint)pCurrentWriteAddress - (nuint)pUtf16Buffer;
currentOffset += (nuint)numBytesWritten / 2;
}
Expand All @@ -2186,11 +2187,12 @@ private static unsafe void WidenAsciiToUtf1_Vector<TVectorByte, TVectorUShort>(b
{
break;
}
(utf16LowVector, utf16HighVector) = Widen<TVectorByte, TVectorUShort>(asciiVector);
utf16LowVector.StoreAligned(pCurrentWriteAddress);
utf16HighVector.StoreAligned(pCurrentWriteAddress + TVectorUShort.Count);
(utf16LowVector, utf16HighVector) = Widen<TVectorByte, TVectorUInt16>(asciiVector);
utf16LowVector.Store(pCurrentWriteAddress);
utf16HighVector.Store(pCurrentWriteAddress + TVectorUInt16.Count);

currentOffset += (nuint)TVectorByte.Count;
pCurrentWriteAddress += (nuint)(TVectorUShort.Count * 2);
pCurrentWriteAddress += (nuint)(TVectorUInt16.Count * 2);
}
}
return;
Expand All @@ -2205,22 +2207,26 @@ private static unsafe bool HasMatch<TVectorByte>(TVectorByte vector)


[MethodImpl(MethodImplOptions.AggressiveInlining)]
private static unsafe (TVectorUShort Lower, TVectorUShort Upper) Widen<TVectorByte, TVectorUShort>(TVectorByte vector)
private static unsafe (TVectorUInt16 Lower, TVectorUInt16 Upper) Widen<TVectorByte, TVectorUInt16>(TVectorByte vector)
where TVectorByte : unmanaged, ISimdVector<TVectorByte, byte>
where TVectorUShort : unmanaged, ISimdVector<TVectorUShort, ushort>
where TVectorUInt16 : unmanaged, ISimdVector<TVectorUInt16, ushort>
{
if (typeof(TVectorByte) == typeof(Vector256<byte>))
{
(Vector256<ushort> Lower256, Vector256<ushort> Upper256) = Vector256.Widen((Vector256<byte>)(object)vector);
return ((TVectorUShort)(object)Lower256, (TVectorUShort)(object)Upper256);
return ((TVectorUInt16)(object)Lower256, (TVectorUInt16)(object)Upper256);
}
else if (typeof(TVectorByte) == typeof(Vector512<byte>))
{
(Vector512<ushort> Lower512, Vector512<ushort> Upper512) = Vector512.Widen((Vector512<byte>)(object)vector);
return ((TVectorUShort)(object)Lower512, (TVectorUShort)(object)Upper512);
return ((TVectorUInt16)(object)Lower512, (TVectorUInt16)(object)Upper512);
}
else
{
Debug.Assert(typeof(TVectorByte) == typeof(Vector128<byte>));
(Vector128<ushort> Lower128, Vector128<ushort> Upper128) = Vector128.Widen((Vector128<byte>)(object)vector);
return ((TVectorUInt16)(object)Lower128, (TVectorUInt16)(object)Upper128);
}
(Vector128<ushort> Lower128, Vector128<ushort> Upper128) = Vector128.Widen((Vector128<byte>)(object)vector);
return ((TVectorUShort)(object)Lower128, (TVectorUShort)(object)Upper128);
}


Expand Down

0 comments on commit 825bf75

Please sign in to comment.