From 31d9e45ea600bb24d0ce85e9a7f1581ddcf1d87c Mon Sep 17 00:00:00 2001 From: lkcl Date: Wed, 19 Apr 2023 14:14:34 +0100 Subject: [PATCH] --- openpower/sv/setvl.mdwn | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/openpower/sv/setvl.mdwn b/openpower/sv/setvl.mdwn index d271cf96a..59e0e36fb 100644 --- a/openpower/sv/setvl.mdwn +++ b/openpower/sv/setvl.mdwn @@ -144,19 +144,28 @@ to the order in which VL and SUBVL loops are applied being swapped ### Core concept loop +This example illustrates the Cray-style Loop concept. However where most Cray +Vectors have a Max Vector Length hard-coded into the architecture, Simple-V +allows MVL to be set, but only as a static immediate, so that compilers may +embed the register resource allocation statically at compile-time. + ``` loop: setvl a3, a0, MVL=8 # update a3 with vl # (# of elements this iteration) - # set MVL to 8 + # set MVL to 8 and + # set a3=VL=MIN(a0,MVL) # do vector operations at up to 8 length (MVL=8) # ... - sub a0, a0, a3 # Decrement count by vl + sub. a0, a0, a3 # Decrement count by vl, set CR0.eq bnez a0, loop # Any more? ``` ### Loop using Rc=1 +In this example, the `setvl.` instruction enabled Rc=1, which +sets CR0.eq when VL becomes zero. + ``` my_fn: li r3, 1000 -- 2.30.2