fixedshift: switch srawiX to XLEN
authorDmitry Selyutin <dmitry.selyutin@3mdeb.com>
Tue, 31 Aug 2021 20:00:08 +0000 (20:00 +0000)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Tue, 31 Aug 2021 20:22:08 +0000 (21:22 +0100)
openpower/isa/fixedshift.mdwn

index ecef4c3a18f854c89cf8f9cd4cde850e66f7609d..6e73a68374354eafdfd0dc01f55eadbac3ebfab3 100644 (file)
@@ -231,11 +231,11 @@ X-Form
 Pseudo-code:
 
     n <- SH
-    r <- ROTL32((RS)[32:63], 64-n)
-    m <- MASK32(n, 31)
-    s <- (RS)[32]
-    RA <- r&m | ([s]*64)& ¬m
-    carry <- s & ((r&¬m)[32:63] != 0)
+    r <- ROTL32((RS)[XLEN/2:XLEN-1], 64-n)
+    m <- MASK32(n, ((XLEN/2)-1))
+    s <- (RS)[XLEN/2]
+    RA <- r&m | ([s]*XLEN)& ¬m
+    carry <- s & ((r&¬m)[XLEN/2:XLEN-1] != 0)
     CA    <- carry
     CA32  <- carry