TUESDAY, JULY 21, 2026
avr
AVR: Fix missing SET instruction in __mulQ64_work.
Corrected missing SET instruction in AVR's __mulQ64_work for signed multiplication.
A previously introduced function for 64-bit multiplication on AVR microcontrollers, __mulQ64_work, was missing a necessary SET instruction. This commit adds the SET instruction, ensuring correct behavior for signed multiplications.
In Details
This commit corrects libgcc's __mulQ64_work for AVR by adding a SET instruction before the ICALL. This instruction is crucial for correctly initializing the upper part of the destination operand for signed multiplicands, resolving a specific issue in the 64-bit multiplication routine.
For Context
- SET
- An assembly instruction that sets a register to a specific value (often zero or one), typically used for initialization before a computation.
- __mulQ64_work
- A helper function in AVR's libgcc for performing 64-bit multiplication operations.
- ICALL
- An indirect call instruction in AVR assembly, used to call a function whose address is stored in a register.