Subject: Re: irq handling patch
To: Chris Gilbert <chris@paradox.demon.co.uk>
From: Richard Earnshaw <rearnsha@buzzard.freeserve.co.uk>
List: port-arm32
Date: 04/02/2001 21:39:04
chris@paradox.demon.co.uk said:
> I've attached the patch.  If people could take a look and check I've
> not done  anything really daft (it runs, I'm currently doing a make
> build with it in  place :) (or if there's anything else I can do :)
> If it looks ok I'll commit  it. 

Is the algorithm that David Seal devised?  If so, I think it would be 
right to credit him with it in a comment.

! 	orrne	r9, r9, r9, lsl #4	/* X * 0x11 */
! 	orrne	r9, r9, r9, lsl #6	/* X * 0x451 */
! 	rsbne	r9, r9, r9, lsl #16	/* X * 0x0450fbaf */
! 	/* fetch the bit number */
! 	ldrneb	r9, [r5, r9, lsr #26 ]
! 
! 	/* and loop back */
! 	bne 	irqloop

Hmm, five instructions conditionally executed would be slower on all ARM 
chips than branching around the sequence (on StrongARM the limit is two).  
You start the sequence with beq anyway, so why leave these as conditional?

R.