提交 90c06f14 authored 作者: Frederic Bastien's avatar Frederic Bastien

fix identity and associative flag of some scalar.

上级 1bee17f9
......@@ -821,9 +821,9 @@ class BinaryBitOp(BinaryScalarOp):
return [None, None]
class OR(BinaryBitOp):
identity = False
identity = 0
commutative = True
associative = False
associative = True
def impl(self, x, y):
return x | y
def c_code(self, node, name, (x, y), (z, ), sub):
......@@ -831,9 +831,9 @@ class OR(BinaryBitOp):
or_ = OR()
class XOR(BinaryBitOp):
identity = False
identity = 0
commutative = True
associative = False
associative = True
def impl(self, x, y):
return x ^ y
def c_code(self, node, name, (x, y), (z, ), sub):
......@@ -841,9 +841,9 @@ class XOR(BinaryBitOp):
xor = XOR()
class AND(BinaryBitOp):
identity = False
identity = 1
commutative = True
associative = False
associative = True
def impl(self, x, y):
return x & y
def c_code(self, node, name, (x, y), (z, ), sub):
......@@ -851,7 +851,6 @@ class AND(BinaryBitOp):
and_ = AND()
class Invert(UnaryBitOp):
identity = False
def impl(self, x):
return ~x
def c_code(self, node, name, (x,), (z, ), sub):
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论