Skip to content

Implemented ldexpf in assembly (subnormal input/output returns zero) #602

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

Merged
merged 2 commits into from
May 15, 2025

Conversation

ZERICO2005
Copy link
Contributor

@ZERICO2005 ZERICO2005 commented May 14, 2025

ldexpf has been implemented in assembly:

  • normal inputs are handled correctly, unless the output is subnormal
  • subnormal inputs/outputs return zero and set ERANGE and FE_INEXACT
  • zero/infinite/NaN inputs are handled correctly
  • Underflow returns positive zero for better compatibility with Ti floats. Negative zero is only returned when the input is negative zero

subnormal inputs/outputs will be handled via eZ80sf routines for efficient normalization and correct rounding in the future.

Optimized frexpf, reduces size by 5 bytes:

  • normal/subnormal: 1F faster
  • inf/NaN: 2F slower
  • zero: 7F + 1R + 1W + 1 slower (still faster than normal/subnormal)

@mateoconlechuga mateoconlechuga merged commit fc0ab8f into master May 15, 2025
9 checks passed
@mateoconlechuga mateoconlechuga deleted the opt_ldexpf branch May 15, 2025 00:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants