From: Luke Kenneth Casson Leighton Date: Fri, 7 Feb 2020 16:27:35 +0000 (+0000) Subject: invert partitioned op is just a bit-wise invert X-Git-Tag: ls180-24jan2020~235 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=6cee09b3cf458b0a25bf98983696783c0ba5d1ce;p=ieee754fpu.git invert partitioned op is just a bit-wise invert --- diff --git a/src/ieee754/part/partsig.py b/src/ieee754/part/partsig.py index 9e1c3f72..4fb74507 100644 --- a/src/ieee754/part/partsig.py +++ b/src/ieee754/part/partsig.py @@ -53,10 +53,13 @@ class PartitionedSignal: return self.sig.eq(val.sig) return self.sig.eq(val) - # unary ops that require partitioning + # unary ops that do not require partitioning def __invert__(self): - return Operator("~", [self]) + return ~self.sig + + # unary ops that require partitioning + def __neg__(self): return Operator("-", [self])