power_insn: support operands check
authorDmitry Selyutin <ghostmansd@gmail.com>
Sat, 3 Sep 2022 10:09:30 +0000 (13:09 +0300)
committerDmitry Selyutin <ghostmansd@gmail.com>
Sat, 3 Sep 2022 18:41:28 +0000 (21:41 +0300)
src/openpower/decoder/power_insn.py

index 2cc942dd46e2bcc5fe07cb4786075d8b8f24c0d0..da843aa21481df3a615bf9253145ac2922b9ba3b 100644 (file)
@@ -491,6 +491,9 @@ class Operands:
     def __iter__(self):
         yield from self.__operands
 
+    def __contains__(self, key):
+        return self.__getitem__(key) is not None
+
     def __getitem__(self, key):
         for operand in self.__operands:
             if operand.name == key: