0

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.

3
  • When you have specific questions about some function I can try to answer it. Commented Apr 12, 2024 at 12:19
  • Hey, thanks for the answer. I dont have questions about specific functions. I was just curious if there is any documentation on these subroutines with extra information like total cycle count etc. I was just confused aboout not finding any fulfilling documentation about these omnipresent subroutines. Commented Apr 14, 2024 at 22:10
  • For cycle count, you could use a simulator like avrtest. Though a simulation only gives a lower bound of WCET (worst code execution time), not some upper bound as requires by safety critical apps. Simulating all inputs is only feasible when all inputs together fit in, say, 32 bits. But then there are still IRQs that add to WCET. avrtest is niche, but is is fast and has features to get cycle count, and it can get information out of a target without printf etc. Commented Apr 15, 2024 at 10:42

1 Answer 1

0

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.