Author: Gerd Isenberg
Date: 00:25:40 07/21/03
Go up one level in this thread
>An uglier, yet less branchy way would be to use a Duff's device:
>
>int j=(n+7)/8;
>switch(n%8)
>{
> case 0: do{ f(i++);
> case 7: f(i++);
> case 6: f(i++);
> case 5: f(i++);
> case 4: f(i++);
> case 3: f(i++);
> case 2: f(i++);
> case 1: f(i++);
> }while(--j>0);
>}
>
>But you did say more readable...
>
>Zach
Hi Zach,
yes i heard about "Duff's device".
The art of unrolling loops ;-)
Gerd
This page took 0 seconds to execute
Last modified: Thu, 15 Apr 21 08:11:13 -0700
Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.