quirc
quirc copied to clipboard
More quirc_float_t
I was checking out what's new and noticed @igrr 's float customization work, but also noticed that it was missing the static casting of constants, which at least GCC is missing (perhaps it could optimize with -ffast-math
).
I also took the liberty of changing repetitive divisions by the same value, to use of the reciprocal of the value.
I validated that there were no more unwanted double stuff on my x86 station as well as with:
make \
CC="arm-none-eabi-gcc" \
CFLAGS="-DQUIRC_USE_TGMATH -D QUIRC_FLOAT_TYPE=float -mthumb -Os"
In this configuration, these changes are shaving off a whopping 51 bytes from the code size!
Note: This contribution was minimally tested and unreviewed.