diff --git a/test/unit/test_x86op_values.py b/test/unit/test_x86op_values.py index 0e6587fea0..15a8486c2d 100644 --- a/test/unit/test_x86op_values.py +++ b/test/unit/test_x86op_values.py @@ -4,16 +4,21 @@ from tinygrad.renderer.isa import X86Ops, X86GroupOp class TestX86OpValues(unittest.TestCase): def test_values(self): + # ADD is added in X86Ops assert X86Ops.ADD != Ops.ADD assert X86Ops.ADD is not Ops.ADD - assert not isinstance(Ops.ADD, X86Ops) - assert isinstance(X86Ops.ADD, Ops) - assert isinstance(X86Ops.ADD, X86Ops) assert Ops.ADD not in X86GroupOp.All assert X86Ops.ADD not in GroupOp.All assert X86Ops.ADD in X86GroupOp.All - # this is now possible but is essentially invalid + assert not isinstance(Ops.ADD, X86Ops) + assert isinstance(X86Ops.ADD, Ops) + assert isinstance(X86Ops.ADD, X86Ops) + # SINK is not added in X86Ops, this is now possible but behavior doesn't change + assert X86Ops.SINK == Ops.SINK + assert X86Ops.SINK is Ops.SINK + assert X86Ops.SINK in GroupOp.All assert X86Ops.SINK not in X86GroupOp.All + assert not isinstance(X86Ops.SINK, X86Ops) assert max(op.value for op in GroupOp.All) + 1 == min(op.value for op in X86GroupOp.All) if __name__ == "__main__":