mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-13 14:39:10 +00:00
Add APE interpreter example (#263)
This commit is contained in:
parent
5b60e5a37d
commit
969174e155
7 changed files with 210 additions and 14 deletions
|
@ -23,9 +23,15 @@
|
|||
* @asyncsignalsafe
|
||||
*/
|
||||
wchar_t *wmemset(wchar_t *p, wchar_t c, size_t n) {
|
||||
size_t i;
|
||||
for (i = 0; i < n; ++i) {
|
||||
p[i] = c;
|
||||
size_t i = 0;
|
||||
if (n >= 4) {
|
||||
wchar_t v __attribute__((__vector_size__(16))) = {c, c, c, c};
|
||||
do {
|
||||
__builtin_memcpy(p + i, &v, 16);
|
||||
} while ((i += 4) + 4 <= n);
|
||||
}
|
||||
while (i < n) {
|
||||
p[i++] = c;
|
||||
}
|
||||
return p;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue