From 91cd0472dea32769fe7ee3d1e4ad0832955f8b8f Mon Sep 17 00:00:00 2001 From: Marek Safar Date: Fri, 24 Feb 2017 15:13:26 +0100 Subject: [System.Numerics] Use corefx implementation --- mcs/class/System.Numerics.Vectors/SR.cs | 14 ------ .../System.Numerics.Vectors.dll.sources | 10 ++--- mcs/class/System.Numerics.Vectors/corefx/SR.cs | 11 +++++ mcs/class/System.Numerics/Makefile | 6 ++- mcs/class/System.Numerics/ReferenceSources/SR.cs | 21 --------- .../System.Numerics/System.Numerics.dll.sources | 51 ++++++++++++++-------- mcs/class/System.Numerics/corefx/SR.cs | 25 +++++++++++ mcs/class/System.Numerics/corefx/Vector.cs | 12 +++++ mcs/class/corlib/Assembly/AssemblyInfo.cs | 2 - 9 files changed, 89 insertions(+), 63 deletions(-) delete mode 100644 mcs/class/System.Numerics.Vectors/SR.cs create mode 100644 mcs/class/System.Numerics.Vectors/corefx/SR.cs delete mode 100644 mcs/class/System.Numerics/ReferenceSources/SR.cs create mode 100644 mcs/class/System.Numerics/corefx/SR.cs create mode 100644 mcs/class/System.Numerics/corefx/Vector.cs diff --git a/mcs/class/System.Numerics.Vectors/SR.cs b/mcs/class/System.Numerics.Vectors/SR.cs deleted file mode 100644 index 6c04e222d68..00000000000 --- a/mcs/class/System.Numerics.Vectors/SR.cs +++ /dev/null @@ -1,14 +0,0 @@ -// -// This file was generated by resx2sr tool -// - -partial class SR -{ - public const string Arg_ArgumentOutOfRangeException = "Index was out of bounds:"; - public const string Arg_ElementsInSourceIsGreaterThanDestination = "Number of elements in source vector is greater than the destination array"; - public const string Arg_MultiDimArrayNotSupported = "Only one-dimensional arrays are supported"; - public const string Arg_NullArgumentNullRef = "The method was called with a null array argument."; - public const string Arg_RegisterLengthOfRangeException = "length must be less than"; - public const string Arg_TypeNotSupported = "Specified type is not supported"; - public const string Reflection_MethodNotSupported = "Vector.Count cannot be called via reflection when intrinsics are enabled."; -} diff --git a/mcs/class/System.Numerics.Vectors/System.Numerics.Vectors.dll.sources b/mcs/class/System.Numerics.Vectors/System.Numerics.Vectors.dll.sources index a5f261e85ca..74524d655fd 100644 --- a/mcs/class/System.Numerics.Vectors/System.Numerics.Vectors.dll.sources +++ b/mcs/class/System.Numerics.Vectors/System.Numerics.Vectors.dll.sources @@ -2,11 +2,11 @@ ../../build/common/SR.cs Assembly/AssemblyInfo.cs Assembly/TypeForwarders.cs -SR.cs +corefx/SR.cs ../../../external/corefx/src/Common/src/System/Numerics/Hashing/HashHelpers.cs ../../../external/corefx/src/System.Numerics.Vectors/src/System/Numerics/ConstantHelper.cs -../../../external/corefx/src/System.Numerics.Vectors/src/System/Numerics//JitIntrinsicAttribute.cs -../../../external/corefx/src/System.Numerics.Vectors/src/System/Numerics//Register.cs -../../../external/corefx/src/System.Numerics.Vectors/src/System/Numerics//Vector_Operations.cs -../../../external/corefx/src/System.Numerics.Vectors/src/System/Numerics//Vector.cs +../../../external/corefx/src/System.Numerics.Vectors/src/System/Numerics/JitIntrinsicAttribute.cs +../../../external/corefx/src/System.Numerics.Vectors/src/System/Numerics/Register.cs +../../../external/corefx/src/System.Numerics.Vectors/src/System/Numerics/Vector_Operations.cs +../../../external/corefx/src/System.Numerics.Vectors/src/System/Numerics/Vector.cs diff --git a/mcs/class/System.Numerics.Vectors/corefx/SR.cs b/mcs/class/System.Numerics.Vectors/corefx/SR.cs new file mode 100644 index 00000000000..def5b0907ed --- /dev/null +++ b/mcs/class/System.Numerics.Vectors/corefx/SR.cs @@ -0,0 +1,11 @@ +// +// This file was generated by resx2sr tool +// + +partial class SR +{ + public const string Arg_ArgumentOutOfRangeException = "Index was out of bounds:"; + public const string Arg_ElementsInSourceIsGreaterThanDestination = "Number of elements in source vector is greater than the destination array"; + public const string Arg_NullArgumentNullRef = "The method was called with a null array argument."; + public const string Arg_TypeNotSupported = "Specified type is not supported"; +} diff --git a/mcs/class/System.Numerics/Makefile b/mcs/class/System.Numerics/Makefile index bc470e1b6e7..19d1e56a543 100644 --- a/mcs/class/System.Numerics/Makefile +++ b/mcs/class/System.Numerics/Makefile @@ -4,10 +4,12 @@ include ../../build/rules.make LIBRARY = System.Numerics.dll LIB_REFS = System -LIB_MCS_FLAGS = /unsafe -nowarn:414 -nowarn:436 +LIB_MCS_FLAGS = /unsafe TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) -TXT_RESOURCE_STRINGS = ../referencesource/System.Numerics/System.Numerics.txt +RESX_RESOURCE_STRING = \ + ../../../external/corefx/src/System.Runtime.Numerics/src/Resources/Strings.resx \ + ../../../external/corefx/src/System.Numerics.Vectors/src/Resources/Strings.resx EXTRA_DISTFILES = diff --git a/mcs/class/System.Numerics/ReferenceSources/SR.cs b/mcs/class/System.Numerics/ReferenceSources/SR.cs deleted file mode 100644 index 3b4d7bd23e7..00000000000 --- a/mcs/class/System.Numerics/ReferenceSources/SR.cs +++ /dev/null @@ -1,21 +0,0 @@ -// -// This file was generated by txt2sr tool -// - -partial class SR -{ - public const string Argument_InvalidNumberStyles = "An undefined NumberStyles value is being used."; - public const string Argument_InvalidHexStyle = "With the AllowHexSpecifier bit set in the enum bit field, the only other valid bits that can be combined into the enum value must be a subset of those in HexNumber."; - public const string Argument_MustBeBigInt = "The parameter must be a BigInteger."; - public const string Format_InvalidFormatSpecifier = "Format specifier was invalid."; - public const string Format_TooLarge = "The value is too large to be represented by this format specifier."; - public const string ArgumentOutOfRange_MustBeNonNeg = "The number must be greater than or equal to zero."; - public const string Overflow_BigIntInfinity = "BigInteger cannot represent infinity."; - public const string Overflow_NotANumber = "The value is not a number."; - public const string Overflow_ParseBigInteger = "The value could not be parsed."; - public const string Overflow_Int32 = "Value was either too large or too small for an Int32."; - public const string Overflow_Int64 = "Value was either too large or too small for an Int64."; - public const string Overflow_UInt32 = "Value was either too large or too small for a UInt32."; - public const string Overflow_UInt64 = "Value was either too large or too small for a UInt64."; - public const string Overflow_Decimal = "Value was either too large or too small for a Decimal."; -} diff --git a/mcs/class/System.Numerics/System.Numerics.dll.sources b/mcs/class/System.Numerics/System.Numerics.dll.sources index 9d03ee13917..1e56c801e93 100644 --- a/mcs/class/System.Numerics/System.Numerics.dll.sources +++ b/mcs/class/System.Numerics/System.Numerics.dll.sources @@ -1,21 +1,34 @@ +../../build/common/Consts.cs ../../build/common/SR.cs Assembly/AssemblyInfo.cs -ReferenceSources/SR.cs -../referencesource/System.Numerics/System/Numerics/BigInteger.cs -../referencesource/System.Numerics/System/Numerics/BigIntegerBuilder.cs -../referencesource/System.Numerics/System/Numerics/BigNumber.cs -../referencesource/System.Numerics/System/Numerics/Complex.cs -../referencesource/System.Numerics/System/Numerics/NumericsHelpers.cs -../referencesource/System.Numerics/System/Numerics/HashCodeHelper.cs -../referencesource/System.Numerics/System/Numerics/JITIntrinsicAttribute.cs -../referencesource/System.Numerics/System/Numerics/Matrix3x2.cs -../referencesource/System.Numerics/System/Numerics/Matrix4x4.cs -../referencesource/System.Numerics/System/Numerics/Plane.cs -../referencesource/System.Numerics/System/Numerics/Quaternion.cs -../referencesource/System.Numerics/System/Numerics/Vector2.cs -../referencesource/System.Numerics/System/Numerics/Vector2_Intrinsics.cs -../referencesource/System.Numerics/System/Numerics/Vector3.cs -../referencesource/System.Numerics/System/Numerics/Vector3_Intrinsics.cs -../referencesource/System.Numerics/System/Numerics/Vector4.cs -../referencesource/System.Numerics/System/Numerics/Vector4_Intrinsics.cs -../referencesource/System.Numerics/System/Numerics/Vector_Operations.cs +corefx/SR.cs +corefx/Vector.cs + +../../../external/corefx/src/Common/src/System/Globalization/FormatProvider.Number.cs +../../../external/corefx/src/Common/src/System/Numerics/Hashing/HashHelpers.cs + +../../../external/corefx/src/System.Runtime.Numerics/src/System/Globalization/FormatProvider.BigInteger.cs +../../../external/corefx/src/System.Runtime.Numerics/src/System/Globalization/FormatProvider.NumberBuffer.cs +../../../external/corefx/src/System.Runtime.Numerics/src/System/Numerics/BigInteger.cs +../../../external/corefx/src/System.Runtime.Numerics/src/System/Numerics/BigIntegerCalculator.AddSub.cs +../../../external/corefx/src/System.Runtime.Numerics/src/System/Numerics/BigIntegerCalculator.BitsBuffer.cs +../../../external/corefx/src/System.Runtime.Numerics/src/System/Numerics/BigIntegerCalculator.DivRem.cs +../../../external/corefx/src/System.Runtime.Numerics/src/System/Numerics/BigIntegerCalculator.FastReducer.cs +../../../external/corefx/src/System.Runtime.Numerics/src/System/Numerics/BigIntegerCalculator.GcdInv.cs +../../../external/corefx/src/System.Runtime.Numerics/src/System/Numerics/BigIntegerCalculator.PowMod.cs +../../../external/corefx/src/System.Runtime.Numerics/src/System/Numerics/BigIntegerCalculator.SquMul.cs +../../../external/corefx/src/System.Runtime.Numerics/src/System/Numerics/BigNumber.cs +../../../external/corefx/src/System.Runtime.Numerics/src/System/Numerics/Complex.cs +../../../external/corefx/src/System.Runtime.Numerics/src/System/Numerics/NumericsHelpers.cs + +../../../external/corefx/src/System.Numerics.Vectors/src/System/Numerics/JitIntrinsicAttribute.cs +../../../external/corefx/src/System.Numerics.Vectors/src/System/Numerics/Matrix3x2.cs +../../../external/corefx/src/System.Numerics.Vectors/src/System/Numerics/Matrix4x4.cs +../../../external/corefx/src/System.Numerics.Vectors/src/System/Numerics/Plane.cs +../../../external/corefx/src/System.Numerics.Vectors/src/System/Numerics/Quaternion.cs +../../../external/corefx/src/System.Numerics.Vectors/src/System/Numerics/Vector2.cs +../../../external/corefx/src/System.Numerics.Vectors/src/System/Numerics/Vector2_Intrinsics.cs +../../../external/corefx/src/System.Numerics.Vectors/src/System/Numerics/Vector3.cs +../../../external/corefx/src/System.Numerics.Vectors/src/System/Numerics/Vector3_Intrinsics.cs +../../../external/corefx/src/System.Numerics.Vectors/src/System/Numerics/Vector4.cs +../../../external/corefx/src/System.Numerics.Vectors/src/System/Numerics/Vector4_Intrinsics.cs diff --git a/mcs/class/System.Numerics/corefx/SR.cs b/mcs/class/System.Numerics/corefx/SR.cs new file mode 100644 index 00000000000..e4590b7131d --- /dev/null +++ b/mcs/class/System.Numerics/corefx/SR.cs @@ -0,0 +1,25 @@ +// +// This file was generated by resx2sr tool +// + +partial class SR +{ + public const string Argument_BadFormatSpecifier = "Format specifier was invalid."; + public const string Argument_InvalidNumberStyles = "An undefined NumberStyles value is being used."; + public const string Argument_InvalidHexStyle = "With the AllowHexSpecifier bit set in the enum bit field, the only other valid bits that can be combined into the enum value must be a subset of those in HexNumber."; + public const string Argument_MustBeBigInt = "The parameter must be a BigInteger."; + public const string Format_TooLarge = "The value is too large to be represented by this format specifier."; + public const string ArgumentOutOfRange_MustBeNonNeg = "The number must be greater than or equal to zero."; + public const string Overflow_BigIntInfinity = "BigInteger cannot represent infinity."; + public const string Overflow_NotANumber = "The value is not a number."; + public const string Overflow_ParseBigInteger = "The value could not be parsed."; + public const string Overflow_Int32 = "Value was either too large or too small for an Int32."; + public const string Overflow_Int64 = "Value was either too large or too small for an Int64."; + public const string Overflow_UInt32 = "Value was either too large or too small for a UInt32."; + public const string Overflow_UInt64 = "Value was either too large or too small for a UInt64."; + public const string Overflow_Decimal = "Value was either too large or too small for a Decimal."; + public const string Arg_ArgumentOutOfRangeException = "Index was out of bounds:"; + public const string Arg_ElementsInSourceIsGreaterThanDestination = "Number of elements in source vector is greater than the destination array"; + public const string Arg_NullArgumentNullRef = "The method was called with a null array argument."; + public const string Arg_TypeNotSupported = "Specified type is not supported"; +} diff --git a/mcs/class/System.Numerics/corefx/Vector.cs b/mcs/class/System.Numerics/corefx/Vector.cs new file mode 100644 index 00000000000..de085baeb13 --- /dev/null +++ b/mcs/class/System.Numerics/corefx/Vector.cs @@ -0,0 +1,12 @@ +namespace System.Numerics +{ + static class Vector + { + [JitIntrinsic] + public static bool IsHardwareAccelerated { + get { + return false; + } + } + } +} \ No newline at end of file diff --git a/mcs/class/corlib/Assembly/AssemblyInfo.cs b/mcs/class/corlib/Assembly/AssemblyInfo.cs index 59ef32f147f..6e1e9ef1264 100644 --- a/mcs/class/corlib/Assembly/AssemblyInfo.cs +++ b/mcs/class/corlib/Assembly/AssemblyInfo.cs @@ -76,8 +76,6 @@ using System.Runtime.InteropServices; [assembly: InternalsVisibleTo ("System, PublicKey=" + AssemblyRef.FrameworkPublicKeyFull2)] [assembly: InternalsVisibleTo ("System.Core, PublicKey=" + AssemblyRef.FrameworkPublicKeyFull2)] -[assembly: InternalsVisibleTo ("System.Numerics, PublicKey=00000000000000000400000000000000")] - [assembly: InternalsVisibleTo ("System.Runtime.WindowsRuntime, PublicKey=00000000000000000400000000000000")] [assembly: InternalsVisibleTo ("System.Runtime.WindowsRuntime.UI.Xaml, PublicKey=00000000000000000400000000000000")] -- cgit v1.2.3