public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Dimitar Dimitrov <dimitar@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc r14-381] libgcc pru: Define TARGET_HAS_NO_HW_DIVIDE
Date: Mon,  1 May 2023 08:15:17 +0000 (GMT)	[thread overview]
Message-ID: <20230501081518.C96E83858D39@sourceware.org> (raw)

https://gcc.gnu.org/g:1ee457a5febc8aa1e21d2298769bc70975f0206f

commit r14-381-g1ee457a5febc8aa1e21d2298769bc70975f0206f
Author: Dimitar Dimitrov <dimitar@dinux.eu>
Date:   Thu Apr 27 19:07:47 2023 +0300

    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>

Diff:
---
 libgcc/config/pru/t-pru | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/libgcc/config/pru/t-pru b/libgcc/config/pru/t-pru
index a5b1871e52d..7d5f5ee4261 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

                 reply	other threads:[~2023-05-01  8:15 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230501081518.C96E83858D39@sourceware.org \
    --to=dimitar@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).