Convert to 4-operands, RT=RA, SH->4-bits, BF->DCTI
authorKonstantinos Margaritis <konstantinos.margaritis@vectorcamp.gr>
Fri, 28 Apr 2023 09:16:56 +0000 (09:16 +0000)
committerKonstantinos Margaritis <konstantinos.margaritis@vectorcamp.gr>
Fri, 28 Apr 2023 09:16:56 +0000 (09:16 +0000)
openpower/sv/twin_butterfly.mdwn

index 4670d77dcafc3949261723aa01a1edfb3bcf0d32..21cb5f25131193f63ed3ceb679c3292be74e7a4a 100644 (file)
@@ -34,21 +34,21 @@ The instruction will run in accumulate mode, so in order to calculate the 2-coef
 
 # [DRAFT] Integer Butterfly Multiply Add/Sub FFT/DCT
 
-BF-Form
+DCTI-Form
 
-* maddsubrs  RT,RA,RB,RC,SH
+* maddsubrs  RT,RA,RB,SH
 
 Pseudo-code:
 
 ```
-    sum <- (RA) + (RB)
-    diff <- (RA) - (RB)
-    prod1 <- MUL(RC, sum)   # TODO: pick hi-half
-    prod2 <- MUL(RC, diff)  # TODO: pick hi-half
-    res1 <- ROTL64(prod1, SH) # TODO shift the other way (63-SH?)
-    res2 <- ROTL64(prod2, SH)
-    RT <- res1
-    RS <- res2
+    sum <- (RT) + (RA)      # RT = a, RA = b
+    diff <- (RT) - (RA)
+    prod1 <- MUL(RB, sum)   # RB = c
+    prod2 <- MUL(RB, diff)  # TODO: Pick high half?
+    res1 <- ROTL64(prod1, XLEN-SH)
+    res2 <- ROTL64(prod2, XLEN-SH)
+    RT <- (RT) + res1
+    RS <- (RS) + res2
 ```
 
 Special Registers Altered:
@@ -57,18 +57,18 @@ Special Registers Altered:
     None
 ```
 
-Where BF-Form is defined in fields.txt:
+Where DCTI-Form is defined in fields.txt:
 
 ```
-# 1.6.39 BF-FORM
-    |0     | 6   |11   |16   |21   | 26 |27  31|
-    | PO   | RT  | RA  | RB  | RC  | SH | XO   |
+# 1.6.7.2 DCTI-FORM
+    |0     | 6    |11      |16     |21    |25      |31  |
+    | PO   |  RT  |   RA   |   RB  |   SH |   XO   | Rc |
 
 ```
 
 The instruction has been added to `minor_22.csv`:
 
 ```
-------01000,ALU,OP_MADDSUBRS,RA,RB,RC,RT,NONE,CR0,0,0,ZERO,0,NONE,0,0,0,0,1,0,RC_ONLY,0,0,maddsubrs,BF,,1,unofficial until submitted and approved/renumbered by the opf isa wg
+------01000,ALU,OP_MADDSUBRS,RT,CONST_UI,RB,RT,NONE,CR0,0,0,ZERO,0,NONE,0,0,0,0,1,0,RC_ONLY,0,0,maddsubrs,DCTI,,1,unofficial until submitted and approved/renumbered by the opf isa wg
 ```