[Feature] Added BinaryOps.AND/BinaryOps.OR (#5223)

* [Feature] Added BinaryOps.AND/BinaryOps.OR

* Add: __rand__, __ror__
This commit is contained in:
hikettei
2024-06-30 09:20:25 +09:00
committed by GitHub
parent 50b05dd3f4
commit ad1ca7da64
9 changed files with 68 additions and 3 deletions

View File

@@ -106,6 +106,12 @@ class Neq(Function):
class Xor(Function):
def forward(self, x:LazyBuffer, y:LazyBuffer) -> LazyBuffer: return x.e(BinaryOps.XOR, y)
class BitwiseAnd(Function):
def forward(self, x:LazyBuffer, y:LazyBuffer) -> LazyBuffer: return x.e(BinaryOps.AND, y)
class BitwiseOr(Function):
def forward(self, x:LazyBuffer, y:LazyBuffer) -> LazyBuffer: return x.e(BinaryOps.OR, y)
class Add(Function):
def forward(self, x:LazyBuffer, y:LazyBuffer) -> LazyBuffer: return x.e(BinaryOps.ADD, y)