mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-23 05:42:29 +00:00
Make progress towards aarch64 build
This commit is contained in:
parent
08ff26c817
commit
ca2860947f
15428 changed files with 25694 additions and 23138 deletions
|
@ -40,6 +40,7 @@ size_t _countbits(const void *a, size_t n) {
|
|||
p = a;
|
||||
e = p + n;
|
||||
if (!IsTiny()) {
|
||||
#ifdef __x86_64__
|
||||
if (X86_HAVE(POPCNT)) {
|
||||
while (p + sizeof(long) * 4 <= e) {
|
||||
__builtin_memcpy(&Ai, p + 000, sizeof(long));
|
||||
|
@ -60,6 +61,7 @@ size_t _countbits(const void *a, size_t n) {
|
|||
t += Ao;
|
||||
}
|
||||
} else {
|
||||
#endif
|
||||
while (p + 8 <= e) {
|
||||
__builtin_memcpy(&x, p, 8);
|
||||
x = x - ((x >> 1) & 0x5555555555555555);
|
||||
|
@ -71,7 +73,9 @@ size_t _countbits(const void *a, size_t n) {
|
|||
t += x;
|
||||
p += 8;
|
||||
}
|
||||
#ifdef __x86_64__
|
||||
}
|
||||
#endif
|
||||
}
|
||||
while (p < e) {
|
||||
b = *p++ & 255;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue