stnolting / riscv-gcc-prebuilt

📦 Prebuilt RISC-V GCC toolchains for x64 Linux.
GNU General Public License v2.0
87 stars 8 forks source link

adding custom instructions #2

Closed ada-flo closed 1 year ago

ada-flo commented 1 year ago

I've been trying to add some custom instructions to this prebuilt toolchain (rv64imc-3.0.0), which requires me to find opcode definitions in riscv-opc.h and riscv-opc.c.

I've found that if you build the original toolchain, the above files could be found under binutils/include/opcode and binutils/opcodes/riscv-opc.c, respectively.

However I've been struggling to find the binutils folder in the downloaded/extracted toolchain here, any help regarding where I might be able to find the folder or something that serves similar functionality?

stnolting commented 1 year ago

Hey there! I am no expert when it comes to modifying GCC... 🙈 But I do think you need to edits those files before compiling GCC - as far as I know.

stnolting commented 1 year ago

FTR An interesting overview of how to add custom instructions to RISC-V gcc: https://pcotret.gitlab.io/riscv-custom/