support official instructions that need .long format
authorJacob Lifshay <programmerjake@gmail.com>
Thu, 20 Jul 2023 00:59:32 +0000 (17:59 -0700)
committerJacob Lifshay <programmerjake@gmail.com>
Thu, 20 Jul 2023 00:59:32 +0000 (17:59 -0700)
src/openpower/insndb/core.py

index 61abc4fd0b7c9ba6e9b8204b6498adec57fa2a3c..f441cf8bada4ad875800f68f5cf3e2874cced6c1 100644 (file)
@@ -258,7 +258,7 @@ class PPCRecord(Dataclass):
     Rc: _RCOE = _RCOE.NONE
     form: _Form = _Form.NONE
     conditions: str = ""
-    unofficial: bool = False
+    unofficial: str = ""
 
     __KEYMAP = {
         "unit": "function",
@@ -1812,7 +1812,8 @@ class WordInstruction(Instruction):
                 if isinstance(operand, (GPRPairOperand, FPRPairOperand)):
                     paired = True
 
-        if style is Style.LEGACY and (paired or record.ppc.unofficial):
+        # unofficial == "0" means an official instruction that needs .long
+        if style is Style.LEGACY and (paired or record.ppc.unofficial != ""):
             yield f"{blob}.long 0x{int(self):08x}"
         else:
             operands = tuple(map(_operator.itemgetter(1),