From: lkcl Date: Sat, 29 Apr 2023 12:22:53 +0000 (+0100) Subject: (no commit message) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ada402d12038ecfe920ed2d39519ca123f06b693;p=libreriscv.git --- diff --git a/openpower/sv/twin_butterfly.mdwn b/openpower/sv/twin_butterfly.mdwn index 3bd36d897..5862253df 100644 --- a/openpower/sv/twin_butterfly.mdwn +++ b/openpower/sv/twin_butterfly.mdwn @@ -14,13 +14,13 @@ The goal is to implement instructions that calculate the expression: ``` -fdct_round_shift((a +/- b) * c) + fdct_round_shift((a +/- b) * c) ``` For the single-coefficient butterfly instruction, and: ``` - fdct_round_shift(a * c1 +/- b * c2) + fdct_round_shift(a * c1 +/- b * c2) ``` For the double-coefficient butterfly instruction. @@ -28,7 +28,7 @@ For the double-coefficient butterfly instruction. `fdct_round_shift` is defined as `ROUND_POWER_OF_TWO(x, 14)` ``` -#define ROUND_POWER_OF_TWO(value, n) (((value) + (1 << ((n)-1))) >> (n)) + #define ROUND_POWER_OF_TWO(value, n) (((value) + (1 << ((n)-1))) >> (n)) ``` These instructions are at the core of **ALL** FDCT calculations in many major video codecs, including -but not limited to- VP8/VP9, AV1, etc. @@ -37,10 +37,16 @@ Arm includes special instructions to optimize these operations, although they ar The suggestion is to have a single instruction to calculate both values `((a + b) * c) >> N`, and `((a - b) * c) >> N`. The instruction will run in accumulate mode, so in order to calculate the 2-coeff version one would just have to call the same instruction with different order a, b and a different constant c. -## [DRAFT] Integer Butterfly Multiply Add/Sub FFT/DCT +## Integer Butterfly Multiply Add/Sub FFT/DCT A-Form +``` + |0 |6 |11 |16 |21 |26 |31 | + | PO | RT | RA | RB | SH | XO |Rc | + +``` + * maddsubrs RT,RA,SH,RB Pseudo-code: @@ -70,25 +76,9 @@ Special Registers Altered: None ``` -Where we have added this variant in A-Form (defined in fields.txt): - -``` -# # 1.6.17 A-FORM - |0 |6 |11 |16 |21 |26 |31 | - | PO | RT | RA | RB | SH | XO |Rc | - -``` - -The instruction has been added to `minor_22.csv`: - -``` -------01000,ALU,OP_MADDSUBRS,RT,CONST_SH,RB,RT,NONE,CR0,0,0,ZERO,0,NONE,0,0,0,0,1,0,RC_ONLY,0,0,maddsubrs,A,,1,unofficial until submitted and approved/renumbered by the opf isa wg -``` - - # Twin Butterfly Integer DCT Instruction(s) -## [DRAFT] Floating Twin Multiply-Add DCT [Single] +## Floating Twin Multiply-Add DCT [Single] X-Form @@ -117,7 +107,7 @@ Special Registers Altered: CR1 (if Rc=1) ``` -## [DRAFT] Floating Multiply-Add FFT [Single] +## Floating Multiply-Add FFT [Single] X-Form