[Libre-soc-dev] clamping/saturation semantics

Lauri Kasanen cand at gmx.com
Sat Dec 12 17:10:46 GMT 2020


On Sat, 12 Dec 2020 11:55:16 -0500
Hendrik Boom <hendrik at topoi.pooq.com> wrote:

> > But s16-s16=s8 cannot. Consider 1-256 - if that op was done at 8-bit
> > width, it would become 1-0=1. When the correct result is -255 (0xfeff),
>
> Would the correct result not be 0xff01 ?

Oh, indeed it would (checked with quick C). Then the signed sub
question becomes whether chopping should preserve sign or not.

Perhaps we need to come up with a less controversial example. Div?

- Lauri



More information about the Libre-soc-dev mailing list