Well, with
Code:
m68k-amigaos-gcc -S -O3 strcpy.c -fomit-frame-pointer -funroll-all-loops
it unrolls it 8 times
Code:
_strcpy:
movel sp@(4),a1
movel sp@(8),a0
movel a1,d1
L2:
moveb a0@+,d0
moveb d0,a1@+
jeq L12
moveb a0@+,d0
moveb d0,a1@+
jeq L12
moveb a0@+,d0
moveb d0,a1@+
jeq L12
moveb a0@+,d0
moveb d0,a1@+
jeq L12
moveb a0@+,d0
moveb d0,a1@+
jeq L12
moveb a0@+,d0
moveb d0,a1@+
jeq L12
moveb a0@+,d0
moveb d0,a1@+
jeq L12
moveb a0@+,d0
moveb d0,a1@+
jne L2
.even
L12:
movel d1,d0
rts
I don't understand why the peephole optimiser doesn't convert
Code:
moveb a0@+,d0
moveb d0,a1@+
to moveb a0@,a1@ since d0 is dead after, but hey...