Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Vector128.LessThan broken for some UIntPtr values on mono #96443

@stephentoub

Description

@stephentoub

Repro:

        [Theory]
        [InlineData(0ul)]
        [InlineData(1ul)]
        [InlineData(127ul)]
        [InlineData(128ul)]
        [InlineData(129ul)]
        [InlineData((ulong)int.MaxValue)]
        [InlineData(ulong.MaxValue)]
        public void Repro2(ulong ulValue)
        {
            Vector128<UIntPtr> vector = Vector128.Create((UIntPtr)ulValue);
            Assert.True(Vector128.EqualsAll(Vector128.LessThan(vector, Vector128<UIntPtr>.Zero), Vector128<UIntPtr>.Zero));
        }

That test passes for all of the supplied values (I haven't tried others) except for ulong.MaxValue, which fails:

    System.Runtime.Intrinsics.Tests.Vectors.Vector128Tests.Repro2(ulValue: 18446744073709551615) [FAIL]
      Assert.True() Failure
      Expected: True
      Actual:   False
      Stack Trace:
        /_/src/libraries/System.Runtime.Intrinsics/tests/Vectors/Vector128Tests.cs(44,0): at System.Runtime.Intrinsics.Tests.Vectors.Vector128Tests.Repro2(UInt64 ulValue)
           at System.Object.InvokeStub_Vector128Tests.Repro2(Object , Span`1 )
        /_/src/libraries/System.Private.CoreLib/src/System/Reflection/MethodBaseInvoker.cs(95,0): at System.Reflection.MethodBaseInvoker.InvokeWithOneArg(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)

I haven't tried other values.

https://dev.azure.com/dnceng-public/public/_build/results?buildId=512965&view=ms.vss-test-web.build-test-results-tab&runId=12013976&resultId=129149&paneView=dotnet-dnceng.dnceng-build-release-tasks.helix-test-information-tab

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions