Slashdot Mirror


User: cthowie

cthowie's activity in the archive.

Stories
0
Comments
2
First seen
Last seen
Profile
(view on slashdot.org)

Comments · 2

  1. Re:GHz Hunting on Intel Demos 4.7-GHz Pentium · · Score: 1

    whoops, I meant: ...
    while ( i );

  2. Re:GHz Hunting on Intel Demos 4.7-GHz Pentium · · Score: 1

    No problem:

    input: uint32 random_val;
    unsigned total_bits_set = 0;
    unsigned i = 32;
    do
    total_bits_set += (random_val >> --i) & 1;
    while ( --i );
    output: total_bits_set

    Now, just unroll so total number of loops is below 16 and you get perfect branch prediction on Pentium 4. Or, take a code size hit and unroll all 32 loops. OK, so how many bonus points do I get? :-)