from videocore6.assembler import assemble, qpu
@qpu
def sequence(asm):
reg_idx = r0
reg_buf = r1
reg_len = r2
reg_stride = r3
nop(sig=ldunifrf(reg_buf))
nop(sig=ldunifrf(reg_len))
shr(reg_len, reg_len, 4)
eidx(reg_idx)
shl(reg_idx, reg_idx, 2)
add(reg_buf, reg_buf, reg_idx)
shl(reg_stride, 4, 4)
eidx(reg_idx)
with loop as l:
mov(tmud, reg_idx)
mov(tmua, reg_buf)
tmuwt()
add(reg_buf, reg_buf, reg_stride)
sub(reg_idx, reg_idx, -16)
sub(reg_len, reg_len, 1, cond='pushz')
l.b(cond='na0')
nop()
nop()
nop()
nop(sig=thrsw)
nop(sig=thrsw)
nop()
nop()
nop(sig=thrsw)
nop()
nop()
nop()
def main():
for insn in assemble(sequence):
print(f'{insn:#018x}')
if __name__ == '__main__':
main()
|