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