[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Counting bits




Graham Toal says:
> Serious optimization isn't a child's game.  When we did the 1's-counting
> code for the Acorn RISC machine, every programmer in the office worked
> on it for a week.  I think the best version in the end was a variation
> of the trick shown earlier and some sneaky use of ARM conditionals and
> address-loading instructions that could do arbitrary shifts on the fly
> while adding.

In my humble opinion, the right way to get code like this written is
to let a superoptimizer get a whack at the problem -- superopts
produce are guaranteed to produce optimal code, and its better to have
fifteen machines grinding for a week than fifteen humans and their
machines.

Perry