[llvm-dev] RFC: What is the real behavior for the minnum/maxnum intrinsics?

Stephen Canon via llvm-dev llvm-dev at lists.llvm.org
Fri Jul 27 04:50:24 PDT 2018


> On Jul 27, 2018, at 4:20 AM, Matt Arsenault <arsenm2 at gmail.com> wrote:
> 
> This is the only part that I immediately care about. When the new standard is finalized, we can re-visit the other details such as the signed 0 question. Are there any targets that don’t already treat -0.0 as < 0.0?

[V]MINxx and [V]MAXxx on x86 return the second argument if the arguments compare equal (but they also don’t handle NaNs “correctly” — they’re really intended to pattern match (a < b ? a : b) instead of the fmin / fmax libm functions.

The newer AVX-512 VRANGExx functions get the sign of zero right.

– Steve

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20180727/f2fd9dca/attachment.html>


More information about the llvm-dev mailing list