[Libre-soc-bugs] [Bug 904] Formal proof for pop-count

bugzilla-daemon at libre-soc.org bugzilla-daemon at libre-soc.org
Fri Aug 5 10:52:29 BST 2022


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

--- Comment #4 from Jacob Lifshay <programmerjake at gmail.com> ---
(In reply to Luke Kenneth Casson Leighton from comment #2)
> renember there is already a treereduce function
> in nmutil, please do not duplicate it, it will
> be embarrassing to publicly announce that two
> identical functions are present in an EU funded
> project.

I didn't remember that. The version I added (tree_reduction) is still useful
because iirc it matches the reduction algorithm used by SVP64 (without
predication), whereas treereduce doesn't -- it instead matches the algorithm
used by Arm SVE's reduction ops.

also, tree_reduction is a very simple wrapper around partial_prefix_sum_ops
which is a prefix sum that allows you to choose which outputs you want and
eliminates unnecessary operations, leaving just the operations needed for just
those outputs.

an additional benefit of the version I wrote is you can easily get the full
list of operations run by the tree reduction, just:
list(tree_reduction_ops(...))

https://git.libre-soc.org/?p=nmutil.git;a=blob;f=src/nmutil/prefix_sum.py;hb=1b02a4882e2eaacd1a2fdb31f9ee302e346b33d1#l267

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


More information about the libre-soc-bugs mailing list