-
Notifications
You must be signed in to change notification settings - Fork 215
make mp_sqr and mp_div_3 internal and add optimizations #450
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
Conversation
|
@nijtmans For example in Tcl, does it use mp_sqr there or always calls mp_mul? Then it might make sense to push this optimization to ltm. Furthermore we could think about removing mp_sqr from the public api alltogether and replacing it by a macro |
|
The advantage of making sqr purely an internal optimization of sqr is certainly that if the lib is downstripped to the bare minimum, the sqr functions could be removed completely. And mp_sqr could still be used via the macro. |
|
Fwiw, I don't believe MoarVM uses mp_sqr.
…On Wed, Nov 6, 2019 at 1:53 PM Daniel Mendler ***@***.***> wrote:
The advantage of making sqr purely an internal optimization of sqr is
certainly that if the lib is downstripped to the bare minimum, the sqr
functions could be removed completely. And mp_sqr could still be used via
the macro.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#450?email_source=notifications&email_token=ACOHYULFDFNEVHPURC7X7T3QSLD5VA5CNFSM4JJVBTZ2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEDGTCXI#issuecomment-550318429>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACOHYUL2P4G5PEASJ3YADITQSLD5VANCNFSM4JJVBTZQ>
.
|
czurnieden
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, but deprecate it formally, please, if you want to privatize mp_sqr.
We will do deprecations in 1.x when we remove the functions in develop. I will prepare a backport for that. |
|
I also made mp_div_3 internal since it is only an optimization. I added more optimizations to mp_div_d and mp_mul_d. |
czurnieden
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yepp, looks nice.
nijtmans
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tcl only uses mp_sqr() in 2 lines of code, so that's 2 minutes change-time. The less API's the better, so I agree with this change
|
mp_sqr will stay as macro btw. The point is really API surface reduction. |
|
@sjaeckel this is ready from my side |
|
@sjaeckel Rebased |
Do we want that or do we want the user to explicitly call mp_sqr if the sqr function should be used?
GMP does this optimization I think, but they also don't expose a sqr function in the API.