From f2a575dc7eb06d638bd9990255bc419a1d3ae753 Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Sat, 15 Feb 2020 17:41:17 +0000 Subject: [PATCH] whoops shift width reduction not active --- src/ieee754/part_shift/part_shift_dynamic.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ieee754/part_shift/part_shift_dynamic.py b/src/ieee754/part_shift/part_shift_dynamic.py index bfd8b244..45ba08ca 100644 --- a/src/ieee754/part_shift/part_shift_dynamic.py +++ b/src/ieee754/part_shift/part_shift_dynamic.py @@ -78,11 +78,11 @@ class PartialResult(Elaboratable): # trying to shift data by 64 bits if the result width # is only 8. shifter = Signal(shiftbits, reset_less=True) - with m.If(element > shiftbits): - comb += shifter.eq(shiftbits) + maxval = C(self.reswid, element.shape()) + with m.If(element > maxval): + comb += shifter.eq(maxval) with m.Else(): comb += shifter.eq(element) - comb += shifter.eq(element) comb += self.partial.eq(self.a_interval << shifter) return m -- 2.30.2