From aae4f645c1f07e98fe1c6a3c6b01c74b9d8e3283 Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Sun, 25 Sep 2022 13:50:35 +0100 Subject: [PATCH] have to sanity-check dz/zz after full qualifier-processing in branch-mode --- src/openpower/sv/trans/svp64.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/openpower/sv/trans/svp64.py b/src/openpower/sv/trans/svp64.py index 37fb7566..334f5093 100644 --- a/src/openpower/sv/trans/svp64.py +++ b/src/openpower/sv/trans/svp64.py @@ -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) -- 2.30.2