[clang] [clang][docs] Revise documentation for `__builtin_reduce_(max|min)`. (PR #114637)
Simon Pilgrim via cfe-commits
cfe-commits at lists.llvm.org
Sun Nov 3 04:12:59 PST 2024
================
@@ -745,12 +745,8 @@ Let ``VT`` be a vector type and ``ET`` the element type of ``VT``.
======================================= ====================================================================== ==================================
Name Operation Supported element types
======================================= ====================================================================== ==================================
- ET __builtin_reduce_max(VT a) return x or y, whichever is larger; If exactly one argument is integer and floating point types
- a NaN, return the other argument. If both arguments are NaNs,
- fmax() return a NaN.
- ET __builtin_reduce_min(VT a) return x or y, whichever is smaller; If exactly one argument integer and floating point types
- is a NaN, return the other argument. If both arguments are
- NaNs, fmax() return a NaN.
+ ET __builtin_reduce_max(VT a) return the largest element of the vector. integer and floating point types
+ ET __builtin_reduce_min(VT a) return the smallest element of the vector. integer and floating point types
----------------
RKSimon wrote:
Please can you add back the NaN semantics - AFAICT they should always return the largest/smallest non-NAN value if any vector element is non-NAN, otherwise it could return any of the NAN values in the (all NAN) vector. There might be a better way of phrasing that......
https://github.com/llvm/llvm-project/pull/114637
More information about the cfe-commits
mailing list