split out instructions from openpower/isa/maddsubrs.mdwn
authorJacob Lifshay <programmerjake@gmail.com>
Mon, 7 Aug 2023 23:04:00 +0000 (16:04 -0700)
committerJacob Lifshay <programmerjake@gmail.com>
Mon, 7 Aug 2023 23:06:58 +0000 (16:06 -0700)
openpower/isa/maddsubrs.mdwn
openpower/isa/maddsubrs/maddsubrs.mdwn [new file with mode: 0644]
openpower/isa/maddsubrs/maddsubrs_code.mdwn [new file with mode: 0644]

index 96efe5a553dcaf6895048ff23d7759edede2d31a..9369b72c7cc96b252100e3d921e99981f1c24c12 100644 (file)
@@ -2,34 +2,4 @@
 
 <!-- PLEASE NOTE THESE ARE UNAPPROVED AND DRAFT, NOT SUBMITTED TO OPF ISA WG -->
 
-# [DRAFT] Integer Butterfly Multiply Add/Sub Round Shift for FFT/DCT
-
-A-Form
-
-* maddsubrs  RT,RA,RB,SH
-
-Pseudo-code:
-
-    n <- SH
-    sum <- (RT[0] || RT) + (RA[0] || RA)
-    diff <- (RT[0] || RT) - (RA[0] || RA)
-    prod1 <- MULS(RB, sum)
-    prod2 <- MULS(RB, diff)
-    if n = 0 then
-        prod1_lo <- prod1[XLEN+1:(XLEN*2)]
-        prod2_lo <- prod2[XLEN+1:(XLEN*2)]
-        RT <- prod1_lo
-        RS <- prod2_lo
-    else
-        round <- [0]*(XLEN*2 + 1)
-        round[XLEN*2 - n + 1] <- 1
-        prod1 <- prod1 + round
-        prod2 <- prod2 + round
-        res1 <- prod1[XLEN - n + 1:XLEN*2 - n]
-        res2 <- prod2[XLEN - n + 1:XLEN*2 - n]
-        RT <- res1
-        RS <- res2
-
-Special Registers Altered:
-
-    None
+[[!inline pagenames="openpower/isa/maddsubrs/maddsubrs" raw="yes"]]
diff --git a/openpower/isa/maddsubrs/maddsubrs.mdwn b/openpower/isa/maddsubrs/maddsubrs.mdwn
new file mode 100644 (file)
index 0000000..92a05f3
--- /dev/null
@@ -0,0 +1,13 @@
+# [DRAFT] Integer Butterfly Multiply Add/Sub Round Shift for FFT/DCT
+
+A-Form
+
+* maddsubrs  RT,RA,RB,SH
+
+Pseudo-code:
+
+[[!inline pagenames="openpower/isa/maddsubrs/maddsubrs_code" raw="yes"]]
+
+Special Registers Altered:
+
+    None
diff --git a/openpower/isa/maddsubrs/maddsubrs_code.mdwn b/openpower/isa/maddsubrs/maddsubrs_code.mdwn
new file mode 100644 (file)
index 0000000..80c996d
--- /dev/null
@@ -0,0 +1,19 @@
+    n <- SH
+    sum <- (RT[0] || RT) + (RA[0] || RA)
+    diff <- (RT[0] || RT) - (RA[0] || RA)
+    prod1 <- MULS(RB, sum)
+    prod2 <- MULS(RB, diff)
+    if n = 0 then
+        prod1_lo <- prod1[XLEN+1:(XLEN*2)]
+        prod2_lo <- prod2[XLEN+1:(XLEN*2)]
+        RT <- prod1_lo
+        RS <- prod2_lo
+    else
+        round <- [0]*(XLEN*2 + 1)
+        round[XLEN*2 - n + 1] <- 1
+        prod1 <- prod1 + round
+        prod2 <- prod2 + round
+        res1 <- prod1[XLEN - n + 1:XLEN*2 - n]
+        res2 <- prod2[XLEN - n + 1:XLEN*2 - n]
+        RT <- res1
+        RS <- res2