From c546fcc2df84d80e87e272ff5cfd723ac538d166 Mon Sep 17 00:00:00 2001 From: ahsonkhan Date: Tue, 21 Feb 2017 18:48:06 -0800 Subject: [PATCH] Using BIT64 ifdefs to use ints instead of longs Commit migrated from https://github.com/dotnet/coreclr/commit/703396bab40d260d9c704d016c617c65bf7bed42 --- src/coreclr/src/mscorlib/src/System/Span.cs | 89 +++++++++++++++++++++++++++++ 1 file changed, 89 insertions(+) diff --git a/src/coreclr/src/mscorlib/src/System/Span.cs b/src/coreclr/src/mscorlib/src/System/Span.cs index 0c548a9..75a102e 100644 --- a/src/coreclr/src/mscorlib/src/System/Span.cs +++ b/src/coreclr/src/mscorlib/src/System/Span.cs @@ -677,75 +677,164 @@ namespace System Unsafe.Add(ref b, 6) = 0; return; case 8: +#if BIT64 Unsafe.As(ref b) = 0; +#else + Unsafe.As(ref b) = 0; + Unsafe.As(ref Unsafe.Add(ref b, 4)) = 0; +#endif return; case 9: +#if BIT64 Unsafe.As(ref b) = 0; +#else + Unsafe.As(ref b) = 0; + Unsafe.As(ref Unsafe.Add(ref b, 4)) = 0; +#endif Unsafe.Add(ref b, 8) = 0; return; case 10: +#if BIT64 Unsafe.As(ref b) = 0; +#else + Unsafe.As(ref b) = 0; + Unsafe.As(ref Unsafe.Add(ref b, 4)) = 0; +#endif Unsafe.As(ref Unsafe.Add(ref b, 8)) = 0; return; case 11: +#if BIT64 Unsafe.As(ref b) = 0; +#else + Unsafe.As(ref b) = 0; + Unsafe.As(ref Unsafe.Add(ref b, 4)) = 0; +#endif Unsafe.As(ref Unsafe.Add(ref b, 8)) = 0; Unsafe.Add(ref b, 10) = 0; return; case 12: +#if BIT64 Unsafe.As(ref b) = 0; +#else + Unsafe.As(ref b) = 0; + Unsafe.As(ref Unsafe.Add(ref b, 4)) = 0; +#endif Unsafe.As(ref Unsafe.Add(ref b, 8)) = 0; return; case 13: +#if BIT64 Unsafe.As(ref b) = 0; +#else + Unsafe.As(ref b) = 0; + Unsafe.As(ref Unsafe.Add(ref b, 4)) = 0; +#endif Unsafe.As(ref Unsafe.Add(ref b, 8)) = 0; Unsafe.Add(ref b, 12) = 0; return; case 14: +#if BIT64 Unsafe.As(ref b) = 0; +#else + Unsafe.As(ref b) = 0; + Unsafe.As(ref Unsafe.Add(ref b, 4)) = 0; +#endif Unsafe.As(ref Unsafe.Add(ref b, 8)) = 0; Unsafe.As(ref Unsafe.Add(ref b, 12)) = 0; return; case 15: +#if BIT64 Unsafe.As(ref b) = 0; +#else + Unsafe.As(ref b) = 0; + Unsafe.As(ref Unsafe.Add(ref b, 4)) = 0; +#endif Unsafe.As(ref Unsafe.Add(ref b, 8)) = 0; Unsafe.As(ref Unsafe.Add(ref b, 12)) = 0; Unsafe.Add(ref b, 14) = 0; return; case 16: +#if BIT64 Unsafe.As(ref b) = 0; Unsafe.As(ref Unsafe.Add(ref b, 8)) = 0; +#else + Unsafe.As(ref b) = 0; + Unsafe.As(ref Unsafe.Add(ref b, 4)) = 0; + Unsafe.As(ref Unsafe.Add(ref b, 8)) = 0; + Unsafe.As(ref Unsafe.Add(ref b, 12)) = 0; +#endif return; case 17: +#if BIT64 Unsafe.As(ref b) = 0; Unsafe.As(ref Unsafe.Add(ref b, 8)) = 0; +#else + Unsafe.As(ref b) = 0; + Unsafe.As(ref Unsafe.Add(ref b, 4)) = 0; + Unsafe.As(ref Unsafe.Add(ref b, 8)) = 0; + Unsafe.As(ref Unsafe.Add(ref b, 12)) = 0; +#endif Unsafe.Add(ref b, 16) = 0; return; case 18: +#if BIT64 Unsafe.As(ref b) = 0; Unsafe.As(ref Unsafe.Add(ref b, 8)) = 0; +#else + Unsafe.As(ref b) = 0; + Unsafe.As(ref Unsafe.Add(ref b, 4)) = 0; + Unsafe.As(ref Unsafe.Add(ref b, 8)) = 0; + Unsafe.As(ref Unsafe.Add(ref b, 12)) = 0; +#endif Unsafe.As(ref Unsafe.Add(ref b, 16)) = 0; return; case 19: +#if BIT64 Unsafe.As(ref b) = 0; Unsafe.As(ref Unsafe.Add(ref b, 8)) = 0; +#else + Unsafe.As(ref b) = 0; + Unsafe.As(ref Unsafe.Add(ref b, 4)) = 0; + Unsafe.As(ref Unsafe.Add(ref b, 8)) = 0; + Unsafe.As(ref Unsafe.Add(ref b, 12)) = 0; +#endif Unsafe.As(ref Unsafe.Add(ref b, 16)) = 0; Unsafe.Add(ref b, 18) = 0; return; case 20: +#if BIT64 Unsafe.As(ref b) = 0; Unsafe.As(ref Unsafe.Add(ref b, 8)) = 0; +#else + Unsafe.As(ref b) = 0; + Unsafe.As(ref Unsafe.Add(ref b, 4)) = 0; + Unsafe.As(ref Unsafe.Add(ref b, 8)) = 0; + Unsafe.As(ref Unsafe.Add(ref b, 12)) = 0; +#endif Unsafe.As(ref Unsafe.Add(ref b, 16)) = 0; return; case 21: +#if BIT64 Unsafe.As(ref b) = 0; Unsafe.As(ref Unsafe.Add(ref b, 8)) = 0; +#else + Unsafe.As(ref b) = 0; + Unsafe.As(ref Unsafe.Add(ref b, 4)) = 0; + Unsafe.As(ref Unsafe.Add(ref b, 8)) = 0; + Unsafe.As(ref Unsafe.Add(ref b, 12)) = 0; +#endif Unsafe.As(ref Unsafe.Add(ref b, 16)) = 0; Unsafe.Add(ref b, 20) = 0; return; case 22: +#if BIT64 Unsafe.As(ref b) = 0; Unsafe.As(ref Unsafe.Add(ref b, 8)) = 0; +#else + Unsafe.As(ref b) = 0; + Unsafe.As(ref Unsafe.Add(ref b, 4)) = 0; + Unsafe.As(ref Unsafe.Add(ref b, 8)) = 0; + Unsafe.As(ref Unsafe.Add(ref b, 12)) = 0; +#endif Unsafe.As(ref Unsafe.Add(ref b, 16)) = 0; Unsafe.As(ref Unsafe.Add(ref b, 20)) = 0; return; -- 2.7.4