From fe7090942f86fc3aa7d8121d43892b6de4a5e5f9 Mon Sep 17 00:00:00 2001 From: Dmitry Selyutin Date: Sun, 23 Jan 2022 18:22:42 +0000 Subject: [PATCH] sv_binutils: consider opcode whenever names match --- src/openpower/sv/sv_binutils.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/openpower/sv/sv_binutils.py b/src/openpower/sv/sv_binutils.py index 1f076147..8e7239a7 100644 --- a/src/openpower/sv/sv_binutils.py +++ b/src/openpower/sv/sv_binutils.py @@ -102,6 +102,12 @@ class Opcode(CType): fmt = f"{{value:0{self.bits}b}}:{{mask:0{self.bits}b}}" return fmt.format(value=self.value, mask=self.mask) + def __lt__(self, other): + if not isinstance(other, self.__class__): + return NotImplemented + + return self.__value < other.__value + @classmethod def c_decl(cls): yield f"struct svp64_opcode {{" @@ -186,6 +192,10 @@ class Entry(CType): def __lt__(self, other): if not isinstance(other, self.__class__): return NotImplemented + + if self.name == other.name: + return self.opcode < other.opcode + return self.name < other.name @classmethod -- 2.30.2