Same Index Every Time
A 32 KB direct-mapped L1 data cache uses 64-byte lines, so it has 512 lines and an address splits as: 6 offset bits, 9 index bits, tag above that. Two float arrays are laid out exactly 32 KB apart:
float a[8192]; /* base 0x0010_0000 */
float b[8192]; /* base 0x0010_8000 */
double s = 0;
for (int i = 0; i < 8192; i++) s += a[i] * b[i];
Ignoring the accesses to s and i, what is the L1 hit rate of the loop?
Sign in to answer questions and track your progress
Sign In