lkml.org 
[lkml]   [2022]   [May]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v7 06/25] rust: add `compiler_builtins` crate
On Mon, 23 May 2022 11:37:16 -0700
Nick Desaulniers <ndesaulniers@google.com> wrote:

> Also, I'm not sure my concern about explicit build failures for C code
> was ever addressed? We have a constant problem with `long long`
> division on ARCH=arm32 and ARCH=i386 in C code.
> https://lore.kernel.org/lkml/CAKwvOdk+A2PBdjSFVUhj4xyCGCKujtej1uPgywQgrKPiK2ksPw@mail.gmail.com/
>
> > +#[cfg(target_arch = "arm")]
> > +define_panicking_intrinsics!("`u64` division/modulo should not be
> > used", {
> > + __aeabi_uldivmod,
> > + __mulodi4,
> > +});

Starting in LLVM 14 (used in Rust 1.60+), __mulodi4 will no longer be
generated. So that can be removed.

As for __aeabi_uldivmod, is there any reason that it can't just be
defined in arch/arm/lib? There are quite a few __aeabi functions already
defined there.

The source of __aeabi_uldivmod in compiler-rt seems quite simple, just
delegating to __uldivmoddi4. I think just changing that to
div64_u64_rem should do the job?

https://android.googlesource.com/toolchain/compiler-rt/+/release_32/lib/arm/aeabi_uldivmod.S

- Gary

\
 
 \ /
  Last update: 2022-05-24 01:43    [W:0.093 / U:0.260 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site