From eb3b0ec23c6cc6d970eaf425bbb79f0213388940 Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Fri, 13 Apr 2018 15:58:46 +0100 Subject: [PATCH] add alt rvp --- alt_rvp.mdwn | 21 +++++++++++++++++++++ simple_v_extension.mdwn | 25 +++++++++++++++++++++++++ 2 files changed, 46 insertions(+) create mode 100644 alt_rvp.mdwn diff --git a/alt_rvp.mdwn b/alt_rvp.mdwn new file mode 100644 index 000000000..2f4b6063c --- /dev/null +++ b/alt_rvp.mdwn @@ -0,0 +1,21 @@ +# Lanes + +Example parallel add: + + /* XLEN and N are "baked-in" to the hardware */ + parameter XLEN; + parameter N; + /* note that N cannot be greater than XLEN */ + + register plane[XLEN]; + register x[N][32][XLEN]; + + function op_add(rd, rs1, rs2) { + /* note that this is ADD, not PADD */ + int i; + for (i = 0; i vector add + + register CSRvectorlen[XLEN][4]; # not quite decided yet about this one... + register CSRpredicate[XLEN][4]; # 2^4 is max vector length + register CSRreg_is_vectorised[XLEN]; # just for fun support scalars as well + register x[32][XLEN]; + + function op_add(rd, rs1, rs2, predr) + { +    /* note that this is ADD, not PADD */ +    int i, id, irs1, irs2; +    # checks CSRvectorlen[rd] == CSRvectorlen[rs] etc. ignored +    # also destination makes no sense as a scalar but what the hell... +    for (i = 0, id=0, irs1=0, irs2=0; i