From f9e91e958319fac522690f0bf7c50ce694969404 Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Wed, 13 May 2020 19:51:12 +0100 Subject: [PATCH] simplift right_mask and left_mask rotator sub-functions, remove TODO comments --- src/soc/shift_rot/rotator.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/soc/shift_rot/rotator.py b/src/soc/shift_rot/rotator.py index 3d90f8be..26c4280d 100644 --- a/src/soc/shift_rot/rotator.py +++ b/src/soc/shift_rot/rotator.py @@ -7,16 +7,12 @@ from soc.shift_rot.rotl import ROTL # note BE bit numbering def right_mask(m, mask_begin): - """ this can be replaced by something like (mask_begin << 1) - 1""" ret = Signal(64, name="right_mask", reset_less=True) - with m.If(mask_begin > 64): - m.d.comb += ret.eq(0) - with m.Else(): + with m.If(mask_begin <= 64): m.d.comb += ret.eq((1<<(64-mask_begin)) - 1) return ret def left_mask(m, mask_end): - """ this can be replaced by something like ~((mask_end << 1) - 1)""" ret = Signal(64, name="left_mask", reset_less=True) m.d.comb += ret.eq(~((1<<(63-mask_end)) - 1)) return ret -- 2.30.2