[PATCH] D71467: [FPEnv] Generate constrained FP comparisons from clang

Ulrich Weigand via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Dec 16 09:48:28 PST 2019


uweigand added a comment.

In D71467#1785943 <https://reviews.llvm.org/D71467#1785943>, @erichkeane wrote:

> I did the compare operators that didn't work right, and will do a separate patch for the fp-classification type ones: f02d6dd6c7afc08f871a623c0411f2d77ed6acf8 <https://reviews.llvm.org/rGf02d6dd6c7afc08f871a623c0411f2d77ed6acf8>


Thanks!  Now I'm getting the correct output for the float test cases as well, and I've added them to the patch.

As to fp-classification, I think there is an additional complication here:  according to IEEE and the proposed C2x standard, these builtins should **never** raise any exception, not even when receiving a signaling NaN as input.  Strictly speaking, this means that they cannot possibly be implemented in terms of any comparison operation.

Now, on SystemZ (and many other platforms, I think) there are in fact specialized instructions that will implement the required semantics without raising any exceptions, but there seems to be no way to represent those at the LLVM IR level.  We'll probably need some extensions here (some new IR-level builtins?) ...

(But I'd say that problem is unrelated to this patch, so I'd prefer to decouple that problem from the question of whether **this** patch is the right solution for comparisons.)


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D71467/new/

https://reviews.llvm.org/D71467





More information about the cfe-commits mailing list