(no commit message)
[libreriscv.git] / openpower / sv / svp64.mdwn
index 863622daac9e9008d1effd46f661f0b12071b0e8..8a578031f76101bc48409f26c34c7aa6fcb0fd0c 100644 (file)
@@ -82,7 +82,7 @@ linearly to larger sizes; SV Vectorisation iterates sequentially through these r
 Where the integer regfile in standard scalar
 OpenPOWER v3.0B/v3.1B is r0 to r31, SV extends this as r0 to r127.
 Likewise FP registers are extended to 128 (fp0 to fp127), and CRs are
-extended to 64 entries, CR0 thru CR63.
+extended to 128 entries, CR0 thru CR127.
 
 The names of the registers therefore reflects a simple linear extension
 of the OpenPOWER v3.0B / v3.1B register naming, and in hardware this
@@ -467,6 +467,12 @@ EXTRA is the means by which two things are achieved:
 2. Register field numbers (limited typically to 5 bit)
    are extended in range, both for Scalar and Vector.
 
+The register files are therefore extended:
+
+* INT is extended from r0-31 to 128
+* FP is extended from fp0-32 to 128
+* CR is extended from CR0-7 to CR0-127
+
 In the following tables register numbers are constructed from the
 standard v3.0B / v3.1B 32 bit register field (RA, FRA) and the EXTRA2
 or EXTRA3 field from the SV Prefix.  The prefixing is arranged so that
