(no commit message)
[libreriscv.git] / openpower / power_trans_ops.mdwn
1 # DRAFT List of 2-arg opcodes
2
3 These are A-Form, recommended Major Opcode 63 for full-width
4 and 59 for half-width (ending in s).
5
6 | 0.5|6.10|11.15|16.20| 21.25 | 26.30 |31| name | Form |
7 | -- | -- | --- | --- | ----- | ----- |--| ---- | ------- |
8 | NN |FRT | FRA | FRB | /// | xxxxx |Rc| trigonometric | A-Form |
9
10 As shown in Power ISA 3.0C Book III Appendix C Table 28 p1190
11 and Table 23 p1181,
12 Major Opcode 63 has room
13 for 9 A-Form 5-bit XO instructions, 00001, 01001, 01010, 01011,
14 01101, 10000, 10001, 10011, 11011.
15 Major Opcode 59 has 11 5-bit XO instructions,
16 00000, 00001, 00100, 00101, 00110, 00111,
17 10000, 10001, 10011, 10111, 11011.
18
19 | opcode | Description | Major 63 | Major 59 |
20 | ------ | ---------------- | ---------------- | ----------- |
21 | fatan2(s) | atan2 arc tangent | 00001 | 00001 |
22 | fatan2pi(s)|atan2 arc tangent / pi | 01001 | 00111 |
23 | fpow(s) | x power of y | 10000 | 10000 |
24 | fpown(s) | x power of n (n int) | 10001 | 10001 |
25 | fpowr(s) | x power of y (x +ve) | 10011 | 10011 |
26 | frootn(s) | x power 1/n (n integer)| 11011 | 11011 |
27 | fhypot(s) | hypotenuse | 01101 | 10111 |
28
29 # DRAFT List of 1-arg transcendental opcodes
30
31 These are X-Form, and are identical in Special Registers Altered to `fsqrt`.
32 Recommended Major Opcode 63 for full-width and 59 for half-width (ending in s).
33
34 Special Registers Altered:
35
36 FPRF FR FI FX OX UX XX
37 VXSNAN VXIMZ VXZDZ
38 CR1 (if Rc=1)
39
40 | 0.5|6.10|11.15|16.20| 21..30 |31| name | Form |
41 | -- | -- | --- | --- | ---------- |--| ---- | ------- |
42 | NN |FRT | /// | FRB | 1xxxx01100 |Rc| transcendental | X-Form |
43
44 Recommended 10-bit XO with the low 5 LSBs 01100:
45
46 | opcode | Description | Major 59 and 63 |
47 | ------ | ---------------- | ---------------- |
48 | frsqrt(s)| Reciprocal Square-root | 10000 01110 |
49 | fcbrt(s) | Cube Root | 10001 01110 |
50 | frecip(s)| Reciprocal | 10010 01111 |
51 | fexp2m1(s)| power-2 minus 1 | 10100 01110 |
52 | flog2p1(s)| log2 plus 1 | 10101 01110 |
53 | fexp2(s) | power-of-2 | 10110 01110 |
54 | flog2(s) | log2 | 10111 01111 |
55 | fexpm1(s)| exponential minus 1 | 11000 01110 |
56 | flogp1(s)| log plus 1 | 11001 01110 |
57 | fexp(s) | exponential | 11010 01110 |
58 | flog(s) | natural log (base e) | 11011 01111 |
59 | fexp10m1(s)| power-10 minus 1 | 11100 01110 |
60 | flog10p1(s)| log10 plus 1 | 11101 01110 |
61 | fexp10(s)| power-of-10 | 11110 01110 |
62 | flog10(s)| log base 10 |11111 01111 |
63
64 # DRAFT List of 1-arg trigonometric opcodes
65
66 These are X-Form, and are identical in Special Registers Altered to `fsqrt`.
67 Recommended Major Opcode 63 for full-width and 59 for half-width (ending in s).
68 Special Registers Altered:
69
70 FPRF FR FI FX OX UX XX
71 VXSNAN VXIMZ VXZDZ
72 CR1 (if Rc=1)
73
74 | 0.5|6.10|11.15|16.20| 21..30 |31| name | Form |
75 | -- | -- | --- | --- | ---------- |--| ---- | ------- |
76 | NN |FRT | /// | FRB | 10xxx011xx |Rc| trigonometric | X-Form |
77
78 Recommended 10-bit XO with the low 5 LSBs 01101 to 01111:
79
80 | opcode | Description | Major 59 and 63 |
81 | ------ | ---------------- | ---------------- |
82 | fsin(s) | sin (radians) | 10000 01101 |
83 | fcos(s) | cos (radians) | 10000 01110 |
84 | ftan(s) | tan (radians) | 10000 01111 |
85 | fasin(s) | arcsin (radians) | 10001 01101 |
86 | facos(s) | arccos (radians) | 10001 01110 |
87 | fatan(s) | arctan (radians) | 10001 01111 |
88 | fsinpi(s) | sin times pi | 10010 01101 |
89 | fcospi(s) | cos times pi | 10010 01110 |
90 | ftanpi(s) | tan times pi | 10010 01111 |
91 | fasinpi(s) | arcsin / pi | 10011 01101 |
92 | facospi(s) | arccos / pi | 10011 01110 |
93 | fatanpi(s) | arctan / pi | 10011 01111 |
94 | fsinh(s) | hyperbolic sin (radians) | 10100 01101 |
95 | fcosh(s) | hyperbolic cos (radians) | 10100 01110 |
96 | ftanh(s) | hyperbolic tan (radians) | 10100 01111 |
97 | fasinh(s) | inverse hyperbolic sin | 10101 01111 |
98 | facosh(s) | inverse hyperbolic cos | 10101 01111 |
99 | fatanh(s) | inverse hyperbolic tan | 10101 01111 |