From: lkcl Date: Sun, 25 Sep 2022 09:36:09 +0000 (+0100) Subject: (no commit message) X-Git-Tag: opf_rfc_ls005_v1~285 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=db06f1d6846696fc5d7930821e17a94a56dc298c;p=libreriscv.git --- diff --git a/openpower/sv/svp64/appendix.mdwn b/openpower/sv/svp64/appendix.mdwn index 642e9e8d1..ae8a0616f 100644 --- a/openpower/sv/svp64/appendix.mdwn +++ b/openpower/sv/svp64/appendix.mdwn @@ -985,10 +985,14 @@ literally, and assume always a little-endian layout: elreg_t int_regfile[128]; - get_polymorphed_reg(reg, bitwidth, offset): - el_reg_t res; +Accessing (get and set) of registers given a value, register (in `elreg_t` +form), and that all arithmetic, numbering and pseudo-Memory format is +LE-endian and LSB0-numbered below: + + elreg_t& get_polymorphed_reg(elreg_t const& reg, bitwidth, offset): + el_reg_t res; // result res.l = 0; // TODO: going to need sign-extending / zero-extending - if !reg.isvec: // scalar has no element offset + if !reg.isvec: // scalar access has no element offset offset = 0 if bitwidth == 8: reg.b = int_regfile[reg].b[offset] @@ -998,9 +1002,9 @@ literally, and assume always a little-endian layout: reg.i = int_regfile[reg].i[offset] elif bitwidth == 64: reg.l = int_regfile[reg].l[offset] - return res & bytemask + return reg - set_polymorphed_reg(reg, bitwidth, offset, val): + set_polymorphed_reg(elreg_t& reg, bitwidth, offset, val): if (!reg.isvec): # for safety mask out hi bits bytemask = (8 << bitwidth) - 1