[PATCH] D111529: Specify Clang vector builtins.

2021-10-26 Thread Florian Hahn via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG025988ded6b2: Specify Clang vector builtins. (authored by fhahn). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D111529/new/ https://reviews.llvm.org/D111529

[PATCH] D111529: Specify Clang vector builtins.

2021-10-19 Thread Florian Hahn via Phabricator via cfe-commits
fhahn updated this revision to Diff 380755. fhahn added a comment. As @scanon pointed out in D111986 , most simd implementations should handle abs(INT_MIN) consistently by returngin INT_MIN. It's therefore better to avoid defining abs(INT_MIN) as UB, which would

[PATCH] D111529: Specify Clang vector builtins.

2021-10-19 Thread Florian Hahn via Phabricator via cfe-commits
fhahn updated this revision to Diff 380612. fhahn marked an inline comment as done. fhahn added a comment. Following feedback from D111986 , explicitly spell out abs behavior of most negative integer as undefined. Repository: rG LLVM Github Monorepo CHANGES

[PATCH] D111529: Specify Clang vector builtins.

2021-10-19 Thread Florian Hahn via Phabricator via cfe-commits
fhahn marked an inline comment as done. fhahn added inline comments. Comment at: clang/docs/LanguageExtensions.rst:579 + NaNs, fmax() return a NaN. + ET __builtin_reduce_add(VT a) \+

[PATCH] D111529: Specify Clang vector builtins.

2021-10-19 Thread Florian Hahn via Phabricator via cfe-commits
fhahn updated this revision to Diff 380598. fhahn marked an inline comment as done. fhahn added a comment. Thanks @kito-cheng, the example should use `__builtin_reduce_add` instead of `_fadd`! Fixed Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D111

[PATCH] D111529: Specify Clang vector builtins.

2021-10-18 Thread Kito Cheng via Phabricator via cfe-commits
kito-cheng added inline comments. Comment at: clang/docs/LanguageExtensions.rst:579 + NaNs, fmax() return a NaN. + ET __builtin_reduce_add(VT a) \+ integer and floatin

[PATCH] D111529: Specify Clang vector builtins.

2021-10-18 Thread Florian Hahn via Phabricator via cfe-commits
fhahn marked an inline comment as done. fhahn added inline comments. Comment at: clang/docs/LanguageExtensions.rst:557 +``i in [0, Number of elements / 2)``. If the numbers of elements is not a +power of 2, the vector is widening with neutral elements for the reduction +at the en

[PATCH] D111529: Specify Clang vector builtins.

2021-10-18 Thread Florian Hahn via Phabricator via cfe-commits
fhahn updated this revision to Diff 380500. fhahn marked an inline comment as done. fhahn added a comment. Fix wording: widening -> widened, thanks! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D111529/new/ https://reviews.llvm.org/D111529 Files:

[PATCH] D111529: Specify Clang vector builtins.

2021-10-18 Thread Craig Topper via Phabricator via cfe-commits
craig.topper added inline comments. Comment at: clang/docs/LanguageExtensions.rst:557 +``i in [0, Number of elements / 2)``. If the numbers of elements is not a +power of 2, the vector is widening with neutral elements for the reduction +at the end to the next power of 2. ---

[PATCH] D111529: Specify Clang vector builtins.

2021-10-18 Thread Florian Hahn via Phabricator via cfe-commits
fhahn marked 2 inline comments as done. fhahn added inline comments. Comment at: clang/docs/LanguageExtensions.rst:553 +Each builtin returns a scalar equivalent to applying the specified +operation(x, y) as horizontal recursive pairwise reduction to all vector +elements. In each

[PATCH] D111529: Specify Clang vector builtins.

2021-10-18 Thread Florian Hahn via Phabricator via cfe-commits
fhahn updated this revision to Diff 380352. fhahn marked an inline comment as done. fhahn added a comment. adjust padding wording. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D111529/new/ https://reviews.llvm.org/D111529 Files: clang/docs/Langu

[PATCH] D111529: Specify Clang vector builtins.

2021-10-18 Thread Florian Hahn via Phabricator via cfe-commits
fhahn updated this revision to Diff 380351. fhahn marked an inline comment as done. fhahn added a comment. Thanks for the latest set of comments! I tried to incorporate the suggestions about improving the reduction wording. I also added an example. I also put up 2 patches to start with the impl

[PATCH] D111529: Specify Clang vector builtins.

2021-10-13 Thread Krzysztof Parzyszek via Phabricator via cfe-commits
kparzysz added inline comments. Comment at: clang/docs/LanguageExtensions.rst:553 +Each builtin returns a scalar equivalent to applying the specified +operation(x, y) as horizontal recursive pairwise reduction to all vector +elements. In each reduction step, ``operation(x, y)`` i

