From f348fcfe4996383d5066a2a2b0836cb7f1a47d80 Mon Sep 17 00:00:00 2001 From: lkcl Date: Fri, 8 Jan 2021 14:18:20 +0000 Subject: [PATCH] --- openpower/sv/ldst.mdwn | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/openpower/sv/ldst.mdwn b/openpower/sv/ldst.mdwn index a92d63cd2..f4b306f11 100644 --- a/openpower/sv/ldst.mdwn +++ b/openpower/sv/ldst.mdwn @@ -32,7 +32,8 @@ Thus we can see that Vector Indexed may be covered, and, as demonstrated with th At the minimum however it is possible to provide unit stride and vector mode, as follows: # LD not VLD! - function op_ld(RT, RA, immed, svctx, update=False) + # op_width: lb=1, lh=2, lw=4, ld=8 + op_load(RT, RA, op_width, immed, svctx, update):  rdv = map_dest_extra(RT);  rsv = map_src_extra(RA);  ps = get_pred_val(FALSE, RA); # predication on src @@ -45,15 +46,21 @@ At the minimum however it is possible to provide unit stride and vector mode, as # indirect mode (multi mode) EA = ireg[rsv+i] + immed; if update: ireg[rsv+i] = EA; + elif svctx.ldstmode == elementstride: + # element stride mode + EA = ireg[rsv] + i * immed + # note: overwrites repeatedly, effectively + # giving the last non-masked-out value + if update: ireg[rsv] = EA; elif svctx.ldstmode == unitstride: # unit and element stride mode - EA = ireg[rsv] + i * immed + EA = ireg[rsv] + i * op_width # note: overwrites repeatedly, effectively # giving the last non-masked-out value if update: ireg[rsv] = EA; else # standard scalar mode (but predicated) - # no stride multiplier means VSPLAT mode + # no stride multiplier means VSPLAT/VINSERT mode EA = ireg[rsv] + immed if update: ireg[rsv] = EA; ireg[rdv+j] <= MEM[EA]; @@ -72,9 +79,9 @@ Indexed LD is:  pd = get_pred_val(FALSE, RT); # ... AND on dest  for (i=0, j=0, k=0; i < VL && j < VL && k < VL): # skip nonpredicated RA, RB and RT - if (RA.isvec) while (!(ps & 1< -- 2.30.2