<div dir="ltr"><div class="gmail_default" style="font-size:small">This commit is a good example for how to add an intrinsic for risc-v:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small"><a href="https://github.com/llvm/llvm-project/commit/16877c5d2cd3f5c45642c9dc546c376ac87aa54d#diff-d340caed3f9af6c4e7ca78d4473ba5375a4973dc2f2b261644248ac039c0b2d1">https://github.com/llvm/llvm-project/commit/16877c5d2cd3f5c45642c9dc546c376ac87aa54d#diff-d340caed3f9af6c4e7ca78d4473ba5375a4973dc2f2b261644248ac039c0b2d1</a><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Jan 18, 2022 at 3:35 AM David Mallasén Quintana via cfe-dev <<a href="mailto:cfe-dev@lists.llvm.org">cfe-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">Hello,<br>
<br>
I have added new instructions to the RISC-V LLVM backend for some<br>
specific hardware I developed and I want to access a sequence of them<br>
directly from C code. As of now I do this using inline assembly but it<br>
can be a bit cumbersome. If I'm not mistaken the way to go would be to<br>
access this functionality from C with CLANG builtins and lowering this<br>
to machine code with LLVM intrinsics that generate my target RISC-V<br>
instructions.<br>
<br>
I have seen the documentation on how to add LLVM intrinsics. However,<br>
I can't find something similar with CLANG builtins, so any pointers to<br>
some documentation would be greatly appreciated. Also, if there is a<br>
better way of achieving this I would be grateful for some information<br>
on how it could be done.<br>
<br>
Best regards,<br>
David<br>
_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a><br>
</blockquote></div>