add first version setvl pseudocode
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sat, 13 Mar 2021 11:34:14 +0000 (11:34 +0000)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sat, 13 Mar 2021 11:34:21 +0000 (11:34 +0000)
openpower/isa/simplev.mdwn [new file with mode: 0644]

diff --git a/openpower/isa/simplev.mdwn b/openpower/isa/simplev.mdwn
new file mode 100644 (file)
index 0000000..6a158bc
--- /dev/null
@@ -0,0 +1,36 @@
+# setvl
+
+SVL-Form
+
+* setvl RT, RA, SVi, vs, ms
+
+Pseudo-code:
+
+    VLimm <- SVi + 1
+
+    if vs = 1 then
+        if RA = 0 then
+            VL <- (RA)
+        else
+            VL <- VLimm
+    else
+        VL <- SVSTATE[7:13]
+
+    if ms = 1 then
+        MVL <- VLimm
+    else
+        MVL <- SVSTATE[0:6]
+
+    if VL > MVL then
+        VL = MVL
+
+    SVSTATE[0:6] = MVL
+    SVSTATE[7:13] = VL
+
+    if RT != 0 then
+        RT <- VL
+
+Special Registers Altered:
+
+    CR0                     (if Rc=1)
+