Revert "https://bugs.libre-soc.org/show_bug.cgi?id=966#c4"
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Tue, 1 Nov 2022 13:49:16 +0000 (13:49 +0000)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Fri, 2 Jun 2023 18:51:16 +0000 (19:51 +0100)
This reverts commit 263a8fca0f7413e62cf74a0e559e8965b0951e6c.

openpower/isa/bitmanip.mdwn

index 5d4044886eb397c046b6cc9027f909d245e196c2..89515ec977385f3ffd7f91b253f795c7d55d69c8 100644 (file)
@@ -111,8 +111,12 @@ Z23-Form
 Pseudo-code:
 
     n <- (RB)
-    m <- sm + 1
-    RT <- (n[m:XLEN-1] || [0]*m) + (RA)
+    switch (sm)
+        case (0): sum[0:XLEN-1] = (n[0:XLEN-1-1] || [0]*1) + (RA)
+        case (1): sum[0:XLEN-1] = (n[0:XLEN-2-1] || [0]*2) + (RA)
+        case (2): sum[0:XLEN-1] = (n[0:XLEN-3-1] || [0]*3) + (RA)
+        default:  sum[0:XLEN-1] = (n[0:XLEN-4-1] || [0]*4) + (RA)
+    RT <- sum
 
 Special Registers Altered:
 
@@ -128,8 +132,12 @@ Z23-Form
 Pseudo-code:
 
     n <- ([0]*(XLEN/2)) || (RB)[XLEN/2:XLEN-1]
-    m <- sm + 1
-    RT <- (n[m:XLEN-1] || [0]*m) + (RA)
+    switch (sm)
+        case (0): sum[0:XLEN-1] = (n[0:XLEN-1-1] || [0]*1) + (RA)
+        case (1): sum[0:XLEN-1] = (n[0:XLEN-2-1] || [0]*2) + (RA)
+        case (2): sum[0:XLEN-1] = (n[0:XLEN-3-1] || [0]*3) + (RA)
+        default:  sum[0:XLEN-1] = (n[0:XLEN-4-1] || [0]*4) + (RA)
+    RT <- sum
 
 Special Registers Altered: