projects
/
libreriscv.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b03132a
)
(no commit message)
author
lkcl
<lkcl@web>
Sun, 23 Oct 2022 10:59:00 +0000
(11:59 +0100)
committer
IkiWiki
<ikiwiki.info>
Sun, 23 Oct 2022 10:59:00 +0000
(11:59 +0100)
openpower/sv/bitmanip.mdwn
patch
|
blob
|
history
diff --git
a/openpower/sv/bitmanip.mdwn
b/openpower/sv/bitmanip.mdwn
index 3b8ee8bf74ee6aa35ec9e2d4566c22104dbe0fc0..688dede42da91091ff791e48d1b51674d3a9c77e 100644
(file)
--- a/
openpower/sv/bitmanip.mdwn
+++ b/
openpower/sv/bitmanip.mdwn
@@
-245,11
+245,13
@@
Replaces a pair of explicit instructions in hot-loops.
```
uint_xlen_t shadd(uint_xlen_t rs1, uint_xlen_t rs2, uint8_t sh) {
+ sh = sh & 0x3;
return (rs1 << (sh+1)) + rs2;
}
uint_xlen_t shadduw(uint_xlen_t rs1, uint_xlen_t rs2, uint8_t sh) {
uint_xlen_t rs1z = rs1 & 0xFFFFFFFF;
+ sh = sh & 0x3;
return (rs1z << (sh+1)) + rs2;
}
```