Closed alwon1 closed 1 year ago
Support for these is implemented. You can check https://github.com/rp-rs/rp-hal/tree/main/rp2040-hal%2Fsrc%2Ffloat
Unless you enable the rp2040-hal feature disable-intrinsics
, you'll be using the accelerated version rather than the software implementation.
You do miss the f64 instructions if you don't enable the rom-v2-intrinsics
feature - but we don't enable that by default because some people have early revision chips
Looks like I missed that. Is it possible to add documentation about those flags in this repo?
Sounds like a good idea. Would you like to do it?
In Section 2.8.3.1. Bootrom Functions of the RP2040 Datasheet mentions several floating-point math functions implemented that should have better performance than what would typically be produced by the compiler as they use additional hardware to improve the performance of these functions.
It has been a while since I looked at this, but the C SDK uses these as the default math functions by using them as a replacement for the standard compiler built-in functions. If this is the case, passing these functions through to LLVM during compilation could improve the performance of these math operations by default.
The Most important to implement would be the functions in divider.h in the C SDK, as they are the most likely to be used.