add vli mode to ff=5 CR ops
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Thu, 6 Oct 2022 11:57:57 +0000 (12:57 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Thu, 6 Oct 2022 11:57:57 +0000 (12:57 +0100)
src/openpower/sv/trans/svp64.py
src/openpower/sv/trans/test_pysvp64dis.py

index 1665087d52dafc4b60f7472e5f5762e3ac86d624..45f212c2e06a7b8c5da52eedd0a656c5be6ff209 100644 (file)
@@ -1386,6 +1386,9 @@ class SVP64Asm:
                     assert dst_zero == src_zero, "dz must equal sz in ffirst BO"
                     mode |= (failfirst << SVP64MODE.BO_LSB)  # set BO
                     svp64_rm.crops.zz = dst_zero
+                if vli:
+                    sv_mode |= 1 # set VLI in LSB of 2-bit mode
+                    #svp64_rm.cr_op.vli = 1
 
             ######################################
             # "saturation" modes
@@ -1422,17 +1425,19 @@ class SVP64Asm:
         if sea:
             mode |= (0b1 << SVP64MODE.SEA)
 
+        # this is a mess. really look forward to replacing it with Insn DB
         if not is_bc:
             svp64_rm.mode = mode      # mode: bits 19-23
-            if vli:
+            if vli and not is_cr:
                 svp64_rm.normal.ffrc0.VLi = 1
 
             # put in predicate masks into svp64_rm
             if ptype == '2P':
                 svp64_rm.smask = smask  # source pred: bits 16-18
 
-            # put in elwidths unless bc
-            svp64_rm.ewsrc = srcwid    # srcwid: bits 6-7
+            # put in elwidths unless cr
+            if not is_cr:
+                svp64_rm.ewsrc = srcwid    # srcwid: bits 6-7
             svp64_rm.elwidth = destwid  # destwid: bits 4-5
 
         svp64_rm.mmode = mmode         # mask mode: bit 0
index 794f3ee0ee76a8197b46b2e4236338a4d6f46d19..e76819b4d9ef916a745b2aea9920aebf0ad8d0f0 100644 (file)
@@ -308,6 +308,7 @@ class SVSTATETestCase(unittest.TestCase):
         expected = [
                     "sv.cmp *4,1,*0,1",
                     "sv.cmp/ff=RC1 *4,1,*0,1",
+                    "sv.cmp/ff=RC1/vli *4,1,*0,1",
                     "sv.cmp/ff=~RC1 *4,1,*0,1",
                     "sv.cmp/ff=RC1/m=r3/sz *4,1,*0,1",
                     "sv.cmp/dz/ff=RC1/m=r3 *4,1,*0,1",