projects
/
ieee754fpu.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
04fbe1a
)
add shift operators TODO on partsig
author
Luke Kenneth Casson Leighton
<lkcl@lkcl.net>
Fri, 7 Feb 2020 16:29:19 +0000
(16:29 +0000)
committer
Luke Kenneth Casson Leighton
<lkcl@lkcl.net>
Fri, 7 Feb 2020 16:29:19 +0000
(16:29 +0000)
src/ieee754/part/partsig.py
patch
|
blob
|
history
diff --git
a/src/ieee754/part/partsig.py
b/src/ieee754/part/partsig.py
index 1eae4a140a44b823e4ceda3adcb590eecc4c5d4a..cef3fed6b2654b25d133d188a25d97480605c40f 100644
(file)
--- 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)