Skip to content

Commit 1a76e37

Browse files
authored
[libs] Skip AdvSimdEncode on Mono (#96829)
* [libs] Skip AdvSimdEncode on Mono * Add guard around existing AdvSimdEncode callsite to exclude on Mono * Add issue to guard * Guard AdvSimdEncode logic for not Mono * Make AdvSimdEncode inaccessible on Mono * Update issue comment
1 parent e458d68 commit 1a76e37

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/libraries/System.Private.CoreLib/src/System/Buffers/Text/Base64Encoder.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ public static unsafe OperationStatus EncodeToUtf8(ReadOnlySpan<byte> bytes, Span
8585
goto DoneExit;
8686
}
8787

88+
#if !MONO // https://github.com/dotnet/runtime/issues/93081
8889
end = srcMax - 48;
8990
if (AdvSimd.Arm64.IsSupported && (end >= src))
9091
{
@@ -93,6 +94,7 @@ public static unsafe OperationStatus EncodeToUtf8(ReadOnlySpan<byte> bytes, Span
9394
if (src == srcEnd)
9495
goto DoneExit;
9596
}
97+
#endif
9698

9799
end = srcMax - 16;
98100
if ((Ssse3.IsSupported || AdvSimd.Arm64.IsSupported) && BitConverter.IsLittleEndian && (end >= src))
@@ -489,6 +491,7 @@ private static unsafe void Avx2Encode(ref byte* srcBytes, ref byte* destBytes, b
489491
destBytes = dest;
490492
}
491493

494+
#if !MONO // https://github.com/dotnet/runtime/issues/93081
492495
[MethodImpl(MethodImplOptions.AggressiveInlining)]
493496
[CompExactlyDependsOn(typeof(AdvSimd.Arm64))]
494497
private static unsafe void AdvSimdEncode(ref byte* srcBytes, ref byte* destBytes, byte* srcEnd, int sourceLength, int destLength, byte* srcStart, byte* destStart)
@@ -546,6 +549,7 @@ private static unsafe void AdvSimdEncode(ref byte* srcBytes, ref byte* destBytes
546549
srcBytes = src;
547550
destBytes = dest;
548551
}
552+
#endif // !MONO
549553

550554
[MethodImpl(MethodImplOptions.AggressiveInlining)]
551555
[CompExactlyDependsOn(typeof(Ssse3))]

0 commit comments

Comments
 (0)