Re: [PATCH] drm/panic: Add a u64 divide by 10 for arm32

2025-06-27 Thread Jocelyn Falempe
On 27/06/2025 13:44, Miguel Ojeda wrote: On Fri, Jun 27, 2025 at 11:41 AM Jocelyn Falempe wrote: +/// On arm32 architecture, dividing an u64 by a constant will generate a call +/// to __aeabi_uldivmod which is not present in the kernel. +/// So use the multiply by inverse method for this archi

Re: [PATCH] drm/panic: Add a u64 divide by 10 for arm32

2025-06-27 Thread Jocelyn Falempe
On 27/06/2025 13:36, Alice Ryhl wrote: On Fri, Jun 27, 2025 at 11:41 AM Jocelyn Falempe wrote: On 32bits ARM, u64 divided by a constant is not optimized to a multiply by inverse by the compiler [1]. So do the multiply by inverse explicitly for this architecture. Link: https://github.com/llvm/

Re: [PATCH] drm/panic: Add a u64 divide by 10 for arm32

2025-06-27 Thread Miguel Ojeda
On Fri, Jun 27, 2025 at 11:41 AM Jocelyn Falempe wrote: > > +/// On arm32 architecture, dividing an u64 by a constant will generate a call > +/// to __aeabi_uldivmod which is not present in the kernel. > +/// So use the multiply by inverse method for this architecture. This sounds more like a nor

Re: [PATCH] drm/panic: Add a u64 divide by 10 for arm32

2025-06-27 Thread Miguel Ojeda
On Fri, Jun 27, 2025 at 1:37 PM Alice Ryhl wrote: > > I would get rid of this conditional and declare another div10 function > that just does input/10 on other arches. Yeah, please keep `cfg`s as local as possible, i.e. inside the implementation of the function where possible, so that we share ev

Re: [PATCH] drm/panic: Add a u64 divide by 10 for arm32

2025-06-27 Thread Alice Ryhl
On Fri, Jun 27, 2025 at 11:41 AM Jocelyn Falempe wrote: > > On 32bits ARM, u64 divided by a constant is not optimized to a > multiply by inverse by the compiler [1]. > So do the multiply by inverse explicitly for this architecture. > > Link: https://github.com/llvm/llvm-project/issues/37280 [1] >

[PATCH] drm/panic: Add a u64 divide by 10 for arm32

2025-06-27 Thread Jocelyn Falempe
On 32bits ARM, u64 divided by a constant is not optimized to a multiply by inverse by the compiler [1]. So do the multiply by inverse explicitly for this architecture. Link: https://github.com/llvm/llvm-project/issues/37280 [1] Reported-by: Andrei Lalaev Closes: https://lore.kernel.org/dri-devel