This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Adding custom instructions to bcc


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]