Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More quirc_float_t #141

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

zougloub
Copy link

@zougloub zougloub commented Feb 15, 2024

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.

…enom

This avoids back and forth conversions from int/double to float if
quirc_float_t is float.
@zougloub zougloub force-pushed the cJ-float-consistency branch from 6b67e97 to 75ab5aa Compare February 15, 2024 23:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant