selectable_int: support int casts
authorDmitry Selyutin <ghostmansd@gmail.com>
Wed, 17 Aug 2022 11:51:30 +0000 (14:51 +0300)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Mon, 29 Aug 2022 19:38:11 +0000 (20:38 +0100)
src/openpower/decoder/selectable_int.py

index e0d2c6abe58b550d76cb0256e39793644b8e21ea..5a8a9b9db3e110916ca2810f4942e941c029402b 100644 (file)
@@ -459,6 +459,9 @@ class SelectableInt:
     def asint(self):
         return self.value
 
+    def __int__(self):
+        return self.asint()
+
     def __float__(self):
         """convert to double-precision float.  TODO, properly convert
         rather than a hack-job: must actually support Power IEEE754 FP