From f4778f63c78da6cbe33df9b3106088c32cde9d66 Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Tue, 25 Jun 2019 16:09:19 +0100 Subject: [PATCH] move add to its own simple example --- simple_v_extension/abridged_spec.mdwn | 10 ++++++++++ simple_v_extension/appendix.mdwn | 17 ++--------------- simple_v_extension/simple_add_example.mdwn | 20 ++++++++++++++++++++ 3 files changed, 32 insertions(+), 15 deletions(-) create mode 100644 simple_v_extension/simple_add_example.mdwn diff --git a/simple_v_extension/abridged_spec.mdwn b/simple_v_extension/abridged_spec.mdwn index 5032eb51a..2143b8caf 100644 --- a/simple_v_extension/abridged_spec.mdwn +++ b/simple_v_extension/abridged_spec.mdwn @@ -239,6 +239,16 @@ to be set. See [[appendix]] for more details on fail-on-first modes. +# Simplified Pseudo-code example + +A greatly simplified example illustrating (just) the VL hardware for-loop +is as follows: +[[!inline raw="yes" pages="simple_v_extension/simple_add_example" ]] + +Note that zeroing, elwidth handling, SUBVL and PCVLIW have all been +left out, for clarity. For examples on how to handle each, see +[[appendix]]. + # Vector Block Format The Vector Block format uses the RISC-V 80-192 bit format from Section 1.5 diff --git a/simple_v_extension/appendix.mdwn b/simple_v_extension/appendix.mdwn index 6e883137c..55e1cd586 100644 --- a/simple_v_extension/appendix.mdwn +++ b/simple_v_extension/appendix.mdwn @@ -105,23 +105,10 @@ attention must be paid. Example pseudo-code for an integer ADD operation (including scalar operations). Floating-point uses the FP Register Table. - function op_add(rd, rs1, rs2) # add not VADD! -  int i, id=0, irs1=0, irs2=0; -  predval = get_pred_val(FALSE, rd); -  rd = int_vec[rd ].isvector ? int_vec[rd ].regidx : rd; -  rs1 = int_vec[rs1].isvector ? int_vec[rs1].regidx : rs1; -  rs2 = int_vec[rs2].isvector ? int_vec[rs2].regidx : rs2; -  for (i = 0; i < VL; i++) - xSTATE.srcoffs = i # save context - if (predval & 1<