There were two code blocks with inverted min/max, prev commit missed one
authorLauri Kasanen <cand@gmx.com>
Fri, 21 May 2021 10:13:11 +0000 (13:13 +0300)
committerLauri Kasanen <cand@gmx.com>
Fri, 21 May 2021 10:13:11 +0000 (13:13 +0300)
openpower/sv/overview.mdwn

index 81d5b9aa90ac6dda251e0bf228914a21d3c7cdd9..ffee381eca1acbcb4e180096a71624179504defb 100644 (file)
@@ -608,7 +608,7 @@ truncated.  Only then can the arithmetic saturation condition be detected:
        # unsigned add
        result = op_add(src1, src2, opwidth) # at max width
        # now saturate (unsigned)
-       sat = max(result, (1<<destwid)-1)
+       sat = min(result, (1<<destwid)-1)
        set_polymorphed_reg(rd, destwid, i, sat)
        # set sat overflow
        if Rc=1: