Array Padding: Example
A(I,J) = A(I,J)+B(I,J)*C(I,J)
Addr[C(1,1)] = Addr[B(1,1)] + 1024*1024*4
position in the cache: C(1,1) = B(1,1) since (1024*1024*4) mod 32KB = 0
COMMON // A(1024,1024),pad1(129)
A(I,J) = A(I,J)+B(I,J)*C(I,J)
Addr[C(1,1)] = Addr[B(1,1)] + 1024*1024*4+129*4
position in the cache: C(1,1) = B(129,1) mod 32KB
- Padding will cause cache lines
- to be placed in different
- Compiler will try to do padding