Skip to content

Instantly share code, notes, and snippets.

@raggi

raggi/duffcpy.c

Created Feb 19, 2013
Embed
What would you like to do?
switch (count % 8)
{
case 0:;
<D3492>:;
*to++ = *from++ ;
case 7:;
*to++ = *from++ ;
case 6:;
*to++ = *from++ ;
case 5:;
*to++ = *from++ ;
case 4:;
*to++ = *from++ ;
case 3:;
*to++ = *from++ ;
case 2:;
*to++ = *from++ ;
case 1:;
*to++ = *from++ ;
if ( --n > 0) goto <D3492>; else goto <D3493>;
<D3493>:;
}
@raggi

This comment has been minimized.

Copy link
Owner Author

@raggi raggi commented Feb 19, 2013

The GCC IR for a Duffs device turns the do while into a goto in stage 3. Go figure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment