You've already forked linux-packaging-mono
Imported Upstream version 4.4.2.4
Former-commit-id: 92904c9c5915c37244316e42ba99e7b934ed7ee2
This commit is contained in:
parent
589d484eee
commit
0b4a830db1
@ -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.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
namespace System.Numerics
|
||||
{
|
||||
internal class ConstantHelper
|
||||
{
|
||||
[MethodImplAttribute(MethodImplOptions.AggressiveInlining)]
|
||||
public static Byte GetByteWithAllBitsSet()
|
||||
{
|
||||
Byte value = 0;
|
||||
unsafe
|
||||
{
|
||||
unchecked
|
||||
{
|
||||
*((Byte*)&value) = (Byte)0xff;
|
||||
}
|
||||
}
|
||||
return value;
|
||||
}
|
||||
[MethodImplAttribute(MethodImplOptions.AggressiveInlining)]
|
||||
public static SByte GetSByteWithAllBitsSet()
|
||||
{
|
||||
SByte value = 0;
|
||||
unsafe
|
||||
{
|
||||
unchecked
|
||||
{
|
||||
*((SByte*)&value) = (SByte)0xff;
|
||||
}
|
||||
}
|
||||
return value;
|
||||
}
|
||||
[MethodImplAttribute(MethodImplOptions.AggressiveInlining)]
|
||||
public static UInt16 GetUInt16WithAllBitsSet()
|
||||
{
|
||||
UInt16 value = 0;
|
||||
unsafe
|
||||
{
|
||||
unchecked
|
||||
{
|
||||
*((UInt16*)&value) = (UInt16)0xffff;
|
||||
}
|
||||
}
|
||||
return value;
|
||||
}
|
||||
[MethodImplAttribute(MethodImplOptions.AggressiveInlining)]
|
||||
public static Int16 GetInt16WithAllBitsSet()
|
||||
{
|
||||
Int16 value = 0;
|
||||
unsafe
|
||||
{
|
||||
unchecked
|
||||
{
|
||||
*((Int16*)&value) = (Int16)0xffff;
|
||||
}
|
||||
}
|
||||
return value;
|
||||
}
|
||||
[MethodImplAttribute(MethodImplOptions.AggressiveInlining)]
|
||||
public static UInt32 GetUInt32WithAllBitsSet()
|
||||
{
|
||||
UInt32 value = 0;
|
||||
unsafe
|
||||
{
|
||||
unchecked
|
||||
{
|
||||
*((UInt32*)&value) = (UInt32)0xffffffff;
|
||||
}
|
||||
}
|
||||
return value;
|
||||
}
|
||||
[MethodImplAttribute(MethodImplOptions.AggressiveInlining)]
|
||||
public static Int32 GetInt32WithAllBitsSet()
|
||||
{
|
||||
Int32 value = 0;
|
||||
unsafe
|
||||
{
|
||||
unchecked
|
||||
{
|
||||
*((Int32*)&value) = (Int32)0xffffffff;
|
||||
}
|
||||
}
|
||||
return value;
|
||||
}
|
||||
[MethodImplAttribute(MethodImplOptions.AggressiveInlining)]
|
||||
public static UInt64 GetUInt64WithAllBitsSet()
|
||||
{
|
||||
UInt64 value = 0;
|
||||
unsafe
|
||||
{
|
||||
unchecked
|
||||
{
|
||||
*((UInt64*)&value) = (UInt64)0xffffffffffffffff;
|
||||
}
|
||||
}
|
||||
return value;
|
||||
}
|
||||
[MethodImplAttribute(MethodImplOptions.AggressiveInlining)]
|
||||
public static Int64 GetInt64WithAllBitsSet()
|
||||
{
|
||||
Int64 value = 0;
|
||||
unsafe
|
||||
{
|
||||
unchecked
|
||||
{
|
||||
*((Int64*)&value) = (Int64)0xffffffffffffffff;
|
||||
}
|
||||
}
|
||||
return value;
|
||||
}
|
||||
[MethodImplAttribute(MethodImplOptions.AggressiveInlining)]
|
||||
public static Single GetSingleWithAllBitsSet()
|
||||
{
|
||||
Single value = 0;
|
||||
unsafe
|
||||
{
|
||||
unchecked
|
||||
{
|
||||
*((Int32*)&value) = (Int32)0xffffffff;
|
||||
}
|
||||
}
|
||||
return value;
|
||||
}
|
||||
[MethodImplAttribute(MethodImplOptions.AggressiveInlining)]
|
||||
public static Double GetDoubleWithAllBitsSet()
|
||||
{
|
||||
Double value = 0;
|
||||
unsafe
|
||||
{
|
||||
unchecked
|
||||
{
|
||||
*((Int64*)&value) = (Int64)0xffffffffffffffff;
|
||||
}
|
||||
}
|
||||
return value;
|
||||
}
|
||||
}
|
||||
}
|
@ -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.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
namespace System.Numerics
|
||||
{
|
||||
internal static class HashCodeHelper
|
||||
{
|
||||
/// <summary>
|
||||
/// Combines two hash codes, useful for combining hash codes of individual vector elements
|
||||
/// </summary>
|
||||
internal static int CombineHashCodes(int h1, int h2)
|
||||
{
|
||||
return (((h1 << 5) + h1) ^ h2);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
// 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.
|
||||
|
||||
namespace System.Numerics
|
||||
{
|
||||
/// <summary>
|
||||
/// An attribute that can be attached to JIT Intrinsic methods/properties
|
||||
/// </summary>
|
||||
[AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor | AttributeTargets.Property)]
|
||||
internal class JitIntrinsicAttribute : Attribute
|
||||
{
|
||||
}
|
||||
}
|
172
mcs/class/System.Numerics.Vectors/System.Numerics/Register.cs
Normal file
172
mcs/class/System.Numerics.Vectors/System.Numerics/Register.cs
Normal file
@ -0,0 +1,172 @@
|
||||
// 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.Runtime.InteropServices;
|
||||
|
||||
namespace System.Numerics
|
||||
{
|
||||
/// <summary>
|
||||
/// A structure describing the layout of an SSE2-sized register.
|
||||
/// Contains overlapping fields representing the set of valid numeric types.
|
||||
/// Allows the generic Vector'T struct to contain an explicit field layout.
|
||||
/// </summary>
|
||||
[StructLayout(LayoutKind.Explicit)]
|
||||
internal struct Register
|
||||
{
|
||||
#region Internal Storage Fields
|
||||
// Internal System.Byte Fields
|
||||
[FieldOffset(0)]
|
||||
internal Byte byte_0;
|
||||
[FieldOffset(1)]
|
||||
internal Byte byte_1;
|
||||
[FieldOffset(2)]
|
||||
internal Byte byte_2;
|
||||
[FieldOffset(3)]
|
||||
internal Byte byte_3;
|
||||
[FieldOffset(4)]
|
||||
internal Byte byte_4;
|
||||
[FieldOffset(5)]
|
||||
internal Byte byte_5;
|
||||
[FieldOffset(6)]
|
||||
internal Byte byte_6;
|
||||
[FieldOffset(7)]
|
||||
internal Byte byte_7;
|
||||
[FieldOffset(8)]
|
||||
internal Byte byte_8;
|
||||
[FieldOffset(9)]
|
||||
internal Byte byte_9;
|
||||
[FieldOffset(10)]
|
||||
internal Byte byte_10;
|
||||
[FieldOffset(11)]
|
||||
internal Byte byte_11;
|
||||
[FieldOffset(12)]
|
||||
internal Byte byte_12;
|
||||
[FieldOffset(13)]
|
||||
internal Byte byte_13;
|
||||
[FieldOffset(14)]
|
||||
internal Byte byte_14;
|
||||
[FieldOffset(15)]
|
||||
internal Byte byte_15;
|
||||
|
||||
// Internal System.SByte Fields
|
||||
[FieldOffset(0)]
|
||||
internal SByte sbyte_0;
|
||||
[FieldOffset(1)]
|
||||
internal SByte sbyte_1;
|
||||
[FieldOffset(2)]
|
||||
internal SByte sbyte_2;
|
||||
[FieldOffset(3)]
|
||||
internal SByte sbyte_3;
|
||||
[FieldOffset(4)]
|
||||
internal SByte sbyte_4;
|
||||
[FieldOffset(5)]
|
||||
internal SByte sbyte_5;
|
||||
[FieldOffset(6)]
|
||||
internal SByte sbyte_6;
|
||||
[FieldOffset(7)]
|
||||
internal SByte sbyte_7;
|
||||
[FieldOffset(8)]
|
||||
internal SByte sbyte_8;
|
||||
[FieldOffset(9)]
|
||||
internal SByte sbyte_9;
|
||||
[FieldOffset(10)]
|
||||
internal SByte sbyte_10;
|
||||
[FieldOffset(11)]
|
||||
internal SByte sbyte_11;
|
||||
[FieldOffset(12)]
|
||||
internal SByte sbyte_12;
|
||||
[FieldOffset(13)]
|
||||
internal SByte sbyte_13;
|
||||
[FieldOffset(14)]
|
||||
internal SByte sbyte_14;
|
||||
[FieldOffset(15)]
|
||||
internal SByte sbyte_15;
|
||||
|
||||
// Internal System.UInt16 Fields
|
||||
[FieldOffset(0)]
|
||||
internal UInt16 uint16_0;
|
||||
[FieldOffset(2)]
|
||||
internal UInt16 uint16_1;
|
||||
[FieldOffset(4)]
|
||||
internal UInt16 uint16_2;
|
||||
[FieldOffset(6)]
|
||||
internal UInt16 uint16_3;
|
||||
[FieldOffset(8)]
|
||||
internal UInt16 uint16_4;
|
||||
[FieldOffset(10)]
|
||||
internal UInt16 uint16_5;
|
||||
[FieldOffset(12)]
|
||||
internal UInt16 uint16_6;
|
||||
[FieldOffset(14)]
|
||||
internal UInt16 uint16_7;
|
||||
|
||||
// Internal System.Int16 Fields
|
||||
[FieldOffset(0)]
|
||||
internal Int16 int16_0;
|
||||
[FieldOffset(2)]
|
||||
internal Int16 int16_1;
|
||||
[FieldOffset(4)]
|
||||
internal Int16 int16_2;
|
||||
[FieldOffset(6)]
|
||||
internal Int16 int16_3;
|
||||
[FieldOffset(8)]
|
||||
internal Int16 int16_4;
|
||||
[FieldOffset(10)]
|
||||
internal Int16 int16_5;
|
||||
[FieldOffset(12)]
|
||||
internal Int16 int16_6;
|
||||
[FieldOffset(14)]
|
||||
internal Int16 int16_7;
|
||||
|
||||
// Internal System.UInt32 Fields
|
||||
[FieldOffset(0)]
|
||||
internal UInt32 uint32_0;
|
||||
[FieldOffset(4)]
|
||||
internal UInt32 uint32_1;
|
||||
[FieldOffset(8)]
|
||||
internal UInt32 uint32_2;
|
||||
[FieldOffset(12)]
|
||||
internal UInt32 uint32_3;
|
||||
|
||||
// Internal System.Int32 Fields
|
||||
[FieldOffset(0)]
|
||||
internal Int32 int32_0;
|
||||
[FieldOffset(4)]
|
||||
internal Int32 int32_1;
|
||||
[FieldOffset(8)]
|
||||
internal Int32 int32_2;
|
||||
[FieldOffset(12)]
|
||||
internal Int32 int32_3;
|
||||
|
||||
// Internal System.UInt64 Fields
|
||||
[FieldOffset(0)]
|
||||
internal UInt64 uint64_0;
|
||||
[FieldOffset(8)]
|
||||
internal UInt64 uint64_1;
|
||||
|
||||
// Internal System.Int64 Fields
|
||||
[FieldOffset(0)]
|
||||
internal Int64 int64_0;
|
||||
[FieldOffset(8)]
|
||||
internal Int64 int64_1;
|
||||
|
||||
// Internal System.Single Fields
|
||||
[FieldOffset(0)]
|
||||
internal Single single_0;
|
||||
[FieldOffset(4)]
|
||||
internal Single single_1;
|
||||
[FieldOffset(8)]
|
||||
internal Single single_2;
|
||||
[FieldOffset(12)]
|
||||
internal Single single_3;
|
||||
|
||||
// Internal System.Double Fields
|
||||
[FieldOffset(0)]
|
||||
internal Double double_0;
|
||||
[FieldOffset(8)]
|
||||
internal Double double_1;
|
||||
|
||||
#endregion Internal Storage Fields
|
||||
}
|
||||
}
|
@ -0,0 +1 @@
|
||||
13785ed5cfe49a9b83029b75bd5fbe239a875333
|
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user