From: Jacob Lifshay Date: Mon, 7 Aug 2023 23:04:00 +0000 (-0700) Subject: split out instructions from openpower/isa/maddrs.mdwn X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b33ae9435211f9850d72bc103942c070b7590323;p=openpower-isa.git split out instructions from openpower/isa/maddrs.mdwn --- diff --git a/openpower/isa/maddrs.mdwn b/openpower/isa/maddrs.mdwn index f768044a..b398ad50 100644 --- a/openpower/isa/maddrs.mdwn +++ b/openpower/isa/maddrs.mdwn @@ -2,26 +2,4 @@ -# [DRAFT] Integer Butterfly Multiply Add and Accumulate FFT/DCT - -A-Form - -* maddrs 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/maddrs/maddrs" raw="yes"]] diff --git a/openpower/isa/maddrs/maddrs.mdwn b/openpower/isa/maddrs/maddrs.mdwn new file mode 100644 index 00000000..9c10b5ce --- /dev/null +++ b/openpower/isa/maddrs/maddrs.mdwn @@ -0,0 +1,13 @@ +# [DRAFT] Integer Butterfly Multiply Add and Accumulate FFT/DCT + +A-Form + +* maddrs RT,RA,RB,SH + +Pseudo-code: + +[[!inline pagenames="openpower/isa/maddrs/maddrs_code" raw="yes"]] + +Special Registers Altered: + + None diff --git a/openpower/isa/maddrs/maddrs_code.mdwn b/openpower/isa/maddrs/maddrs_code.mdwn new file mode 100644 index 00000000..d6c0267d --- /dev/null +++ b/openpower/isa/maddrs/maddrs_code.mdwn @@ -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]