From 2d0de4f3d47c0479bbd244c89e145212792bdc36 Mon Sep 17 00:00:00 2001 From: lkcl Date: Fri, 5 Jan 2024 16:14:51 +0000 Subject: [PATCH] --- openpower/sv/cookbook/daxpy_example.mdwn | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/openpower/sv/cookbook/daxpy_example.mdwn b/openpower/sv/cookbook/daxpy_example.mdwn index aba10f784..dc6c1b10a 100644 --- a/openpower/sv/cookbook/daxpy_example.mdwn +++ b/openpower/sv/cookbook/daxpy_example.mdwn @@ -31,14 +31,13 @@ need explaining. ``` # 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 +2 .L2 setvl MAXVL=32,VL=CTR # actually VL=MIN(MAXVL,CTR) +3 sv.lfdup *32,8(6) # load x into fp32-63, incr x +4 sv.lfd/els *64,8(7) # load y into fp64-95, NO INC +5 sv.fmadd *64,*64,1,*32 # (*y) = (*y) * (*x) + a +6 sv.stfdup *64,8(7) # store at y, post-incr y +7 sv.bc/ctr .L2 # decr CTR by VL, jump !zero +8 blr # return ``` The first instruction is simple: the plan is to use CTR for looping. -- 2.30.2