[llvm-dev] Adding assembly instructions to LLVM

soroosh khoram via llvm-dev llvm-dev at lists.llvm.org
Sun Oct 30 14:33:08 PDT 2016


Hi,

As part of a project I need to compile C code for a new architecture that
is based on x86 with some new instructions. In my C code I'm going to use
inline assembly, so the only thing I need from LLVM is to recognize the
instruction and put it in the binary in the right place with correct input
values/register addresses.

I tried to add a simple ADD instruction, following the instructions in
http://llvm.org/docs/ExtendingLLVM.html#adding-a-new-instruction and just
duplicating everything I saw for the ADD instruction for my instruction.
The problem is that this page doesn't explain where I should add the opcode
for my instruction.

I've been reading the documents and the source code for several days now
and I feel kind of lost right now. I was hoping someone here could point me
to the right direction.

Thank you
Soroosh
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20161030/a26f0079/attachment.html>


More information about the llvm-dev mailing list