Datasheet

Table Of Contents
NOTE
A new calculation begins immediately with every write to an operand register, and a new operand write immediately
squashes any calculation currently in progress. For example, when dividing many numbers by the same divisor, only
xDIVIDEND needs to be written, and the signedness of each calculation is determined by whether SDIVIDEND or UDIVIDEND
is written.
To support save and restore on interrupt handler entry/exit (or on e.g. an RTOS context switch), the result registers are
also writable. Writing to a result register will cancel any operation in progress at the time. The DIV_CSR.DIRTY flag can
help make save/restore more efficient: this flag is set when any divider register (operand or result) is written to, and
cleared when the quotient is read.
NOTE
When enabled, the default divider AEABI support maps C level / and % to the hardware divider. When building software
using the Pico SDK and using the divider directly, it is important to read the quotient register last. This ensures the
partial divider state will be correctly saved and restored by any interrupt code that uses the divider. You should read
the quotient register whether you need the value or not.
The Pico SDK module pico_divider https://github.com/raspberrypi/pico-sdk/tree/pre_release/src/common/pico_divider/
include/pico/divider.h provides both the AEABI implementation needed to hook the C / and % operators for both 32-bit and
64-bit integer division, as well as some additional C functions that return quotients and remainders at the same time. All
of these functions correctly save and restore the hardware divider state (when dirty) so that they can be used in either
user or IRQ handler code.
The Pico SDK module hardware_divider https://github.com/raspberrypi/pico-sdk/tree/pre_release/src/rp2_common/
hardware_divider/include/hardware/divider.h provides lower level macros and helper functions for accessing the
hardware_divider, but these do not save and restore the hardware divider state (although this header does provide
separate functions to do so).
2.3.1.6. Interpolator
Each core is equipped with two interpolators (INTERP0 and INTERP1) which can accelerate tasks by combining certain pre-
configured operations into a single processor cycle. Intended for cases where the pre-configured operation is repeated
many times, this results in code which uses both fewer CPU cycles and fewer CPU registers in the time-critical sections of
the code.
The interpolators are used to accelerate audio operations within the Pico SDK, but their flexible configuration makes it
possible to optimise many other tasks such as quantization and dithering, table lookup address generation, affine texture
mapping, decompression and linear feedback.
RP2040 Datasheet
2.3. Processor subsystem 36