From: lkcl Date: Mon, 19 Jun 2023 10:52:17 +0000 (+0100) Subject: (no commit message) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=747c7e792dc1352dec62c23b7eb520d0d497a9a5;p=libreriscv.git --- diff --git a/openpower/sv/po9_encoding/discussion.mdwn b/openpower/sv/po9_encoding/discussion.mdwn index e92ae8137..78f256513 100644 --- a/openpower/sv/po9_encoding/discussion.mdwn +++ b/openpower/sv/po9_encoding/discussion.mdwn @@ -102,31 +102,7 @@ Length detection: else return 64 ``` -# alternative 32-64 encoding (3) **current** - -this idea gets even simpler. the 55-bit area is eliminated and may only be -reintroduced by sacrificing parts of EXT200-263. - -``` -|0-5| 6-29 |30 31|32-37 | 38-663 | Description | -|---|--------|-----|--------|--------|------------------| -|PO9| xxxx | x x | 010001 | //// | RESERVED | -|PO9| xxxx | x x | 000001 | //// | RESERVED | -|PO9| !ZERO | 1 1 | !PO9 | xxxx | SSingle:EXT232-263 | -|PO9| 0000 | 1 1 | !PO9 | xxxx | Scalar EXT232-263 | -|PO9| SVRM | 1 0 | !PO9 | xxxx | SVP64:EXT232-263 | -|PO9| 0000 | 0 1 | Defined Word-instruction | 32-bit EXT300-363 | -|PO9| !ZERO | 0 1 | Defined Word-instruction | SSingle:EXT000-063 | -|PO9| SVRM | 0 0 | Defined Word-instruction | SVP64:EXT000-063 | -``` -* bit 31 is "SSingle" -* bit 30 is EXT200-263 if set otherwise EXT000-063 - -This was one of the original early PO9 Encodings. - -# alternative **no 32 encoding* (4) **current** - - +# alternative **no 32 encoding** (3) **current** aim of this idea is to attempt simplification of area identification and length. the 55-bit area is eliminated and may only be reintroduced @@ -300,3 +276,135 @@ test. Only EXT000-063 is not by a "process of elimination" (if ... return True) return True ``` +# alternative 32-64 encoding (4) **current** + +this idea gets even simpler. the 55-bit area is eliminated and may only be +reintroduced by sacrificing parts of EXT200-263. + +``` +|0-5| 6-29 |30 31|32-37 | 38-663 | Description | +|---|--------|-----|--------|--------|------------------| +|PO9| xxxx | x x | 010001 | //// | RESERVED | +|PO9| xxxx | x x | 000001 | //// | RESERVED | +|PO9| !ZERO | 1 1 | !PO9 | xxxx | SSingle:EXT232-263 | +|PO9| 0000 | 1 1 | !PO9 | xxxx | Scalar EXT232-263 | +|PO9| SVRM | 1 0 | !PO9 | xxxx | SVP64:EXT232-263 | +|PO9| 0000 | 0 1 | Defined Word-instruction | 32-bit EXT300-363 | +|PO9| !ZERO | 0 1 | Defined Word-instruction | SSingle:EXT000-063 | +|PO9| SVRM | 0 0 | Defined Word-instruction | SVP64:EXT000-063 | +``` +* bit 31 is "SSingle" +* bit 30 is EXT200-263 if set otherwise EXT000-063 + +This was one of the original early PO9 Encodings. + +**Identification**: + +The following identification-criteria may be easily verified by taking +a copy of the table above and striking out each line that fails each +test. Only EXT000-063 is not by a "process of elimination" (if ... return True) + +**Length detection**: (critically-important to be short) + +``` + if PO1 return 64 + elif not PO9 return 32 + elif Word[30:31] = 0b00 return 32 + else return 64 +``` + +**EXT232-263:** + +``` + if not PO9 return False + # eliminate EXT900 + if Word[30:31] == 0b00 return False + # eliminate EXT0xx + if Word[31] == 0b1 return False + # eliminate EXT900 and reserved areas + if Word[33:37] != 0b10001 return False + # + return True +``` + + + +**EXT000-063**: (includes Prefixed) + +``` + if PO1 return False # or other reserved + if not PO9 return True # prefixed needs more + # eliminate EXT900 + if Word[30:31] = 0b00 return False + # eliminate Prefixed-EXT900, RESERVED and EXT200 + if Word[31] = 0b0 return False + # eliminate 32-bit Unvec in 64b area + if Word[30:31] = 0b01 and + Word[6:29 ] = 0x000000 return False + return True +``` + +**SVP64**: + +``` + # easy-elimination, first + if not PO9 return False + if Word[30] = 0b0 return False + # eliminate anything not SVP64:EXT900 + if Word[30:31] = 0b10 and + Word[33:37] = 0b10001 and + Word[62:63] != 0b01 return False + # eliminate anything not SVP64:EXT200-231 + if Word[31:32] = 0b00 return False + # all remaining combinations are SVP64:EXTnnn + return True +``` + +**SVP64Single**: + +``` + # easy-elimination, first + if not PO9 return False + # eliminate 32-bit EXT900 + if Word[30:31] = 0b00 return False + # eliminate SVP64:EXT000-063 + if Word[30:31] = 0b11 return False + # eliminate anything "Identity" + if Word[6:29 ] = 0x000000 return False + # eliminate SVP64:EXT200-231 + if Word[30:32] = 0b101 return False + # eliminate anything not SSingle:EXT900 + if Word[30:31] = 0b10 and + Word[33:37] = 0b10001 and + Word[62:63] != 0b00 return False + # everything left is SVP64Single + return True +``` + +**RESERVED**: (no need to pass for further detailed decode) + +``` + # easy-elimination, first + if not PO9 return False + # eliminate EXT900 + if Word[30:31] = 0b00 return False + # eliminate SVP64:EXT000-031 + if Word[30:31] = 0b11 return False + # eliminate SSingle:EXT000-063 + if Word[6:29 ] != 0x000000 and + Word[30:31] = 0b01 return False + # eliminate EXT200-231 + if Word[30:31] = 0b10 and + Word[33:37] = 0b10001 return False + # eliminate SSingle:EXT900 + if Word[30:31] = 0b10 and + Word[6:29 ] != 0x000000 and + Word[33:37] = 0b10001 and + Word[62:63] = 0b00 return False + # eliminate SVP64:EXT900 + if Word[30:31] = 0b10 and + Word[33:37] = 0b10001 and + Word[62:63] = 0b01 return False + # all else needs further detailed decode + return True +```