A little benchmark in D and C

safety0ff via digitalmars-d-ldc digitalmars-d-ldc at puremagic.com
Sun Jul 6 01:32:55 PDT 2014


On Sunday, 6 July 2014 at 08:30:03 UTC, safety0ff wrote:
>
>         if ((i & 3) != 0) // above comments show how this line 
> is implemented
>             continue;     // see ch.10 section 3 of hacker's 
> delight 2nd ed.
>         if (i % 5 != 0)
>             continue;

Oops, this should be:
           if (i % 3 != 0) // above comments show how this line is 
implemented
              continue;     // see ch.10 section 3 of hacker's 
delight 2nd ed.
           if ((i & 3) != 0)
              continue;
           if (i % 5 != 0)
               continue;

Also, I switched the signed integers to unsigned to help simplify 
the assembly.


More information about the digitalmars-d-ldc mailing list