All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vineet Gupta <vgupta@kernel.org>
To: linux-snps-arc@lists.infradead.org
Cc: linux-kernel@vger.kernel.org, Arnd Bergmann <arnd@arndb.de>,
	Dinh Nguyen <dinguyen@kernel.org>,
	Simon Schuster <schuster.simon@siemens-energy.com>,
	Vineet Gupta <vgupta@kernel.org>
Subject: [PATCH 2/4] ARC: math emul: use existing lib versions of libgcc routines
Date: Wed, 18 Nov 2026 21:59:56 -0800	[thread overview]
Message-ID: <20261119055958.1621709-3-vgupta@kernel.org> (raw)
In-Reply-To: <20261119055958.1621709-1-vgupta@kernel.org>

Use the existing lib/ emulation.

Divide/modulo need some mention: technically emulation is only needed
for hardware lacking the insns (ARCompact ISA or ARCv2 ISA based cores
configured w/o divider and/or those insns disabled in the
build (-mno-div-rem). But to be future-proof (thinking modules)
just add them unconditionally.

Suggested-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Vineet Gupta <vgupta@kernel.org>
---
 arch/arc/Kconfig           | 10 ++++++++++
 arch/arc/kernel/arcksyms.c | 23 -----------------------
 2 files changed, 10 insertions(+), 23 deletions(-)

diff --git a/arch/arc/Kconfig b/arch/arc/Kconfig
index 80e61175bf52..9bf747882f2a 100644
--- a/arch/arc/Kconfig
+++ b/arch/arc/Kconfig
@@ -25,6 +25,16 @@ config ARC
 	select GENERIC_ATOMIC64 if !ISA_ARCV2 || !(ARC_HAS_LL64 && ARC_HAS_LLSC)
 	# for now, we don't need GENERIC_IRQ_PROBE, CONFIG_GENERIC_IRQ_CHIP
 	select GENERIC_IRQ_SHOW
+	select GENERIC_LIB_ASHLDI3
+	select GENERIC_LIB_ASHRDI3
+	select GENERIC_LIB_LSHRDI3
+	select GENERIC_LIB_MULDI3
+	select GENERIC_LIB_CMPDI2
+	select GENERIC_LIB_UCMPDI2
+	select GENERIC_LIB_MODSI3
+	select GENERIC_LIB_UMODSI3
+	select GENERIC_LIB_DIVSI3
+	select GENERIC_LIB_UDIVSI3
 	select GENERIC_PCI_IOMAP
 	select GENERIC_SCHED_CLOCK
 	select GENERIC_SMP_IDLE_THREAD
diff --git a/arch/arc/kernel/arcksyms.c b/arch/arc/kernel/arcksyms.c
index c22055e66cfe..bba133fdd1b6 100644
--- a/arch/arc/kernel/arcksyms.c
+++ b/arch/arc/kernel/arcksyms.c
@@ -7,29 +7,6 @@
 
 #include <linux/module.h>
 
-/* libgcc functions, not part of kernel sources */
-extern void __ashldi3(void);
-extern void __ashrdi3(void);
-extern void __divsi3(void);
-extern void __lshrdi3(void);
-extern void __modsi3(void);
-extern void __muldi3(void);
-extern void __ucmpdi2(void);
-extern void __udivsi3(void);
-extern void __umodsi3(void);
-extern void __cmpdi2(void);
-
-EXPORT_SYMBOL(__ashldi3);
-EXPORT_SYMBOL(__ashrdi3);
-EXPORT_SYMBOL(__divsi3);
-EXPORT_SYMBOL(__lshrdi3);
-EXPORT_SYMBOL(__modsi3);
-EXPORT_SYMBOL(__muldi3);
-EXPORT_SYMBOL(__ucmpdi2);
-EXPORT_SYMBOL(__udivsi3);
-EXPORT_SYMBOL(__umodsi3);
-EXPORT_SYMBOL(__cmpdi2);
-
 /* ARC optimised assembler routines */
 EXPORT_SYMBOL(memset);
 EXPORT_SYMBOL(memcpy);
-- 
2.53.0


WARNING: multiple messages have this Message-ID (diff)
From: Vineet Gupta <vgupta@kernel.org>
To: linux-snps-arc@lists.infradead.org
Cc: linux-kernel@vger.kernel.org, Arnd Bergmann <arnd@arndb.de>,
	Dinh Nguyen <dinguyen@kernel.org>,
	Simon Schuster <schuster.simon@siemens-energy.com>,
	Vineet Gupta <vgupta@kernel.org>
Subject: [PATCH 2/4] ARC: math emul: use existing lib versions of libgcc routines
Date: Wed, 18 Nov 2026 21:59:56 -0800	[thread overview]
Message-ID: <20261119055958.1621709-3-vgupta@kernel.org> (raw)
In-Reply-To: <20261119055958.1621709-1-vgupta@kernel.org>

Use the existing lib/ emulation.

Divide/modulo need some mention: technically emulation is only needed
for hardware lacking the insns (ARCompact ISA or ARCv2 ISA based cores
configured w/o divider and/or those insns disabled in the
build (-mno-div-rem). But to be future-proof (thinking modules)
just add them unconditionally.

Suggested-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Vineet Gupta <vgupta@kernel.org>
---
 arch/arc/Kconfig           | 10 ++++++++++
 arch/arc/kernel/arcksyms.c | 23 -----------------------
 2 files changed, 10 insertions(+), 23 deletions(-)

diff --git a/arch/arc/Kconfig b/arch/arc/Kconfig
index 80e61175bf52..9bf747882f2a 100644
--- a/arch/arc/Kconfig
+++ b/arch/arc/Kconfig
@@ -25,6 +25,16 @@ config ARC
 	select GENERIC_ATOMIC64 if !ISA_ARCV2 || !(ARC_HAS_LL64 && ARC_HAS_LLSC)
 	# for now, we don't need GENERIC_IRQ_PROBE, CONFIG_GENERIC_IRQ_CHIP
 	select GENERIC_IRQ_SHOW
+	select GENERIC_LIB_ASHLDI3
+	select GENERIC_LIB_ASHRDI3
+	select GENERIC_LIB_LSHRDI3
+	select GENERIC_LIB_MULDI3
+	select GENERIC_LIB_CMPDI2
+	select GENERIC_LIB_UCMPDI2
+	select GENERIC_LIB_MODSI3
+	select GENERIC_LIB_UMODSI3
+	select GENERIC_LIB_DIVSI3
+	select GENERIC_LIB_UDIVSI3
 	select GENERIC_PCI_IOMAP
 	select GENERIC_SCHED_CLOCK
 	select GENERIC_SMP_IDLE_THREAD
diff --git a/arch/arc/kernel/arcksyms.c b/arch/arc/kernel/arcksyms.c
index c22055e66cfe..bba133fdd1b6 100644
--- a/arch/arc/kernel/arcksyms.c
+++ b/arch/arc/kernel/arcksyms.c
@@ -7,29 +7,6 @@
 
 #include <linux/module.h>
 
-/* libgcc functions, not part of kernel sources */
-extern void __ashldi3(void);
-extern void __ashrdi3(void);
-extern void __divsi3(void);
-extern void __lshrdi3(void);
-extern void __modsi3(void);
-extern void __muldi3(void);
-extern void __ucmpdi2(void);
-extern void __udivsi3(void);
-extern void __umodsi3(void);
-extern void __cmpdi2(void);
-
-EXPORT_SYMBOL(__ashldi3);
-EXPORT_SYMBOL(__ashrdi3);
-EXPORT_SYMBOL(__divsi3);
-EXPORT_SYMBOL(__lshrdi3);
-EXPORT_SYMBOL(__modsi3);
-EXPORT_SYMBOL(__muldi3);
-EXPORT_SYMBOL(__ucmpdi2);
-EXPORT_SYMBOL(__udivsi3);
-EXPORT_SYMBOL(__umodsi3);
-EXPORT_SYMBOL(__cmpdi2);
-
 /* ARC optimised assembler routines */
 EXPORT_SYMBOL(memset);
 EXPORT_SYMBOL(memcpy);
-- 
2.53.0


_______________________________________________
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc

  parent reply	other threads:[~2026-11-19  6:00 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-19  5:59 [PATCH 0/4] Remove libgcc dependency for ARC Vineet Gupta
2026-11-19  5:59 ` Vineet Gupta
2026-11-19  5:59 ` [PATCH 1/4] ARC: math emul: elide 64/64 divide and floating point routines Vineet Gupta
2026-11-19  5:59   ` Vineet Gupta
2026-11-19  5:59 ` Vineet Gupta [this message]
2026-11-19  5:59   ` [PATCH 2/4] ARC: math emul: use existing lib versions of libgcc routines Vineet Gupta
2026-11-19  5:59 ` [PATCH 3/4] Revert "ARC: Strip libgcc debug information when generating BTF" Vineet Gupta
2026-11-19  5:59   ` Vineet Gupta
2026-11-19  5:59 ` [PATCH 4/4] ARC: stop linking libgcc Vineet Gupta
2026-11-19  5:59   ` Vineet Gupta
2026-11-19  7:35 ` [PATCH 0/4] Remove libgcc dependency for ARC Arnd Bergmann
2026-11-19  7:35   ` Arnd Bergmann

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=20261119055958.1621709-3-vgupta@kernel.org \
    --to=vgupta@kernel.org \
    --cc=arnd@arndb.de \
    --cc=dinguyen@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-snps-arc@lists.infradead.org \
    --cc=schuster.simon@siemens-energy.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.