From 7f493b0656dfd164e518c6e4de87c0f1c6351472 Mon Sep 17 00:00:00 2001 From: lkcl Date: Sun, 15 May 2022 17:14:14 +0100 Subject: [PATCH] --- openpower/sv/bitmanip.mdwn | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/openpower/sv/bitmanip.mdwn b/openpower/sv/bitmanip.mdwn index 52b70aeca..a6b421f71 100644 --- a/openpower/sv/bitmanip.mdwn +++ b/openpower/sv/bitmanip.mdwn @@ -261,6 +261,25 @@ uint_xlen_t intabs(uint_xlen_t rs1, uint_xlen_t rs2) { } ``` +## abs-accumulate + +required for the [[sv/av_opcodes]], these are needed for motion estimation. +both are overwrite on RS. + +``` +uint_xlen_t uintabsacc(uint_xlen_t rs, uint_xlen_t ra, uint_xlen_t rb) { + return rs + (src1 > src2) ? (src1-src2) : (src2-src1) +} +uint_xlen_t intabsacc(uint_xlen_t rs, int_xlen_t ra, int_xlen_t rb) { + return rs + (src1 > src2) ? (src1-src2) : (src2-src1) +} +``` + +For SVP64 these use EXTRA2 and allow Twin Elwidths. The reason is so +that the Register used as an Accumulator (RS) may have its own +Element Width Override. This allows e.g. a 16 bit accumulator for 8 bit +differences. + # shift-and-add Power ISA is missing LD/ST with shift, which is present in both ARM and x86. -- 2.30.2