diff options
author | Dimitar Dimitrov <dimitar@dinux.eu> | 2023-04-27 19:07:47 +0300 |
---|---|---|
committer | Dimitar Dimitrov <dimitar@dinux.eu> | 2023-05-01 11:08:51 +0300 |
commit | 1ee457a5febc8aa1e21d2298769bc70975f0206f (patch) | |
tree | a6ff8ba81a912acef1e16c562798fda009bb4e75 /libgcc | |
parent | 19a5b824ef1486a5caf94c7cde7facb2dd4fd96e (diff) | |
download | gcc-1ee457a5febc8aa1e21d2298769bc70975f0206f.zip gcc-1ee457a5febc8aa1e21d2298769bc70975f0206f.tar.gz gcc-1ee457a5febc8aa1e21d2298769bc70975f0206f.tar.bz2 |
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 <dimitar@dinux.eu>
Diffstat (limited to 'libgcc')
-rw-r--r-- | libgcc/config/pru/t-pru | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libgcc/config/pru/t-pru b/libgcc/config/pru/t-pru index a5b1871..7d5f5ee 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 |