add zz mode to sv/trans/svp64.py as a hack
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sat, 17 Sep 2022 19:48:57 +0000 (20:48 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sat, 17 Sep 2022 19:48:57 +0000 (20:48 +0100)
src/openpower/consts.py
src/openpower/sv/trans/svp64.py

index 65f2bc08d7b9e5d70ba67d740aa4e90f0bb55b60..3a5e2c8e3ad29e499e07f3cda6ca94d93ea4c458 100644 (file)
@@ -248,6 +248,7 @@ class SVP64MODEb(_Const):
     # when predicate not set: 0=ignore/skip 1=zero
     DZ = 3  # for destination
     SZ = 4  # for source
+    ZZ = 3  # for both sz/dz, on all but CR-ops
     # for branch-conditional
     BC_SNZ = 3  # for branch-conditional mode
     BC_VLI = 2  # for VL include/exclude on VLSET mode
index bd5f9b763515a0d28fd6c281524fa85971fedb3d..c617375ad8a07148db0c30878077c42070b1ea13 100644 (file)
@@ -1107,6 +1107,8 @@ class SVP64Asm:
                 sv_mode = 0b10
                 saturation = 0
             # predicate zeroing
+            elif encmode == 'zz': # TODO, a lot more checking on legality
+                dst_zero = 1      # NOT on cr_ops, that's RM[6]
             elif encmode == 'sz':
                 src_zero = 1
             elif encmode == 'dz':
@@ -1235,11 +1237,11 @@ class SVP64Asm:
         """
             | 0-1 |  2  |  3   4  |  description               |
             | --- | --- |---------|--------------------------- |
-            | 00  | 0   |  dz els | normal mode                |
-            | 00  | 1   |  dz shf | shift mode                 |
+            | 00  | 0   |  zz els | normal mode                |
+            | 00  | 1   |  /  /   | reserved                   |
             | 01  | inv | CR-bit  | Rc=1: ffirst CR sel        |
             | 01  | inv | els RC1 |  Rc=0: ffirst z/nonz       |
-            | 10  |   N | dz  els |  sat mode: N=0/1 u/s       |
+            | 10  |   N | zz  els |  sat mode: N=0/1 u/s       |
             | 11  | inv | CR-bit  |  Rc=1: pred-result CR sel  |
             | 11  | inv | els RC1 |  Rc=0: pred-result z/nonz  |
         """