have to sanity-check dz/zz after full qualifier-processing in branch-mode
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sun, 25 Sep 2022 12:50:35 +0000 (13:50 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sun, 25 Sep 2022 12:50:35 +0000 (13:50 +0100)
src/openpower/sv/trans/svp64.py

index 37fb75669b783dff918011aa0a34b7ad5798f9df..334f50930da39e83579c5e06da4d045b2226d605 100644 (file)
@@ -1186,13 +1186,15 @@ class SVP64Asm:
                 elif encmode == 'cti':
                     svp64_rm.branch.CTR = 1
                     svp64_rm.branch.ctr.CTi = 1
-                elif encmode in ['dz', 'zz']:
-                    raise AssertionError("no encmode %s, use 'sz'" % encmode)
                 else:
                     raise AssertionError("unknown encmode %s" % encmode)
             else:
                 raise AssertionError("unknown encmode %s" % encmode)
 
+        # sanity check if dz/zz used in branch-mode
+        if is_bc and dst_zero:
+            raise AssertionError("dz/zz not supported in branch, use 'sz'")
+
         # check sea *after* all qualifiers are evaluated
         if sea:
             assert sv_mode in (None, 0b00, 0b01)