From: Luke Kenneth Casson Leighton Date: Sat, 24 Sep 2022 16:24:35 +0000 (+0100) Subject: move sea check to after all qualifiers are checked X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=4681516c95c4729fdcf763016a8010bdd93a2333;p=openpower-isa.git move sea check to after all qualifiers are checked --- diff --git a/src/openpower/sv/trans/svp64.py b/src/openpower/sv/trans/svp64.py index 7bf93eff..ec2e9396 100644 --- a/src/openpower/sv/trans/svp64.py +++ b/src/openpower/sv/trans/svp64.py @@ -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 diff --git a/src/openpower/sv/trans/test_pysvp64dis.py b/src/openpower/sv/trans/test_pysvp64dis.py index dc146447..7a29d67e 100644 --- a/src/openpower/sv/trans/test_pysvp64dis.py +++ b/src/openpower/sv/trans/test_pysvp64dis.py @@ -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)