void my_memset(char *a, char c, unsigned n) {
char s[16]={c,c,c,c,c,c,c,c,c,c,c,c,c,c,c,c}; while((int)a&15)*a++=c,n--;while(n&255)a[--n]=c;
__asm("movups (%1), %%xmm0; _LAR: movntps %%xmm0, (%0); movntps %%xmm0, 16(%0); movntps %%xmm0, 32(%0); movntps %%xmm0, 48(%0); movntps %%xmm0, 64(%0); movntps %%xmm0, 80(%0); movntps %%xmm0, 96(%0); movntps %%xmm0, 112(%0); movntps %%xmm0, 128(%0); movntps %%xmm0, 144(%0); movntps %%xmm0, 160(%0); movntps %%xmm0, 176(%0); movntps %%xmm0, 192(%0); movntps %%xmm0, 208(%0); movntps %%xmm0, 224(%0); movntps %%xmm0, 240(%0); addl $256, %0; subl $2, %2; jnz _LAR; ": : "r"(a), "r"(&s), "r"(n/128): "memory");
}
| Compilation | N/A | N/A | Compile Error | Score: N/A | 显示更多 |