Perform some code cleanup

This commit is contained in:
Justine Tunney 2023-05-15 16:32:10 -07:00
parent cc1732bc42
commit 210187cf77
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
205 changed files with 1748 additions and 2595 deletions

View file

@ -33,7 +33,11 @@
// @param rax,rdx,xmm0,xmm1,st0,st1 is return value
// @see test/libc/runtime/gc_test.c
// @threadsafe
__gc: mov %fs:0,%rcx // __get_tls()
__gc:
#ifdef __x86_64__
mov %fs:0,%rcx // __get_tls()
mov 0x18(%rcx),%rcx // tls::garbages
decl (%rcx) // ++g->i
mov (%rcx),%r8d // r8 = g->i
@ -58,4 +62,22 @@ __gc: mov %fs:0,%rcx // __get_tls()
ret
9: ud2
nop
#elif defined(__aarch64__)
stp x29,x30,[sp,-80]!
mov x29,sp
stp x0,x1,[sp,16]
stp x2,x3,[sp,32]
stp x4,x5,[sp,48]
stp x6,x7,[sp,64]
// todo jart
ldp x0,x1,[sp,16]
ldp x2,x3,[sp,32]
ldp x4,x5,[sp,48]
ldp x6,x7,[sp,64]
ldp x29,x30,[sp],80
#endif /* __x86_64__ */
.endfn __gc,globl,hidden