use a simpler way to do the same thing
authorKonstantinos Margaritis <konstantinos.margaritis@vectorcamp.gr>
Mon, 1 May 2023 18:05:10 +0000 (18:05 +0000)
committerKonstantinos Margaritis <konstantinos.margaritis@vectorcamp.gr>
Thu, 4 May 2023 15:31:10 +0000 (15:31 +0000)
openpower/isa/butterfly.mdwn

index 65f4dc56564bb7c33197b8bf6e9b750eb8eeae15..43c5c48fee642e2db0de734929581b4cd23aa3d5 100644 (file)
@@ -21,10 +21,8 @@ Pseudo-code:
         RT <- prod1_lo
         RS <- prod2_lo
     else
-        if n = 1 then
-            round <- [0]*(XLEN -n) || [1]*1
-        else
-            round <- [0]*(XLEN -n) || [1]*1 || [0]*(n-1)
+        round <- [0]*XLEN
+        round[XLEN -n] <- 1
         prod1_lo <- prod1_lo + round
         prod2_lo <- prod2_lo + round
         m <- MASK(n, (XLEN-1))