if pack:
# pack advances subvl in *outer* loop
while True:
+ assert srcstep <= vl-1
end_src = srcstep == vl-1
if end_src:
if end_ssub:
# advance subvl in *inner* loop
if end_ssub:
while True:
+ assert srcstep <= vl-1
end_src = srcstep == vl-1
if end_src: # end-point
self.loopend = True
if unpack:
# unpack advances subvl in *outer* loop
while True:
+ assert dststep <= vl-1
end_dst = dststep == vl-1
if end_dst:
if end_dsub:
# advance subvl in *inner* loop
if end_dsub:
while True:
+ assert dststep <= vl-1
end_dst = dststep == vl-1
if end_dst: # end-point
self.loopend = True
TODO when Pack/Unpack is set, substep becomes the *outer* loop
"""
self.subvl = yield self.dec2.rm_dec.rm_in.subvl
+ if self.loopend: # huhn??
+ return
self.src_iterate()
self.dst_iterate()
vl = self.svstate.vl
# srcstep-skipping opportunity identified
if self.srcstep_skip:
+ # cannot do this with sv.bc - XXX TODO
+ if srcmask == 0:
+ self.loopend = True
while (((1 << srcstep) & srcmask) == 0) and (srcstep != vl):
log(" sskip", bin(1 << srcstep))
srcstep += 1
pred_dst_zero = self.pred_dz
vl = self.svstate.vl
if self.dststep_skip:
+ # cannot do this with sv.bc - XXX TODO
+ if dstmask == 0:
+ self.loopend = True
while (((1 << dststep) & dstmask) == 0) and (dststep != vl):
log(" dskip", bin(1 << dststep))
dststep += 1
# check if end reached (we let srcstep overrun, above)
# nothing needs doing (TODO zeroing): just do next instruction
+ if self.loopend:
+ return True
return ((ssubstep == subvl and srcstep == vl) or
(dsubstep == subvl and dststep == vl))