From: lkcl Date: Sat, 20 Aug 2022 11:34:30 +0000 (+0100) Subject: (no commit message) X-Git-Tag: opf_rfc_ls005_v1~826 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=3b5e7fc54cdf92e510f8e793662c35bbef04f2b4;p=libreriscv.git --- diff --git a/openpower/sv/ldst.mdwn b/openpower/sv/ldst.mdwn index b5aa548e8..02e6358a9 100644 --- a/openpower/sv/ldst.mdwn +++ b/openpower/sv/ldst.mdwn @@ -444,8 +444,7 @@ and other modes have all been removed, for clarity and simplicity: # LD not VLD! (ldbrx if brev=True) # this covers unit stride mode and a type of vector offset function op_ld(RT, RA, brev, op_width, imm_offs, svctx) - for (int i = 0, int j = 0; i < svctx.VL && j < svctx.VL;): - + for (int i = 0, int j = 0; i < svctx.VL && j < svctx.VL): if not svctx.unit/el-strided: # strange vector mode, compute 64 bit address which is # not polymorphic! elwidth hardcoded to 64 here @@ -460,7 +459,7 @@ and other modes have all been removed, for clarity and simplicity: bytereverse = brev XNOR MSR.LE # read the underlying memory - memread <= mem[srcbase + imm_offs]; + memread <= MEM(srcbase + imm_offs, op_width) # optionally performs byteswap at op width if (bytereverse): @@ -484,6 +483,28 @@ and other modes have all been removed, for clarity and simplicity: i++; j++; +For LD/Indexed, the key here is that in the calculation of the Effective Address, +RA has no elwidth override but RB does. + + # LD not VLD! + function op_ld(RT, RA, RB, op_width, svctx) + for (int i = 0, int j = 0; i < svctx.VL && j < svctx.VL): + if not svctx.el-strided: + # RA not polymorphic! elwidth hardcoded to 64 here + srcbase = get_polymorphed_reg(RA, 64, i) + else: + # element stride mode, again RA not polymorphic + srcbase = get_polymorphed_reg(RA, 64, 0) + # RB *is* polymorphic + offs = get_polymorphed_reg(RB, svctx.src_elwidth, i) + # sign-extend + if svctx.SEA: offs = sext(offs, svctx.src_elwidth, 64) + # read the underlying memory + memread <= MEM(srcbase + offs, op_width) + # proceed to check saturation + ... + ... + # Remapped LD/ST In the [[sv/remap]] page the concept of "Remapping" is described.