From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2059) id C96E83858D39; Mon, 1 May 2023 08:15:17 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C96E83858D39 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1682928918; bh=wiDYF92Opky3UNUpb1TGmLzMDgfESQvh93EBmI499TE=; h=From:To:Subject:Date:From; b=T0q4aFAdFRaKOWzQpB9gnsYilCqkIkKD25pw+DRJr2RH1QkaoD9TPbPWtSkyz387T S1dedrT19i+R3z22aWas/ZQfqQz2uFEU0ZPjQgh4AqpGAeHcxCFatTqt7AJCGdC/Xt K0PxVJh/PtYcz7ntLdNU8xk1bRZGoL7P8Gtqc9Jc= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Dimitar Dimitrov To: gcc-cvs@gcc.gnu.org Subject: [gcc r14-381] libgcc pru: Define TARGET_HAS_NO_HW_DIVIDE X-Act-Checkin: gcc X-Git-Author: Dimitar Dimitrov X-Git-Refname: refs/heads/master X-Git-Oldrev: 19a5b824ef1486a5caf94c7cde7facb2dd4fd96e X-Git-Newrev: 1ee457a5febc8aa1e21d2298769bc70975f0206f Message-Id: <20230501081518.C96E83858D39@sourceware.org> Date: Mon, 1 May 2023 08:15:17 +0000 (GMT) List-Id: https://gcc.gnu.org/g:1ee457a5febc8aa1e21d2298769bc70975f0206f commit r14-381-g1ee457a5febc8aa1e21d2298769bc70975f0206f Author: Dimitar Dimitrov 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 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