Skip to content

Conversation

@ZERICO2005
Copy link
Contributor

@ZERICO2005 ZERICO2005 commented Sep 21, 2025

Implements (u)lltod in assembly and optimizes (u)ltod.

Since long double has 53 bits of precision, 64 bit integers may be rounded. (u)lltod can detect if rounding occurs and raise FE_INEXACT. This can be enabled/disabled with the define __lltod_signal_FE_INEXACT := 1 at the top of ltod.src. The rounding is hard coded to round-to-nearest with ties-to-even.

(u)lltod can switch between calling __lladd_1 or having it inlined.

@ZERICO2005
Copy link
Contributor Author

On the topic of raising FE_INEXACT, I think it should only be raised if (u)ltof raises FE_INEXACT, which it currently does not. So I will disable raising FE_INEXACT in (u)lltod to be consistent with other routines.

@ZERICO2005 ZERICO2005 merged commit 529c558 into master Oct 15, 2025
9 checks passed
@ZERICO2005 ZERICO2005 deleted the lltod_asm branch October 15, 2025 21:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

1 participant