Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 4 commits into from
Nov 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions clang/docs/LanguageExtensions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will not be true for a signaling nan for a 2 element vector with IEEE behavior for minnum/maxnum

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But really it was a mistake to make this support floating point

ET __builtin_reduce_add(VT a) \+ integer types
ET __builtin_reduce_mul(VT a) \* integer types
ET __builtin_reduce_and(VT a) & integer types
Expand Down
Loading