|
17 | 17 | from devito.types import Symbol |
18 | 18 | from devito.types.basic import Basic |
19 | 19 |
|
20 | | -__all__ = ['CondEq', 'CondNe', 'BitwiseNot', 'BitwiseXor', 'IntDiv', # noqa |
21 | | - 'CallFromPointer', 'CallFromComposite', 'FieldFromPointer', |
22 | | - 'FieldFromComposite', 'ListInitializer', 'Byref', 'IndexedPointer', |
23 | | - 'Cast', 'DefFunction', 'MathFunction', 'InlineIf', 'ReservedWord', |
24 | | - 'Keyword', 'String', 'Macro', 'Class', 'MacroArgument', 'Deref', |
25 | | - 'Namespace', 'Rvalue', 'Null', 'SizeOf', 'rfunc', 'BasicWrapperMixin', |
26 | | - 'ValueLimit', 'VectorAccess'] |
| 20 | +__all__ = ['CondEq', 'CondNe', 'BitwiseNot', 'BitwiseXor', 'BitwiseAnd', # noqa |
| 21 | + 'LeftShift', 'RightShift', 'IntDiv', 'CallFromPointer', |
| 22 | + 'CallFromComposite', 'FieldFromPointer', 'FieldFromComposite', |
| 23 | + 'ListInitializer', 'Byref', 'IndexedPointer', 'Cast', 'DefFunction', |
| 24 | + 'MathFunction', 'InlineIf', 'ReservedWord', 'Keyword', 'String', |
| 25 | + 'Macro', 'Class', 'MacroArgument', 'Deref', 'Namespace', 'Rvalue', |
| 26 | + 'Null', 'SizeOf', 'rfunc', 'BasicWrapperMixin', 'ValueLimit', |
| 27 | + 'VectorAccess'] |
27 | 28 |
|
28 | 29 |
|
29 | 30 | class CondEq(sympy.Eq): |
@@ -65,16 +66,33 @@ def negated(self): |
65 | 66 |
|
66 | 67 |
|
67 | 68 | class BitwiseNot(BooleanFunction): |
68 | | - pass |
| 69 | + op = '~' |
69 | 70 |
|
70 | 71 |
|
71 | | -class BitwiseXor(BooleanFunction): |
| 72 | +class BitwiseBinaryOp(BooleanFunction): |
| 73 | + op = '' |
72 | 74 |
|
73 | 75 | # Enforce two args |
74 | 76 | def __new__(cls, arg0, arg1, **kwargs): |
75 | 77 | return super().__new__(cls, arg0, arg1, **kwargs) |
76 | 78 |
|
77 | 79 |
|
| 80 | +class BitwiseXor(BitwiseBinaryOp): |
| 81 | + op = '^' |
| 82 | + |
| 83 | + |
| 84 | +class BitwiseAnd(BitwiseBinaryOp): |
| 85 | + op = '&' |
| 86 | + |
| 87 | + |
| 88 | +class LeftShift(BitwiseBinaryOp): |
| 89 | + op = '<<' |
| 90 | + |
| 91 | + |
| 92 | +class RightShift(BitwiseBinaryOp): |
| 93 | + op = '>>' |
| 94 | + |
| 95 | + |
78 | 96 | class IntDiv(sympy.Expr): |
79 | 97 |
|
80 | 98 | """ |
|
0 commit comments