From: lkcl Date: Sat, 5 Oct 2019 09:31:52 +0000 (+0100) Subject: (no commit message) X-Git-Tag: convert-csv-opcode-to-binary~3896 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=8d84db3e5788078924e399c5fdbc37f71f4ee5e7;p=libreriscv.git --- diff --git a/simple_v_extension/vector_ops.mdwn b/simple_v_extension/vector_ops.mdwn index e45b9642f..71d45fbfb 100644 --- a/simple_v_extension/vector_ops.mdwn +++ b/simple_v_extension/vector_ops.mdwn @@ -131,6 +131,16 @@ Pseudocode in c: return result; } +## Vector Normalisation (not included) + +Vector normalisation may be performed through dot product, recip square root and multiplication: + + fdot F3, F1, F1 # vector dot with self + rcpsqrta F3, F3 + fscale,0 F2, F3, F1 + +Or it may be performed through VLEN (Vector length) and division. + ## Vector length * rd=scalar, vs1=vec (SUBVL=1) @@ -144,6 +154,8 @@ The scalar length of a vector: sqrt(x[0]^2 + x[1]^2 + ...). +One option is for this to be a macro op fusion sequence, with inverse-sqrt also being a second macro op sequence suitable for normalisation. + ## Vector distance * VDIST rd, vs1, vs2