convert -size 1024x1024 -depth 8 gray:in.raw out.bmp
unsigned char* foo = malloc(sizeof(unsigned char) * 16);
memset(foo, 42, 16);
__asm__(
/* somehow put foo inside xmm3 and your output in xmm2 */
"psubb %%xmm3, %%xmm2\n"
/* outputs, inputs, clobbers*/
);
Project > Build options...
, then in the Compiler settings
tab, check the relevant CPU architecture
box. If you don't know which one to use, check the Intel Core i7 CPU
with the most items.
If you are compiling in command line, the corresponding flag is -march=corei7-avx
.