(no commit message)
[libreriscv.git] / openpower / sv / bitmanip.mdwn
index 057cf2bb893a7d39ad55a669a46615493d8f69c2..25cd54eaf75624a47d7be87d06b811627ca5b578 100644 (file)
@@ -60,10 +60,10 @@ minor opcode allocation
 | -- | -- | --- | --- | ----- | -------- |--| ------ |
 | NN | RT | RA  | RB  | RC    | mode 001 |Rc| ternary |
 | NN | RT | RA  | RB  | im0-4 | im5-7 00 |Rc| ternaryi |
-| NN | RS | RA  | RB  | deg   | 00  011  |Rc| gfmul |
+| NN | RS | RA  | RB  | RC    | 00  011  |Rc| gfmul |
 | NN | RS | RA  | RB  | deg   | 01  011  |Rc| gfadd |
 | NN | RT | RA  | RB  | deg   | 10  011  |Rc| gfinv |
-| NN | RS | RA  | RB  | deg   | 11  011  |Rc| gfmod |
+| NN | RS | RA  | RB  | deg   | 11  011  |Rc| gfmuli |
 
 | 0.5|6.10|11.15| 16.23 |24.27 | 28.30 |31| name |
 | -- | -- | --- | ----- | ---- | ----- |--| ------ |
@@ -83,6 +83,9 @@ ops
 | NN | RA | RB  |     |       | 1  | 0100 110 |Rc| rsvd |
 | NN | RA | RB  | sh  | itype | SH | 1000 110 |Rc| bmopsi |
 | NN | RA | RB  |     |       |    | 1100 110 |Rc| rsvd |
+| NN | RA | RB  |     |       |    | 1100 110 |Rc| rsvd |
+| NN | RA | RB  |     |       |    | 1100 110 |Rc| rsvd |
+| NN | RA | RB  |     |       |    | 1100 110 |Rc| rsvd |
 | NN | RA | RB  |     |       | 0  | 0001 110 |Rc| rsvd |
 | NN | RA | RB  |     |       | 0  | 0101 110 |Rc| rsvd |
 | NN | RA | RB  | RC  | 00    | 0  | 0010 110 |Rc| gorc |
@@ -246,7 +249,7 @@ bmrev however there is no direct equivalent and consequently a bmrevi is require
 | -- | -- | --- | --- | --- | ------- |--| ----- |
 | NN | RT | RA  | RB  | RC  | mode 010 |Rc| bm*   |
 | NN | RT | RA  | RB  | RC  | 0 1  111 |Rc| bmrev |
-| NN |    |     |     |     | 1 1  111 |Rc| rsvd |
+
 
 ```
 uint_xlen_t bmset(RA, RB, sh)
@@ -511,10 +514,12 @@ this requires 3 parameters and a "degree"
 realistically with the degree also needing to be an immediate it should be brought down to an overwrite version:
 
     RS = GFMUL(RS, RA, gfdegree, modulo=RB)
+    RS = GFMUL(RS, RA, gfdegree=RC, modulo=RB)
 
 | 0.5|6.10|11.15|16.20|21.25| 26..30  |31|
 | -- | -- | --- | --- | --- | ------- |--|
 | NN | RS | RA  | RB  | deg | 00  011 |Rc|
+| NN | RS | RA  | RB  | RC  | 11  011 |Rc|
 
 where the SimpleV variant may override RS-as-src differently from RS-as-dest
 
@@ -571,10 +576,14 @@ if __name__ == "__main__":
 ## GF add
 
     RS = GFADD(RS, RA|0, gfdegree, modulo=RB)
+    RS = GFADDI(RS, RA|0, gfdegree=RC, modulo=RB)
 
-| 0.5|6.10|11.15|16.20|21.25| 26..30  |31|
-| -- | -- | --- | --- | --- | ------- |--|
-| NN | RS | RA  | RB  | deg | 01  011 |Rc|
+| 0.5|6.10|11.15|16.20|21.25| 26..30  |31| name  |
+| -- | -- | --- | --- | --- | ------- |--| ----- |
+| NN | RS | RA  | RB  | RC  | 0 1  011 |Rc| gfadd |
+| NN | RS | RA  | RB  | RC  | 1 1  111 |Rc| gfaddi |
+
+GFMOD is a pseudo-op where RA=0
 
 ## gf invert
 
@@ -610,10 +619,6 @@ def gf_invert(a, mod=0x1B) :
   return g1
 ```
 
-## GF mod
-
-modulo arithmetic to ensure a polynomial is in range seems sensible to have.
-
 # bitmatrix
 
 ```