projects
/
libreriscv.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b64f0a2
)
(no commit message)
author
lkcl
<lkcl@web>
Wed, 2 Oct 2019 07:31:32 +0000
(08:31 +0100)
committer
IkiWiki
<ikiwiki.info>
Wed, 2 Oct 2019 07:31:32 +0000
(08:31 +0100)
simple_v_extension/specification/bitmanip.mdwn
patch
|
blob
|
history
diff --git
a/simple_v_extension/specification/bitmanip.mdwn
b/simple_v_extension/specification/bitmanip.mdwn
index 25acef4690a985db5cb77a30da972215ae89766b..d38b4246f9ab85ca81e2bded3c798ab7a515f6ee 100644
(file)
--- a/
simple_v_extension/specification/bitmanip.mdwn
+++ b/
simple_v_extension/specification/bitmanip.mdwn
@@
-80,6
+80,15
@@
output instruction pseudoinstruction
population-count
+Pseudocode:
+
+ unsigned int v; // count the number of bits set in v
+ unsigned int c; // c accumulates the total bits set in v
+ for (c = 0; v; c++)
+ {
+ v &= v - 1; // clear the least significant bit set
+ }
+
## ffirst - find first bit
finds the first bit set as an index.