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