correct pseudocode for cbranch
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Wed, 25 Sep 2019 07:59:03 +0000 (08:59 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Wed, 25 Sep 2019 07:59:03 +0000 (08:59 +0100)
simple_v_extension/appendix.mdwn

index 553d3eee758bc6ad4ef29574dc8d5efbc88b48fc..a951d4450663125307b76c5d5feff09a609c16c3 100644 (file)
@@ -326,16 +326,20 @@ complex), this becomes:
 
     if pred_inversion:
         if pred_zeroing:
-            if result != 0:
+            # NOR
+            if result == 0:
                 goto branch
         else:
-            if result == 0:
+            # NAND
+            if (result & ps) != result:
                 goto branch
     else:
         if pred_zeroing:
-            if (result & ps) != result:
+            # OR
+            if result != 0:
                 goto branch
         else:
+            # AND
             if (result & ps) == result:
                 goto branch