public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: Joshua Weber <jweber8@hawk.iit.edu>
To: gcc-help@gcc.gnu.org
Subject: Adding custom instructions to bcc
Date: Fri, 21 Oct 2011 20:16:00 -0000	[thread overview]
Message-ID: <CA+FtBRjtxpXYDV0fPY-ybLJbwgvu0iyFnTTn0vSQWYxoB4Gr+A@mail.gmail.com> (raw)

I am looking to be able to add custom instructions to the gcc/gas compiler.

I have already written a full microprocessor simulator that simulates
execution of all machine code. I am looking to extend the instruction
set of the microprocessor to support new custom instructions.

I would ideally like to be able to simply place custom instructions in
C code using asm blocks. I would even be happy with coding in machine
code directly (hexadecimal definitions) in asm blocks.

I have been attempting to read and understand the internals of both
gcc and the binutils (gas). I still feel unclear if I need to modify
gcc at all. Would the simple addition of the new opcodes to the
binutils/opcodes/<arch>-opc.c file be sufficient to support the
additional custom instructions?

Any help in this regard would be greatly appreciated. I have failed to
identify many online resources for this, even though there seems to be
a degree of interest in it. It is very common within the SoC and FPGA
microprocessor world for the extension of the ISA to include new
instructions, and yet there is very little existing documentation on
this subject.

Thanks,
Joshua Weber

             reply	other threads:[~2011-10-21 20:16 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-21 20:16 Joshua Weber [this message]
2011-10-22  5:26 ` Ian Lance Taylor

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CA+FtBRjtxpXYDV0fPY-ybLJbwgvu0iyFnTTn0vSQWYxoB4Gr+A@mail.gmail.com \
    --to=jweber8@hawk.iit.edu \
    --cc=gcc-help@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).