From: Luke Kenneth Casson Leighton Date: Sat, 15 Feb 2020 17:41:17 +0000 (+0000) Subject: whoops shift width reduction not active X-Git-Tag: ls180-24jan2020~148 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f2a575dc7eb06d638bd9990255bc419a1d3ae753;p=ieee754fpu.git whoops shift width reduction not active --- 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