Re: [PATCH] nios2: ksyms: Declare __mulsi3 export

From: Simon Schuster

Date: Mon Nov 02 2026 - 02:24:44 EST


On Sun, Nov 01, 2026 at 12:19:34PM +0100, Arnd Bergmann wrote:
> On Sun, Nov 1, 2026, at 01:26, Vineet Gupta wrote:
> > On 10/31/26 16:57, Vineet Gupta wrote:
>
> >>
> >> ┌───────────┬───────┬───────────┐
> >> │  routine  │ calls │ functions │
> >> ├───────────┼───────┼───────────┤
> >> │ __udivsi3 │ 415   │ 238       │
> >> ├───────────┼───────┼───────────┤
> >> │ __umodsi3 │ 203   │ 131       │
> >> ├───────────┼───────┼───────────┤
> >> │ __divsi3  │ 77    │ 57        │
> >> ├───────────┼───────┼───────────┤
> >> │ __modsi3  │ 41    │ 33        │
> >> └───────────┴───────┴───────────┘
> >>
> >> I can take a stab at providing the generic libgcc implementation in
> >> lib/* but I only expect the arches using libgcc version to switch.
> >
> > It seems there 4 are always needed together or not at all.
> > Do we want 4 Kconfig gates or just one will suffice ?
>
> Either way is fine for me. Simon did separate symbols in his
> nios2 patch[1], and I don't mind staying with that version
> unless someone else feels strongly about it.

So the implementation of these four in the series is indeed coupled and
all resolve back to a common base implementation. It got separate
symbols as I assumed that one could potentially provide optimised
assembly routines for one of them but not the others in an individual
arch; but admittedly, I did not think too much about that point (one
would indeed probably provide a specialised instance of the common base
routine?) as it was easy enough to do.

> I would however like to have separate patches to add lib/divmul.c
> and lib/mulsi3.c, and then patches on top that start using these
> from nios2 and arc.

I can split up Patch 3 in my series and pull out the nios2-KConfig
selects of the generic symbols, so that nios2 enabling them is a
separate patch.

Best regards
Simon