From: Dimitar Dimitrov Date: Thu, 27 Apr 2023 16:07:47 +0000 (+0300) Subject: libgcc pru: Define TARGET_HAS_NO_HW_DIVIDE X-Git-Tag: basepoints/gcc-15~9758 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1ee457a5febc8aa1e21d2298769bc70975f0206f;p=thirdparty%2Fgcc.git libgcc pru: Define TARGET_HAS_NO_HW_DIVIDE This patch aligns the configuration to the actual PRU capabilities. It also reduces the size of the affected libgcc functions. For a real-world project using integer arithmetics the savings are significant: Before: text data bss dec hex filename 3688 865 544 5097 13e9 hc-sr04-range-sensor.elf With TARGET_HAS_NO_HW_DIVIDE defined: text data bss dec hex filename 2824 865 544 4233 1089 hc-sr04-range-sensor.elf Execution speed also appears to have improved. The moddi3 function is now executed in half the CPU cycles. libgcc/ChangeLog: * config/pru/t-pru (HOST_LIBGCC2_CFLAGS): Add -DTARGET_HAS_NO_HW_DIVIDE. Signed-off-by: Dimitar Dimitrov --- diff --git a/libgcc/config/pru/t-pru b/libgcc/config/pru/t-pru index a5b1871e52d4..7d5f5ee4261b 100644 --- a/libgcc/config/pru/t-pru +++ b/libgcc/config/pru/t-pru @@ -42,6 +42,9 @@ LIB2ADD += \ HOST_LIBGCC2_CFLAGS += -Os -ffunction-sections -fdata-sections +# Use an appropriate implementation when implementing DImode division. +HOST_LIBGCC2_CFLAGS += -DTARGET_HAS_NO_HW_DIVIDE + LIB2FUNCS_EXCLUDE = _muldi3 SHLIB_MAPFILES += $(srcdir)/config/pru/libgcc-eabi.ver