GCC Newspaper
JUNE 15, 2026
Date
/
Architectures
Components
Topics
News & Policy
Other
gcc/pru

pru: Transform patterns to use hard register constraints

Refactors PRU backend to use hard register constraints, simplifying register class definitions.

The PRU backend now uses hard register constraints, which simplifies register class definitions by removing single-register classes. Predicates are updated to directly compare register numbers, and the mulsi3 and umulsidi3 patterns have been updated to use the new constraints, yielding cleaner code.

In Details

This commit refactors the PRU backend's register constraints, specifically in constraints.md, predicates.md, pru.h, and pru.md. The change replaces single-register classes (e.g., MULDST_REGS) with hard register constraints in patterns like mulsi3 and umulsidi3. This simplifies the register class structure by removing the need for single-register classes, streamlining the backend's definition of register usage.

For Context

The PRU (Programmable Real-time Unit) is a coprocessor often used in embedded systems for real-time tasks. This commit simplifies how the compiler describes which registers can be used for specific operations. Instead of defining special groups of registers for each specific use, it now uses more direct constraints. This internal change makes the compiler's code easier to understand and maintain for the PRU architecture.

Filed Under: pruregister allocationrefactor