From 8d65676a82d37472da3ca94fbc6f90f930e0f3d7 Mon Sep 17 00:00:00 2001 From: Jacob Lifshay Date: Tue, 6 Sep 2022 04:30:45 -0700 Subject: [PATCH] finished allocating fptrans XO values --- openpower/power_trans_ops.mdwn | 85 ++++++++++--------- .../power_trans_ops_copy_from_PO59_table.py | 2 + 2 files changed, 45 insertions(+), 42 deletions(-) diff --git a/openpower/power_trans_ops.mdwn b/openpower/power_trans_ops.mdwn index d35ba9f84..de0818bea 100644 --- a/openpower/power_trans_ops.mdwn +++ b/openpower/power_trans_ops.mdwn @@ -14,23 +14,23 @@ Entries whose mnemonic ends in `(s)` are in both PO=59 and PO=63. |-----------------------------------------------|---------------------------------------------------|---------------------------------------------------|-----------------------------------------------------|----------------------------------------------------| | 10000 | `10000 01100`
(ffadds) (draft) | `10000 01101`
fsinpi(s) (draft) | `10000 01110`
fatan2pi(s) (draft) | `10000 01111`
fasinpi(s) (draft) | | 10001 | `10001 01100`
fcospi(s) (draft) | `10001 01101`
ftanpi(s) (draft) | `10001 01110`
facospi(s) (draft) | `10001 01111`
fatanpi(s) (draft) | -| 10010 | `10010 01100`
**TBD** (draft) | `10010 01101`
fsin(s) (draft) | `10010 01110`
fatan2(s) (draft) | `10010 01111`
fasin(s) (draft) | +| 10010 | `10010 01100`
frsqrt(s) (draft) | `10010 01101`
fsin(s) (draft) | `10010 01110`
fatan2(s) (draft) | `10010 01111`
fasin(s) (draft) | | 10011 | `10011 01100`
fcos(s) (draft) | `10011 01101`
ftan(s) (draft) | `10011 01110`
facos(s) (draft) | `10011 01111`
fatan(s) (draft) | -| 10100 | `10100 01100`
**TBD** (draft) | `10100 01101`
fsinh(s) (draft) | `10100 01110`
fhypot(s) (draft) | `10100 01111`
fasinh(s) (draft) | +| 10100 | `10100 01100`
frecip(s) (draft) | `10100 01101`
fsinh(s) (draft) | `10100 01110`
fhypot(s) (draft) | `10100 01111`
fasinh(s) (draft) | | 10101 | `10101 01100`
fcosh(s) (draft) | `10101 01101`
ftanh(s) (draft) | `10101 01110`
facosh(s) (draft) | `10101 01111`
fatanh(s) (draft) | -| 10110 | `10110 01100`
**TBD** (draft) | `10110 01101`
**TBD** (draft) | `10110 01110`
**TBD** (draft) | `10110 01111`
**TBD** (draft) | -| 10111 | `10111 01100`
**TBD** (draft) | `10111 01101`
**TBD** (draft) | `10111 01110`
**TBD** (draft) | `10111 01111`
**TBD** (draft) | - -| XO LSB half →
XO MSB half ↓ | 01100 | 01101 | 01110 | 01111 | -|-----------------------------------------------|---------------------------------------------------|---------------------------------------------------|-----------------------------------------------------|----------------------------------------------------| -| 11000 | `11000 01100`
**TBD** (draft) | `11000 01101`
**TBD** (draft) | `11000 01110`
**TBD** (draft) | `11000 01111`
**TBD** (draft) | -| 11001 | `11001 01100`
**TBD** (draft) | `11001 01101`
**TBD** (draft) | `11001 01110`
(fctid) | `11001 01111`
(fctidz) | -| 11010 | `11010 01100`
**TBD** (draft) | `11010 01101`
**TBD** (draft) | `11010 01110`
(fcfid(s)) | `11010 01111`
**TBD** (draft) | -| 11011 | `11011 01100`
**TBD** (draft) | `11011 01101`
**TBD** (draft) | `11011 01110`
**TBD** (draft) | `11011 01111`
**TBD** (draft) | -| 11100 | `11100 01100`
**TBD** (draft) | `11100 01101`
**TBD** (draft) | `11100 01110`
**TBD** (draft) | `11100 01111`
**TBD** (draft) | -| 11101 | `11101 01100`
**TBD** (draft) | `11101 01101`
**TBD** (draft) | `11101 01110`
(fctidu) | `11101 01111`
(fctiduz) | -| 11110 | `11110 01100`
**TBD** (draft) | `11110 01101`
**TBD** (draft) | `11110 01110`
(fcfidu(s)) | `11110 01111`
**TBD** (draft) | -| 11111 | `11111 01100`
**TBD** (draft) | `11111 01101`
**TBD** (draft) | `11111 01110`
**TBD** (draft) | `11111 01111`
**TBD** (draft) | +| 10110 | `10110 01100`
fcbrt(s) (draft) | | | | +| 10111 | | | | | + +| XO LSB half →
XO MSB half ↓ | 01100 | 01101 | 01110 | 01111 | +|-----------------------------------------------|----------------------------------------------------|----------------------------------------------------|-----------------------------------------------------|----------------------------------------------------| +| 11000 | `11000 01100`
fexp2m1(s) (draft) | `11000 01101`
flog2p1(s) (draft) | | | +| 11001 | `11001 01100`
fexpm1(s) (draft) | `11001 01101`
flogp1(s) (draft) | `11001 01110`
(fctid) | `11001 01111`
(fctidz) | +| 11010 | `11010 01100`
fexp10m1(s) (draft)| `11010 01101`
flog10p1(s) (draft)| `11010 01110`
(fcfid(s)) | | +| 11011 | `11011 01100`
fpown(s) (draft) | `11011 01101`
frootn(s) (draft) | | | +| 11100 | `11100 01100`
fexp2(s) (draft) | `11100 01101`
flog2(s) (draft) | | | +| 11101 | `11101 01100`
fexp(s) (draft) | `11101 01101`
flog(s) (draft) | `11101 01110`
(fctidu) | `11101 01111`
(fctiduz) | +| 11110 | `11110 01100`
fexp10(s) (draft) | `11110 01101`
flog10(s) (draft) | `11110 01110`
(fcfidu(s)) | | +| 11111 | `11111 01100`
fpowr(s) (draft) | `11111 01101`
fpow(s) (draft) | | | # DRAFT List of 2-arg opcodes @@ -41,7 +41,8 @@ and 59 for half-width (ending in s). | 0.5|6.10|11.15|16.20| 21..30 |31| name | Form | | -- | -- | --- | --- | ---------- |--| ---- | ------- | -| NN |FRT | FRA | FRB | 10xxx011xx |Rc| transcendental | X-Form | +| NN |FRT | FRA | FRB | 1xxxx011xx |Rc| transcendental | X-Form | +| NN |FRT | FRA | RB | 1xxxx011xx |Rc| transcendental | X-Form | As shown in Power ISA 3.1 Book III Appendix D Table 28 p1190 and Table 23 p1368, @@ -51,15 +52,15 @@ Major Opcode 59 has 11 5-bit XO instructions, with some overlap leading to a partially orthogonal set across full and half width. -| opcode | Description | Major 59 and 63 | -|------------|-----------------------------------------|-----------------| -| fatan2(s) | atan2 arc tangent | 10010 01110 | -| fatan2pi(s)| atan2 arc tangent / π | 10000 01110 | -| fpow(s) | xy | | -| fpown(s) | xn (n ∈ ℤ) | | -| fpowr(s) | xy (x >= 0) | | -| frootn(s) | n√x (n ∈ ℤ) | | -| fhypot(s) | √(x2 + y2) | 10100 01110 | +| opcode | Description | Major 59 and 63 | bits 16..20 | +|------------|-----------------------------------------|-----------------|-------------| +| fatan2(s) | atan2 arc tangent | 10010 01110 | FRB | +| fatan2pi(s)| atan2 arc tangent / π | 10000 01110 | FRB | +| fpow(s) | xy | 11111 01101 | FRB | +| fpown(s) | xn (n ∈ ℤ) | 11011 01100 | RB | +| fpowr(s) | xy (x >= 0) | 11111 01100 | FRB | +| frootn(s) | n√x (n ∈ ℤ) | 11011 01101 | RB | +| fhypot(s) | √(x2 + y2) | 10100 01110 | FRB | # DRAFT List of 1-arg transcendental opcodes @@ -76,27 +77,27 @@ Special Registers Altered: | 0.5|6.10|11.15|16.20| 21..30 |31| name | Form | | -- | -- | --- | --- | ---------- |--| ---- | ------- | -| NN |FRT | /// | FRB | 10xxx011xx |Rc| transcendental | X-Form | +| NN |FRT | /// | FRB | 1xxxx011xx |Rc| transcendental | X-Form | Recommended 10-bit XO with the low 5 LSBs 01100: | opcode | Description | Major 59 and 63 | |------------|--------------------------|-----------------| -| frsqrt(s) | 1 / √x | | -| fcbrt(s) | ∛x | | -| frecip(s) | 1 / x | | -| fexp2m1(s) | 2x - 1 | | -| flog2p1(s) | log2 (x + 1) | | -| fexp2(s) | 2x | | -| flog2(s) | log2 x | | -| fexpm1(s) | ex - 1 | | -| flogp1(s) | loge (x + 1) | | -| fexp(s) | ex | | -| flog(s) | loge x | | -| fexp10m1(s)| 10x - 1 | | -| flog10p1(s)| log10 (x + 1) | | -| fexp10(s) | 10x | | -| flog10(s) | log10 x | | +| frsqrt(s) | 1 / √x | 10010 01100 | +| fcbrt(s) | ∛x | 10110 01100 | +| frecip(s) | 1 / x | 10100 01100 | +| fexp2m1(s) | 2x - 1 | 11000 01100 | +| flog2p1(s) | log2 (x + 1) | 11000 01101 | +| fexp2(s) | 2x | 11100 01100 | +| flog2(s) | log2 x | 11100 01101 | +| fexpm1(s) | ex - 1 | 11001 01100 | +| flogp1(s) | loge (x + 1) | 11001 01101 | +| fexp(s) | ex | 11101 01100 | +| flog(s) | loge x | 11101 01101 | +| fexp10m1(s)| 10x - 1 | 11010 01100 | +| flog10p1(s)| log10 (x + 1) | 11010 01101 | +| fexp10(s) | 10x | 11110 01100 | +| flog10(s) | log10 x | 11110 01101 | # DRAFT List of 1-arg trigonometric opcodes @@ -113,7 +114,7 @@ Special Registers Altered: | 0.5|6.10|11.15|16.20| 21..30 |31| name | Form | | -- | -- | --- | --- | ---------- |--| ---- | ------- | -| NN |FRT | /// | FRB | 10xxx011xx |Rc| trigonometric | X-Form | +| NN |FRT | /// | FRB | 1xxxx011xx |Rc| trigonometric | X-Form | Recommended 10-bit XO with the low 5 LSBs 01101 to 01111: diff --git a/openpower/power_trans_ops_copy_from_PO59_table.py b/openpower/power_trans_ops_copy_from_PO59_table.py index af7503eb6..f3a25c1a8 100644 --- a/openpower/power_trans_ops_copy_from_PO59_table.py +++ b/openpower/power_trans_ops_copy_from_PO59_table.py @@ -92,6 +92,8 @@ def process(lr): f"binary string: {row}") for i, column in zip(columns_range, columns): cell = line_parts[i] + if cell.strip() == "": + continue match = re.fullmatch( r" * *` *(?P[01][01 ]*[01]) *` *" r" *
*(?P[a-zA-Z0-9_.][a-zA-Z0-9_.()]*)?" -- 2.30.2