From 227e2aa876891ef910004562ce6f278c3bb94a79 Mon Sep 17 00:00:00 2001 From: lkcl Date: Mon, 30 May 2022 10:23:11 +0100 Subject: [PATCH] --- openpower/sv/bitmanip.mdwn | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/openpower/sv/bitmanip.mdwn b/openpower/sv/bitmanip.mdwn index ca4d0acd3..b742b1db8 100644 --- a/openpower/sv/bitmanip.mdwn +++ b/openpower/sv/bitmanip.mdwn @@ -423,21 +423,28 @@ msb = ra[5:0]; rev[0:msb] = rb[msb:0]; rt = ZE(rev[msb:0]); -uint_xlen_t bmextrev(RA, RB, sh) +uint_xlen_t bmrevi(RA, RB, sh) { int shamt = XLEN-1; if (RA != 0) shamt = (GPR(RA) & (XLEN - 1)); shamt = (XLEN-1)-shamt; # shift other end - bra = bitreverse(RB) # swap LSB-MSB + brb = bitreverse(GPR(RB)) # swap LSB-MSB mask = (2<> shamt); + return mask & (brb >> shamt); +} + +uint_xlen_t bmrev(RA, RB, RC) { + return bmrevi(RA, RB, GPR(RC) & 0b111111); } ``` -| 0.5|6.10|11.15|16.20|21.26| 27..30 |31| name | -| -- | -- | --- | --- | --- | ------- |--| ------ | -| NN | RT | RA | RB | sh | 1111 |Rc| bmrevi | +| 0.5|6.10|11.15|16.20|21.26| 27..30 |31| name | Form | +| -- | -- | --- | --- | --- | ------- |--| ------ | -------- | +| NN | RT | RA | RB | sh | 1111 |Rc| bmrevi | MDS-Form | +| 0.5|6.10|11.15|16.20|21.25| 26..30 |31| name | Form | +| -- | -- | --- | --- | --- | ------- |--| ------ | -------- | +| NN | RT | RA | RB | RC | 11110 |Rc| bmrev | VA2-Form | # grevlut -- 2.30.2