public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: Ian Lance Taylor <iant@google.com>
To: Joshua Weber <jweber8@hawk.iit.edu>
Cc: gcc-help@gcc.gnu.org
Subject: Re: Adding custom instructions to bcc
Date: Sat, 22 Oct 2011 05:26:00 -0000	[thread overview]
Message-ID: <mcraa8tlhpx.fsf@dhcp-172-18-216-180.mtv.corp.google.com> (raw)
In-Reply-To: <CA+FtBRjtxpXYDV0fPY-ybLJbwgvu0iyFnTTn0vSQWYxoB4Gr+A@mail.gmail.com>	(Joshua Weber's message of "Fri, 21 Oct 2011 15:16:27 -0500")

Joshua Weber <jweber8@hawk.iit.edu> writes:

> 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.

If you are only going to use asm blocks to generate the new
instructions, then you do not need to modify gcc.  It will suffice to
modify gas.

For some targets, changing <arch>-opc.c will suffice.  It depends on how
the target is implemented in gas.

Ian

      reply	other threads:[~2011-10-22  5:26 UTC|newest]

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

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=mcraa8tlhpx.fsf@dhcp-172-18-216-180.mtv.corp.google.com \
    --to=iant@google.com \
    --cc=gcc-help@gcc.gnu.org \
    --cc=jweber8@hawk.iit.edu \
    /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).