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]
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