From b3d665654e7d7601a9c01f1020709fae6058f8e8 Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Tue, 5 Dec 2023 14:14:14 +0000 Subject: [PATCH] rename pospopcount image, split into two --- .../sv/cookbook/{popcount.svg => 1_popcount.svg} | 0 openpower/sv/cookbook/2_popcount.svg | 4 ++++ openpower/sv/cookbook/pospopcnt.mdwn | 11 +++++++++-- 3 files changed, 13 insertions(+), 2 deletions(-) rename openpower/sv/cookbook/{popcount.svg => 1_popcount.svg} (100%) create mode 100644 openpower/sv/cookbook/2_popcount.svg diff --git a/openpower/sv/cookbook/popcount.svg b/openpower/sv/cookbook/1_popcount.svg similarity index 100% rename from openpower/sv/cookbook/popcount.svg rename to openpower/sv/cookbook/1_popcount.svg diff --git a/openpower/sv/cookbook/2_popcount.svg b/openpower/sv/cookbook/2_popcount.svg new file mode 100644 index 000000000..69c99d14c --- /dev/null +++ b/openpower/sv/cookbook/2_popcount.svg @@ -0,0 +1,4 @@ + + + +
RESULT 1
RESULT 1
RESULT 2
RESULT 2
RESULT 3
RESULT 3
RESULT n
RESULT n
ARRAY POPCOUNT
ARRAY POPCOUNT
POSITIONAL POPCOUNT
POSITIONAL POPCOUNT
RESULT 1
RESULT 1
RESULT 2
RESULT 2
RESULT n
RESULT n
Text is not SVG - cannot display
\ No newline at end of file diff --git a/openpower/sv/cookbook/pospopcnt.mdwn b/openpower/sv/cookbook/pospopcnt.mdwn index 22ca3077e..2c9b6533b 100644 --- a/openpower/sv/cookbook/pospopcnt.mdwn +++ b/openpower/sv/cookbook/pospopcnt.mdwn @@ -42,9 +42,16 @@ 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 whereas positional popcount adds up the totals of each bit set to 1 in each bit-position, of an array of input values. +Array popcount is just standard popcount function +([[!wikipedia Hamming weight]]) on an array of values, horizontally, +however positional popcount is different (vertical) -pospopcnt +pospopcnt + +Positional popcount adds up the totals of each bit set to 1 in each +bit-position, of an array of input values. + +pospopcnt [[!tag svp64_cookbook ]] -- 2.30.2