From: Luke Kenneth Casson Leighton Date: Tue, 9 Jan 2024 14:00:57 +0000 (+0000) Subject: bug 1244: add url to original source of pos popcount X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ce7300b40b23fa227c84d9af0bb2664e76d41277;p=libreriscv.git bug 1244: add url to original source of pos popcount --- diff --git a/conferences/fosdem2024/fosdem2024_ddffirst/fosdem2024_ddffirst.tex b/conferences/fosdem2024/fosdem2024_ddffirst/fosdem2024_ddffirst.tex index 58550e992..2c17909dd 100644 --- a/conferences/fosdem2024/fosdem2024_ddffirst/fosdem2024_ddffirst.tex +++ b/conferences/fosdem2024/fosdem2024_ddffirst/fosdem2024_ddffirst.tex @@ -183,10 +183,12 @@ for (i = 0; i < VL; i++) \begin{itemize} \item Positional popcount adds up the totals of each bit set to 1 in each bit-position, of an array of input values. \item Notoriously difficult to do in SIMD assembler: typically 550 lines + \item https://github.com/clausecker/pospop \end{itemize} \lstinputlisting[language={}]{pospopcount.c} + } diff --git a/conferences/fosdem2024/fosdem2024_ddffirst/pospopcount.c b/conferences/fosdem2024/fosdem2024_ddffirst/pospopcount.c index df0983aee..35e252dcb 100644 --- a/conferences/fosdem2024/fosdem2024_ddffirst/pospopcount.c +++ b/conferences/fosdem2024/fosdem2024_ddffirst/pospopcount.c @@ -1,7 +1,6 @@ /*Copyright (c) 2020 Robert Clausecker fuz@fuz.su count8 reference implementation */ -func count8safe(counts *[8]int, buf []uint8) { - for i := range buf - for j := 0; j < 8; j++ - counts[j] += int(buf[i] >> j & 1) -} +count8safe(counts *[8]int, buf []uint8) + for i := range buf + for j := 0; j < 8; j++ + counts[j] += int(buf[i] >> j & 1)