Skip to content

Instantly share code, notes, and snippets.

@raggi
Created February 19, 2013 09:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save raggi/4984306 to your computer and use it in GitHub Desktop.
Save raggi/4984306 to your computer and use it in GitHub Desktop.
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
Copy link
Author

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