projects
/
libreriscv.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f24a043
)
revert bitmask changes
author
Luke Kenneth Casson Leighton
<lkcl@lkcl.net>
Thu, 17 Mar 2022 06:14:16 +0000
(06:14 +0000)
committer
Luke Kenneth Casson Leighton
<lkcl@lkcl.net>
Thu, 17 Mar 2022 06:14:16 +0000
(06:14 +0000)
openpower/sv/bitmanip.mdwn
patch
|
blob
|
history
diff --git
a/openpower/sv/bitmanip.mdwn
b/openpower/sv/bitmanip.mdwn
index 3cfe2f6d881840514b72456980b461618db69503..468c5cca54674d3c1835776594b1016886a270ff 100644
(file)
--- a/
openpower/sv/bitmanip.mdwn
+++ b/
openpower/sv/bitmanip.mdwn
@@
-284,19
+284,22
@@
def MASK(x, y):
uint_xlen_t bmset(RS, RB, sh)
{
int shamt = RB & (XLEN - 1);
- return RS | MASK(shamt, sh)
+ mask = (2<<sh)-1;
+ return RS | (mask << shamt);
}
uint_xlen_t bmclr(RS, RB, sh)
{
int shamt = RB & (XLEN - 1);
- return RS & ~MASK(shamt, sh)
+ mask = (2<<sh)-1;
+ return RS & ~(mask << shamt);
}
uint_xlen_t bminv(RS, RB, sh)
{
int shamt = RB & (XLEN - 1);
- return RS ^ MASK(shamt, sh)
+ mask = (2<<sh)-1;
+ return RS ^ (mask << shamt);
}
uint_xlen_t bmext(RS, RB, sh)