MIPS: BCM63xx: Replace irq dispatch code with a generic version
MIPS: BCM63xx: Replace irq dispatch code with a generic version

The generic version uses a variable length of u32 registers instead of u32/u64.
This allows easier support for "wider" registers without having to rewrite
everything.

This "generic" version is as fast as the old version in the best case
(i == next set bit), and twice as fast in the worst case in 64 bits.

Using a macro was chosen over a (forced) inline version because gcc generated
more compact code with the macro.

The change from (signed) int to unsigned int for i and to_call was intentional
as the value can be only between 0 and (width - 1) anyway, and allowed gcc to
optimise the code a bit further.

Signed-off-by: Jonas Gorski <8a35dafb21031d5c8209b1c0c47aaf0390b56a0e@openwrt.org>
Cc: 562397917b9a8bf316569a848858b12fb417723f@linux-mips.org
Cc: John Crispin <be6487f9df4dce44a640672d6c07330104d43593@openwrt.org>
Cc: Maxime Bizon <f76ce1f46e3863a1d2d6b7e849385982e002f716@freebox.fr>
Cc: Florian Fainelli <73262ad0334ab37227b2f7a0205f51db1e606681@openwrt.org>
Cc: Kevin Cernekee <3105dbb3dd63fbb4f6371cfb04adc6726f76c56b@gmail.com>
Cc: Gregory Fong <5545c2196fdf3421ce913d3d9046eafb23ba0da5@gmail.com>
Patchwork: https://patchwork.linux-mips.org/patch/7316/
Signed-off-by: Ralf Baechle <92f48d309cda194c8eda36aa8f9ae28c488fa208@linux-mips.org>

KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs