<div dir="ltr"><div dir="ltr"><div dir="ltr">Rotates are a special case of the recently added funnel shift ops:</div><div dir="ltr"><a href="http://llvm.org/docs/LangRef.html#llvm-fshl-intrinsic">http://llvm.org/docs/LangRef.html#llvm-fshl-intrinsic</a></div><div dir="ltr"><br></div><div>We don't canonicalize standard IR (shifts and bitwise logic) to the intrinsics yet, but that is the intent.</div><div><br></div><div>There are also clang builtins for rotate left/right that map to the funnel shift intrinsics:</div><div><a href="https://clang.llvm.org/docs/LanguageExtensions.html#builtin-functions">https://clang.llvm.org/docs/LanguageExtensions.html#builtin-functions</a><br></div><div><br></div></div></div><br><div class="gmail_quote"><div dir="ltr">On Mon, Nov 5, 2018 at 9: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>