power_insn: remove the whitespaces properly
[openpower-isa.git] / src / openpower / decoder / power_enums.py
index 013d3d08c1bc53302e3981ed672645590e7a2bad..29faffb15031eb1d88294f6dabed9c0bbc7c3696 100644 (file)
@@ -160,22 +160,24 @@ class Form(Enum):
     SVL = 29  # Simple-V for setvl instruction
     SVD = 30  # Simple-V for LD/ST bit-reverse, variant of D-Form
     SVDS = 31  # Simple-V for LD/ST bit-reverse, variant of DS-Form
-    SVM = 32  # Simple-V SHAPE mode - TEMPORARY TEMPORARY TEMPORARY
-    SVRM = 33  # Simple-V REMAP mode
-    TLI = 34  # ternlogi
-    XB = 35
-    BM2 = 36 # bmask
-    SVI = 37  # Simple-V Index Mode
-    VA2 = 38
-    SVC = 39
-    SVR = 40
+    SVM = 32  # Simple-V SHAPE mode
+    SVM2 = 33  # Simple-V SHAPE2 mode - fits into SVM
+    SVRM = 34  # Simple-V REMAP mode
+    TLI = 35  # ternlogi
+    XB = 36
+    BM2 = 37 # bmask
+    SVI = 38  # Simple-V Index Mode
+    VA2 = 39
+    SVC = 40
+    SVR = 41
 
 # Simple-V svp64 fields https://libre-soc.org/openpower/sv/svp64/
 
 
 class SVMode(Enum):
     NORMAL = auto()
-    LDST = auto()
+    LDST_IDX = auto()
+    LDST_IMM = auto()
     BRANCH = auto()
     CROP = auto()
 
@@ -245,6 +247,16 @@ class SVExtraReg(Enum):
     WHOLE_REG = auto()
     SPR = auto()
 
+    @classmethod
+    def _missing_(cls, value):
+        selectors = (
+            In1Sel, In2Sel, In3Sel, CRInSel,
+            OutSel, CROutSel,
+        )
+        if isinstance(value, selectors):
+            return cls.__members__.get(value.name, cls.NONE)
+        return super()._missing_(value)
+
 
 @unique
 class SVP64PredMode(Enum):
@@ -451,7 +463,8 @@ _insns = [
     "setvl",  # https://libre-soc.org/openpower/sv/setvl
     "svindex",  # https://libre-soc.org/openpower/sv/remap
     "svremap",  # https://libre-soc.org/openpower/sv/remap - TEMPORARY
-    "svshape",  # https://libre-soc.org/openpower/sv/remap
+    "svshape",  # https://libre-soc.org/openpower/sv/remap/#svshape
+    "svshape2",  # https://libre-soc.org/openpower/sv/remap/discussion TODO
     "svstep",  # https://libre-soc.org/openpower/sv/setvl
     "sim_cfg",
     "slbia", "sld", "slw", "srad", "sradi",
@@ -661,10 +674,11 @@ class LDSTMode(Enum):
 
 
 @unique
-class RC(Enum):
+class RCOE(Enum):
     NONE = 0
     ONE = 1
-    RC = 2
+    RC = 2    # includes OE
+    RC_ONLY = 3  # does not include OE
 
 
 @unique