diff --git a/src/coreclr/vm/interpexec.cpp b/src/coreclr/vm/interpexec.cpp index 92bc3638ccb124..0dd6c9848569c1 100644 --- a/src/coreclr/vm/interpexec.cpp +++ b/src/coreclr/vm/interpexec.cpp @@ -1613,11 +1613,11 @@ void InterpExecMethod(InterpreterFrame *pInterpreterFrame, InterpMethodContextFr ip += 3; break; case INTOP_CONV_U1_R4: - ConvFpHelper(stack, ip); + ConvFpHelper(stack, ip); ip += 3; break; case INTOP_CONV_U1_R8: - ConvFpHelper(stack, ip); + ConvFpHelper(stack, ip); ip += 3; break; case INTOP_CONV_I2_I4: @@ -1645,11 +1645,11 @@ void InterpExecMethod(InterpreterFrame *pInterpreterFrame, InterpMethodContextFr ip += 3; break; case INTOP_CONV_U2_R4: - ConvFpHelper(stack, ip); + ConvFpHelper(stack, ip); ip += 3; break; case INTOP_CONV_U2_R8: - ConvFpHelper(stack, ip); + ConvFpHelper(stack, ip); ip += 3; break; case INTOP_CONV_I4_R4: diff --git a/src/libraries/System.Runtime/tests/System.Runtime.Tests/System/DoubleTests.GenericMath.cs b/src/libraries/System.Runtime/tests/System.Runtime.Tests/System/DoubleTests.GenericMath.cs index 153d4fdf22a729..8a1b2747889b0f 100644 --- a/src/libraries/System.Runtime/tests/System.Runtime.Tests/System/DoubleTests.GenericMath.cs +++ b/src/libraries/System.Runtime/tests/System.Runtime.Tests/System/DoubleTests.GenericMath.cs @@ -346,17 +346,18 @@ public static void op_InequalityTest() [Fact] [SkipOnMono("https://github.com/dotnet/runtime/issues/100368")] - [ActiveIssue("https://github.com/dotnet/runtime/issues/116823", typeof(PlatformDetection), nameof(PlatformDetection.IsCoreClrInterpreter))] + // Passes on the interpreter, but interpreter configurations might still use jit fallback + [ActiveIssue("https://github.com/dotnet/runtime/issues/116823", typeof(PlatformDetection), nameof(PlatformDetection.IsNotMonoRuntime))] public static void ConvertToIntegerTest() { // Signed Values - Assert.Equal(0, FloatingPointHelper.ConvertToInteger(double.MinValue)); + Assert.Equal(short.MinValue, FloatingPointHelper.ConvertToInteger(double.MinValue)); Assert.Equal(int.MinValue, FloatingPointHelper.ConvertToInteger(double.MinValue)); Assert.Equal(long.MinValue, FloatingPointHelper.ConvertToInteger(double.MinValue)); Assert.Equal(Int128.MinValue, FloatingPointHelper.ConvertToInteger(double.MinValue)); Assert.Equal(nint.MinValue, FloatingPointHelper.ConvertToInteger(double.MinValue)); - Assert.Equal(0, FloatingPointHelper.ConvertToInteger(double.MinValue)); + Assert.Equal(sbyte.MinValue, FloatingPointHelper.ConvertToInteger(double.MinValue)); Assert.Equal(2, FloatingPointHelper.ConvertToInteger(2.6)); Assert.Equal(2, FloatingPointHelper.ConvertToInteger(2.6)); @@ -365,12 +366,12 @@ public static void ConvertToIntegerTest() Assert.Equal(2, FloatingPointHelper.ConvertToInteger(2.6)); Assert.Equal(2, FloatingPointHelper.ConvertToInteger(2.6)); - Assert.Equal(-1, FloatingPointHelper.ConvertToInteger(double.MaxValue)); + Assert.Equal(short.MaxValue, FloatingPointHelper.ConvertToInteger(double.MaxValue)); Assert.Equal(int.MaxValue, FloatingPointHelper.ConvertToInteger(double.MaxValue)); Assert.Equal(long.MaxValue, FloatingPointHelper.ConvertToInteger(double.MaxValue)); Assert.Equal(Int128.MaxValue, FloatingPointHelper.ConvertToInteger(double.MaxValue)); Assert.Equal(nint.MaxValue, FloatingPointHelper.ConvertToInteger(double.MaxValue)); - Assert.Equal(-1, FloatingPointHelper.ConvertToInteger(double.MaxValue)); + Assert.Equal(sbyte.MaxValue, FloatingPointHelper.ConvertToInteger(double.MaxValue)); // Unsigned Values diff --git a/src/libraries/System.Runtime/tests/System.Runtime.Tests/System/SingleTests.GenericMath.cs b/src/libraries/System.Runtime/tests/System.Runtime.Tests/System/SingleTests.GenericMath.cs index 407cb6c41164ad..ad19ea63e61b5d 100644 --- a/src/libraries/System.Runtime/tests/System.Runtime.Tests/System/SingleTests.GenericMath.cs +++ b/src/libraries/System.Runtime/tests/System.Runtime.Tests/System/SingleTests.GenericMath.cs @@ -346,17 +346,18 @@ public static void op_InequalityTest() [Fact] [SkipOnMono("https://github.com/dotnet/runtime/issues/100368")] - [ActiveIssue("https://github.com/dotnet/runtime/issues/116823", typeof(PlatformDetection), nameof(PlatformDetection.IsCoreClrInterpreter))] + // Passes on the interpreter, but interpreter configurations might still use jit fallback + [ActiveIssue("https://github.com/dotnet/runtime/issues/116823", typeof(PlatformDetection), nameof(PlatformDetection.IsNotMonoRuntime))] public static void ConvertToIntegerTest() { // Signed Values - Assert.Equal(0, FloatingPointHelper.ConvertToInteger(float.MinValue)); + Assert.Equal(short.MinValue, FloatingPointHelper.ConvertToInteger(float.MinValue)); Assert.Equal(int.MinValue, FloatingPointHelper.ConvertToInteger(float.MinValue)); Assert.Equal(long.MinValue, FloatingPointHelper.ConvertToInteger(float.MinValue)); Assert.Equal(Int128.MinValue, FloatingPointHelper.ConvertToInteger(float.MinValue)); Assert.Equal(nint.MinValue, FloatingPointHelper.ConvertToInteger(float.MinValue)); - Assert.Equal(0, FloatingPointHelper.ConvertToInteger(float.MinValue)); + Assert.Equal(sbyte.MinValue, FloatingPointHelper.ConvertToInteger(float.MinValue)); Assert.Equal(2, FloatingPointHelper.ConvertToInteger(2.6f)); Assert.Equal(2, FloatingPointHelper.ConvertToInteger(2.6f)); @@ -365,12 +366,12 @@ public static void ConvertToIntegerTest() Assert.Equal(2, FloatingPointHelper.ConvertToInteger(2.6f)); Assert.Equal(2, FloatingPointHelper.ConvertToInteger(2.6f)); - Assert.Equal(-1, FloatingPointHelper.ConvertToInteger(float.MaxValue)); + Assert.Equal(short.MaxValue, FloatingPointHelper.ConvertToInteger(float.MaxValue)); Assert.Equal(int.MaxValue, FloatingPointHelper.ConvertToInteger(float.MaxValue)); Assert.Equal(long.MaxValue, FloatingPointHelper.ConvertToInteger(float.MaxValue)); Assert.Equal(Int128.MaxValue, FloatingPointHelper.ConvertToInteger(float.MaxValue)); Assert.Equal(nint.MaxValue, FloatingPointHelper.ConvertToInteger(float.MaxValue)); - Assert.Equal(-1, FloatingPointHelper.ConvertToInteger(float.MaxValue)); + Assert.Equal(sbyte.MaxValue, FloatingPointHelper.ConvertToInteger(float.MaxValue)); // Unsigned Values