John R Pierce wrote:

>
> There's another trick to this, primarily useful in assembler not C
> programming...

You can do it in C also.  Its called Duff's Device.  Its ugly but legal
C code.

Here a URL with info on it:

   http://wwwwbs.cs.tu-berlin.de/~jutta/c/duffs-device.html

Regards,

Herb Savage

>
> Say you unroll something 16 times....   Take teh actual iteration count
> modulo 16, and JMP into the loop at that offset to start with the repeat
> counter set to the count/16.  i.e. if you need to do, say, 60 iterations of
> the inner code, thats 48 + 12, so you set the loop count to 3, and jump to
> the 4th block of the 16 (16-12 = 4)
>
> Anyways, prime95 is HEAVILY unrolled, using assembler macros to generate the
> inline linear inner 'loops'.
>
> -jrp
_________________________________________________________________
Unsubscribe & list info -- http://www.scruz.net/~luke/signup.htm
Mersenne Prime FAQ      -- http://www.tasam.com/~lrwiman/FAQ-mers

Reply via email to