add ztrans proposal
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Mon, 5 Aug 2019 05:16:59 +0000 (06:16 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Mon, 5 Aug 2019 05:17:13 +0000 (06:17 +0100)
ztrans_proposal.mdwn [new file with mode: 0644]

diff --git a/ztrans_proposal.mdwn b/ztrans_proposal.mdwn
new file mode 100644 (file)
index 0000000..15c6ea7
--- /dev/null
@@ -0,0 +1,51 @@
+# Ztrans - transcendental operations
+
+See:
+
+* <http://bugs.libre-riscv.org/show_bug.cgi?id=127>
+* <https://www.khronos.org/registry/spir-v/specs/unified1/OpenCL.ExtendedInstructionSet.100.html>
+
+[[!toc levels=2]]
+
+# List of 2-arg opcodes
+
+[[!table  data="""
+opcode    | Description           | pseudo-code                | Extension |
+FATAN2    | atan2 arc tangent     | rd = atan2(rs2, rs1)       | Ztrans    |
+FATAN2PI  | atan arc tangent / pi | rd = atan2(rs2, rs1) / pi  |           |
+FPOW      | power of              | rd = pow(rs1, rs2)         | Ztrans    |
+"""]]
+
+# List of 1-arg opcodes
+
+[[!table  data="""
+opcode   | Description              | pseudo-code             | Extension |
+FCBRT    | Cube Root                | rd = pow(rs1, 3)        |           |
+FEXP2    | power-of-2               | rd = pow(2, rs1)        |           |
+FLOG2    | log2                     | rd = log2(rs1)          |           |
+FEXPM1   | exponent minus 1         | rd = pow(e, rs1) - 1.0  |           |
+FLOG1P   | log plus 1               | rd = log(e, 1 + rs1)    |           |
+FEXP     | exponent                 | rd = pow(e, rs1)        |           |
+FLOG     | natural log (base e)     | rd = log(e, rs1)        |           |
+FEXP10   | power-of-10              | rd = pow(10, rs1)       |           |
+FLOG10   | log base 10              | rd = log10(rs1)         |           |
+FSIN     | sin (radians)            |                         | Ztrans    |
+FCOS     | cos (radians)            |                         | Ztrans    |
+FTAN     | tan (radians)            |                         | Ztrans    |
+FSINPI   | sin times pi             | rd = sin(pi * rs1)      |           |
+FCOSPI   | cos times pi             | rd = cos(pi * rs1)      |           |
+FTANPI   | tan times pi             | rd = tan(pi * rs1)      |           |
+FSINH    | hyperbolic sin (radians) |                         |           |
+FCOSH    | hyperbolic cos (radians) |                         |           |
+FTANH    | hyperbolic tan (radians) |                         |           |
+FASINH   | inverse hyperbolic sin   |                         |           |
+FACOSH   | inverse hyperbolic cos   |                         |           |
+FATANH   | inverse hyperbolic tan   |                         |           |
+"""]]
+
+# Pseudo-code ops
+
+* FRCP rd, rs1 - pseudo-code alias for rd = 1.0 / rs1
+* SINCOS - fused macro-op between FSIN and FCOS (issued in that order).
+* SINCOSPI - fused macro-op between FSINPI and FCOSPI (issued in that order).
+