dsld: MASK(0, 63-n) works just as well as MASK(64, 63-n).
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Fri, 28 Oct 2022 22:09:22 +0000 (23:09 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Fri, 28 Oct 2022 22:09:22 +0000 (23:09 +0100)
also fix "overflow" pseudocode

openpower/isa/svfixedarith.mdwn

index 6d82b896b440b87e21efc078fe1abd80d4962387..4c624a3adc5c12cccace4756bcd20bdac4223cf4 100644 (file)
@@ -57,12 +57,12 @@ Pseudo-code:
 
     n <- (RB)[58:63]
     v <- ROTL64((RA), n)
-    mask <- MASK(64, 63-n)
+    mask <- MASK(0, 63-n)
     RT <- (v[0:63] & mask) | ((RC) & ¬mask)
     RS <- v[0:63] & ¬mask
-    overflow = 0
-    if RS != [0]*64:
-        overflow = 1
+    overflow <- 0
+    if RS != [0]*64 then
+        overflow <- 1
 
 Special Registers Altered:
 
@@ -82,9 +82,9 @@ Pseudo-code:
     mask <- MASK(n, 63)
     RT <- (v[0:63] & mask) | ((RC) & ¬mask)
     RS <- v[0:63] & ¬mask
-    overflow = 0
-    if RS != [0]*64:
-        overflow = 1
+    overflow <- 0
+    if RS != [0]*64 then
+        overflow <- 1
 
 Special Registers Altered: