Adding Int128 and UInt128 with a base software implementation (#69204)
authorTanner Gooding <tagoo@outlook.com>
Thu, 19 May 2022 04:41:17 +0000 (21:41 -0700)
committerGitHub <noreply@github.com>
Thu, 19 May 2022 04:41:17 +0000 (21:41 -0700)
commit7f9ed8f271df8fb83862b3812d9c490e4ff74711
tree026f445cd096316bb34188757c5a6f918899bd8e
parentd8fe9cde5c746843478a6f55ae5582e0738b10a8
Adding Int128 and UInt128 with a base software implementation (#69204)

* Adding barebones Int128 and UInt128 structs

* Special case Int128 and UInt128 alignment on x64 Unix and Arm64

* Implementing Int128 and UInt128

* Adding tests for Int128 and UInt128

* Updating Int128/UInt128 to respect the System V ABI ordering

* Fixing an issue with UInt128->BigInteger setting the wrong sign

* Don't use Unsafe.As in the Int128/UInt128 hex parsing logic

* Adding Int128 P/Invoke tests and ensure R2R correctly sets the packing

* Fixing some issues with the Int128 interop test for non-Windows

* Ensure that floating-point conversions exist for Int128 and UInt128

* Fixing the casing of a couple fields

* Revert "Don't use Unsafe.As in the Int128/UInt128 hex parsing logic"

This reverts commit 09e8bfc52d5b1b7f7b341f318bf1046b19768dd3.

* Adjusting the Int128/UInt128 generic math tests to have consistent ordering

* Responding to PR feedback

* Ensure that pNativeLayoutInfo alignment is initialized for Int128/UInt128

* Don't use Unsafe.As in the Int128/UInt128 hex parsing logic

* Skip the Interop/PInvoke/Int128 tests on Mono
54 files changed:
THIRD-PARTY-NOTICES.TXT
src/coreclr/tools/Common/Compiler/Int128FieldLayoutAlgorithm.cs [new file with mode: 0644]
src/coreclr/tools/Common/JitInterface/SystemVStructClassificator.cs
src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/CompilerTypeSystemContext.Aot.cs
src/coreclr/tools/aot/ILCompiler.Compiler/ILCompiler.Compiler.csproj
src/coreclr/tools/aot/ILCompiler.ReadyToRun/Compiler/ReadyToRunCompilerContext.cs
src/coreclr/tools/aot/ILCompiler.ReadyToRun/ILCompiler.ReadyToRun.csproj
src/coreclr/vm/classlayoutinfo.cpp
src/coreclr/vm/classnames.h
src/coreclr/vm/corelib.h
src/coreclr/vm/methodtablebuilder.cpp
src/libraries/System.Private.CoreLib/src/Resources/Strings.resx
src/libraries/System.Private.CoreLib/src/System.Private.CoreLib.Shared.projitems
src/libraries/System.Private.CoreLib/src/System/Buffers/Text/FormattingHelpers.CountDigits.cs
src/libraries/System.Private.CoreLib/src/System/Decimal.DecCalc.cs
src/libraries/System.Private.CoreLib/src/System/Decimal.cs
src/libraries/System.Private.CoreLib/src/System/Double.cs
src/libraries/System.Private.CoreLib/src/System/Half.cs
src/libraries/System.Private.CoreLib/src/System/IComparable.cs
src/libraries/System.Private.CoreLib/src/System/IEquatable.cs
src/libraries/System.Private.CoreLib/src/System/Int128.cs [new file with mode: 0644]
src/libraries/System.Private.CoreLib/src/System/Math.cs
src/libraries/System.Private.CoreLib/src/System/Number.Formatting.cs
src/libraries/System.Private.CoreLib/src/System/Number.NumberBuffer.cs
src/libraries/System.Private.CoreLib/src/System/Number.Parsing.cs
src/libraries/System.Private.CoreLib/src/System/Numerics/BitOperations.cs
src/libraries/System.Private.CoreLib/src/System/Object.cs
src/libraries/System.Private.CoreLib/src/System/Single.cs
src/libraries/System.Private.CoreLib/src/System/ThrowHelper.cs
src/libraries/System.Private.CoreLib/src/System/UInt128.cs [new file with mode: 0644]
src/libraries/System.Runtime.Numerics/ref/System.Runtime.Numerics.cs
src/libraries/System.Runtime.Numerics/src/Resources/Strings.resx
src/libraries/System.Runtime.Numerics/src/System/Numerics/BigInteger.cs
src/libraries/System.Runtime.Numerics/src/System/Numerics/BigNumber.cs
src/libraries/System.Runtime.Numerics/src/System/Numerics/NumericsHelpers.cs
src/libraries/System.Runtime/ref/System.Runtime.cs
src/libraries/System.Runtime/tests/System.Runtime.Tests.csproj
src/libraries/System.Runtime/tests/System/DecimalTests.GenericMath.cs
src/libraries/System.Runtime/tests/System/DoubleTests.GenericMath.cs
src/libraries/System.Runtime/tests/System/HalfTests.GenericMath.cs
src/libraries/System.Runtime/tests/System/Int128Tests.GenericMath.cs [new file with mode: 0644]
src/libraries/System.Runtime/tests/System/Int128Tests.cs [new file with mode: 0644]
src/libraries/System.Runtime/tests/System/SingleTests.GenericMath.cs
src/libraries/System.Runtime/tests/System/UInt128Tests.GenericMath.cs [new file with mode: 0644]
src/libraries/System.Runtime/tests/System/UInt128Tests.cs [new file with mode: 0644]
src/tests/Interop/CMakeLists.txt
src/tests/Interop/PInvoke/Int128/CMakeLists.txt [new file with mode: 0644]
src/tests/Interop/PInvoke/Int128/Int128Native.cpp [new file with mode: 0644]
src/tests/Interop/PInvoke/Int128/Int128Test.cs [new file with mode: 0644]
src/tests/Interop/PInvoke/Int128/Int128Test.csproj [new file with mode: 0644]
src/tests/Interop/PInvoke/Int128/Program.cs [new file with mode: 0644]
src/tests/Interop/PInvoke/Int128/UInt128Native.cpp [new file with mode: 0644]
src/tests/Interop/PInvoke/Int128/UInt128Test.cs [new file with mode: 0644]
src/tests/issues.targets