From: Luke Kenneth Casson Leighton Date: Mon, 22 Mar 2021 17:33:14 +0000 (+0000) Subject: read predicate mask from correct point in SVP64Asm X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=72bed90b87fe2c9c534747d3477a0f9e69221761;p=soc.git read predicate mask from correct point in SVP64Asm --- diff --git a/src/soc/decoder/isa/test_caller_svp64_predication.py b/src/soc/decoder/isa/test_caller_svp64_predication.py index 837c42d8..46486c2e 100644 --- a/src/soc/decoder/isa/test_caller_svp64_predication.py +++ b/src/soc/decoder/isa/test_caller_svp64_predication.py @@ -64,7 +64,7 @@ class DecoderTestCase(FHDLTestCase): # | # dest r3=0b10 N Y - isa = SVP64Asm(['sv.extsb/sm=~r3/m=r3 5.v, 9.v' + isa = SVP64Asm(['sv.extsb/sm=~r3/dm=r3 5.v, 9.v' ]) lst = list(isa) print ("listing", lst) @@ -90,7 +90,7 @@ class DecoderTestCase(FHDLTestCase): def test_sv_extsw_intpred_dz(self): # extsb, integer twin-pred mask: dest is r3 (0b01), zeroing on dest - isa = SVP64Asm(['sv.extsb/m=r3/dz 5.v, 9.v' + isa = SVP64Asm(['sv.extsb/dm=r3/dz 5.v, 9.v' ]) lst = list(isa) print ("listing", lst) @@ -120,7 +120,7 @@ class DecoderTestCase(FHDLTestCase): # adds, integer predicated mask r3=0b10 # 1 = 5 + 9 => not to be touched (skipped) # 2 = 6 + 10 => 0x3334 = 0x2223+0x1111 - isa = SVP64Asm(['sv.add/m=r3 1.v, 5.v, 9.v' + isa = SVP64Asm(['sv.add/dm=r3 1.v, 5.v, 9.v' ]) lst = list(isa) print ("listing", lst) @@ -151,7 +151,7 @@ class DecoderTestCase(FHDLTestCase): # adds, CR predicated mask CR4.eq = 1, CR5.eq = 0, invert (ne) # 1 = 5 + 9 => not to be touched (skipped) # 2 = 6 + 10 => 0x3334 = 0x2223+0x1111 - isa = SVP64Asm(['sv.add/m=ne 1.v, 5.v, 9.v' + isa = SVP64Asm(['sv.add/dm=ne 1.v, 5.v, 9.v' ]) lst = list(isa) print ("listing", lst) diff --git a/src/soc/sv/trans/svp64.py b/src/soc/sv/trans/svp64.py index 887ca87f..bf507a91 100644 --- a/src/soc/sv/trans/svp64.py +++ b/src/soc/sv/trans/svp64.py @@ -428,9 +428,9 @@ class SVP64Asm: has_pmask = True has_smask = True # predicate mask (dest) - if encmode.startswith("dm="): + elif encmode.startswith("dm="): pme = encmode - pmmode, pmask = decode_predicate(encmode[2:]) + pmmode, pmask = decode_predicate(encmode[3:]) mmode = pmmode has_pmask = True # predicate mask (src, twin-pred)