It was difficult to find good documentation on how the RPT instruction is supposed to work so naken_asm uses the following syntax:
rpt #5, rrum.a #2, r9
rptz #5, rrum.a #2, r9
rptc #5, rrum.a #2, r9
rpt r4, rrum.a #2, r9
rptz r4, rrum.a #2, r9
rptc r4, rrum.a #2, r9
If the -optimize command line argument is set, currently the only thing that will get optimized is a first operand that is using the indexed mode where the index is 0 will get optimized to register indirect. An example is:
mov.w 0(r4), r6
will be optimized to:
mov.w @r4, r6
There are cases where 0(r4) is preferred so the optimization is not turned on by default.