<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">There used to be such intrinsics (bit-field extract/deposit):</div><div dir="ltr"><div><a href="http://releases.llvm.org/2.0/docs/LangRef.html#int_part_select">http://releases.llvm.org/2.0/docs/LangRef.html#int_part_select</a><br></div><div><a href="http://releases.llvm.org/2.0/docs/LangRef.html#int_part_set">http://releases.llvm.org/2.0/docs/LangRef.html#int_part_set</a><br></div><div>But they are removed later.<br></div><div><br></div><div>Our internal branch of llvm actual keep them.</div><div>Depending on how you want to use them, if you mixed them into pointer calculations, it can easily confuse scalar evolution. This is bad.</div><div>Also, it is not hard to build these intrinsics from patterns of and/or/shift/trunc/zext, so mabe you could build them in the backend instead of at the LLVM IR level. E.g <a href="https://github.com/etherzhhb/Shang/blob/eb4aa11385b93af4b73cfd4701e1473124ada325/lib/BitLevelOpt/BitLevelOpt.cpp">https://github.com/etherzhhb/Shang/blob/eb4aa11385b93af4b73cfd4701e1473124ada325/lib/BitLevelOpt/BitLevelOpt.cpp</a> <br></div></div></div></div></div></div><br><div class="gmail_quote"><div dir="ltr">On Mon, Nov 5, 2018 at 8:25 PM Braden Nelson 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:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Would it be worth it to add intrinsics for bitfield extract/deposit and binary rotate left/right?<br>Both of these have dedicated instructions in multiple ISAs, including the two major ISAs (x86-64 and ARM)<br>Adding them could decrease load on the backend to recognize common intrinsic patterns that correspond to these instructions, but could increase load on backends that do not have dedicated instructions for these intrinsics.</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="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
</blockquote></div>