@@ -484,6 +490,9 @@ A pseudocode algorithm explains the relationship, for INT/FP (see [[svp64/append
     else:         # scalar
          return (spec[0:1] << 5) | RA
 
+Future versions may extend to 256 by shifting Vector numbering up.
+Scalar will not be altered.
+
 ## INT/FP EXTRA3
 
 alternative which is understandable and, if EXTRA3 is zero, maps to
@@ -492,45 +501,56 @@ encodings used in the original SV Prefix scheme.  the reason why they
 were chosen is so that scalar registers in v3.0B and prefixed scalar
 registers have access to the same 32 registers.
 
-| R\*\_EXTRA3 | Mode | Range | MSB downto LSB |
+Fields are as follows:
+
+* Value: R_EXTRA3
+* Mode: register is tagged as scalar or vector
+* Range/Inc: the range of registers accessible from this EXTRA
+  encoding, and the "increment" (accessibility). "/4" means
+  that this EXTRA encoding may only give access (starting point)
+  every 4th register.
+* MSB..LSB: the bit field showing how the register opcode field
+  combines with EXTRA to give (extend) the register number (GPR)
+
+| Value | Mode | Range/Inc | 6..0 |
 |-----------|-------|---------------|---------------------|
-| 000       | Scalar | `r0-r31` | `0b00 RA`      |
-| 001       | Scalar | `r32-r63` | `0b01 RA`      |
-| 010       | Scalar | `r64-r95` | `0b10 RA`      |
-| 011       | Scalar | `r96-r127` | `0b11 RA`      |
-| 100       | Vector | `r0-r124` | `RA 0b00`      |
-| 101       | Vector | `r1-r125` | `RA 0b01`      |
-| 110       | Vector | `r2-r126` | `RA 0b10`      |
-| 111       | Vector | `r3-r127` | `RA 0b11`      |
+| 000       | Scalar | `r0-r31`/1 | `0b00 RA`      |
+| 001       | Scalar | `r32-r63`/1 | `0b01 RA`      |
+| 010       | Scalar | `r64-r95`/1 | `0b10 RA`      |
+| 011       | Scalar | `r96-r127`/1 | `0b11 RA`      |
+| 100       | Vector | `r0-r124`/4 | `RA 0b00`      |
+| 101       | Vector | `r1-r125`/4 | `RA 0b01`      |
+| 110       | Vector | `r2-r126`/4 | `RA 0b10`      |
+| 111       | Vector | `r3-r127`/4 | `RA 0b11`      |
 
 ## INT/FP EXTRA2
 
 alternative which is understandable and, if EXTRA2 is zero will map to
 "no effect" i.e Scalar OpenPOWER register naming:
 
-| R\*\_EXTRA2 | Mode | Range | MSB down to LSB |
-|-----------|-------|---------------|---------------------|
-| 00       | Scalar | `r0-r31` | `0b00 RA`                |
-| 01       | Scalar | `r32-r63` | `0b01 RA`      |
-| 10       | Vector | `r0-r124` | `RA 0b00`      |
-| 11       | Vector | `r2-r126` | `RA 0b10`   |
+| Value | Mode | Range/inc | 6..0 |
+|-----------|-------|---------------|-----------|
+| 00       | Scalar | `r0-r31`/1 | `0b00 RA`     |
+| 01       | Scalar | `r32-r63`/1 | `0b01 RA`      |
+| 10       | Vector | `r0-r124`/4 | `RA 0b00`      |
+| 11       | Vector | `r2-r126`/4 | `RA 0b10`   |
 
 ## CR EXTRA3
 
-CR encoding is essentially the same but made more complex due to CRs being bit-based.  See separate section for explanation and pseudocode.
+CR encoding is essentially the same but made more complex due to CRs being bit-based.  See [[svp64/appendix]] for explanation and pseudocode.
 
  Encoding shown MSB down to LSB
 
-| R\*\_EXTRA3 | Mode | 7..5    | 4..2    | 1..0    |
-|-------------|------|---------| --------|---------|
-| 000       | Scalar | 0b000   | BA[4:2] | BA[1:0] |
-| 001       | Scalar | 0b001   | BA[4:2] | BA[1:0] |
-| 010       | Scalar | 0b010   | BA[4:2] | BA[1:0] |
-| 011       | Scalar | 0b011   | BA[4:2] | BA[1:0] |
-| 100       | Vector | BA[4:2] | 0b000   | BA[1:0] |
-| 101       | Vector | BA[4:2] | 0b010   | BA[1:0] |
-| 110       | Vector | BA[4:2] | 0b100   | BA[1:0] |
-| 111       | Vector | BA[4:2] | 0b110   | BA[1:0] |
+| Value | Mode | Range/Inc     | 8..5      | 4..2    | 1..0    |
+|-------|------|---------------|-----------| --------|---------|
+| 000   | Scalar | `CR0-CR7`/1   | 0b0000    | BA[4:2] | BA[1:0] |
+| 001   | Scalar | `CR8-CR15`/1  | 0b0001    | BA[4:2] | BA[1:0] |
+| 010   | Scalar | `CR16-CR23`/1 | 0b0010    | BA[4:2] | BA[1:0] |
+| 011   | Scalar | `CR24-CR31`/1 | 0b0011    | BA[4:2] | BA[1:0] |
+| 100   | Vector | `CR0-CR112`/16 | BA[4:2] 0 | 0b000   | BA[1:0] |
+| 101   | Vector | `CR4-CR116`/16 | BA[4:2] 0 | 0b100   | BA[1:0] |
+| 110   | Vector | `CR8-CR120`/16 | BA[4:2] 1 | 0b000   | BA[1:0] |
+| 111   | Vector | `CR12-CR124`/16 | BA[4:2] 1 | 0b100   | BA[1:0] |
 
 ## CR EXTRA2
 
@@ -538,12 +558,12 @@ CR encoding is essentially the same but made more complex due to CRs being bit-b
 
 Encoding shown MSB down to LSB
 
-| R\*\_EXTRA2 | Mode   | 7..5    | 4..2    | 1..0    |
-|-------------|--------|---------|---------|---------|
-| 00          | Scalar | 0b000   | BA[4:2] | BA[1:0] |
-| 01          | Scalar | 0b001   | BA[4:2] | BA[1:0] |
-| 10          | Vector | BA[4:2] | 0b000   | BA[1:0] |
-| 11          | Vector | BA[4:2] | 0b100   | BA[1:0] |
+| Value | Mode   | Range/Inc      | 8..5    | 4..2    | 1..0    |
+|-------|--------|----------------|---------|---------|---------|
+| 00    | Scalar | `CR0-CR7`/1    | 0b0000  | BA[4:2] | BA[1:0] |
+| 01    | Scalar | `CR8-CR15`/1   | 0b0001  | BA[4:2] | BA[1:0] |
+| 10    | Vector | `CR0-CR112`/16 | BA[4:2] 0 | 0b000   | BA[1:0] |
+| 11    | Vector | `CR8-CR120`/16 | BA[4:2] 1 | 0b000   | BA[1:0] |
 
 # Appendix