as described in https://bugs.libre-soc.org/show_bug.cgi?id=1044#c80 Knuth's Algorithm D needs inputs with the most-significant word being non-zero, so we have to find the number of leading zero words in our fixed-length inputs so we know how many words to tell Algorithm D is in the dynamically-sized inputs (basically, we just make Algorithm D ignore all the high-order zero words and act as if the inputs are really shorter than they are). so, count-leading-zeros, except we're counting zero words, not bits. https://git.libre-soc.org/?p=openpower-isa.git;a=blob;f=src/openpower/test/bigint/powmod.py;h=7fc794685bebb1f3c2451c64da041a0e81143e29;hb=d3c7a0ddc169877e8daf38a347091c366e85624b#l717 and https://git.libre-soc.org/?p=openpower-isa.git;a=blob;f=src/openpower/test/bigint/powmod.py;h=7fc794685bebb1f3c2451c64da041a0e81143e29;hb=d3c7a0ddc169877e8daf38a347091c366e85624b#l734 * TODO: replace count-leading-zero-words code with dd-ff.
ok so this is part of the dd-ffirstchanges i just actioned and added to the spec: ddffirst now implies mapreduce mode. this is *rel* important to make very clear with examples such as this one. if it can be actioned within the "Ongoing" grant bug 937 and/or the cryotoprimitives grant bug 589 that would be much better than leaving it to a future grant.
(In reply to Luke Kenneth Casson Leighton from comment #1) > if it can be actioned within the "Ongoing" grant bug 937 > and/or the cryotoprimitives grant bug 589 that would be > much better than leaving it to a future grant. I think we can toss it into cryptoprimitives, just stuff it under the mul-remap bug since I don't expect it to be big enough to deserve its own budget (1-2 days work).