[PATCH] D111529: Specify Clang vector builtins.

2021-10-13 Thread Craig Topper via Phabricator via cfe-commits
craig.topper added inline comments. Comment at: clang/docs/LanguageExtensions.rst:552 +operation(x, y) as pairwise tree reduction to the input. The pairs are formed +by concatenating both inputs and pairing adjacent elements. + fhahn wrote: > craig.topper wrote:

[PATCH] D111529: Specify Clang vector builtins.

2021-10-13 Thread Steve Canon via Phabricator via cfe-commits
scanon accepted this revision. scanon added a comment. This revision is now accepted and ready to land. I'm happy with this now. Comment at: clang/docs/LanguageExtensions.rst:552 +operation(x, y) as pairwise tree reduction to the input. The pairs are formed +by concatenating bo

[PATCH] D111529: Specify Clang vector builtins.

2021-10-13 Thread Florian Hahn via Phabricator via cfe-commits
fhahn marked an inline comment as done. fhahn added inline comments. Comment at: clang/docs/LanguageExtensions.rst:552 +operation(x, y) as pairwise tree reduction to the input. The pairs are formed +by concatenating both inputs and pairing adjacent elements. + cr

[PATCH] D111529: Specify Clang vector builtins.

2021-10-13 Thread Florian Hahn via Phabricator via cfe-commits
fhahn updated this revision to Diff 379517. fhahn marked 2 inline comments as done. fhahn added a comment. Another stab at phrasing the reduction step. Also added a note that the implementation is work-in-progress. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://revie

[PATCH] D111529: Specify Clang vector builtins.

2021-10-12 Thread Craig Topper via Phabricator via cfe-commits
craig.topper added inline comments. Comment at: clang/docs/LanguageExtensions.rst:552 +operation(x, y) as pairwise tree reduction to the input. The pairs are formed +by concatenating both inputs and pairing adjacent elements. + fhahn wrote: > craig.topper wrote:

[PATCH] D111529: Specify Clang vector builtins.

2021-10-12 Thread Florian Hahn via Phabricator via cfe-commits
fhahn marked 4 inline comments as done. fhahn added inline comments. Comment at: clang/docs/LanguageExtensions.rst:538 + T __builtin_elementwise_rint(T x) return the integral value nearest to x (according to the floating point types +

[PATCH] D111529: Specify Clang vector builtins.

2021-10-12 Thread Florian Hahn via Phabricator via cfe-commits
fhahn updated this revision to Diff 378992. fhahn added a comment. Try to be more precise about how the reduction steps are performed and replace _round and _rint by roundeven. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D111529/new/ https://revi

[PATCH] D111529: Specify Clang vector builtins.

2021-10-11 Thread Steve Canon via Phabricator via cfe-commits
scanon added inline comments. Comment at: clang/docs/LanguageExtensions.rst:565 + NaNs, fmax() return a NaN. + ET __builtin_reduce_add(VT a) \+ integer and floating po

[PATCH] D111529: Specify Clang vector builtins.

2021-10-11 Thread Steve Canon via Phabricator via cfe-commits
scanon added inline comments. Comment at: clang/docs/LanguageExtensions.rst:565 + NaNs, fmax() return a NaN. + ET __builtin_reduce_add(VT a) \+ integer and floating po

[PATCH] D111529: Specify Clang vector builtins.

2021-10-11 Thread Steve Canon via Phabricator via cfe-commits
scanon added inline comments. Comment at: clang/docs/LanguageExtensions.rst:538 + T __builtin_elementwise_rint(T x) return the integral value nearest to x (according to the floating point types +prevailing rounding mode) in

[PATCH] D111529: Specify Clang vector builtins.

2021-10-11 Thread Craig Topper via Phabricator via cfe-commits
craig.topper added inline comments. Comment at: clang/docs/LanguageExtensions.rst:552 +operation(x, y) as pairwise tree reduction to the input. The pairs are formed +by concatenating both inputs and pairing adjacent elements. + I'm not sure I understand what is b

[PATCH] D111529: Specify Clang vector builtins.

2021-10-11 Thread Florian Hahn via Phabricator via cfe-commits
fhahn created this revision. fhahn added reviewers: scanon, erichkeane, rjmccall, aaron.ballman, dexonsmith, rsmith, craig.topper. fhahn requested review of this revision. Herald added a project: clang. This patch specifies a set of vector builtins for Clang, as discussed on cfe-dev: https://list