On Sat, January 26, 2013 5:08 pm, Marc Orr wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://reviews.gem5.org/r/1670/#review3941
> -----------------------------------------------------------
>
>
>
> src/mem/protocol/MOESI_CMP_token-L1cache.sm
> <http://reviews.gem5.org/r/1670/#comment3811>
>
>     Will integer division make 5/4 = 1.00 instead of 1.25 ?
>

Note that ultimately the result is converted to a uint64_t. My analysis
tells me that both versions should result in same value. Assume that 1.25
can be represented exactly as a double. We are comparing 1.25x and (5x) /
4. Let x = 4m + n, where 0 <= n <= 3. Then, 1.25x = 5m + 1.25n and (5x)/4
= 5m + (5n)/4. So, the terms that we need to compare are 1.25n and (5n)/4.
Since n can only take values {0,1,2,3}, it is easy to see that after
casting 1.25n to uint64_t and truncating (5n)/4, you would get the same
result. In actual, I do see differences when I run regression tests. It
might be that 1.25 cannot be represented exactly.

Another thing is that I doubt if a cache controller would include a
floating point multiplier to do such a computation.

--
Nilay

_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to