On the other hand, the u64 bump has no branches, just an add carry.
This amounts to 1 add carry each bump (assuming we can get cc to do the
add carry to memory) and no branches to predict. We should also take
care to put the u64 in one cache line, of course.
George
> Script started on Thu Nov 1 10:23:54 2001
> # ./chk
> Simple bump = 13
> Bump chk and incr = 15
> # ./chk
> Simple bump = 13
> Bump chk and incr = 15
> # ./chk
> Simple bump = 13
> Bump chk and incr = 15
> # exit
> exit
> Script done on Thu Nov 1 10:24:08 2001
>
> It adds only two CPU clock cycles if (iff) the 'C' compiler is
> well behaved.
>
> Test code is appended. In the test code, I calculate everything, then
> print the results. This is so the 'C' library + system call doesn't
> mess up the cache. Note this if you use this as a template to test
> other questionable code snippets.
>
> Cheers,
> Dick Johnson
>
> Penguin : Linux version 2.4.1 on an i686 machine (799.53 BogoMips).
>
> I was going to compile a list of innovations that could be
> attributed to Microsoft. Once I realized that Ctrl-Alt-Del
> was handled in the BIOS, I found that there aren't any.
>
> ------------------------------------------------------------------------
> Name: test_jiff.tar.gz
> test_jiff.tar.gz Type: Unix Tape Archive (application/x-tar)
> Encoding: BASE64
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/