-
Notifications
You must be signed in to change notification settings - Fork 212
Open
Description
Creating this issue in order to pull the discussion regarding a mp_isone()
macro out of #532
Following up on #532 (comment)
[...] It might be tempting to generalize it but since the size of a
mp_digit
is not fixed over different architectures it would get too complex.
I just thought about it a bit more and had a look into mp_cmp_d()
and only then realized that #define mp_isone(a) ( ((a)->used == 1u) && ((a)->dp[0] == 1u) )
would falsely claim -1
as one
...
So I have some follow up questions:
- maybe it'd be a better idea to have an inline version of
mp_cmp_d()
?- does the function-call overhead really matter that much? I can imagine that it matters, but have no clue to what extent. Did someone measure this?
- are there any other candidates that could/should be inlined?
- how will we do that? We're still providing C89 support, so I guess we can't expect all those compilers being able to handle inline functions correctly.
- maybe it's time to think about starting to merge in tfm?
- Which functions should we start with?
- Which architectures?
justinethier
Metadata
Metadata
Assignees
Labels
No labels