Browse Source
* Implement TLS on Aarch64 Mach-O * Add aarch64 macho TLS filetest * Address review comments - `Aarch64` instead of `AArch64` in comments - Remove unnecessary guard in tls_value lowering - Remove unnecessary regalloc metadata in emission * Use x1 as temporary register in emission - Instead of passing in a temporary register to use when emitting the TLS code, just use `x1`, as it's already in the clobber set. This also keeps the size of `aarch64::inst::Inst` at 32 bytes. - Update filetest accordingly * Update aarch64 mach-o TLS filetestpull/6102/head
Nathan Whitaker
2 years ago
committed by
GitHub
7 changed files with 173 additions and 4 deletions
@ -0,0 +1,58 @@ |
|||
test compile precise-output |
|||
set tls_model=macho |
|||
target aarch64 |
|||
|
|||
function u0:0(i32) -> i32, i64 { |
|||
gv0 = symbol colocated tls u1:0 |
|||
|
|||
block0(v0: i32): |
|||
v1 = global_value.i64 gv0 |
|||
return v0, v1 |
|||
} |
|||
|
|||
; VCode: |
|||
; stp fp, lr, [sp, #-16]! |
|||
; mov fp, sp |
|||
; str x24, [sp, #-16]! |
|||
; stp d14, d15, [sp, #-16]! |
|||
; stp d12, d13, [sp, #-16]! |
|||
; stp d10, d11, [sp, #-16]! |
|||
; stp d8, d9, [sp, #-16]! |
|||
; block0: |
|||
; mov x24, x0 |
|||
; macho_tls_get_addr x0, userextname0 |
|||
; mov x1, x0 |
|||
; mov x0, x24 |
|||
; ldp d8, d9, [sp], #16 |
|||
; ldp d10, d11, [sp], #16 |
|||
; ldp d12, d13, [sp], #16 |
|||
; ldp d14, d15, [sp], #16 |
|||
; ldr x24, [sp], #16 |
|||
; ldp fp, lr, [sp], #16 |
|||
; ret |
|||
; |
|||
; Disassembled: |
|||
; block0: ; offset 0x0 |
|||
; stp x29, x30, [sp, #-0x10]! |
|||
; mov x29, sp |
|||
; str x24, [sp, #-0x10]! |
|||
; stp d14, d15, [sp, #-0x10]! |
|||
; stp d12, d13, [sp, #-0x10]! |
|||
; stp d10, d11, [sp, #-0x10]! |
|||
; stp d8, d9, [sp, #-0x10]! |
|||
; block1: ; offset 0x1c |
|||
; mov x24, x0 |
|||
; adrp x0, #0 ; reloc_external MachOAarch64TlsAdrPage21 u1:0 0 |
|||
; ldr x0, [x0] ; reloc_external MachOAarch64TlsAdrPageOff12 u1:0 0 |
|||
; ldr x1, [x0] |
|||
; blr x1 |
|||
; mov x1, x0 |
|||
; mov x0, x24 |
|||
; ldp d8, d9, [sp], #0x10 |
|||
; ldp d10, d11, [sp], #0x10 |
|||
; ldp d12, d13, [sp], #0x10 |
|||
; ldp d14, d15, [sp], #0x10 |
|||
; ldr x24, [sp], #0x10 |
|||
; ldp x29, x30, [sp], #0x10 |
|||
; ret |
|||
|
Loading…
Reference in new issue