17445c079fcff82cfda28e73b9e99486a041abbd
[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). Major Opcode 63 has room
5 for 9 A-Form 5-bit XO instructions, 00001, 01001, 01010, 01011,
6 01101, 10000, 10001, 10011, 11011
7
8 | opcode | Description | pseudocode | Extension |
9 | ------ | ---------------- | ---------------- | ----------- |
10 | FATAN2 | atan2 arc tangent | rd = atan2(rs2, rs1) | Zarctrignpi |
11 | FATAN2PI | atan2 arc tangent / pi | rd = atan2(rs2, rs1) / pi | Zarctrigpi |
12 | FPOW | x power of y | rd = pow(rs1, rs2) | ZftransAdv |
13 | FPOWN | x power of n (n int) | rd = pow(rs1, rs2) | ZftransAdv |
14 | FPOWR | x power of y (x +ve) | rd = exp(rs1 log(rs2)) | ZftransAdv |
15 | FROOTN | x power 1/n (n integer)| rd = pow(rs1, 1/rs2) | ZftransAdv |
16 | FHYPOT | hypotenuse | rd = sqrt(rs1^2 + rs2^2) | ZftransAdv |
17
18 ## List of 1-arg transcendental opcodes
19
20 | opcode | Description | pseudocode | Extension |
21 | ------ | ---------------- | ---------------- | ----------- |
22 | FRSQRT | Reciprocal Square-root | rd = sqrt(rs1) | Zfrsqrt |
23 | FCBRT | Cube Root | rd = pow(rs1, 1.0 / 3) | ZftransAdv |
24 | FRECIP | Reciprocal | rd = 1.0 / rs1 | Zftrans |
25 | FEXP2 | power-of-2 | rd = pow(2, rs1) | Zftrans |
26 | FLOG2 | log2 | rd = log(2. rs1) | Zftrans |
27 | FEXPM1 | exponential minus 1 | rd = pow(e, rs1) - 1.0 | ZftransExt |
28 | FLOG1P | log plus 1 | rd = log(e, 1 + rs1) | ZftransExt |
29 | FEXP | exponential | rd = pow(e, rs1) | ZftransExt |
30 | FLOG | natural log (base e) | rd = log(e, rs1) | ZftransExt |
31 | FEXP10 | power-of-10 | rd = pow(10, rs1) | ZftransExt |
32 | FLOG10 | log base 10 | rd = log(10, rs1) | ZftransExt |
33
34 ## List of 1-arg trigonometric opcodes
35
36 | opcode | Description | pseudo-code | Extension |
37 | ------ | ---------------- | ---------------- | ----------- |
38 | FSIN | sin (radians) | rd = sin(rs1) | Ztrignpi |
39 | FCOS | cos (radians) | rd = cos(rs1) | Ztrignpi |
40 | FTAN | tan (radians) | rd = tan(rs1) | Ztrignpi |
41 | FASIN | arcsin (radians) | rd = asin(rs1) | Zarctrignpi |
42 | FACOS | arccos (radians) | rd = acos(rs1) | Zarctrignpi |
43 | FATAN | arctan (radians) | rd = atan(rs1) | Zarctrignpi |
44 | FSINPI | sin times pi | rd = sin(pi * rs1) | Ztrigpi |
45 | FCOSPI | cos times pi | rd = cos(pi * rs1) | Ztrigpi |
46 | FTANPI | tan times pi | rd = tan(pi * rs1) | Ztrigpi |
47 | FASINPI | arcsin / pi | rd = asin(rs1) / pi | Zarctrigpi |
48 | FACOSPI | arccos / pi | rd = acos(rs1) / pi | Zarctrigpi |
49 | FATANPI | arctan / pi | rd = atan(rs1) / pi | Zarctrigpi |
50 | FSINH | hyperbolic sin (radians) | rd = sinh(rs1) | Zfhyp |
51 | FCOSH | hyperbolic cos (radians) | rd = cosh(rs1) | Zfhyp |
52 | FTANH | hyperbolic tan (radians) | rd = tanh(rs1) | Zfhyp |
53 | FASINH | inverse hyperbolic sin | rd = asinh(rs1) | Zfhyp |
54 | FACOSH | inverse hyperbolic cos | rd = acosh(rs1) | Zfhyp |
55 | FATANH | inverse hyperbolic tan | rd = atanh(rs1) | Zfhyp |