GCC Newspaper
JUNE 15, 2026
Date
/
Architectures
Components
Topics
News & Policy
Other
avr Performance Win

AVR: Implement fixed-point conversions to/from [u]int24_t.

The AVR backend now supports conversions between fixed-point numbers and 24-bit integers, resolving link errors.

The AVR backend now supports conversions between fixed-point numbers and 24-bit integers, addressing missing references during linking. The avr_out_fract function now handles 24-bit integral modes, facilitated by adding PSImode to the mode iterators in avr-fixed.md. This resolves undefined reference errors during linking when using fixed-point conversions with 24-bit integers.

In Details

The file avr-fixed.md defines how fixed-point conversions are handled in the AVR backend. The avr_out_fract function is responsible for generating inline code for fixed-point conversions. By adding PSImode to the mode iterators, the backend can now handle 24-bit integral modes, resolving link errors related to missing __fractunssapsi and similar functions.

For Context

The AVR microcontroller architecture is commonly used in embedded systems. Fixed-point arithmetic provides a way to represent fractional numbers using integers, which can be more efficient than using floating-point numbers on smaller processors. This commit enables the compiler to handle conversions between fixed-point numbers and 24-bit integers on AVR, where 24-bit integers may be used to represent higher-precision fixed-point values. This resolves linker errors encountered when these conversions were used.

Filed Under: avrfixed-pointcode generation