From: Luke Kenneth Casson Leighton Date: Fri, 13 Apr 2018 14:58:46 +0000 (+0100) Subject: add alt rvp X-Git-Tag: convert-csv-opcode-to-binary~5683 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=eb3b0ec23c6cc6d970eaf425bbb79f0213388940;p=libreriscv.git add alt rvp --- 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