https://gcc.gnu.org/g:6753df43a0251cffbfe2fca85e978807f976fb01
commit r15-9221-g6753df43a0251cffbfe2fca85e978807f976fb01 Author: Georg-Johann Lay <a...@gjlay.de> Date: Fri Apr 4 22:01:43 2025 +0200 AVR: Speed up __umulhisi3 for small devices with MUL. __umulhisi3 had an "rcall 1f" to save 6 bytes, which is an unreasonable size gain vs. cycle cost. Just use the same code on all devices with MUL, irrespective of program memory size. libgcc/ * config/avr/lib1funcs.S (__umulhisi3) [Have MUL]: Reduce call depth by 1. Diff: --- libgcc/config/avr/lib1funcs.S | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/libgcc/config/avr/lib1funcs.S b/libgcc/config/avr/lib1funcs.S index 96f20ca8e646..01208927c6b0 100644 --- a/libgcc/config/avr/lib1funcs.S +++ b/libgcc/config/avr/lib1funcs.S @@ -581,19 +581,12 @@ DEFUN __umulhisi3 mul A1, B1 movw C2, r0 mul A0, B1 -#ifdef __AVR_HAVE_JMP_CALL__ - ;; This function is used by many other routines, often multiple times. - ;; Therefore, if the flash size is not too limited, avoid the RCALL - ;; and inverst 6 Bytes to speed things up. add C1, r0 adc C2, r1 clr __zero_reg__ adc C3, __zero_reg__ -#else - rcall 1f -#endif mul A1, B0 -1: add C1, r0 + add C1, r0 adc C2, r1 clr __zero_reg__ adc C3, __zero_reg__