Announcements

Announcing the RISC-V GCC 4.9 Port and New ABI

By January 13, 2015October 1st, 2020No Comments

We are excited to announce our release of a new, clean-slate port of gcc 4.9 to RISC-V.  The riscv-tools repository has been updated to reflect the use of our new gcc port in the master branch.  

There are a couple differences to be aware of.

First, the compiler binary name has changed to follow GNU conventions (riscv-gcc is now riscv64-unknown-elf-gcc, or riscv64-unknown-linux-gnu-gcc for the Linux/glibc variant). 

Second, the riscv-gcc repository, based on gcc 4.6, will be retired. Instead, riscv-tools now points to the riscv-gnu-toolchain repository. One of the advantages with the new repository is it only contains relevant code for RISC-V. When building the toolchain, the gcc source is downloaded and the RISC-V patches applied.  

Third, the ABI has been changed (new RISC-V calling convention) for the following reasons:

1) We moved the most popular registers to an aligned block of eight registers (x8-x15) to minimize the hardware cost to decode RVC instructions.

2) We dropped the return value registers, v0 and v1, and instead return results in the first two argument registers, a0 and a1.  This mainly benefits object-oriented code, wherein the “this” pointer is passed in a0, by removing register moves in code sequences like foo()->bar()->baz().

3) We rebalanced the number of callee- and caller-saved registers.

We apologize for any inconveniences or confusion that has arisen during our development of this update. Hopefully, the new tool-chain should provide us with fewer bugs and better code performance over gcc 4.6.