From: shriya Date: Wed, 6 Dec 2023 14:46:07 +0000 (+0000) Subject: (no commit message) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=3ba9e52c9310e96ff02439df8ac94d53bd956d67;p=libreriscv.git --- diff --git a/openpower/sv/cookbook/pospopcnt.mdwn b/openpower/sv/cookbook/pospopcnt.mdwn index 1607d618b..cec72685f 100644 --- a/openpower/sv/cookbook/pospopcnt.mdwn +++ b/openpower/sv/cookbook/pospopcnt.mdwn @@ -42,14 +42,6 @@ sv.add *16,*16,*24 # and accumulate in results sv.bc/all 16, *0, -0x28 # reduce CTR by VL and stop if -ve ``` -Array popcount is just standard popcount function -([[!wikipedia Hamming weight]]) on an array of values, horizontally, -however positional popcount is different (vertical) - - - -Positional popcount adds up the totals of each bit set to 1 in each -bit-position, of an array of input values. pospopcnt + + +Array popcount is just standard popcount function +([[!wikipedia Hamming weight]]) on an array of values, horizontally, +however positional popcount is different (vertical). Refer to Fig.1 + + + +Positional popcount adds up the totals of each bit set to 1 in each +bit-position, of an array of input values. Refer to Fig.2 +
+# Visual representation of the pospopcount algorithm + pospopcnt @@ -79,7 +84,6 @@ bit-position, of an array of input values. alt="pospopcnt" width="100%" /> -# Visual representation of the pospopcount algorithm # Walkthrough of the assembler