back.pysim: fix simulation of Value.xor().
This commit is contained in:
parent
4777a7b3a2
commit
7f6b3f93f5
2 changed files with 6 additions and 3 deletions
|
|
@ -137,7 +137,7 @@ class _RHSValueCompiler(_ValueCompiler):
|
|||
return lambda state: normalize(arg(state) == mask, shape)
|
||||
if value.op == "r^":
|
||||
# Believe it or not, this is the fastest way to compute a sideways XOR in Python.
|
||||
return lambda state: normalize(str(arg(state)).count("1") % 2, shape)
|
||||
return lambda state: normalize(format(arg(state), "b").count("1") % 2, shape)
|
||||
elif len(value.operands) == 2:
|
||||
lhs, rhs = map(self, value.operands)
|
||||
if value.op == "+":
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue