assemblyavravr-gcclibgcc

libgcc subroutines documentation for avr-gcc


I disassembled some C++ code with the avr-gcc compiler in godbolt and often found calls to libgcc subroutines like __udivmodhi4 or __mulhi3.

Where can I find good and insightful documentation about those subroutines?

I tried to find any good documentation about those subroutines but could not find any.

The only (kind of) useful thing I found was the plain implementation of those subroutines in the libgcc avr config files.


Solution

  • Basically, the documentation is the libgcc implementation (and comments) you aleady found.

    Nomenclature is according to the respective insn naming in the backend's avr.md. The insn names can be found in section 17.10 Standard Pattern Names For Generation of the internals.

    And the avr-gcc wiki also mentions some functions in Exceptions to the Calling Convention, but that's far from being complete.