CCTLib
Calling-context and data-object attribution library for Intel Pin
loadspy_avx32_tp.c
Go to the documentation of this file.
1 // loadspy ISA test: back-to-back 32B AVX loads from same address.
2 #include <stdint.h>
3 #define WORK_COUNT 100000
4 static volatile uint64_t sink;
5 static uint64_t buf[4] __attribute__((aligned(32))) = {1, 2, 3, 4};
6 int main(int argc, char** argv) {
7  (void)argc; (void)argv;
8  uint64_t acc = 0;
9  for (int i = 0; i < WORK_COUNT; ++i) {
10  __asm__ __volatile__(
11  "vmovdqu (%1), %%ymm0\n\t"
12  "vmovdqu (%1), %%ymm1\n\t" // redundant 32B load
13  "vmovq %%xmm0, %0\n\t"
14  : "=r"(acc)
15  : "r"(buf)
16  : "ymm0", "ymm1", "memory");
17  }
18  sink = acc;
19  return 0;
20 }
static uint64_t buf[ITERS]
#define WORK_COUNT
int main(int argc, char **argv)
static uint64_t buf[4] __attribute__((aligned(32)))
static volatile uint64_t sink