chibicc icon indicating copy to clipboard operation
chibicc copied to clipboard

RISC-V backend port

Open ksco opened this issue 2 years ago • 2 comments

Hi there!

I'm adding a RISC-V backend to chibicc and have made some progress. Just in case anyone is interested, I would like to mention this work here. The commit history of this fork is (almost) the same as the original project, only the codegen related code has been ported to RISC-V instead of x86-64. It uses Spike to simulate compiled programs, so you don't need a RISC-V machine to run it.

Repo: https://github.com/ksco/chibicc-riscv

Hope to hear your suggestions.

ksco avatar May 17 '22 16:05 ksco

This looks awesome! Do you have an example of how to invoke the compiler then run code in Spike?

redthing1 avatar Jul 12 '23 16:07 redthing1

Here is an example: https://github.com/ksco/chibicc-riscv/blob/main/Makefile#L18-L24

ksco avatar Jul 12 '23 16:07 ksco