[parisc-linux] Progress

John David Anglin dave@hiauly1.hia.nrc.ca
Tue, 23 Nov 1999 11:19:17 -0500 (EST)


> 
> > My timing tests on a 735 indicate that the loop with two addib instructions
> > is only 25% faster than a loop with one addib and one nop.
> 
> Who cares about how fast the loop is, actually ?

You get better control of the number of delay instructions executed.  This
is the definition of __delay() that I like:

/* 
 * __delay(N) executes N+2 or N+3 instructions without any pipeline stalls
 * depending on whether it is aligned on an eight byte boundary or not.
 */

extern __inline__ void __delay(unsigned long loops) {
	asm volatile(
	"	.balignl	8,0x34000034
		addib,UV        -1,%0,.
		addi,NUV        -1,%0,%0"
		: "=r" (loops) : "0" (loops));
}

Increase your BogoMIPS!

Dave
-- 
J. David Anglin                                  dave.anglin@nrc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6605)