clean up remaining comments from fptrans reallocation.
[libreriscv.git] / openpower / power_trans_ops.mdwn
1 # Opcode Tables for PO=59/63 XO=1---011--
2
3 Power ISA v3.1B opcodes extracted from:
4 * Power ISA v3.1B Appendix D Table 23 sheet 2 of 4 page 1391
5 * Power ISA v3.1B Appendix D Table 25 sheet 2 of 4 page 1399
6
7 Parenthesized entries are not part of fptrans.
8
9 Entries whose mnemonic ends in `s` are only in PO=59.
10 Entries whose mnemonic doesn't end in `s` are only in PO=63.
11 Entries whose mnemonic ends in `(s)` are in both PO=59 and PO=63.
12
13 | XO LSB half &#x2192;<br> XO MSB half &#x2193; | 01100 | 01101 | 01110 | 01111 |
14 |-----------------------------------------------|---------------------------------------------------|---------------------------------------------------|-----------------------------------------------------|----------------------------------------------------|
15 | 10000 | <small>`10000 01100`</small><br>(ffadds) (draft) | <small>`10000 01101`</small><br>fsinpi(s) (draft) | <small>`10000 01110`</small><br>fatan2pi(s) (draft) | <small>`10000 01111`</small><br>fasinpi(s) (draft) |
16 | 10001 | <small>`10001 01100`</small><br>fcospi(s) (draft) | <small>`10001 01101`</small><br>ftanpi(s) (draft) | <small>`10001 01110`</small><br>facospi(s) (draft) | <small>`10001 01111`</small><br>fatanpi(s) (draft) |
17 | 10010 | <small>`10010 01100`</small><br>frsqrt(s) (draft) | <small>`10010 01101`</small><br>fsin(s) (draft) | <small>`10010 01110`</small><br>fatan2(s) (draft) | <small>`10010 01111`</small><br>fasin(s) (draft) |
18 | 10011 | <small>`10011 01100`</small><br>fcos(s) (draft) | <small>`10011 01101`</small><br>ftan(s) (draft) | <small>`10011 01110`</small><br>facos(s) (draft) | <small>`10011 01111`</small><br>fatan(s) (draft) |
19 | 10100 | <small>`10100 01100`</small><br>frecip(s) (draft) | <small>`10100 01101`</small><br>fsinh(s) (draft) | <small>`10100 01110`</small><br>fhypot(s) (draft) | <small>`10100 01111`</small><br>fasinh(s) (draft) |
20 | 10101 | <small>`10101 01100`</small><br>fcosh(s) (draft) | <small>`10101 01101`</small><br>ftanh(s) (draft) | <small>`10101 01110`</small><br>facosh(s) (draft) | <small>`10101 01111`</small><br>fatanh(s) (draft) |
21 | 10110 | <small>`10110 01100`</small><br>fcbrt(s) (draft) | | | |
22 | 10111 | | | | |
23
24 | XO LSB half &#x2192;<br> XO MSB half &#x2193; | 01100 | 01101 | 01110 | 01111 |
25 |-----------------------------------------------|----------------------------------------------------|----------------------------------------------------|-----------------------------------------------------|----------------------------------------------------|
26 | 11000 | <small>`11000 01100`</small><br>fexp2m1(s) (draft) | <small>`11000 01101`</small><br>flog2p1(s) (draft) | | |
27 | 11001 | <small>`11001 01100`</small><br>fexpm1(s) (draft) | <small>`11001 01101`</small><br>flogp1(s) (draft) | <small>`11001 01110`</small><br>(fctid) | <small>`11001 01111`</small><br>(fctidz) |
28 | 11010 | <small>`11010 01100`</small><br>fexp10m1(s) (draft)| <small>`11010 01101`</small><br>flog10p1(s) (draft)| <small>`11010 01110`</small><br>(fcfid(s)) | |
29 | 11011 | <small>`11011 01100`</small><br>fpown(s) (draft) | <small>`11011 01101`</small><br>frootn(s) (draft) | | |
30 | 11100 | <small>`11100 01100`</small><br>fexp2(s) (draft) | <small>`11100 01101`</small><br>flog2(s) (draft) | | |
31 | 11101 | <small>`11101 01100`</small><br>fexp(s) (draft) | <small>`11101 01101`</small><br>flog(s) (draft) | <small>`11101 01110`</small><br>(fctidu) | <small>`11101 01111`</small><br>(fctiduz) |
32 | 11110 | <small>`11110 01100`</small><br>fexp10(s) (draft) | <small>`11110 01101`</small><br>flog10(s) (draft) | <small>`11110 01110`</small><br>(fcfidu(s)) | |
33 | 11111 | <small>`11111 01100`</small><br>fpowr(s) (draft) | <small>`11111 01101`</small><br>fpow(s) (draft) | | |
34
35 # DRAFT List of 2-arg opcodes
36
37 These are X-Form, recommended Major Opcode 63 for full-width
38 and 59 for half-width (ending in s).
39
40 | 0.5|6.10|11.15|16.20| 21..30 |31| name | Form |
41 | -- | -- | --- | --- | ---------- |--| ---- | ------- |
42 | NN |FRT | FRA | FRB | 1xxxx011xx |Rc| transcendental | X-Form |
43 | NN |FRT | FRA | RB | 1xxxx011xx |Rc| transcendental | X-Form |
44
45 Recommended 10-bit XO assignments:
46
47 | opcode | Description | Major 59 and 63 | bits 16..20 |
48 |------------|-----------------------------------------|-----------------|-------------|
49 | fatan2(s) | atan2 arc tangent | 10010 01110 | FRB |
50 | fatan2pi(s)| atan2 arc tangent / &pi; | 10000 01110 | FRB |
51 | fpow(s) | x<sup>y</sup> | 11111 01101 | FRB |
52 | fpown(s) | x<sup>n</sup> (n &in; &#x2124;) | 11011 01100 | RB |
53 | fpowr(s) | x<sup>y</sup> (x >= 0) | 11111 01100 | FRB |
54 | frootn(s) | <sup>n</sup>&#x221A;x (n &in; &#x2124;) | 11011 01101 | RB |
55 | fhypot(s) | &#x221A;(x<sup>2</sup> + y<sup>2</sup>) | 10100 01110 | FRB |
56
57 # DRAFT List of 1-arg transcendental opcodes
58
59 These are X-Form, and are mostly identical in Special Registers Altered to
60 `fsqrt` (the exact fp exceptions they can produce differ).
61 Recommended Major Opcode 63 for full-width and 59 for half-width (ending in s).
62
63 Special Registers Altered (FIXME: come up with correct list):
64
65 FPRF FR FI FX OX UX XX
66 VXSNAN VXIMZ VXZDZ
67 CR1 (if Rc=1)
68
69 | 0.5|6.10|11.15|16.20| 21..30 |31| name | Form |
70 | -- | -- | --- | --- | ---------- |--| ---- | ------- |
71 | NN |FRT | /// | FRB | 1xxxx011xx |Rc| transcendental | X-Form |
72
73 Recommended 10-bit XO assignments:
74
75 | opcode | Description | Major 59 and 63 |
76 |------------|--------------------------|-----------------|
77 | frsqrt(s) | 1 / &#x221A;x | 10010 01100 |
78 | fcbrt(s) | &#x221B;x | 10110 01100 |
79 | frecip(s) | 1 / x | 10100 01100 |
80 | fexp2m1(s) | 2<sup>x</sup> - 1 | 11000 01100 |
81 | flog2p1(s) | log<sub>2</sub> (x + 1) | 11000 01101 |
82 | fexp2(s) | 2<sup>x</sup> | 11100 01100 |
83 | flog2(s) | log<sub>2</sub> x | 11100 01101 |
84 | fexpm1(s) | e<sup>x</sup> - 1 | 11001 01100 |
85 | flogp1(s) | log<sub>e</sub> (x + 1) | 11001 01101 |
86 | fexp(s) | e<sup>x</sup> | 11101 01100 |
87 | flog(s) | log<sub>e</sub> x | 11101 01101 |
88 | fexp10m1(s)| 10<sup>x</sup> - 1 | 11010 01100 |
89 | flog10p1(s)| log<sub>10</sub> (x + 1) | 11010 01101 |
90 | fexp10(s) | 10<sup>x</sup> | 11110 01100 |
91 | flog10(s) | log<sub>10</sub> x | 11110 01101 |
92
93 # DRAFT List of 1-arg trigonometric opcodes
94
95 These are X-Form, and are mostly identical in Special Registers Altered to
96 `fsqrt` (the exact fp exceptions they can produce differ).
97 Recommended Major Opcode 63 for full-width and 59 for half-width (ending in s)
98
99 Special Registers Altered:
100
101 FPRF FR FI FX OX UX XX
102 VXSNAN VXIMZ VXZDZ
103 CR1 (if Rc=1)
104
105 | 0.5|6.10|11.15|16.20| 21..30 |31| name | Form |
106 | -- | -- | --- | --- | ---------- |--| ---- | ------- |
107 | NN |FRT | /// | FRB | 1xxxx011xx |Rc| trigonometric | X-Form |
108
109 Recommended 10-bit XO assignments:
110
111 | opcode | Description | Major 59 and 63 |
112 |-------------|--------------------------|------------------|
113 | fsin(s) | sin (radians) | 10010 01101 |
114 | fcos(s) | cos (radians) | 10011 01100 |
115 | ftan(s) | tan (radians) | 10011 01101 |
116 | fasin(s) | arcsin (radians) | 10010 01111 |
117 | facos(s) | arccos (radians) | 10011 01110 |
118 | fatan(s) | arctan (radians) | 10011 01111 |
119 | fsinpi(s) | sin(&pi; * x) | 10000 01101 |
120 | fcospi(s) | cos(&pi; * x) | 10001 01100 |
121 | ftanpi(s) | tan(&pi; * x) | 10001 01101 |
122 | fasinpi(s) | arcsin(x) / &pi; | 10000 01111 |
123 | facospi(s) | arccos(x) / &pi; | 10001 01110 |
124 | fatanpi(s) | arctan(x) / &pi; | 10001 01111 |
125 | fsinh(s) | hyperbolic sin | 10100 01101 |
126 | fcosh(s) | hyperbolic cos | 10101 01100 |
127 | ftanh(s) | hyperbolic tan | 10101 01101 |
128 | fasinh(s) | inverse hyperbolic sin | 10100 01111 |
129 | facosh(s) | inverse hyperbolic cos | 10101 01110 |
130 | fatanh(s) | inverse hyperbolic tan | 10101 01111 |