From df9be2a24b1e7ad5ba705d146f8e314363506acd Mon Sep 17 00:00:00 2001 From: lkcl Date: Tue, 3 May 2022 19:48:22 +0100 Subject: [PATCH] --- openpower/sv/bitmanip.mdwn | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/openpower/sv/bitmanip.mdwn b/openpower/sv/bitmanip.mdwn index b33e80a33..eafe63a93 100644 --- a/openpower/sv/bitmanip.mdwn +++ b/openpower/sv/bitmanip.mdwn @@ -129,7 +129,7 @@ double check that instructions didn't need 3 inputs. | NN | RT | RA | RB | 1 | itype | 0101 110 |Rc| xperm | | NN | RA | RB | RC | 0 | itype | 1001 110 |Rc| av minmax | | NN | RA | RB | RC | 1 | 00 | 1001 110 |Rc| av abss | -| NN | RA | RB | RC | 1 | 01 | 1001 110 |Rc| av absu| +| NN | RA | RB | RC | 1 | 01 | 1001 110 |Rc| av absu | | NN | RA | RB | | 1 | 10 | 1001 110 |Rc| av avgadd | | NN | RA | RB | | 1 | 11 | 1001 110 |Rc| rsvd | | NN | RT | | | | | 1101 110 |Rc| rsvd | @@ -214,7 +214,9 @@ another mode selection would be CRs not Ints. crregs[BC][i]) -# int min/max +# int ops + +## min/max required for the [[sv/av_opcodes]] @@ -237,7 +239,7 @@ uint_xlen_t maxu(uint_xlen_t rs1, uint_xlen_t rs2) } ``` -# int average +## average required for the [[sv/av_opcodes]], these exist in Packed SIMD (VSX) but not scalar @@ -248,7 +250,18 @@ uint_xlen_t intavg(uint_xlen_t rs1, uint_xlen_t rs2) { } ``` -## cmix +## abs + +required for the [[sv/av_opcodes]], these exist in Packed SIMD (VSX) +but not scalar + +``` +uint_xlen_t intabs(uint_xlen_t rs1, uint_xlen_t rs2) { + return (src1 > src2) ? (src1-src2) : (src2-src1) +} +``` + +# cmix based on RV bitmanip, covered by ternlog bitops -- 2.30.2