From 6385af8c6fe8506f14dd62f27fd7618cbb58ce57 Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Wed, 7 Aug 2019 00:12:36 +0100 Subject: [PATCH] add hypotenuse opcode --- rv_major_opcode_1010011.mdwn | 6 +++--- ztrans_proposal.mdwn | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/rv_major_opcode_1010011.mdwn b/rv_major_opcode_1010011.mdwn index 82d69456d..5e2f48d88 100644 --- a/rv_major_opcode_1010011.mdwn +++ b/rv_major_opcode_1010011.mdwn @@ -56,7 +56,7 @@ funct5 | SDHQ | rs2 | rs1 | funct3 | rd | opcode | name | 01001 | xx | rs2 | rs1 | yyy | rd | 1010011 | ? | 01010 | xx | rs2 | rs1 | yyy | rd | 1010011 | ? | 01011 | xx | xxxxx | rs1 | yyy | rd | 1010011 | tb=01011 | -01100 | xx | rs2 | rs1 | yyy | rd | 1010011 | ? | +01100 | xx | rs2 | rs1 | yyy | rd | 1010011 | **FHYPOT.xx** | 01101 | xx | rs2 | rs1 | rm | rd | 1010011 | **FATAN2.xx** | 01110 | xx | rs2 | rs1 | rm | rd | 1010011 | **FATAN2PI.xx**| 01111 | xx | rs2 | rs1 | rm | rd | 1010011 | **FPOW.xx** | @@ -238,9 +238,9 @@ funct5 | SDHQ | rs2 | rs1 | funct3 | rd | opcode | name | 01011 | xx | 11111 | rs1 | rm | rd | 1010011 | ? | """]] -## funct5 = 01100 - unused +## funct5 = 01100 - **FHYPOT** -Brownfield encodings available. +Proposed for Zftrans - FHYPOT: "sqrt(rs1 * rs1 + rs2 * rs2)" ## funct5 = 01101 - **FATAN2** diff --git a/ztrans_proposal.mdwn b/ztrans_proposal.mdwn index d0dff7e26..f68b02fbc 100644 --- a/ztrans_proposal.mdwn +++ b/ztrans_proposal.mdwn @@ -30,6 +30,7 @@ FATAN2 | atan2 arc tangent | rd = atan2(rs2, rs1) | Zarctrignpi | FATAN2PI | atan arc tangent / pi | rd = atan2(rs2, rs1) / pi | Zarctrigpi | FPOW | x power of y | rd = pow(rs1, rs2) | ZftransAdv | FROOT | x power 1/y | rd = pow(rs1, 1/rs2) | ZftransAdv | +FHYPOT | hypotenuse | rd = sqrt(x^2 + y^2) | Zftrans | """]] # List of 1-arg transcendental opcodes -- 2.30.2