mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-03 17:58:30 +00:00
Get garbage collector working on aarch64
Garbage collection will now happen on arm64 when a function returns, rather than kicking the can down the road to when the process exits. This change also does some code cleanup and incorporates suggestions
This commit is contained in:
parent
9793d3524f
commit
01fd655097
16 changed files with 144 additions and 323 deletions
|
@ -9,26 +9,10 @@ int _bsfll(long long) pureconst;
|
|||
int _bsf128(uintmax_t) pureconst;
|
||||
|
||||
#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
|
||||
#ifdef __x86_64__
|
||||
#define _bsf(u) \
|
||||
({ \
|
||||
unsigned BiTs; \
|
||||
asm("bsf\t%0,%0" : "=r"(BiTs) : "0"((unsigned)(u)) : "cc"); \
|
||||
BiTs; \
|
||||
})
|
||||
#define _bsfl(u) \
|
||||
({ \
|
||||
unsigned long BiTs; \
|
||||
asm("bsf\t%0,%0" : "=r"(BiTs) : "0"((unsigned long)(u)) : "cc"); \
|
||||
(unsigned)BiTs; \
|
||||
})
|
||||
#define _bsfll(u) _bsfl(u)
|
||||
#else
|
||||
#define _bsf(x) __builtin_ctz(x)
|
||||
#define _bsfl(x) __builtin_ctzl(x)
|
||||
#define _bsfll(x) __builtin_ctzll(x)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue