From 2483a2bc0cd98d0655610b7b8f4af4894edbc10f Mon Sep 17 00:00:00 2001 From: lkcl Date: Thu, 10 Dec 2020 17:52:54 +0000 Subject: [PATCH] --- openpower/sv/svp_rewrite/svp64/discussion.mdwn | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/openpower/sv/svp_rewrite/svp64/discussion.mdwn b/openpower/sv/svp_rewrite/svp64/discussion.mdwn index 4047962d7..b33632921 100644 --- a/openpower/sv/svp_rewrite/svp64/discussion.mdwn +++ b/openpower/sv/svp_rewrite/svp64/discussion.mdwn @@ -33,26 +33,30 @@ something like: * ptyp - predication INT / CR * psrc / pdst - predicate mask selector and inversion * vspec - 3 bit src / dest scalar-vector extension -* sat: DEFAULT / 8bit / 16bit / 32bit (signed/unsigned) +* sat: 0bSU - S=1 signed U=1 unsigned 0b11 reserved # standard arith ops (single predication) these are of the form res = op(src1, src2, ...) -| 0 1 | 2 3 | 4 | 5 7 | 8 16 | 17 19 | -| ----- | --- | ---- | ---- | ----- | ----- | -| subvl | ew | ptyp | pred | vspec | sat | - +| 0 1 | 2 3 | 4 5 | 6 | 7 9 | 10 18 | 19 21 | +| ----- | --- | --- | ---- | ---- | ----- | ----- | +| subvl | sew | dew | ptyp | pred | vspec | sat | * subvl - 1 to 4 scalar / vec2 / vec3 / vec4 -* ew - DEFAULT / 8 / 16 /32 element width +* sew / dew - DEFAULT / 8 / 16 /32 element width * ptyp - predication INT / CR * pred - predicate mask selector and inversion * vspec - 2/3 bit src / dest scalar-vector extension -* sat: DEFAULT / 8bit / 16bit / 32bit (signed/unsigned) +* sat: 0bSU - S=1 signed U=1 unsigned 0b11 reserved For 2 op (dest/src1/src2) the tag may be 3 bits: total 9 bits. for 3 op (dest/src1/2/3) the vspec may be 2 bits per reg: total 8 bits. +Note: + +* saturation is done on the result at the **source** elwidth +* signed-saturation causes sign-extension from source to dest elwidths **after** saturation + # Notes about rounding, clamp and saturate One of the issues with vector ops is that in integer DSP ops for example in Audio the operation must clamp or saturate rather than overflow or ignore the upper bits and become a modulo operation. This for Audio is extremely important, also to provide an indicator as to whether saturation occurred. see [[av_opcodes]]. -- 2.30.2