[Libre-soc-bugs] [Bug 1044] SVP64 implementation of pow(x,y,z)

bugzilla-daemon at libre-soc.org bugzilla-daemon at libre-soc.org
Fri Oct 6 04:25:39 BST 2023


https://bugs.libre-soc.org/show_bug.cgi?id=1044

--- Comment #24 from Jacob Lifshay <programmerjake at gmail.com> ---
I wrote the powmod assembly, and got a python equivalent working, however,
because divmod is really slow, running one powmod invocation is a few hundred
thousand simulated instructions (powmod calls divmod 256-512 times, divmod
loops 256 times, each inner loop is ~20 ops).

Therefore, I think I should implement Knuth's algorithm D instead of the shift
& subtract divmod algorithm we currently have, since I expect it to run 20-50x
faster.

I pushed to the programmerjake/powmod branch.

https://git.libre-soc.org/?p=openpower-isa.git;a=shortlog;h=f8467f43e8e04f84280ac5586f92222916df0676

commit f8467f43e8e04f84280ac5586f92222916df0676
Author: Jacob Lifshay <programmerjake at gmail.com>
Date:   Thu Oct 5 19:57:29 2023 -0700

    add WIP powmod_256 -- asm test is currently disabled since divmod is too
slow

commit f56b16a029c1e41b323b99f9514e04a42bba9c3a
Author: Jacob Lifshay <programmerjake at gmail.com>
Date:   Thu Oct 5 19:53:45 2023 -0700

    fix assemble to properly look for whole symbols to replace

    previously if there were labels foo and foobar, it would partially
    replace foobar giving 0x<addr>bar, which is wrong.

    also optimized to use dict instead of linear search for label names

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the libre-soc-bugs mailing list