-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix Half comparison #39773
Fix Half comparison #39773
Conversation
* Fixes the comparison to be correct when both numbers are negative * Add relevant tests
@@ -116,7 +116,7 @@ private ushort Significand | |||
// says they should be equal, even if the signs differ. | |||
return leftIsNegative && !AreZero(left, right); | |||
} | |||
return (short)(left._value) < (short)(right._value); | |||
return left._value < right._value ^ leftIsNegative; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just for reference, here is the lt implementation: https://github.com/ucb-bar/berkeley-softfloat-3/blob/master/source/f16_lt_quiet.c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like it's pretty much the same.
@tarekgh, @GrabYourPitchforks; seems to be a number of ICU failures that are likely unrelated. |
@safern CI started to get the following failures, any idea what has changed? Is this the issue that the PR #39833 is fixing? Executed on dci-mac-build-043.local
+ ./RunTests.sh --runtime-path /tmp/helix/working/B6540A0D/p
----- start Thu Jul 23 02:11:51 PDT 2020 =============== To repro directly: =====================================================
pushd .
/tmp/helix/working/B6540A0D/p/dotnet exec --runtimeconfig Common.Tests.runtimeconfig.json --depsfile Common.Tests.deps.json xunit.console.dll Common.Tests.dll -xml testResults.xml -nologo -nocolor -notrait category=IgnoreForCI -notrait category=OuterLoop -notrait category=failing
popd
===========================================================================================================
/private/tmp/helix/working/B6540A0D/w/AC97099A/e /private/tmp/helix/working/B6540A0D/w/AC97099A/e
Process terminated. Couldn't find a valid ICU package installed on the system. Set the configuration flag System.Globalization.Invariant to true if you want to run with no globalization support.
at System.Environment.FailFast(System.String)
at System.Globalization.GlobalizationMode.GetGlobalizationInvariantMode()
at System.Globalization.GlobalizationMode..cctor()
at System.Globalization.GlobalizationMode.get_Invariant()
at System.Globalization.CultureData.CreateCultureWithInvariantData()
at System.Globalization.CultureData.get_Invariant()
at System.Globalization.CultureInfo..cctor()
at System.Globalization.CultureInfo.get_CachedCulturesByName()
at System.Globalization.CultureInfo.GetCultureInfo(System.String)
at System.Reflection.RuntimeAssembly.GetLocale()
at System.Reflection.RuntimeAssembly.GetName(Boolean)
at System.Reflection.Assembly.GetName()
at Internal.Microsoft.Extensions.DependencyModel.DependencyContextLoader.LoadAssemblyContext(System.Reflection.Assembly, Internal.Microsoft.Extensions.DependencyModel.IDependencyContextReader)
at Internal.Microsoft.Extensions.DependencyModel.DependencyContextLoader.Load(System.Reflection.Assembly)
at Internal.Microsoft.Extensions.DependencyModel.DependencyContext.Load(System.Reflection.Assembly)
at Xunit.AssemblyHelper..ctor(System.String, Xunit.Abstractions.IMessageSink)
at Xunit.AssemblyHelper.SubscribeResolveForAssembly(System.Type, Xunit.Abstractions.IMessageSink)
at Xunit.ConsoleClient.Program.Main(System.String[]) |
CC @akoeplinger for the ICU failures on OSX if this is related to #39833 |
@tarekgh I just validated and the build didn't not have @akoeplinger changes. I will trigger a build again. |
/azp run runtime |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run dotnet-linker-tests |
Azure Pipelines successfully started running 1 pipeline(s). |
* Fix Half comparison * Fixes the comparison to be correct when both numbers are negative * Add relevant tests * Add parentheses for clarity * Add tests validating comparison between negative numbers for Single/Double as well
* Fix Half comparison * Fixes the comparison to be correct when both numbers are negative * Add relevant tests * Add parentheses for clarity * Add tests validating comparison between negative numbers for Single/Double as well Co-authored-by: Ganbarukamo41 <[email protected]>
* Fix Half comparison * Fixes the comparison to be correct when both numbers are negative * Add relevant tests * Add parentheses for clarity * Add tests validating comparison between negative numbers for Single/Double as well
Fixes #39770
cc @tannergooding