Tutorial: How to add a builtin function to the GCC backend

Day 1 | 15:55 | 00:25 | K.3.201 | Jeremy Bennett


Note: I'm reworking this at the moment, some things won't work.

The stream isn't available yet! Check back at 15:55.
Get involved in the conversation!Join the chat

A common first step to adding full code-generation functionality for a new instruction, or set of instructions is to add them to the back-end as a builtin function. This is particularly common with RISC-V where custom ISA extensions are common place.

In this tutorial I will take you through the steps to add a builtin-function to the back-end, using a case study from the OpenHW CV32E4Pv2 RISC-V core. This has 8 ISA extensions, with a total of more than 300 instructions.

I will conclude by looking at some of the things we got wrong. In particular unexpected consequences when the new compiler started being used more widely.