yield f"{indent}{', '.join(map(str, members))}"
-# ********************
-# Normal mode
-# https://libre-soc.org/openpower/sv/normal/
+class FFPRRc0BaseRM(BaseRM):
+ def specifiers(self, record, mode):
+ if self.RC1:
+ inv = "~" if self.inv else ""
+ yield f"{mode}={inv}RC1"
+
+ yield from super().specifiers(record=record)
+
class NormalLDSTBaseRM(BaseRM):
def specifiers(self, record):
yield from super().specifiers(record=record)
+# ********************
+# Normal mode
+# https://libre-soc.org/openpower/sv/normal/
class NormalBaseRM(NormalLDSTBaseRM):
pass
yield f"dz"
if self.sz:
yield f"sz"
+
yield from super().specifiers(record=record)
CR: BaseRM.mode[3, 4]
-class NormalFFRc0RM(NormalBaseRM):
+class NormalFFRc0RM(FFPRRc0BaseRM, NormalBaseRM):
"""normal: Rc=0: ffirst z/nonz"""
inv: BaseRM.mode[2]
VLi: BaseRM.mode[3]
RC1: BaseRM.mode[4]
def specifiers(self, record):
- if self.RC1:
- inv = "~" if self.inv else ""
- yield f"ff={inv}RC1"
-
- yield from super().specifiers(record=record)
+ yield from super().specifiers(record=record, mode="ff")
class NormalSatRM(NormalBaseRM):
CR: BaseRM.mode[3, 4]
-class NormalPRRc0RM(NormalBaseRM):
+class NormalPRRc0RM(FFPRRc0BaseRM, NormalBaseRM):
"""normal: Rc=0: pred-result z/nonz"""
inv: BaseRM.mode[2]
zz: BaseRM.mode[3]
def specifiers(self, record):
if self.zz:
yield f"zz"
- if self.RC1:
- inv = "~" if self.inv else ""
- yield f"pr={inv}RC1"
- yield from super().specifiers(record=record)
+ yield from super().specifiers(record=record, mode="pr")
class NormalRM(NormalBaseRM):
CR: BaseRM.mode[3, 4]
-class LDSTImmFFRc0RM(LDSTImmBaseRM):
+class LDSTImmFFRc0RM(FFPRRc0BaseRM, LDSTImmBaseRM):
"""ld/st immediate: Rc=0: ffirst z/nonz"""
inv: BaseRM.mode[2]
els: BaseRM.mode[3]
RC1: BaseRM.mode[4]
def specifiers(self, record):
- if self.RC1:
- inv = "~" if self.inv else ""
- yield f"ff={inv}RC1"
+ yield from super().specifiers(record=record, mode="ff")
- yield from super().specifiers(record=record)
class LDSTImmSatRM(LDSTImmBaseRM):
"""ld/st immediate: sat mode: N=0/1 u/s"""
CR: BaseRM.mode[3, 4]
-class LDSTImmPRRc0RM(LDSTImmBaseRM):
+class LDSTImmPRRc0RM(FFPRRc0BaseRM, LDSTImmBaseRM):
"""ld/st immediate: Rc=0: pred-result z/nonz"""
inv: BaseRM.mode[2]
els: BaseRM.mode[3]
RC1: BaseRM.mode[4]
def specifiers(self, record):
- if self.RC1:
- inv = "~" if self.inv else ""
- yield f"pr={inv}RC1"
+ yield from super().specifiers(record=record, mode="pr")
- yield from super().specifiers(record=record)
class LDSTImmRM(LDSTImmBaseRM):
simple: LDSTImmSimpleRM
CR: BaseRM.mode[3, 4]
-class LDSTIdxPRRc0RM(LDSTIdxBaseRM):
+class LDSTIdxPRRc0RM(FFPRRc0BaseRM, LDSTIdxBaseRM):
"""ld/st index: Rc=0: pred-result z/nonz"""
inv: BaseRM.mode[2]
zz: BaseRM.mode[3]
def specifiers(self, record):
if self.zz:
yield f"zz"
- if self.RC1:
- inv = "~" if self.inv else ""
- yield f"pr={inv}RC1"
- yield from super().specifiers(record=record)
+ yield from super().specifiers(record=record, mode="pr")
class LDSTIdxRM(LDSTIdxBaseRM):