From 516e504415252f3feea3acb41aa4f6f914d3c3f7 Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Fri, 7 Oct 2022 13:47:03 +0100 Subject: [PATCH] more work on inssort. add useful reg-dump in ISACaller --- src/openpower/decoder/isa/caller.py | 8 ++++++ .../decoder/isa/test_caller_svp64_inssort.py | 28 +++++++++++++++---- 2 files changed, 30 insertions(+), 6 deletions(-) diff --git a/src/openpower/decoder/isa/caller.py b/src/openpower/decoder/isa/caller.py index 6971aa21..1cdc1327 100644 --- a/src/openpower/decoder/isa/caller.py +++ b/src/openpower/decoder/isa/caller.py @@ -1475,6 +1475,14 @@ class ISACaller(ISACallerHelper, ISAFPHelpers, StepLoop): # not supported yet: raise e # ... re-raise + log("gprs after code", code) + self.gpr.dump() + crs = [] + for i in range(len(self.crl)): + crs.append(bin(self.crl[i].asint())) + log("crs", " ".join(crs)) + log("vl,maxvl", self.svstate.vl, self.svstate.maxvl) + # don't use this except in special circumstances if not self.respect_pc: self.fake_pc += 4 diff --git a/src/openpower/decoder/isa/test_caller_svp64_inssort.py b/src/openpower/decoder/isa/test_caller_svp64_inssort.py index 1fe0b6b5..d54a59c9 100644 --- a/src/openpower/decoder/isa/test_caller_svp64_inssort.py +++ b/src/openpower/decoder/isa/test_caller_svp64_inssort.py @@ -180,7 +180,7 @@ class DecoderTestCase(FHDLTestCase): print ("i", i, val, crf) assert crf == crs_expected[i] - def tst_sv_insert_sort(self): + def test_sv_insert_sort(self): """ ctr = alen-1 li r10, 1 # prepare mask @@ -197,18 +197,33 @@ class DecoderTestCase(FHDLTestCase): sv.mv/m=1< key_item: + array[j - 1] = array[j] + j += 1 + array[j - 1] = key_item + return array """ lst = SVP64Asm(["addi 10, 0, 1", - "addi 9, 11, -1", + "addi 9, 11, 0", "slw 10, 10, 9", "addi 10, 10, -1", "mtspr 9, 11", "setvl 3, 0, 10, 0, 1, 1", "addi 3, 3, -1", - "sv.addi/m=1<