From: lkcl Date: Sat, 12 Mar 2022 23:40:03 +0000 (+0000) Subject: (no commit message) X-Git-Tag: opf_rfc_ls005_v1~3085 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b926cd9eba021625faa94c37b024830a5be37807;p=libreriscv.git --- diff --git a/openpower/sv/bitmanip.mdwn b/openpower/sv/bitmanip.mdwn index 60a6b8409..c023f6cec 100644 --- a/openpower/sv/bitmanip.mdwn +++ b/openpower/sv/bitmanip.mdwn @@ -93,7 +93,7 @@ TODO: convert all instructions to use RT and not RS | NN | RT | RA | RB | | 00 |0 | rsvd | | NN | RT | RA | RB | im0-4 | im5-7 00 |1 | grevlog | | NN | RT | RA | s0-4 | im0-4 | im5-7 01 |s5| grevlogi | -| NN | RT | RA | RB | sh0-4 | mode 010 |Rc| bitmask* | +| NN | RT | RA | RB | RC | mode 010 |Rc| bitmask* | | NN | RS | RA | RB | RC | 00 011 |0 | gfbmadd | | NN | RS | RA | RB | RC | 00 011 |1 | gfbmaddsub | | NN | RS | RA | RB | RC | 01 011 |0 | clmadd | @@ -283,36 +283,41 @@ bmset(RA=0, RB=0, RC=mask) will produce a run of ones of length "mask" in a sing | 0.5|6.10|11.15|16.20|21.25| 26..30 |31| name | | -- | -- | --- | --- | --- | ------- |--| ----- | -| NN | RT | RA | RB | RC | mode 010 |Rc| bm* | +| NN | RS | RA | RB | RC | mode 010 |Rc| bm* | +Immediate-variant is an overwrite form: + +| 0.5|6.10|11.15|16.20| 21 | 22.23 | 24....30 |31| name | +| -- | -- | --- | --- | -- | ----- | -------- |--| ---- | +| NN | RS | RB | sh | SH | itype | 1000 110 |Rc| bm*i | ``` -uint_xlen_t bmset(RA, RB, sh) +uint_xlen_t bmset(RS, RB, sh) { int shamt = RB & (XLEN - 1); mask = (2<> shamt); + return mask & (RS >> shamt); } ```