add support for *_flag global variables needed by bfp_* functions
authorJacob Lifshay <programmerjake@gmail.com>
Fri, 12 May 2023 06:35:41 +0000 (23:35 -0700)
committerJacob Lifshay <programmerjake@gmail.com>
Fri, 12 May 2023 06:35:41 +0000 (23:35 -0700)
src/openpower/decoder/isa/caller.py
src/openpower/decoder/power_enums.py
src/openpower/decoder/pseudo/parser.py

index 6a4882c8a4a12c8a4e2cbbbe46b9eb0b175357ba..da25bd1e4caa46cbbdb3726a3956727ca58c4b81 100644 (file)
@@ -33,7 +33,8 @@ from openpower.decoder.power_enums import (FPTRANS_INSNS, CRInSel, CROutSel,
                                            SVP64LDSTmode, SVP64PredCR,
                                            SVP64PredInt, SVP64PredMode,
                                            SVP64RMMode, SVPType, XER_bits,
-                                           insns, spr_byname, spr_dict)
+                                           insns, spr_byname, spr_dict,
+                                           BFP_FLAG_NAMES)
 from openpower.decoder.power_insn import SVP64Instruction
 from openpower.decoder.power_svp64 import SVP64RM, decode_extra
 from openpower.decoder.selectable_int import (FieldSelectableInt,
@@ -1255,6 +1256,9 @@ class ISACaller(ISACallerHelper, ISAFPHelpers, StepLoop):
                                'XLEN': 64  # elwidth overrides
                                })
 
+        for name in BFP_FLAG_NAMES:
+            setattr(self, name, 0)
+
         # update pc to requested start point
         self.set_pc(initial_pc)
 
index ed6354243b11cb21b4aa4c150862f48000e6b8ab..3bd7eee160ec8afb38cc12204e47285cbeebb6b3 100644 (file)
@@ -1109,6 +1109,23 @@ XER_bits = {
 
 MSRSpec = namedtuple("MSRSpec", ["dr", "pr", "sf"])
 
+# flags for bfp_* functions
+BFP_FLAG_NAMES = (
+    'vxsnan_flag',
+    'vximz_flag',
+    'vxidi_flag',
+    'vxisi_flag',
+    'vxzdz_flag',
+    'vxsqrt_flag',
+    'vxcvi_flag',
+    'vxvc_flag',
+    'ox_flag',
+    'ux_flag',
+    'xx_flag',
+    'zx_flag',
+    'inc_flag',
+)
+
 if __name__ == '__main__':
     # find out what the heck is in SPR enum :)
     print("sprs full", len(SPRfull))
index d9dd7cddb3a0d772b233f9f0a0768b0c8c37487d..48b5e82acaed75f8f948b995e0bc29cb4af11717 100644 (file)
@@ -17,6 +17,7 @@ from openpower.decoder.power_decoder import create_pdecode
 from openpower.decoder.pseudo.lexer import (
     IndentLexer, raise_syntax_error, SyntaxError2)
 from openpower.decoder.orderedset import OrderedSet
+from openpower.decoder.power_enums import BFP_FLAG_NAMES
 
 # I use the Python AST
 #from compiler import ast
@@ -671,7 +672,7 @@ class PowerParser:
                     'SVSHAPE0', 'SVSHAPE1', 'SVSHAPE2', 'SVSHAPE3']:
             self.special_regs.add(name)
             self.write_regs.add(name)  # and add to list to write
-        if name in ('XLEN', 'FPSCR'):
+        if name in ('XLEN', 'FPSCR') or name in BFP_FLAG_NAMES:
             attr = ast.Name("self", ast.Load())
             p[0] = ast.Attribute(attr, name, ast.Load(), lineno=p.lineno(1))
         else: