[PATCH] D147866: ValueTracking: Implement computeKnownFPClass for minnum/maxnum

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Apr 16 08:25:58 PDT 2023

arsenm added a comment.

In D147866#4272135 <https://reviews.llvm.org/D147866#4272135>, @arsenm wrote:

> In D147866#4269440 <https://reviews.llvm.org/D147866#4269440>, @jcranmer-intel wrote:
>> In D147866#4269363 <https://reviews.llvm.org/D147866#4269363>, @arsenm wrote:
>>> In D147866#4269348 <https://reviews.llvm.org/D147866#4269348>, @jcranmer-intel wrote:
>>>> `minnum(0.0, 0.0)` can return `-0.0`, so the handling around positive/negative zero isn't correct.
> The sign is of zero is not indeterminate. minnum(0.0, 0.0) cannot choose to introduce a signed zero. The ordering of a positive zero and negative zero is undetermined.

Section 11 states "Do not depend on the sign of a zero result or the quantum of a decimal result for minNum(x, y), maxNum(x, y), minNumMag(x, y), or maxNumMag(x, y) when x and y are equal.". But the definition for minNum and maxNum state it returns x or y. Returning -0 would be returning a value that is neither x nor y, so I maintain the handling here is correct as-is



More information about the llvm-commits mailing list