You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Raspberry Pi Silicon RP2040 is a dual-Cortex-M0+ based microcontroller, but it also has a Hardware Divide peripheral.
It it possible to mark __udivmodsi4 (and/or similar) as weak symbols so we can replace them in a library crate? Or is there some other supported way to drop-in a faster platform-specific divide algorithm?
I'm hesitant to involve weak symbols since they have some over on targets that use dynamic linking: defining a symbol as weak forces all calls to it to be indirect via the PLT since a strong definition could be present in a shared library that is loaded at runtime.
Instead we should prefer the current system of relying on the linker as described by rp-rs/rp-hal#278 (comment). Rustc guarantees that the compiler_builtins crate is always linked last so its symbols will only be used if no other definition is available in the libraries listed in the linker args.
There are currently a few issues with this due to the fact that compiler-builtins isn't putting each intrinsic in its own object file (#412), but this is something that should be fixed within compiler-builtins.
The Raspberry Pi Silicon RP2040 is a dual-Cortex-M0+ based microcontroller, but it also has a Hardware Divide peripheral.
It it possible to mark
__udivmodsi4
(and/or similar) as weak symbols so we can replace them in a library crate? Or is there some other supported way to drop-in a faster platform-specific divide algorithm?Ref: rp-rs/rp-hal#278
The text was updated successfully, but these errors were encountered: