From: lkcl Date: Sat, 30 Apr 2022 16:01:40 +0000 (+0100) Subject: (no commit message) X-Git-Tag: opf_rfc_ls005_v1~2536 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e7f90febfefca0fa4dc359f180622a1fa7c57192;p=libreriscv.git --- diff --git a/openpower/sv/svp64/appendix.mdwn b/openpower/sv/svp64/appendix.mdwn index 0f55c1128..f9fb960c1 100644 --- a/openpower/sv/svp64/appendix.mdwn +++ b/openpower/sv/svp64/appendix.mdwn @@ -937,11 +937,16 @@ required.* # Element-width overrides +Element-width overrides are best illustrated with a packed structure +union in the c programming language. The following should be taken +literally, and assume always a little-endian layout: + typedef union { - uint8_t b; - uint16_t s; - uint32_t i; - uint64_t l; + uint8_t b[]; + uint16_t s[]; + uint32_t i[]; + uint64_t l[]; + uint8_t actual_bytes[8]; } el_reg_t; elreg_t int_regfile[128]; @@ -972,10 +977,20 @@ required.* elif bitwidth == 64: int_regfile[reg].l[offset] = val +In effect the GPR registers r0 to r127 (and corresponding FPRs fp0 +to fp127) are reinterpreted to be "starting points" in a byte-addressable +memory. Vectors - which become just a virtual naming construct - effectively +overlap. + +It is extremely important for implementors to note that the only circumstance +where upper portions of an underlying 64-bit register are zero'd out is +when the destination is a scalar. The ideal register file has byte-level +write-enable lines, just like most SRAMs. + An example ADD operation with predication and element width overrides:  for (i = 0; i < VL; i++) - if (predval & 1<>destwid) + if (!RT.isvec) break + if (RT.isvec)  { id += 1; } + if (RA.isvec)  { irs1 += 1; } + if (RB.isvec)  { irs2 += 1; } + if (RC.isvec)  { irs3 += 1; } +The significant part here is that the second half is stored +starting not from RT+MAXVL at all: it is the *element* index +that is offset by MAXVL, both starting from RT. * [[isa/svfixedarith]] * [[isa/svfparith]]