CCTLib
Calling-context and data-object attribution library for Intel Pin
footprint_avx32_sweep.c
Go to the documentation of this file.
1 // footprint ISA test: AVX 32-byte stride sweep.
2 // Each iteration issues one 32B AVX store to a NEW address (stride 32B).
3 // N=100000 unique 32B slots => footprint should be at least 100000 * 32 /
4 // (footprint's unit) bytes distinct addresses.
5 //
6 // This exercises footprint tracking under wide SIMD stores that touch
7 // multiple bytes per instruction.
8 #include <stdint.h>
9 #define N 100000
10 static volatile uint64_t sink;
11 static uint64_t buf[N * 4] __attribute__((aligned(32)));
12 int main(int argc, char** argv) {
13  (void)argc; (void)argv;
14  for (int i = 0; i < N; ++i) {
15  __asm__ __volatile__(
16  "vmovdqu %%ymm0, (%0)\n\t" // 32B store to a fresh cacheline
17  :
18  : "r"(&buf[i * 4])
19  : "memory", "ymm0");
20  }
21  sink = buf[0];
22  return 0;
23 }
static uint64_t buf[ITERS]
#define N
int main(int argc, char **argv)
static uint64_t buf[N *4] __attribute__((aligned(32)))
static volatile uint64_t sink