From: Luke Kenneth Casson Leighton Date: Wed, 19 May 2021 13:40:36 +0000 (+0100) Subject: comments for SVP64 ASM LD/ST-with-update duplicate RA X-Git-Tag: xlen-bcd~588 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=cf158f558398c3ce938fee4669eec53b19999531;p=openpower-isa.git comments for SVP64 ASM LD/ST-with-update duplicate RA --- diff --git a/src/openpower/sv/trans/svp64.py b/src/openpower/sv/trans/svp64.py index f106b469..4a7d44bb 100644 --- a/src/openpower/sv/trans/svp64.py +++ b/src/openpower/sv/trans/svp64.py @@ -232,6 +232,9 @@ class SVP64Asm: opregfields = zip(fields, v30b_regs) # err that was easy # now for each of those find its place in the EXTRA encoding + # note there is the possibility (for LD/ST-with-update) of + # RA occurring **TWICE**. to avoid it getting added to the + # v3.0B suffix twice, we spot it as a duplicate, here extras = OrderedDict() for idx, (field, regname) in enumerate(opregfields): imm, regname = decode_imm(regname) @@ -239,13 +242,14 @@ class SVP64Asm: log (" idx find", idx, field, regname, imm) extra = svp64_src.get(regname, None) if extra is not None: - extra = ('s', extra, False) + extra = ('s', extra, False) # not a duplicate extras[extra] = (idx, field, regname, rtype, imm) log (" idx src", idx, extra, extras[extra]) dextra = svp64_dest.get(regname, None) log ("regname in", regname, dextra) if dextra is not None: - dextra = ('d', dextra, extra is not None) + is_a_duplicate = extra is not None # duplicate spotted + dextra = ('d', dextra, is_a_duplicate) extras[dextra] = (idx, field, regname, rtype, imm) log (" idx dst", idx, extra, extras[dextra]) @@ -383,6 +387,8 @@ class SVP64Asm: extras[extra_idx] = sv_extra # append altered field value to v3.0b, differs for LDST + # note that duplicates are skipped e.g. EXTRA2 contains + # *BOTH* s:RA *AND* d:RA which happens on LD/ST-with-update srcdest, idx, duplicate = extra_idx if duplicate: # skip adding to v3.0b fields, already added continue