[PATCH] D111529: Specify Clang vector builtins.
Craig Topper via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Oct 13 14:15:46 PDT 2021
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:
> > scanon wrote:
> > > fhahn wrote:
> > > > craig.topper wrote:
> > > > > I'm not sure I understand what is being concatenated here.
> > > > I tried to spell it out more clearly. I'm still not sure if that spells it out as clearly as possibly and I'd appreciate any suggestions on how to improve the wording.
> > > It's unclear because there's no apparent "first" or "second" vector; there's just a single argument, and the result isn't a vector, it's a scalar. I think you want to say something like: "the operation is repeatedly applied to adjacent pairs of elements until the result is a scalar" and then provide a worked example.
> > The input is a single vector. I'm not understanding where we get a second vector to concatenate.
> Oh yes, now I see where the confusion was coming from. I was thinking about the reduction tree and how the input is broken up. Sorry for the confusing wording. I gave it another try, should be much simpler again now.
Should it somehow mention the pair is the even element `i` and the odd element `i+1`. There are n-1 adjacent pairs in an n element vector, but we want non-overlapping pairs.
Should probably spell out the non-power2 behavior. Presumably we pad identity elements after the last element to widen the vector out to a power 2 and then proceed normally?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D111529/new/
https://reviews.llvm.org/D111529
More information about the cfe-commits
mailing list