<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">On 10/30/16 5:33 PM, soroosh khoram via
      llvm-dev wrote:<br>
    </div>
    <blockquote
cite="mid:CACxUfiQOhWpowdyzKrrH-xKy_BP7uxS8mphUycoGLJFZTVhVxQ@mail.gmail.com"
      type="cite">
      <div dir="ltr">Hi,
        <div><br>
        </div>
        <div>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.</div>
      </div>
    </blockquote>
    <br>
    If you already have an assembler that recognizes your new
    instruction, it may be easier to use the -no-integrated-as argument
    on the clang command line and have it use the assembler that
    supports the instruction.<br>
    <br>
    If there is no assembler that understands your new instructions,
    then enhancing LLVM's code generator/internal assembler/internal
    disassembler is probably a good way to go.<br>
    <br>
    Regards,<br>
    <br>
    John Criswell<br>
    <blockquote
cite="mid:CACxUfiQOhWpowdyzKrrH-xKy_BP7uxS8mphUycoGLJFZTVhVxQ@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div><br>
        </div>
        <div>I tried to add a simple ADD instruction, following the
          instructions inĀ <a moz-do-not-send="true"
            href="http://llvm.org/docs/ExtendingLLVM.html#adding-a-new-instruction">http://llvm.org/docs/ExtendingLLVM.html#adding-a-new-instruction</a>
          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.</div>
        <div><br>
        </div>
        <div>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.</div>
        <div><br>
        </div>
        <div>Thank you</div>
        <div>Soroosh
        </div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
LLVM Developers mailing list
<a class="moz-txt-link-abbreviated" href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>
<a class="moz-txt-link-freetext" href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a>
</pre>
    </blockquote>
    <br>
    <p><br>
    </p>
    <pre class="moz-signature" cols="72">-- 
John Criswell
Assistant Professor
Department of Computer Science, University of Rochester
<a class="moz-txt-link-freetext" href="http://www.cs.rochester.edu/u/criswell">http://www.cs.rochester.edu/u/criswell</a></pre>
  </body>
</html>