sz: BaseRM.mode[3]
-class LDSTImmRsvdRM(LDSTImmBaseRM):
- """ld/st immediate: rsvd"""
- pass
+class LDSTImmPostRM(LDSTImmBaseRM):
+ """ld/st immediate: postinc mode (and load-fault)"""
+ pi: BaseRM.mode[3] # Post-Increment Mode
+ lf: BaseRM.mode[4] # Fault-First Mode (not *Data-Dependent* Fail-First)
+
+ def specifiers(self, record):
+ if self.pi:
+ yield "pi"
+ if self.lf:
+ yield "lf"
class LDSTImmFFRc1RM(FFPRRc1BaseRM, LDSTImmBaseRM):
class LDSTImmRM(LDSTImmBaseRM):
simple: LDSTImmSimpleRM
- rsvd: LDSTImmRsvdRM
+ post: LDSTImmPostRM
ffrc1: LDSTImmFFRc1RM
ffrc0: LDSTImmFFRc0RM
sat: LDSTImmSatRM
# mode except reserved in place of mr
table = (
(0b000000, 0b111000, "simple"), # simple (no Rc)
- (0b001000, 0b111000, "rsvd"), # rsvd (no Rc)
+ (0b001000, 0b111000, "post"), # post (no Rc)
(0b010001, 0b110001, "ffrc1"), # ffirst, Rc=1
(0b010000, 0b110001, "ffrc0"), # ffirst, Rc=0
(0b100000, 0b110000, "sat"), # saturation (no Rc)
# see https://libre-soc.org/openpower/sv/ldst/
is_ldst = rm['mode'] in ['LDST_IDX', 'LDST_IMM']
is_ldst_idx = rm['mode'] == 'LDST_IDX'
+ is_ldst_imm = rm['mode'] == 'LDST_IMM'
is_ld = v30b_op.startswith("l") and is_ldst
is_st = v30b_op.startswith("s") and is_ldst
predresult = False
failfirst = False
ldst_elstride = 0
+ ldst_postinc = 0
sea = False
vli = False
# just src width
elif encmode.startswith("sw="):
srcwid = decode_elwidth(encmode[3:])
+ # post-increment
+ elif encmode == 'pi':
+ ldst_postinc = 1
+ # in indexed mode, set sv_mode=0b00
+ assert is_ldst_imm is True
+ sv_mode = 0b00
# element-strided LD/ST
elif encmode == 'els':
ldst_elstride = 1
else:
raise AssertionError("unknown encmode %s" % encmode)
+ # post-inc only available on ld-with-update
+ if ldst_postinc:
+ assert "u" in opcode, "/pi only available on ld/st-update"
+
# sanity check if dz/zz used in branch-mode
if is_bc and dst_zero:
raise AssertionError("dz/zz not supported in branch, use 'sz'")
| 0-1 | 2 | 3 4 | description |
| --- | --- |---------|--------------------------- |
| 00 | 0 | zz els | normal mode |
- | 00 | 1 | / / | reserved |
+ | 00 | 1 | pi lf | post-inc, LD-fault-first |
| 01 | inv | CR-bit | Rc=1: ffirst CR sel |
| 01 | inv | els RC1 | Rc=0: ffirst z/nonz |
| 10 | N | zz els | sat mode: N=0/1 u/s |
pass
sv_mode = 0b00
+ ######################################
+ # ldst-immediate "post" (and "load-fault-first" modes)
+ elif sv_mode == 0b00 and ldst_postinc == 1: # (or ldst_ld_ffirst)
+ mode |= (0b1 << SVP64MODE.LDI_POST) # sets bit 2
+ mode |= (ldst_postinc << SVP64MODE.LDI_PI) # sets post-inc
+
######################################
# "mapreduce" modes
elif sv_mode == 0b00: