Skip to content

Conversation

albinahlback
Copy link
Collaborator

@albinahlback albinahlback commented Mar 22, 2024

Edit: Also solves #1879

@fredrik-johansson
Copy link
Collaborator

BTW, it might be possible to avoid the need for a carry-out. I will make an issue about that.

@albinahlback
Copy link
Collaborator Author

Hmm, I think we should investigate this before we go further. While hardcoded routines are sort of easy for me, the generic ones are considerably harder for me. Would be nice to just utilize GMP's mpn_mullo_basecase if it is possible.

@albinahlback
Copy link
Collaborator Author

albinahlback commented Mar 26, 2024

@fredrik-johansson

        mullo_basecase / FLINT || mul / mullow
n =  1:            1.20x       ||     1.00
n =  2:            1.16x       ||     1.14
n =  3:            0.92x       ||     1.32
n =  4:            1.16x       ||     1.28
n =  5:            1.26x       ||     1.27
n =  6:            1.30x       ||     1.30
n =  7:            1.22x       ||     1.29
n =  8:            1.23x       ||     1.32
n =  9:            1.16x       ||     1.42
n = 10:            1.13x       ||     1.47
n = 11:            1.08x       ||     1.49
n = 12:            1.06x       ||     1.50
n = 13:            1.05x       ||     1.50
n = 14:            1.03x       ||     1.54
n = 15:            1.03x       ||     1.37
n = 16:            1.02x       ||     1.40
n = 17:            1.00x       ||     1.49
n = 18:            1.00x       ||     1.45
n = 19:            0.99x       ||     1.53
n = 20:            1.00x       ||     1.45
n = 21:            0.99x       ||     1.54
n = 22:            1.00x       ||     1.47
n = 23:            0.99x       ||     1.53
n = 24:            0.99x       ||     1.47
n = 25:            0.99x       ||     1.51
n = 26:            0.99x       ||     1.44
n = 27:            0.99x       ||     1.50
n = 28:            0.99x       ||     1.46
n = 29:            0.99x       ||     1.40
n = 30:            0.99x       ||     1.30

I.e. very good on Skylake when taking into account that we calculate an extra limb.

@albinahlback
Copy link
Collaborator Author

Valgrind looks OK for this, so I'll merge!

@albinahlback albinahlback merged commit 5a88847 into flintlib:main Mar 26, 2024
@albinahlback albinahlback deleted the mpn_mullow branch January 15, 2025 01:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants