From: Luke Kenneth Casson Leighton Date: Fri, 7 Feb 2020 16:29:19 +0000 (+0000) Subject: add shift operators TODO on partsig X-Git-Tag: ls180-24jan2020~233 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f487ba8f94dac9b63ae2c43b764e6ac0ca70abd4;p=ieee754fpu.git add shift operators TODO on partsig --- diff --git a/src/ieee754/part/partsig.py b/src/ieee754/part/partsig.py index 1eae4a14..cef3fed6 100644 --- a/src/ieee754/part/partsig.py +++ b/src/ieee754/part/partsig.py @@ -86,6 +86,15 @@ class PartitionedSignal: # binary ops that need partitioning + def __lshift__(self, other): + return Operator("<<", [self, other]) + def __rlshift__(self, other): + return Operator("<<", [other, self]) + def __rshift__(self, other): + return Operator(">>", [self, other]) + def __rrshift__(self, other): + return Operator(">>", [other, self]) + def __add__(self, other): shape = self.sig.shape() pa = PartitionedAdder(shape[0], self.partpoints)