split out instructions from openpower/isa/msubrs.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/msubrs.mdwn
openpower/isa/msubrs/msubrs.mdwn [new file with mode: 0644]
openpower/isa/msubrs/msubrs_code.mdwn [new file with mode: 0644]

index a2d229dcbb1559fb5c58dba257c1d75b14e7136b..c6118a3b30a8fc3e256148c0a5d04b06bdb4b933 100644 (file)
@@ -2,26 +2,4 @@
 
 <!-- PLEASE NOTE THESE ARE UNAPPROVED AND DRAFT, NOT SUBMITTED TO OPF ISA WG -->
 
-# [DRAFT] Integer Butterfly Multiply Add and Accumulate FFT/DCT
-
-A-Form
-
-* msubrs  RT,RA,RB,SH
-
-Pseudo-code:
-
-    n <- SH
-    prod <- MULS(RB, RA)
-    if n = 0 then
-        prod_lo <- prod[XLEN:(XLEN*2) - 1]
-        RT <- (RT) - prod_lo
-    else
-        res[0:XLEN*2-1] <- (EXTSXL((RT)[0], 1) || (RT)) - prod
-        round <- [0]*XLEN*2
-        round[XLEN*2 - n] <- 1
-        res <- res + round
-        RT <- res[XLEN - n:XLEN*2 - n -1]
-
-Special Registers Altered:
-
-    None
+[[!inline pagenames="openpower/isa/msubrs/msubrs" raw="yes"]]
diff --git a/openpower/isa/msubrs/msubrs.mdwn b/openpower/isa/msubrs/msubrs.mdwn
new file mode 100644 (file)
index 0000000..d2eb9db
--- /dev/null
@@ -0,0 +1,13 @@
+# [DRAFT] Integer Butterfly Multiply Add and Accumulate FFT/DCT
+
+A-Form
+
+* msubrs  RT,RA,RB,SH
+
+Pseudo-code:
+
+[[!inline pagenames="openpower/isa/msubrs/msubrs_code" raw="yes"]]
+
+Special Registers Altered:
+
+    None
diff --git a/openpower/isa/msubrs/msubrs_code.mdwn b/openpower/isa/msubrs/msubrs_code.mdwn
new file mode 100644 (file)
index 0000000..78a9e41
--- /dev/null
@@ -0,0 +1,11 @@
+    n <- SH
+    prod <- MULS(RB, RA)
+    if n = 0 then
+        prod_lo <- prod[XLEN:(XLEN*2) - 1]
+        RT <- (RT) - prod_lo
+    else
+        res[0:XLEN*2-1] <- (EXTSXL((RT)[0], 1) || (RT)) - prod
+        round <- [0]*XLEN*2
+        round[XLEN*2 - n] <- 1
+        res <- res + round
+        RT <- res[XLEN - n:XLEN*2 - n -1]