We're sorry but this page doesn't work properly without JavaScript enabled. Please enable it to continue.
Feedback

How to add an GCC builtin to the RISC-V compiler

Formal Metadata

Title
How to add an GCC builtin to the RISC-V compiler
Title of Series
Number of Parts
542
Author
License
CC Attribution 2.0 Belgium:
You are free to use, adapt and copy, distribute and transmit the work or content in adapted or unchanged form for any legal purpose as long as the work is attributed to the author in the manner specified by the author or licensor.
Identifiers
Publisher
Release Date
Language

Content Metadata

Subject Area
Genre
Abstract
Many low level features of architectures are implemented in GCC as builtin functions. Builtin functions look superficially like any C function, but are in fact intrinsic to the compiler and represented as patterns to be matched in the machine description. Builtin functions are often used to access unique functionality of individual machine instructions. Being integrated within the compiler, they are more efficient than using simple inline assembly code. For RISC-V, they offer an excellent way to expose the functionality of instruction set extensions to the C/C++ programmer. Adding a builtin function to GCC is not that difficult, but neither is it completely trivial. In this talk we will show you how to add builtin functions using examples from the OpenHW Group's CV32E40Pv2 processor core.