Loop unrolling

FIRTH at TL-20B.ARPA FIRTH at TL-20B.ARPA
Sun Mar 31 23:28:24 AEST 1985


The loop

    L1:
	movb (r2)+,(r1)+
	bneq L1

is indeed improved by unrolling:

    L1:
	movb (r2)+,(r1)+
	beql L2
	movb (r2)+,(r1)+
	bneq L1
    L2:

Each unrolling replaces a conditional branch taken by a conditional
branch NOT taken, which is a gain in speed

Robert Firth
Tartan Labs Inc
-------



More information about the Comp.lang.c mailing list