power_fields: fix comparison operators
authorDmitry Selyutin <ghostmansd@gmail.com>
Sat, 17 Sep 2022 13:51:50 +0000 (16:51 +0300)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sat, 17 Sep 2022 16:44:16 +0000 (17:44 +0100)
src/openpower/decoder/power_fields.py

index 80aa1d4e11eaabf8548c9f9992461a4dffadb664..e7d353b51a61122452da795131420a68d7d7685e 100644 (file)
@@ -8,6 +8,7 @@ from openpower.decoder.selectable_int import (
     SelectableInt as _SelectableInt,
     BitRange as _BitRange,
     selectconcat as _selectconcat,
+    selectltu as _selectltu,
 )
 
 
@@ -62,10 +63,10 @@ class Reference:
         else:
             raise ValueError(other)
 
-        return op(lhs, rhs)
+        return op(int(lhs), int(rhs))
 
     def __lt__(self, other):
-        return self.__binary_operator(_operator.lt, other)
+        return self.__binary_operator(_selectltu, other)
 
     def __eq__(self, other):
         return self.__binary_operator(_operator.eq, other)