4 alignas(16) uint8_t buf
[32];
5 // This uses inline assembly to generate an instruction that writes to a large
6 // block of memory. If it fails on your compiler/architecture, please add
7 // appropriate code to generate a large write to "buf". If you cannot write at
8 // least 2*sizeof(void*) bytes with a single instruction, you will have to skip
12 memset(buf
, UINT32_MAX
, 8);
13 #if defined(__i386__) || defined(__x86_64__)
14 asm volatile ("movdqa %%xmm0, %0" : : "m"(buf
));
15 #elif defined(__arm__)
16 asm volatile ("stm %0, { r0, r1, r2, r3 }" : : "r"(buf
));
17 #elif defined(__aarch64__)
18 asm volatile ("stp x0, x1, %0" : : "m"(buf
));
19 #elif defined(__mips__)
20 asm volatile ("lw $2, %0" : : "m"(buf
));