move sea check to after all qualifiers are checked
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sat, 24 Sep 2022 16:24:35 +0000 (17:24 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sat, 24 Sep 2022 16:24:35 +0000 (17:24 +0100)
src/openpower/sv/trans/svp64.py
src/openpower/sv/trans/test_pysvp64dis.py

index 7bf93eff6dd564a81ad1ec9ede541e520cfdac0c..ec2e9396132fc4717280294539f69981d3bc0385 100644 (file)
@@ -1154,7 +1154,6 @@ class SVP64Asm:
                 assert sv_mode == 0b01 # only allow ff mode
                 vli = True
             elif encmode == 'sea':
-                assert sv_mode in (None, 0b00, 0b01)
                 assert is_ldst_idx
                 sea = True
                 assert failfirst is False, "cannot use ffirst+signed-address"
@@ -1192,6 +1191,10 @@ class SVP64Asm:
             else:
                 raise AssertionError("unknown encmode %s" % encmode)
 
+        # check sea *after* all qualifiers are evaluated
+        if sea:
+            assert sv_mode in (None, 0b00, 0b01)
+
         if ptype == '2P':
             # since m=xx takes precedence (overrides) sm=xx and dm=xx,
             # treat them as mutually exclusive
index dc146447dafcd64038a40ca5512e28f3334ba940..7a29d67e914d1fb5d74f6ce23afc1defa65115bc 100644 (file)
@@ -298,7 +298,9 @@ class SVSTATETestCase(unittest.TestCase):
     def test_19_ldst_idx_els(self):
         expected = [
                     "sv.stdx/els *4,16,2",
+                    "sv.stdx/sea/els *4,16,2",
                     "sv.ldx/els *4,16,2",
+                    "sv.ldx/sea/els *4,16,2",
                         ]
         self._do_tst(expected)