[clang] 6e614e1 - [clang][docs] Revise documentation for `__builtin_reduce_(max|min)`. (#114637)

via cfe-commits cfe-commits at lists.llvm.org
Wed Nov 13 17:28:53 PST 2024


Author: c8ef
Date: 2024-11-14T09:28:51+08:00
New Revision: 6e614e11df6a152082b51a1b18332cb8730a4032

URL: https://github.com/llvm/llvm-project/commit/6e614e11df6a152082b51a1b18332cb8730a4032
DIFF: https://github.com/llvm/llvm-project/commit/6e614e11df6a152082b51a1b18332cb8730a4032.diff

LOG: [clang][docs] Revise documentation for `__builtin_reduce_(max|min)`. (#114637)

The function operation described in the document did not match its
actual semantic meaning, this patch resolved the problem.

Added: 
    

Modified: 
    clang/docs/LanguageExtensions.rst

Removed: 
    


################################################################################
diff  --git a/clang/docs/LanguageExtensions.rst b/clang/docs/LanguageExtensions.rst
index 0998e6b30e229e..ff8e841ee53a2b 100644
--- a/clang/docs/LanguageExtensions.rst
+++ b/clang/docs/LanguageExtensions.rst
@@ -745,12 +745,10 @@ 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. The floating point result    integer and floating point types
+                                         will always be a number unless all elements of the vector are NaN.
+ ET __builtin_reduce_min(VT a)           return the smallest element of the vector. The floating point result   integer and floating point types
+                                         will always be a number unless all elements of the vector are NaN.
  ET __builtin_reduce_add(VT a)           \+                                                                     integer types
  ET __builtin_reduce_mul(VT a)           \*                                                                     integer types
  ET __builtin_reduce_and(VT a)           &                                                                      integer types


        


More information about the cfe-commits mailing list