<div dir="ltr">For masked.gather, the mask should be all 1s to do a load for each element. You should set the passthru to undef. On targets that don't have native support for gather in hardware, the gather will be expanded into a loop that does each load and inserts it into a vector. This is expansion is done by the ScalarizedMaskedMemIntrinsicPass that runs a little before SelectionDAG.<div><br></div><div><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature">~Craig</div></div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Apr 7, 2020 at 6:46 PM Levo DeLellis via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hello everyone. I'll tell you my goal then my question. In pseudo code I'd like to do the following<br><br>  values = lookup_table[offsets]<br><br>offsets is `<8 x i8>` which I get by doing `and <8 x i8> %a, %b`<br>lookup_table is simply a 16 byte constant array of i8 aligned to 16.<br>values would be `<8 x i8>` which I'll use with another vector operation<br><br>I was thinking I might need an array of pointers but I looked at getelementptr for a solution. It appears it can use it <a href="https://llvm.org/docs/LangRef.html#vector-of-pointers" target="_blank">https://llvm.org/docs/LangRef.html#vector-of-pointers</a><br>Specifically the following line<br><br>       %A = getelementptr i8, i8* %ptr, <4 x i64> %offsets<br><br>However it doesn't show how I should load %A but mentions gather (I don't need a mask or pass through values). I looked at 'load' and it doesn't appear to support a vector. Is there anything else I can use that may be more efficient? If llvm.masked.gather is the way to go do I want the mask all 1's or 0's? I heard of masked-off bit being different things to different people but my first impression is I want all 0's<br><br></div>
_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
</blockquote></div>