[Core] RP2040: use built-in integer hardware divider and optimized i64 multiplication #18464
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
The rp2040 cortex m0+ cores do not implement an integer divider itself, but instead the rp2040 provides two on-chip hardware dividers as an extra peripheral. To use those the GCC arm-v6 eabi integer division and modulo built-ins have to be replaced with implementations that utilize them. An optimized i64 multiplication implementation is provided as well.
these functions are implemented directly and do not need the pico vtable mechanism as the float/double functions
Benchmark
Reference metric is completed QMK keyboard tasks per second:
Types of Changes
Issues Fixed or Closed by This PR
Checklist