Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/corert.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/System.Private.CoreLib/shared/System/Runtime/Intrinsics/Vector64.cs')
-rw-r--r--src/System.Private.CoreLib/shared/System/Runtime/Intrinsics/Vector64.cs43
1 files changed, 43 insertions, 0 deletions
diff --git a/src/System.Private.CoreLib/shared/System/Runtime/Intrinsics/Vector64.cs b/src/System.Private.CoreLib/shared/System/Runtime/Intrinsics/Vector64.cs
new file mode 100644
index 000000000..8ce90b9d0
--- /dev/null
+++ b/src/System.Private.CoreLib/shared/System/Runtime/Intrinsics/Vector64.cs
@@ -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.
+// See the LICENSE file in the project root for more information.
+
+using System.Diagnostics;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+using Internal.Runtime.CompilerServices;
+
+namespace System.Runtime.Intrinsics
+{
+ [Intrinsic]
+ [DebuggerDisplay("{DisplayString,nq}")]
+ [DebuggerTypeProxy(typeof(Vector64DebugView<>))]
+ [StructLayout(LayoutKind.Sequential, Size = 8)]
+ public readonly struct Vector64<T> where T : struct
+ {
+ // These fields exist to ensure the alignment is 8, rather than 1.
+ // This also allows the debug view to work https://github.com/dotnet/coreclr/issues/15694)
+ private readonly ulong _00;
+
+ private unsafe string DisplayString
+ {
+ get
+ {
+ // The IsPrimitive check ends up working for `bool`, `char`, `IntPtr`, and `UIntPtr`
+ // which are not actually supported by any current architecture. This shouldn't be
+ // an issue however and greatly simplifies the check
+
+ if (typeof(T).IsPrimitive)
+ {
+ var items = new T[8 / Unsafe.SizeOf<T>()];
+ Unsafe.WriteUnaligned(ref Unsafe.As<T, byte>(ref items[0]), this);
+ return $"({string.Join(", ", items)})";
+ }
+ else
+ {
+ return SR.NotSupported_Type;
+ }
+ }
+ }
+ }
+}