You are viewing the 2025 edition of FOSDEM. Click here to view the 2026 edition
Tutorial: How to add a builtin function to the GCC backend
K.3.201 | Day 1 | 15:55 - 16:20 | Speakers: Jeremy Bennett
Tutorial: How to add a builtin function to the GCC backend
Abstract
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.
Attachments
Speakers
Jeremy Bennett
Links
External Links
Notice: The placeholder video image is licensed under CC BY-SA 4.0. The original image can be found hereChanges made to the image are: Cropped the image to a new ratio, part of the image was cut off.
