From: lkcl Date: Fri, 5 Jan 2024 15:58:57 +0000 (+0000) Subject: (no commit message) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=53741987addffc997a6ba9fd680df222d6bc250b;p=libreriscv.git --- diff --git a/openpower/sv/cookbook/daxpy_example.mdwn b/openpower/sv/cookbook/daxpy_example.mdwn index 6316ca2ab..459fc233f 100644 --- a/openpower/sv/cookbook/daxpy_example.mdwn +++ b/openpower/sv/cookbook/daxpy_example.mdwn @@ -81,16 +81,16 @@ The end result is an exceptionally compact daxpy that is easy to read and understand. ``` - # r5: n count; r6: x ptr; r7: y ptr; fp1: a - 1 mtctr 5 # move n to CTR - 2 .L2 - 3 setvl MAXVL=32,VL=CTR # actually VL=MIN(MAXVL,CTR) - 4 sv.lfdup *32,8(6) # load x into fp32-63, incr x - 5 sv.lfd/els *64,8(7) # load y into fp64-95, NO INC - 6 sv.fmadd *64,*64,1,*32 # (*y) = (*y) * (*x) + a - 7 sv.stfdup *64,8(7) # store at y, post-incr y - 8 sv.bc/ctr .L2 # decr CTR by VL, jump !zero - 9 blr # return +# r5: n count; r6: x ptr; r7: y ptr; fp1: a +1 mtctr 5 # move n to CTR +2 .L2 +3 setvl MAXVL=32,VL=CTR # actually VL=MIN(MAXVL,CTR) +4 sv.lfdup *32,8(6) # load x into fp32-63, incr x +5 sv.lfd/els *64,8(7) # load y into fp64-95, NO INC +6 sv.fmadd *64,*64,1,*32 # (*y) = (*y) * (*x) + a +7 sv.stfdup *64,8(7) # store at y, post-incr y +8 sv.bc/ctr .L2 # decr CTR by VL, jump !zero +9 blr # return ``` # RVV version