add DCT butterfly mode into svremap
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Fri, 23 Jul 2021 13:16:23 +0000 (14:16 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Fri, 23 Jul 2021 13:16:23 +0000 (14:16 +0100)
openpower/isa/simplev.mdwn

index d76d823a719aa9d171559b1eb2d4cbda1301b880..c4eb7711e1fa1f4679ebaac32a62833898217862 100644 (file)
@@ -97,7 +97,7 @@ Pseudo-code:
         # FRC
         SVSHAPE2[18:20] <- 0b001          # permute x,z,y
         SVSHAPE2[28:29] <- 0b11           # skip y
-    # set schedule up for butterfly
+    # set schedule up for FFT butterfly
     if (SVRM = 0b0001) then
         # calculate O(N log2 N)
         n <- [0] * 3
@@ -118,6 +118,25 @@ Pseudo-code:
         SVSHAPE1[28:29] <- 0b01           # j+halfstep schedule
         # FRC (coefficients)
         SVSHAPE2[28:29] <- 0b10           # k schedule
+    # set schedule up for DCT Inner butterfly
+    if (SVRM = 0b0010) then
+        # calculate O(N log2 N)
+        n <- [0] * 3
+        do while n < 5
+           if SVxd[4-n] = 0 then
+               leave
+           n <- n + 1
+        n <- ((0b0 || SVxd) + 1) * n
+        vlen[0:6] <- n[1:7]
+        # set up template in SVSHAPE0, then copy to 1-3
+        # for FRA and FRT
+        SVSHAPE0[0:5] <- (0b0 || SVxd)   # xdim
+        SVSHAPE0[30:31] <- 0b01          # Butterfly mode
+        SVSHAPE0[18:20] <- 0b001         # DCT Inner Butterfly sub-mode
+        # copy
+        SVSHAPE1[0:31] <- SVSHAPE0[0:31]
+        # set up FRB and FRS
+        SVSHAPE1[28:29] <- 0b01           # j+halfstep schedule
     # set VL, MVL and Vertical-First
     SVSTATE[0:6] <- vlen
     SVSTATE[7:13] <- vlen