ridiculousfish / libdivide

Official git repository for libdivide: optimized integer division
http://libdivide.com
Other
1.1k stars 79 forks source link

Add _do_raw functions for 32 & 64 bit types #119

Closed adbancroft closed 1 month ago

adbancroft commented 2 months ago

Libdivide already had libdivide_s16_do_raw & libdivide_u16_do_raw: this PR expands that idiom to 32 & 64 bit types.

This is useful to save a few bytes of memory on embedded Harvard architecture systems: the magic & more values can be pre-computed and then placed directly at the call site. This places the values in the .text section (ends up in flash memory, plentiful) rather than the .bss section (runtime memory, highly constrained).