From: Jacob Lifshay Date: Mon, 7 Aug 2023 23:04:00 +0000 (-0700) Subject: split out instructions from openpower/isa/msubrs.mdwn X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=3cf8c964a0e89de782990d448760e6a96ad38169;p=openpower-isa.git split out instructions from openpower/isa/msubrs.mdwn --- diff --git a/openpower/isa/msubrs.mdwn b/openpower/isa/msubrs.mdwn index a2d229dc..c6118a3b 100644 --- a/openpower/isa/msubrs.mdwn +++ b/openpower/isa/msubrs.mdwn @@ -2,26 +2,4 @@ -# [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 index 00000000..d2eb9db8 --- /dev/null +++ b/openpower/isa/msubrs/msubrs.mdwn @@ -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 index 00000000..78a9e410 --- /dev/null +++ b/openpower/isa/msubrs/msubrs_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]